/* ==========================================
   Web Manajemen Sertifikat P3H
   Color scheme: GiziNow
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --green: #8CC344;
    --green-dark: #269636;
    --green-light: #C5E4B6;
    --green-lighter: #f0f9e8;
    --orange: #F28D35;
    --orange-dark: #F2762E;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-green: 0 4px 14px rgba(140, 195, 68, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--green-dark) 0%, #1a7a2a 100%);
    color: white;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: white;
    padding: 4px;
}

.sidebar-brand .brand-text {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-brand .brand-text small {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
    display: block;
}

.sidebar-nav { padding: 16px 12px; flex: 1; }

.sidebar-nav .nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    padding: 8px 12px 4px;
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.sidebar-nav a.active {
    background: var(--green);
    box-shadow: var(--shadow-green);
}

.sidebar-nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-footer .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-footer .user-name {
    font-size: 13px;
    font-weight: 600;
}

.sidebar-footer .user-role {
    font-size: 11px;
    opacity: 0.6;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 0;
}

.topbar {
    background: white;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.topbar .breadcrumb {
    font-size: 13px;
    color: var(--gray-400);
}

.topbar .breadcrumb a {
    color: var(--green-dark);
    text-decoration: none;
}

.content-area {
    padding: 28px 32px;
}

/* ===== CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--gray-100);
    transition: all 0.3s;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.green { background: var(--green-lighter); color: var(--green-dark); }
.stat-icon.orange { background: #fef3e2; color: var(--orange); }
.stat-icon.blue { background: #eef4ff; color: #3b82f6; }

.stat-icon svg { width: 24px; height: 24px; }

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.stat-info p {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
    font-weight: 500;
}

/* ===== TABLE CARD ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-100);
}

.card-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.card-body { padding: 24px; }
.card-body.no-pad { padding: 0; }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--gray-50);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

table tr:hover td { background: var(--green-lighter); }

table tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green { background: var(--green-lighter); color: var(--green-dark); }
.badge-orange { background: #fef3e2; color: var(--orange-dark); }
.badge-blue { background: #e8f4fd; color: #1d72b8; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: var(--green);
    color: white;
    box-shadow: var(--shadow-green);
}

.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover { background: var(--gray-200); }

.btn-orange {
    background: var(--orange);
    color: white;
    box-shadow: 0 4px 14px rgba(242, 141, 53, 0.3);
}

.btn-orange:hover {
    background: var(--orange-dark);
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover { background: #dc2626; }

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover { background: #d97706; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-sm svg { width: 14px; height: 14px; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--green);
    color: var(--green-dark);
}

.btn-outline:hover {
    background: var(--green);
    color: white;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group label .required {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--gray-800);
    background: white;
    transition: all 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(140, 195, 68, 0.15);
}

.form-control::placeholder { color: var(--gray-400); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--green-lighter);
    color: var(--green-dark);
    border: 1px solid var(--green-light);
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eef4ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* ===== SEARCH BAR ===== */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
    width: 300px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--green-lighter);
    border-color: var(--green);
    color: var(--green-dark);
}

.pagination .active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

/* ===== VERIFY PAGE ===== */
.verify-container {
    max-width: 700px;
    margin: 60px auto;
    padding: 0 20px;
}

.verify-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.verify-header {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    color: white;
    padding: 32px;
    text-align: center;
}

.verify-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.verify-header p {
    font-size: 14px;
    opacity: 0.8;
}

.verify-status {
    text-align: center;
    padding: 24px;
}

.verify-status .icon-valid {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--green-lighter);
    color: var(--green-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.verify-status .icon-valid svg { width: 32px; height: 32px; }

.verify-status h2 {
    font-size: 20px;
    color: var(--green-dark);
    font-weight: 700;
}

.verify-status p {
    color: var(--gray-500);
    font-size: 14px;
}

.verify-details {
    padding: 0 32px 32px;
}

.verify-details table { width: 100%; }
.verify-details table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}
.verify-details table td:first-child {
    font-weight: 600;
    color: var(--gray-500);
    width: 180px;
    font-size: 13px;
}
.verify-details table td:last-child {
    color: var(--gray-800);
    font-weight: 500;
}

.verify-invalid {
    text-align: center;
    padding: 48px 32px;
}

.verify-invalid .icon-invalid {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fef2f2;
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -100px; right: -100px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    bottom: -80px; left: -80px;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo img {
    width: 64px;
    margin-bottom: 16px;
}

.login-card .logo h2 {
    font-size: 22px;
    color: var(--gray-900);
    font-weight: 800;
}

.login-card .logo p {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 4px;
}

.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: var(--gray-300);
}

.empty-state h3 {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.empty-state p { font-size: 14px; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}

.modal h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal p { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== FILE UPLOAD ===== */
.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.file-upload:hover {
    border-color: var(--green);
    background: var(--green-lighter);
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload svg {
    width: 32px;
    height: 32px;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.file-upload p {
    font-size: 13px;
    color: var(--gray-500);
}

.file-upload .selected-file {
    font-size: 12px;
    color: var(--green-dark);
    margin-top: 8px;
    font-weight: 600;
}

/* ===== ACTIONS ===== */
.actions-cell {
    display: flex;
    gap: 6px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .topbar { padding: 16px 20px; }
    .content-area { padding: 20px; }
    .search-box input { width: 100%; }
}

/* Profile page */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.profile-grid .card { margin-bottom: 0; }
.profile-grid .form-actions { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
