﻿/* ============================================
   Kuesioner ILH Kabupaten Tuban 2026
   Premium Full CSS (Frontend + Admin v3)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --primary-bg: #eff6ff;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
}

/* ================= FRONTEND RESPONDEN KUESIONER ================= */

/* ---- Header ---- */
.sticky-top-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
}

.header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    padding: 32px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.header.header-scrolled {
    padding: 12px 20px;
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: .3px;
}

.header.header-scrolled h1 {
    font-size: 1.1rem;
}

.header p {
    font-size: .85rem;
    opacity: .9;
    margin-top: 6px;
    margin-bottom: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    display: block;
}

.header.header-scrolled p {
    display: none;
}

/* ---- Progress Bar ---- */
.progress-wrap {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    position: relative;
    z-index: 99;
}

.progress-inner {
    max-width: 720px;
    margin: 0 auto;
}

.progress-steps {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.progress-step {
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--gray-100);
    color: var(--gray-400);
    transition: all .3s;
    white-space: nowrap;
}

.progress-step.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .3);
}

.progress-step.done {
    background: var(--success-bg);
    color: var(--success);
}

.progress-bar-track {
    height: 6px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    border-radius: 6px;
    transition: width .4s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(59, 130, 246, .5);
}

/* ---- Warning Banner ---- */
.warning-banner {
    position: sticky;
    top: 0;
    z-index: 98;
    background: var(--warning-bg);
    border-bottom: 2px solid var(--warning);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown .3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.warning-icon {
    font-size: 1.2rem;
}

.warning-text {
    flex: 1;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-800);
}

.warning-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0 4px;
    line-height: 1;
}

.warning-close:hover {
    color: var(--gray-700);
}

/* ---- Container & Cards ---- */
.container {
    max-width: 740px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.step-section {
    display: none;
    animation: fadeIn .4s ease;
}

.step-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sub-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .04);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.sub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sub-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    background: rgba(248, 250, 252, 0.7);
    border-bottom: 1px solid var(--gray-100);
}

.sub-code {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 6px rgba(37, 99, 235, .2);
}

.sub-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.sub-card-body {
    padding: 22px;
}

/* ---- Category Header ---- */
.category-header {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: #fff;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .3px;
    box-shadow: var(--shadow);
}

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-label .req {
    color: var(--danger);
    margin-left: 2px;
}

.optional-tag {
    font-size: .75rem;
    font-weight: 400;
    color: var(--gray-400);
    font-style: italic;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    transition: all .2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    cursor: pointer;
    appearance: auto;
}

select:disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
    border-style: dashed;
}

/* ---- Checkbox Group ---- */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background .2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.checkbox-item:hover {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-item span {
    font-size: .9rem;
    color: var(--gray-700);
}

.other-text {
    margin-top: 6px;
    margin-left: 28px;
}

.other-text input {
    padding: 10px 12px;
    font-size: .85rem;
}

/* ---- Likert Scale ---- */
.likert-question {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: all .3s;
}

.likert-question:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.likert-question.has-error {
    background: var(--danger-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-left: -16px;
    margin-right: -16px;
    border-bottom-color: transparent;
}

.likert-text {
    font-size: .9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    line-height: 1.5;
}

.likert-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.likert-option {
    position: relative;
    height: 100%;
}

.likert-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.likert-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .2s ease;
    text-align: center;
    height: 100%;
    box-sizing: border-box;
    min-height: 70px;
    background: #fff;
}

.likert-option label:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.likert-option input:checked+label {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 1px var(--primary);
}

.likert-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-400);
    margin-bottom: 4px;
    transition: color .2s;
}

.likert-label {
    font-size: .7rem;
    color: var(--gray-500);
    line-height: 1.3;
    font-weight: 500;
    transition: color .2s;
}

.likert-option input:checked+label .likert-num {
    color: var(--primary);
}

.likert-option input:checked+label .likert-label {
    color: var(--primary-dark);
}

/* ---- Indicator Toggle ---- */
.indicator-toggle {
    font-size: .8rem;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-weight: 600;
    user-select: none;
    transition: opacity .2s;
}

.indicator-toggle:hover {
    opacity: .7;
}

.indicator-toggle .arrow {
    transition: transform .2s;
    display: inline-block;
    font-size: .75rem;
}

.indicator-toggle.open .arrow {
    transform: rotate(90deg);
}

.indicator-content {
    display: none;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: .8rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.indicator-content.show {
    display: block;
    animation: fadeIn .25s ease;
}

/* ---- Global Indicator Toggle ---- */
.global-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.global-toggle button {
    font-size: .8rem;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-600);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all .2s;
    box-shadow: var(--shadow-sm);
}

.global-toggle button:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* ---- Selfie Section ---- */
.selfie-container {
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    background: rgba(239, 246, 255, .5);
    transition: background .3s;
}

