:root {
    --ccis-navy: #0b3d91;
    --ccis-blue: #0d6efd;
    --ccis-sky: #4ba3ff;
    --ccis-ink: #12324f;
    --ccis-text: #53647a;
    --ccis-bg: #f4f7fc;
    --ccis-panel: #ffffff;
    --ccis-soft: #eef4ff;
    --ccis-border: #dfe7f2;
    --ccis-success: #198754;
    --ccis-danger: #dc3545;
    --ccis-warning: #f59e0b;
    --ccis-shadow: 0 16px 40px rgba(11, 61, 145, 0.10);
    --ccis-shadow-soft: 0 8px 24px rgba(17, 34, 60, 0.06);
}

body {
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    background: var(--ccis-bg);
    color: var(--ccis-ink);
}

body.auth-bg-qr {
    position: relative;
    min-height: 100vh;
    background-color: #081c3a;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 22%),
        radial-gradient(circle at 80% 15%, rgba(255,255,255,0.12), transparent 16%),
        linear-gradient(135deg, #0f172a 0%, #2563eb 55%, #60a5fa 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

body.auth-bg-qr::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Crect width='200' height='200' fill='none'/%3E%3Crect x='10' y='10' width='40' height='40' fill='%23ffffff'/%3E%3Crect x='150' y='10' width='40' height='40' fill='%23ffffff'/%3E%3Crect x='10' y='150' width='40' height='40' fill='%23ffffff'/%3E%3Crect x='70' y='70' width='20' height='20' fill='%23ffffff'/%3E%3Crect x='110' y='110' width='20' height='20' fill='%23ffffff'/%3E%3Crect x='140' y='140' width='20' height='20' fill='%23ffffff'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 220px;
    opacity: 0.08;
    pointer-events: none;
}

body.auth-bg-qr .ccis-auth-shell {
    position: relative;
    z-index: 1;
}

.auth-hero {
    position: relative;
    z-index: 2;
}

.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 30%);
    pointer-events: none;
}

body.ccis-app-shell a {
    text-decoration: none;
}

#sidebar {
    background: linear-gradient(180deg, #07274f 0%, var(--ccis-navy) 48%, #0a2f63 100%);
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 16px 0 40px rgba(3, 20, 45, 0.18);
}

.sidebar-brand {
    padding: 24px 20px 18px;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #dbeaff 100%);
    color: var(--ccis-navy);
    box-shadow: inset 0 0 0 1px rgba(11,61,145,0.1);
}

.sidebar-brand .brand-text {
    font-size: 0.96rem;
    letter-spacing: 0.01em;
}

.sidebar-brand .brand-text span {
    color: rgba(255,255,255,0.72);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.sidebar-nav {
    padding: 8px 12px 12px;
}

.sidebar-section-title {
    color: rgba(255,255,255,0.58);
    font-size: 0.66rem;
    padding: 16px 12px 8px;
    letter-spacing: 0.18em;
}

.sidebar-link {
    border-radius: 12px;
    margin: 2px 0;
    padding: 10px 12px;
    color: rgba(255,255,255,0.84);
    font-weight: 600;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255,255,255,0.16);
    color: #ffffff;
    padding-left: 16px;
}

.sidebar-link.active {
    box-shadow: inset 3px 0 0 0 #ffffff;
}

.sidebar-footer {
    padding: 14px 18px 18px;
}

.sidebar-footer .user-mini {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 10px 12px;
}

.sidebar-footer .user-avatar {
    background: linear-gradient(135deg, #ffffff, #dbeaff);
    color: var(--ccis-navy);
}

.main-wrapper {
    margin-left: 260px;
    background: transparent;
}

.top-navbar {
    height: 74px;
    padding: 0 24px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(11,61,145,0.08);
    box-shadow: 0 6px 20px rgba(11,61,145,0.05);
}

.top-navbar .page-title {
    color: var(--ccis-ink);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.top-navbar #sidebarToggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--ccis-soft);
    color: var(--ccis-navy);
}

.top-navbar .nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--ccis-soft);
    color: var(--ccis-navy);
}

