/* ============================================================
   QR Verify Management System – style.css
   ============================================================ */

/* ---------- Root Variables ---------- */
:root {
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --secondary:     #7c3aed;
    --success:       #16a34a;
    --danger:        #dc2626;
    --warning:       #d97706;
    --sidebar-bg:    #1e1b4b;
    --sidebar-hover: #312e81;
    --sidebar-active:#4f46e5;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --bg-body:       #f1f5f9;
    --card-radius:   14px;
    --shadow-card:   0 4px 24px rgba(37, 99, 235, 0.09);
    --shadow-hover:  0 8px 32px rgba(37, 99, 235, 0.18);
    --transition:    0.25s ease;
}

/* ---------- Base Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: #1e293b;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    background: linear-gradient(180deg, #1e1b4b 0%, #2d2776 55%, #312e81 100%);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--transition), transform var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.25rem;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-brand .brand-text span {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
}

/* Navigation */
.sidebar-nav { padding: 12px 0; flex: 1; }

.sidebar-section-title {
    color: rgba(255,255,255,0.35);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 16px 20px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.72);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    transition: background var(--transition), color var(--transition), padding-left var(--transition);
    position: relative;
}

.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    padding-left: 26px;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #a5b4fc;
    border-radius: 0 3px 3px 0;
}

.sidebar-badge {
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer .user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-footer .user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.85rem; font-weight: 700;
    flex-shrink: 0;
}

.sidebar-footer .user-name {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-footer .user-role {
    color: rgba(255,255,255,0.45);
    font-size: 0.68rem;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.top-navbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.top-navbar .page-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
}

.top-navbar .nav-icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: none;
    background: #f8fafc;
    color: #64748b;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    position: relative;
}

.top-navbar .nav-icon-btn:hover { background: #e2e8f0; color: #1e293b; }

.top-navbar .notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

.top-navbar .user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background var(--transition);
}

.top-navbar .user-btn:hover { background: #e2e8f0; }

.top-navbar .user-btn .avatar {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.top-navbar .user-btn .uname { font-size: 0.8rem; font-weight: 600; color: #1e293b; }
.top-navbar .user-btn .urole { font-size: 0.68rem; color: #64748b; }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    padding: 24px;
    flex: 1;
}

/* ============================================================
   DASHBOARD STAT CARDS
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-card .stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-card .stat-icon.blue    { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.stat-card .stat-icon.purple  { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.stat-card .stat-icon.green   { background: linear-gradient(135deg, #16a34a, #22c55e); }
.stat-card .stat-icon.red     { background: linear-gradient(135deg, #dc2626, #ef4444); }
.stat-card .stat-icon.orange  { background: linear-gradient(135deg, #d97706, #f59e0b); }

.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    color: #1e293b;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================================
   GENERAL CARDS
   ============================================================ */
.app-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    border: none;
    overflow: hidden;
}

.app-card .card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-card .card-header .card-title-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.app-card .card-body { padding: 22px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.table-wrapper .table-topbar {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-wrapper .table-topbar .table-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
}

.table > :not(caption) > * > * { padding: 12px 16px; }

.table thead th {
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: #f8fafc; }
.table tbody td { font-size: 0.85rem; color: #334155; vertical-align: middle; }

/* ============================================================
   BADGES
   ============================================================ */
.badge-verified  { background: #dcfce7; color: #16a34a; }
.badge-pending   { background: #fef9c3; color: #b45309; }
.badge-rejected  { background: #fee2e2; color: #dc2626; }
.badge-active    { background: #dbeafe; color: #1d4ed8; }
.badge-inactive  { background: #f1f5f9; color: #64748b; }
.badge-clean     { background: #dcfce7; color: #16a34a; }
.badge-has_record{ background: #fee2e2; color: #dc2626; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary   { background: var(--primary);   border-color: var(--primary);   }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--secondary); border-color: var(--secondary);  }
.btn-success   { background: var(--success);   border-color: var(--success);    }
.btn-danger    { background: var(--danger);    border-color: var(--danger);     }

.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 70%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    top: -100px; right: -100px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -80px; left: -80px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.login-card .login-header {
    background: linear-gradient(135deg, #1e1b4b, #4338ca);
    padding: 36px 40px 28px;
    text-align: center;
    color: #fff;
}

.login-card .login-header .logo-circle {
    width: 64px; height: 64px;
    background: rgba(255,255,255,0.15);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.75rem;
    backdrop-filter: blur(4px);
}

.login-card .login-header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.login-card .login-header p {
    font-size: 0.8rem;
    opacity: 0.75;
}

.login-card .login-body { padding: 36px 40px; }

.login-card .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.login-card .form-control {
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    padding: 10px 14px;
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    outline: none;
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff;
    transition: opacity var(--transition), transform var(--transition);
}

.login-card .btn-login:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* ============================================================
   QR CODE CARD
   ============================================================ */
.qr-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    padding: 28px;
    text-align: center;
}

.qr-card .qr-img-wrapper {
    width: 200px; height: 200px;
    margin: 0 auto 16px;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #f8fafc;
}

.qr-card .qr-img-wrapper img, .qr-card .qr-img-wrapper svg {
    width: 100%; height: 100%;
}

/* ============================================================
   USER PROFILE CARD
   ============================================================ */
.profile-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.profile-card .profile-banner {
    height: 120px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.profile-card .profile-info {
    padding: 0 24px 24px;
    text-align: center;
}

.profile-card .profile-avatar {
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    margin-top: -45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.75rem; font-weight: 700;
}

.profile-card .profile-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    margin-top: 10px;
}

.profile-card .profile-role {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ============================================================
   VERIFICATION PAGE
   ============================================================ */
.verify-page {
    min-height: 100vh;
    background: var(--bg-body);
    padding: 40px 16px;
}

.verify-header {
    background: linear-gradient(135deg, #1e1b4b, #4338ca);
    border-radius: 16px 16px 0 0;
    padding: 28px 32px;
    color: #fff;
    text-align: center;
}

.verify-section-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.verify-section-card .vsec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    font-size: 0.875rem;
    color: #1e293b;
}

.verify-section-card .vsec-body { padding: 16px 18px; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container { z-index: 9999; }

/* ============================================================
   ACTIVITY TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }

.timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 0; bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 18px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px; top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item .tl-action { font-size: 0.82rem; color: #334155; }
.timeline-item .tl-time   { font-size: 0.68rem; color: #94a3b8; margin-top: 2px; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 20px;
}

.app-breadcrumb a { color: var(--primary); }
.app-breadcrumb .sep { color: #cbd5e1; }
.app-breadcrumb .current { color: #334155; font-weight: 600; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-label { font-size: 0.8rem; font-weight: 600; color: #374151; }

.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    padding: 9px 14px;
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    outline: none;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-wrapper {
    position: relative;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.search-wrapper input {
    padding-left: 36px;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    font-size: 0.85rem;
    transition: border-color var(--transition);
    height: 38px;
}

.search-wrapper input:focus { border-color: var(--primary); outline: none; }

/* ============================================================
   SIDEBAR TOGGLE (mobile)
   ============================================================ */
#sidebarToggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #64748b;
    cursor: pointer;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    #sidebarToggle { display: flex; align-items: center; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1039;
    }

    .sidebar-overlay.show { display: block; }
}

@media (max-width: 576px) {
    .page-content { padding: 16px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-value { font-size: 1.5rem; }
    .login-card .login-body, .login-card .login-header { padding: 24px; }
}