.selfie-container:hover {
    background: var(--primary-bg);
}

.selfie-container video {
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
    display: none;
    margin: 0 auto 16px;
    box-shadow: var(--shadow);
}

.selfie-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.selfie-preview {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.selfie-preview img {
    max-width: 240px;
    max-height: 240px;
    border-radius: 50%;
    border: 4px solid var(--success);
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.geo-status {
    margin-top: 12px;
    font-size: .8rem;
    font-weight: 500;
}

/* ---- Buttons ---- */
.btn-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: .85rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(37, 99, 235, .2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, .3);
}

.btn-secondary {
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 6px rgba(16, 185, 129, .2);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, .3);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ---- Section Divider ---- */
.section-divider {
    border: none;
    border-top: 2px dashed var(--gray-200);
    margin: 24px 0;
}

/* ---- Thank You ---- */
.thank-you {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: 40px;
}

.thank-you .icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce .5s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.thank-you h2 {
    font-size: 1.8rem;
    color: var(--gray-800);
    margin-bottom: 12px;
    font-weight: 700;
}

.thank-you p {
    color: var(--gray-500);
    font-size: 1rem;
    margin-bottom: 30px;
}

/* ---- Error / Validation ---- */
.field-error {
    border-color: var(--danger) !important;
    background: var(--danger-bg) !important;
}

.error-msg {
    color: var(--danger);
    font-size: .8rem;
    font-weight: 500;
    margin-top: 6px;
    display: none;
}

.error-msg.show {
    display: block;
    animation: fadeIn .2s;
}

/* ---- Loading Overlay ---- */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .9);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(4px);
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1rem;
    color: var(--gray-700);
    font-weight: 600;
}

/* ============================================
   ADMIN PREMIUM UI - SPLIT LOGIN & SIDEBAR
   ============================================ */

/* ---- Split Login ---- */
.split-login {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #fff;
}

.login-visual {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    position: relative;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 10%;
    text-align: left;
}

.login-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="40" fill="rgba(255,255,255,0.05)"/></svg>') center/cover;
    opacity: 0.5;
}

.login-visual h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    z-index: 2;
}

.login-visual p {
    font-size: 1.1rem;
    opacity: .8;
    max-width: 400px;
    z-index: 2;
    line-height: 1.6;
}

.login-form-area {
    width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px;
    background: #fff;
}

.login-form-area h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-form-area p {
    color: var(--gray-500);
    margin-bottom: 32px;
    font-size: .9rem;
}

.login-form-area .form-label {
    font-size: .85rem;
}

.login-form-area input {
    padding: 14px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.login-form-area .btn {
    padding: 14px;
    font-size: 1rem;
    border-radius: 8px;
    margin-top: 10px;
}

@media (max-width: 900px) {
    .split-login {
        display: block;
        overflow: auto;
    }

    .login-visual {
        padding: 40px 20px;
        text-align: center;
        height: auto;
    }

    .login-visual p {
        margin: 0 auto;
        text-align: center;
    }

    .login-form-area {
        width: 100%;
        padding: 40px 20px;
    }
}

/* ---- Admin Dashboard Layout ---- */
.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--gray-50);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: all .3s;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: .5px;
}

.sidebar-nav {
    padding: 20px 12px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 500;
    transition: all .2s;
}

.nav-item:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.nav-item.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .4);
}

.nav-item i {
    font-style: normal;
    font-size: 1.2rem;
}

/* Fake Icon */
.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, .05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: .75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color .2s;
}

.logout-btn:hover {
    color: #fca5a5;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    background: #fff;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.topbar-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.tab-content {
    display: none;
    animation: fadeIn .3s ease;
}

.tab-content.active {
    display: block;
}

/* Dashboard Cards (Premium) */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.dash-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform .2s, box-shadow .2s;
    border: 1px solid rgba(0, 0, 0, .03);
}

.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.dash-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.icon-green {
    background: #ecfdf5;
    color: #10b981;
}

.icon-purple {
    background: #faf5ff;
    color: #a855f7;
}

.icon-orange {
    background: #fffbeb;
    color: #f59e0b;
}

.dash-info {
    flex: 1;
}

.dash-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
    margin-bottom: 6px;
}

.dash-label {
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-500);
}

/* Charts Area */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, .03);
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
}