.top-navbar .user-btn {
    background: var(--ccis-soft);
    border: 1px solid rgba(11,61,145,0.08);
    border-radius: 14px;
    padding: 6px 10px 6px 6px;
}

.top-navbar .user-btn .avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ccis-navy), var(--ccis-blue));
}

.page-content {
    padding: 24px;
}

.alert {
    border: none;
    border-radius: 14px;
    box-shadow: var(--ccis-shadow-soft);
}

.app-card,
.stat-card,
.table-wrapper,
.qr-card,
.profile-card {
    border: 1px solid var(--ccis-border);
    box-shadow: var(--ccis-shadow-soft);
}

.stat-card {
    border-radius: 20px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
}

.stat-card .stat-icon {
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

.app-card {
    border-radius: 20px;
    overflow: hidden;
    background: var(--ccis-panel);
}

.app-card .card-header {
    background: linear-gradient(90deg, rgba(11,61,145,0.04), rgba(13,110,253,0.04));
    border-bottom: 1px solid var(--ccis-border);
    padding: 18px 22px;
}

.app-card .card-body {
    padding: 22px;
}

.table-wrapper {
    border-radius: 20px;
    background: var(--ccis-panel);
    overflow: hidden;
}

.table-wrapper .table-topbar {
    padding: 18px 20px;
    border-bottom: 1px solid var(--ccis-border);
}

.table thead th {
    background: #f7faff;
    color: var(--ccis-text);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.badge-active,
.badge-verified,
.badge-clean {
    background: rgba(25, 135, 84, 0.12);
    color: var(--ccis-success);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.14);
    color: var(--ccis-warning);
}

.badge-rejected,
.badge-has_record {
    background: rgba(220, 53, 69, 0.12);
    color: var(--ccis-danger);
}

.btn-primary,
.btn-login {
    background: linear-gradient(135deg, var(--ccis-navy), var(--ccis-blue));
    border: none;
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.18);
}

.btn-primary:hover,
.btn-login:hover {
    filter: brightness(1.03);
}

.btn-outline-primary {
    color: var(--ccis-blue);
    border-color: rgba(13,110,253,0.24);
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid var(--ccis-border);
    padding: 10px 12px;
    background: #fcfdff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ccis-blue);
    box-shadow: 0 0 0 4px rgba(13,110,253,0.10);
}

.input-group-text {
    border-color: var(--ccis-border);
    background: #f8fbff;
    color: var(--ccis-text);
}

.search-wrapper input {
    border-radius: 999px;
    border: 1px solid var(--ccis-border);
    height: 42px;
    background: #fcfdff;
}

.search-wrapper input:focus {
    box-shadow: 0 0 0 4px rgba(13,110,253,0.10);
}

.qr-card {
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.profile-card {
    border-radius: 22px;
    background: var(--ccis-panel);
}

.profile-card .profile-banner {
    background: linear-gradient(135deg, var(--ccis-navy), var(--ccis-blue));
}

.verify-page {
    background: linear-gradient(180deg, #f8fbff, var(--ccis-bg));
}

.verify-header {
    background: linear-gradient(135deg, var(--ccis-navy), var(--ccis-blue));
    border-radius: 22px 22px 0 0;
}

.verify-section-card {
    border-radius: 16px;
    border: 1px solid var(--ccis-border);
    overflow: hidden;
    box-shadow: var(--ccis-shadow-soft);
}

.verify-section-card .vsec-header {
    background: #f8fbff;
    color: var(--ccis-ink);
}

.login-page {
    background:
        radial-gradient(circle at top left, rgba(75, 163, 255, 0.22), transparent 24%),
        linear-gradient(135deg, #06224d 0%, var(--ccis-navy) 38%, #0d6efd 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: -60% auto auto 40%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.18), transparent 36%);
    filter: blur(18px);
    opacity: 0.85;
}

.login-page::after {
    content: '';
    position: absolute;
    inset: auto 12% 8% auto;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.16), transparent 42%);
    filter: blur(16px);
}

body.auth-bg-qr::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cg stroke='rgba(255,255,255,0.16)' stroke-width='3' fill='none'%3E%3Cpath d='M16 56h58M16 92h32M176 16v58M140 16v32M16 176h58M16 212h32M176 176v58M140 212v-32M96 96h48M96 144h48M96 96v48M144 96v48'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.12;
    background-repeat: repeat;
    background-size: 240px;
}

