/* Admin Panel - Premium Control Center */
:root {
    --adm-primary: #4f46e5;
    --adm-primary-dark: #4338ca;
    --adm-primary-light: #eef2ff;
    --adm-accent: #f59e0b;
    --adm-success: #059669;
    --adm-danger: #dc2626;
    --adm-warning: #d97706;
    --adm-info: #0284c7;
    --adm-bg: #f8fafc;
    --adm-surface: #ffffff;
    --adm-border: #e2e8f0;
    --adm-text: #0f172a;
    --adm-muted: #64748b;
    --adm-sidebar: 285px;
    --adm-topbar: 70px;
    --adm-radius: 12px;
    --adm-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 4px 14px rgba(15,23,42,0.04);
    --adm-shadow-lg: 0 10px 32px rgba(15,23,42,0.1);
    --adm-transition: 0.25s ease;
}

.adm-panel-body { font-family: 'Inter', system-ui, sans-serif; background: var(--adm-bg); color: var(--adm-text); }
.adm-panel-wrapper { display: flex; min-height: 100vh; }

.adm-sidebar {
    width: var(--adm-sidebar); background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    color: #fff; position: fixed; top: 0; left: 0; height: 100vh; z-index: 1040;
    display: flex; flex-direction: column; transition: transform var(--adm-transition);
    box-shadow: 4px 0 24px rgba(30,27,75,0.2);
}
.adm-sidebar-brand { padding: 1.4rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.adm-sidebar-logo {
    width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--adm-primary), var(--adm-accent)); font-weight: 700; font-size: 0.8rem; margin-bottom: 0.65rem;
}
.adm-sidebar-brand h5 { margin: 0; font-size: 0.95rem; font-weight: 700; }
.adm-sidebar-brand small { color: rgba(255,255,255,0.5); font-size: 0.75rem; }
.adm-sidebar-nav { flex: 1; padding: 0.85rem; overflow-y: auto; }
.adm-nav-section { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.35); padding: 0.65rem 0.85rem 0.25rem; margin-top: 0.35rem; }
.adm-sidebar-link {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0.85rem; margin-bottom: 0.15rem;
    color: rgba(255,255,255,0.78); text-decoration: none; border-radius: 10px; font-size: 0.875rem; font-weight: 500; transition: var(--adm-transition);
}
.adm-sidebar-link i { width: 20px; font-size: 1.05rem; }
.adm-sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.adm-sidebar-link.active { background: linear-gradient(135deg, rgba(79,70,229,0.45), rgba(245,158,11,0.2)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.adm-sidebar-link .badge { margin-left: auto; font-size: 0.65rem; }
.adm-sidebar-link.logout { color: #fca5a5; margin-top: 0.5rem; }
.adm-sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.08); }
.adm-sidebar-user { display: flex; align-items: center; gap: 0.7rem; }
.adm-avatar {
    width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--adm-primary), var(--adm-accent)); font-weight: 700; font-size: 0.8rem; color: #fff;
}

.adm-main { margin-left: var(--adm-sidebar); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.adm-topbar {
    height: var(--adm-topbar); background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--adm-border); padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1030;
}
.adm-topbar-left { display: flex; align-items: center; gap: 1rem; }
.adm-sidebar-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--adm-border); border-radius: 10px; background: #fff; }
.adm-breadcrumb { font-size: 0.8rem; color: var(--adm-muted); margin: 0; }
.adm-breadcrumb strong { color: var(--adm-text); }
.adm-topbar-search { position: relative; width: 280px; }
.adm-topbar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--adm-muted); }
.adm-topbar-search input { width: 100%; padding: 0.5rem 1rem 0.5rem 2.25rem; border: 1px solid var(--adm-border); border-radius: 50px; font-size: 0.85rem; background: var(--adm-bg); }
.adm-topbar-right { display: flex; align-items: center; gap: 0.65rem; }
.adm-topbar-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--adm-border); background: #fff;
    display: flex; align-items: center; justify-content: center; color: var(--adm-muted); text-decoration: none; position: relative;
}
.adm-notif-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: var(--adm-danger); border-radius: 50%; border: 2px solid #fff; }
.adm-profile-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.75rem 0.3rem 0.3rem; border: 1px solid var(--adm-border); border-radius: 50px; background: #fff; font-size: 0.85rem; font-weight: 500; }