/* DataTables Styling Overrides */
.dt-container {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

table.dataTable {
    border-collapse: collapse;
    width: 100% !important;
    margin: 16px 0 !important;
}

table.dataTable thead th {
    border-bottom: 2px solid var(--gray-200) !important;
    color: var(--gray-600);
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px 10px !important;
}

table.dataTable tbody td {
    border-bottom: 1px solid var(--gray-100) !important;
    padding: 16px 10px !important;
    font-size: .9rem;
    color: var(--gray-700);
    vertical-align: middle;
}

table.dataTable.no-footer {
    border-bottom: none !important;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    outline: none;
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    margin: 0 4px;
    background: #fff;
    color: var(--gray-700) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--gray-100);
    color: var(--gray-900) !important;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .3px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Detail View */
.detail-section {
    margin-bottom: 20px;
}

.detail-section h3 {
    font-size: .88rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 6px;
}

.detail-row {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    font-size: .84rem;
    flex-wrap: wrap;
}

.detail-label {
    font-weight: 600;
    color: var(--gray-600);
    min-width: 160px;
}

.detail-value {
    color: var(--gray-800);
    flex: 1;
}

.selfie-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    object-fit: cover;
}

/* Dashboard Recent Table */
.recent-table-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid rgba(0, 0, 0, .03);
}

.recent-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recent-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.recent-table {
    width: 100%;
    border-collapse: collapse;
}

.recent-table th {
    padding: 14px 24px;
    text-align: left;
    background: var(--gray-50);
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.recent-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
    font-size: .9rem;
    color: var(--gray-700);
    vertical-align: middle;
}

.recent-table tr:last-child td {
    border-bottom: none;
}

.recent-table tr:hover {
    background: var(--gray-50);
}

/* User Management */
.user-form {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    border: 1px solid rgba(0, 0, 0, .03);
}

.user-form h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--gray-800);
}

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* Responsive Admin */
/* Tables Responsiveness */
.dt-container {
    overflow-x: auto;
    background: #fff;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

table.dataTable th,
table.dataTable td {
    white-space: nowrap;
}

/* Responsive Admin */
@media (max-width: 1024px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .split-login {
        display: block;
        overflow: auto;
    }

    .login-visual {
        padding: 40px 20px;
        text-align: center;
        height: auto;
    }

    .login-visual p {
        margin: 0 auto;
        text-align: center;
    }

    .login-form-area {
        width: 100%;
        padding: 40px 20px;
    }
}

@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
        overflow: hidden;
    }

    /* Mobile App Bottom Nav */
    .sidebar {
        width: 100%;
        height: 65px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        flex-direction: row;
        background: #1e293b;
        border-top: 1px solid rgba(0, 0, 0, .2);
        box-shadow: 0 -4px 10px rgba(0, 0, 0, .15);
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        width: 100%;
        padding: 0;
        overflow: hidden;
        justify-content: space-around;
        align-items: center;
    }

    .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 8px 0;
        margin: 0;
        border-radius: 0;
        gap: 4px;
        font-size: .65rem;
        color: #94a3b8;
    }

    .nav-item.active {
        background: transparent;
        color: #60a5fa;
        box-shadow: none;
        border-top: 3px solid #3b82f6;
        border-radius: 0;
    }

    .nav-item i {
        font-size: 1.25rem;
    }

    /* Reveal topbar on mobile for logout & title */
    .topbar {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: var(--shadow-sm);
    }

    .topbar-title {
        font-size: 1.1rem;
    }

    .topbar-actions .btn {
        font-size: .75rem;
        padding: 6px 12px;
    }

    .mobile-logout {
        display: inline-flex !important;
    }

    /* Adjust content for bottom nav */
    .main-content {
        padding-bottom: 65px;
        overflow-y: auto;
        height: 100%;
    }

    .content-scroll {
        padding: 16px;
        overflow: visible;
        height: auto;
    }

    /* Dashboard Cards Mobile */
    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .dash-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
        gap: 10px;
    }

    .dash-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        margin: 0 auto;
    }

    .dash-num {
        font-size: 1.4rem;
    }

    .dash-label {
        font-size: .75rem;
        line-height: 1.3;
    }

    .chart-grid {
        gap: 16px;
        margin-bottom: 20px;
    }

    .chart-card {
        padding: 16px;
    }

    .recent-table-card {
        margin-bottom: 20px;
    }

    .dt-container {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRINT CSS (PDF GENERATION)
   ============================================ */
@media print {
    body {
        background: #fff !important;
    }

    .back-btn,
    .btn-print,
    .topbar,
    .sidebar {
        display: none !important;
    }

    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .header-title {
        padding: 0 0 10px 0 !important;
        border-bottom: 2px solid #000 !important;
        margin-bottom: 20px !important;
    }

    .q-box {
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
        padding: 10px !important;
    }

    .selfie-box {
        border: none !important;
        background: transparent !important;
        padding: 0;
    }

    .selfie-box img {
        max-width: 250px !important;
        border: 1px solid #ccc !important;
    }

    * {
        color: #000 !important;
    }

    @page {
        margin: 1cm;
        size: A4;
    }
}

.dataTables_wrapper { overflow-x: auto; width: 100%; }

.dataTables_wrapper { overflow-x: auto; width: 100%; }
@media (max-width: 768px) { .hide-mobile { display: none !important; } .icon-btn-mobile { padding: 4px; display: inline-flex; justify-content: center; align-items: center; } }