.ccis-auth-shell {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
    align-items: center;
}

.auth-hero {
    padding: 36px;
    border-radius: 28px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(12px);
    color: #ffffff;
}

.auth-hero .hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.auth-hero h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
}

.auth-hero p {
    color: rgba(255,255,255,0.8);
    max-width: 480px;
}

.auth-hero .hero-points {
    padding: 0;
    margin: 18px 0 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.auth-hero .hero-points li {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-hero .hero-points i {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.16);
}

.auth-art {
    margin-top: 26px;
    min-height: 170px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
    border: 1px solid rgba(255,255,255,0.18);
    overflow: hidden;
    position: relative;
}

.auth-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 260'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23ffffff' stop-opacity='0.15'/%3E%3Cstop offset='100%25' stop-color='%23ffffff' stop-opacity='0.03'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 36h88M16 76h52M62 36v56M132 22h52M212 22v54M212 22h40M212 78h40M232 22v56M72 140h68M72 180h120M132 140v40M216 140h32M252 140v40M144 220h88M144 180v40M232 180v40' stroke='%23ffffff' stroke-width='4' stroke-linecap='round'/%3E%3Ccircle cx='26' cy='36' r='8' fill='%23ffffff'/%3E%3Ccircle cx='152' cy='140' r='10' fill='%23ffffff'/%3E%3Ccircle cx='232' cy='22' r='8' fill='%23ffffff'/%3E%3Crect x='190' y='72' width='26' height='26' rx='6' fill='%23ffffff'/%3E%3Crect x='24' y='108' width='32' height='32' rx='8' fill='%23ffffff' opacity='0.18'/%3E%3Crect x='184' y='192' width='40' height='40' rx='12' fill='%23ffffff' opacity='0.12'/%3E%3C/svg%3E");
    opacity: 0.35;
    mix-blend-mode: screen;
}

.auth-art::after {
    content: 'QR connectivity · secure identity · circuit intelligence';
    position: absolute;
    left: 24px;
    bottom: 20px;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.78);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
}

.login-card {
    max-width: 470px;
    width: 100%;
    margin-left: auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(2, 14, 31, 0.28);
    border: 1px solid rgba(255,255,255,0.18);
}

.login-card .login-header {
    background: linear-gradient(135deg, #06224d, #0d6efd);
    padding: 28px 32px 24px;
}

.login-card .login-header .logo-circle {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(255,255,255,0.18);
}

.login-card .login-body {
    padding: 28px 32px 30px;
    background: #ffffff;
}

.login-card .form-label {
    color: var(--ccis-ink);
    font-weight: 600;
}

.hero-landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background:
        radial-gradient(circle at top left, rgba(75,163,255,0.16), transparent 24%),
        linear-gradient(135deg, #f8fbff 0%, #f4f7fc 100%);
}

.hero-landing .landing-card {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: center;
    padding: 24px;
    border-radius: 32px;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--ccis-border);
    box-shadow: var(--ccis-shadow);
}

.hero-landing .landing-card h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--ccis-navy);
    line-height: 1.15;
}

.hero-landing .landing-card p {
    color: var(--ccis-text);
    font-size: 1.02rem;
    margin-top: 12px;
}

.hero-landing .landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hero-landing .landing-panel {
    border-radius: 24px;
    background: linear-gradient(135deg, var(--ccis-navy), var(--ccis-blue));
    color: #ffffff;
    padding: 24px;
}

.hero-landing .landing-panel ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    gap: 10px;
}

.hero-landing .landing-panel li {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 992px) {
    .main-wrapper {
        margin-left: 0;
    }

    .ccis-auth-shell,
    .hero-landing .landing-card {
        grid-template-columns: 1fr;
    }

    .login-card {
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 16px;
    }

    .top-navbar {
        padding: 0 16px;
    }

    .login-page {
        padding: 16px;
    }

    .login-card .login-header,
    .login-card .login-body,
    .auth-hero,
    .hero-landing .landing-card,
    .hero-landing .landing-panel {
        padding: 24px;
    }
}