.adm-content { padding: 1.5rem; flex: 1; }
.adm-page-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.adm-page-title { font-size: 1.6rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.adm-page-subtitle { color: var(--adm-muted); margin: 0.25rem 0 0; font-size: 0.9rem; }
.adm-page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.adm-welcome-banner {
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 50%, #f59e0b 100%); color: #fff;
    border-radius: var(--adm-radius); padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; box-shadow: var(--adm-shadow-lg);
}
.adm-welcome-banner h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.35rem; }
.adm-welcome-banner p { margin: 0; opacity: 0.92; font-size: 0.9rem; }

.adm-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.adm-stat-card {
    background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: var(--adm-radius);
    padding: 1.15rem; display: flex; gap: 0.85rem; align-items: center; box-shadow: var(--adm-shadow);
    transition: var(--adm-transition); text-decoration: none; color: inherit;
}
.adm-stat-card:hover { transform: translateY(-2px); box-shadow: var(--adm-shadow-lg); color: inherit; }
.adm-stat-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.adm-stat-primary .adm-stat-icon { background: #eef2ff; color: #4f46e5; }
.adm-stat-info .adm-stat-icon { background: #e0f2fe; color: #0369a1; }
.adm-stat-success .adm-stat-icon { background: #d1fae5; color: #047857; }
.adm-stat-secondary .adm-stat-icon { background: #f1f5f9; color: #475569; }
.adm-stat-warning .adm-stat-icon { background: #fef3c7; color: #b45309; }
.adm-stat-danger .adm-stat-icon { background: #fee2e2; color: #b91c1c; }
.adm-stat-dark .adm-stat-icon { background: #e2e8f0; color: #334155; }
.adm-stat-value { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.adm-stat-label { font-size: 0.72rem; color: var(--adm-muted); font-weight: 500; }

.adm-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.adm-quick-action {
    display: flex; align-items: center; gap: 0.85rem; padding: 1rem 1.15rem; background: var(--adm-surface);
    border: 1px solid var(--adm-border); border-radius: var(--adm-radius); text-decoration: none; color: inherit; box-shadow: var(--adm-shadow); transition: var(--adm-transition);
}
.adm-quick-action:hover { border-color: var(--adm-primary); transform: translateY(-2px); color: inherit; }
.adm-quick-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.adm-quick-primary .adm-quick-icon { background: #eef2ff; color: #4f46e5; }
.adm-quick-success .adm-quick-icon { background: #d1fae5; color: #059669; }
.adm-quick-warning .adm-quick-icon { background: #fef3c7; color: #d97706; }
.adm-quick-info .adm-quick-icon { background: #e0f2fe; color: #0284c7; }
.adm-quick-action h6 { margin: 0 0 0.1rem; font-size: 0.875rem; font-weight: 600; }
.adm-quick-action p { margin: 0; font-size: 0.75rem; color: var(--adm-muted); }
.adm-quick-arrow { margin-left: auto; color: var(--adm-muted); }

.adm-card { background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: var(--adm-radius); box-shadow: var(--adm-shadow); margin-bottom: 1.25rem; overflow: hidden; }
.adm-card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--adm-border); display: flex; align-items: center; justify-content: space-between; background: #f8fafc; flex-wrap: wrap; gap: 0.5rem; }
.adm-card-header h5 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.adm-card-body { padding: 1.25rem; }
.adm-action-card .adm-card-body { padding: 1rem; }

.adm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600; border-radius: 10px; border: none; transition: var(--adm-transition); text-decoration: none; cursor: pointer;
}
.adm-btn-primary { background: linear-gradient(135deg, var(--adm-primary), var(--adm-primary-dark)); color: #fff; }
.adm-btn-primary:hover { color: #fff; transform: translateY(-1px); }
.adm-btn-success { background: var(--adm-success); color: #fff; }
.adm-btn-warning { background: var(--adm-warning); color: #fff; }
.adm-btn-danger { background: var(--adm-danger); color: #fff; }
.adm-btn-info { background: var(--adm-info); color: #fff; }
.adm-btn-outline { background: transparent; border: 1.5px solid var(--adm-border); color: var(--adm-text); }
.adm-btn-outline:hover { border-color: var(--adm-primary); color: var(--adm-primary); background: var(--adm-primary-light); }
.adm-btn-secondary { background: #475569; color: #fff; }

.adm-form-label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.3rem; display: block; }
.adm-form-control, .adm-panel-body .form-control, .adm-panel-body .form-select {
    border: 1.5px solid var(--adm-border); border-radius: 10px; padding: 0.55rem 0.85rem; font-size: 0.875rem;
}
.adm-form-control:focus, .adm-panel-body .form-control:focus { border-color: var(--adm-primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }

.adm-filter-card { background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: var(--adm-radius); padding: 1.15rem; margin-bottom: 1.25rem; box-shadow: var(--adm-shadow); }

.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; font-size: 0.85rem; margin: 0; }
.adm-table thead th { background: #f8fafc; font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--adm-muted); padding: 0.8rem 1rem; border-bottom: 2px solid var(--adm-border); white-space: nowrap; }
.adm-table tbody td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--adm-border); vertical-align: middle; }
.adm-table tbody tr:hover { background: rgba(79,70,229,0.03); }
.adm-table-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.adm-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.85rem; }
.adm-detail-item { background: #f8fafc; border: 1px solid var(--adm-border); border-radius: 10px; padding: 0.75rem 0.9rem; }
.adm-detail-item label { display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--adm-muted); margin-bottom: 0.2rem; }
.adm-detail-item span { font-weight: 500; font-size: 0.875rem; }

.adm-empty-state { text-align: center; padding: 2.5rem 1.5rem; }
.adm-empty-icon { width: 72px; height: 72px; margin: 0 auto 1rem; background: var(--adm-primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; color: var(--adm-primary); }
.adm-empty-state h5 { font-weight: 600; }
.adm-empty-state p { color: var(--adm-muted); max-width: 320px; margin: 0 auto 1rem; font-size: 0.875rem; }

.adm-timeline-item { display: flex; gap: 0.85rem; padding-bottom: 1rem; position: relative; }
.adm-timeline-item:not(.last)::before { content: ''; position: absolute; left: 6px; top: 18px; bottom: 0; width: 2px; background: var(--adm-border); }
.adm-timeline-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--adm-primary); border: 3px solid var(--adm-primary-light); flex-shrink: 0; margin-top: 4px; }
.adm-timeline-content { flex: 1; background: #f8fafc; border: 1px solid var(--adm-border); border-radius: 10px; padding: 0.75rem 0.9rem; }
.adm-timeline-content p { font-size: 0.85rem; color: var(--adm-muted); margin-top: 0.2rem; }

.adm-alert { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.9rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; font-size: 0.875rem; border: 1px solid transparent; }
.adm-alert-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.adm-alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.adm-alert-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.adm-alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

.adm-profile-header {
    background: linear-gradient(135deg, #4338ca, #7c3aed); color: #fff; border-radius: var(--adm-radius);
    padding: 2rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.adm-profile-avatar { width: 88px; height: 88px; border-radius: 18px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; border: 3px solid rgba(255,255,255,0.25); }
.adm-profile-badge { background: rgba(255,255,255,0.2); padding: 0.2rem 0.65rem; border-radius: 50px; font-size: 0.75rem; margin-right: 0.35rem; display: inline-block; margin-top: 0.5rem; }
.adm-profile-tabs .nav-link { border: none; font-weight: 600; font-size: 0.875rem; color: var(--adm-muted); border-radius: 10px; padding: 0.65rem 1.15rem; }
.adm-profile-tabs .nav-link.active { background: var(--adm-primary-light); color: var(--adm-primary-dark); }

.adm-doc-item { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border: 1px solid var(--adm-border); border-radius: 10px; margin-bottom: 0.5rem; background: #f8fafc; }

.adm-chart-card { background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: var(--adm-radius); padding: 1.25rem; box-shadow: var(--adm-shadow); margin-bottom: 1.25rem; }
.adm-bar-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem; height: 180px; padding-top: 1rem; }
.adm-bar-group { flex: 1; text-align: center; }
.adm-bar-group .bars { display: flex; gap: 3px; justify-content: center; align-items: flex-end; height: 150px; }
.adm-bar { width: 14px; border-radius: 4px 4px 0 0; transition: height 0.3s ease; min-height: 4px; }
.adm-bar.birth { background: linear-gradient(180deg, #6366f1, #4f46e5); }
.adm-bar.death { background: linear-gradient(180deg, #94a3b8, #64748b); }
.adm-bar-label { font-size: 0.65rem; color: var(--adm-muted); margin-top: 0.35rem; }

.adm-report-nav { list-style: none; padding: 0; margin: 0; }
.adm-report-nav a {
    display: block; padding: 0.75rem 1rem; color: var(--adm-text); text-decoration: none; font-size: 0.875rem; font-weight: 500;
    border-bottom: 1px solid var(--adm-border); transition: var(--adm-transition);
}
.adm-report-nav a:hover { background: var(--adm-primary-light); color: var(--adm-primary); }
.adm-report-nav a.active { background: var(--adm-primary-light); color: var(--adm-primary-dark); font-weight: 600; border-left: 3px solid var(--adm-primary); }

.adm-user-list-item { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 0; border-bottom: 1px solid var(--adm-border); }
.adm-user-list-item:last-child { border-bottom: none; }
.adm-user-list-avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--adm-primary-light); color: var(--adm-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }

.adm-loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.85); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 9998; }
.adm-loading-overlay.show { display: flex; }
.adm-loader-spinner { width: 42px; height: 42px; border: 3px solid var(--adm-border); border-top-color: var(--adm-primary); border-radius: 50%; animation: admSpin 0.7s linear infinite; margin: 0 auto 0.65rem; }
@keyframes admSpin { to { transform: rotate(360deg); } }

.adm-auth-page { min-height: 100vh; display: flex; background: var(--adm-bg); }
.adm-auth-left { flex: 1; background: linear-gradient(135deg, #312e81, #4338ca); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.adm-auth-left h1 { font-size: 1.85rem; font-weight: 700; margin-bottom: 0.75rem; }
.adm-auth-feature { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; font-size: 0.875rem; }
.adm-auth-feature i { width: 34px; height: 34px; background: rgba(255,255,255,0.15); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.adm-auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; max-width: 480px; }
.adm-auth-card { width: 100%; max-width: 400px; }
.adm-auth-card h2 { font-size: 1.55rem; font-weight: 700; margin-bottom: 0.25rem; }
.adm-input-group { position: relative; }
.adm-input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--adm-muted); z-index: 5; }
.adm-input-group .form-control { padding-left: 2.35rem; }
.adm-password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--adm-muted); z-index: 5; }

.adm-sidebar-backdrop { display: none; }
.adm-modal .modal-content { border: 1px solid var(--adm-border); border-radius: var(--adm-radius); box-shadow: var(--adm-shadow-lg); }
.adm-modal .modal-header { border-bottom: 1px solid var(--adm-border); background: #f8fafc; }
.adm-content .pagination { margin-top: 1.25rem; }
.adm-content .page-link { border-radius: 8px; margin: 0 2px; border-color: var(--adm-border); color: var(--adm-text); font-size: 0.85rem; }
.adm-content .page-item.active .page-link { background: var(--adm-primary); border-color: var(--adm-primary); }

@media (max-width: 991px) {
    .adm-sidebar { transform: translateX(-100%); }
    .adm-sidebar.show { transform: translateX(0); }
    .adm-main { margin-left: 0; }
    .adm-sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .adm-topbar-search { display: none; }
    .adm-sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 1038; }
}
@media (max-width: 767px) {
    .adm-auth-page { flex-direction: column; }
    .adm-auth-left { padding: 2rem 1.5rem; }
    .adm-auth-right { max-width: 100%; }
    .adm-content { padding: 1rem; }
    .adm-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .adm-table-responsive thead { display: none; }
    .adm-table-responsive tbody tr { display: block; margin-bottom: 0.85rem; border: 1px solid var(--adm-border); border-radius: 10px; padding: 0.35rem; background: #fff; }
    .adm-table-responsive tbody td { display: flex; justify-content: space-between; padding: 0.45rem 0.65rem; border: none; }
    .adm-table-responsive tbody td::before { content: attr(data-label); font-weight: 600; font-size: 0.7rem; color: var(--adm-muted); text-transform: uppercase; }
    .adm-profile-header { flex-direction: column; text-align: center; }
}

@media print {
    .adm-sidebar, .adm-topbar, .no-print { display: none !important; }
    .adm-main { margin-left: 0 !important; }
}
