/* =============================================
   PMB S2 Kesmas - Admin CSS
   ============================================= */

:root {
    --primary: #1a6f9c;
    --primary-dark: #0d4f74;
    --secondary: #2ecc8a;
    --accent: #f59e0b;
    --danger: #ef4444;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f1f5f9;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-w: 250px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---- LOGIN PAGE ---- */
.admin-login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d4f74, #1a6f9c, #2ecc8a);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-img-lg {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.75rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.login-back {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-back a {
    color: var(--primary);
    font-weight: 600;
}

/* ---- ADMIN LAYOUT ---- */
.admin-body {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: #0d1b2a;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-img-sidebar {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3)) brightness(1.1);
}

.sidebar-brand-title {
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
}

.sidebar-brand-sub {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border-left-color: var(--secondary);
}

.sidebar-link.active {
    background: rgba(26, 111, 156, 0.3);
    color: white;
    border-left-color: var(--secondary);
}

.sidebar-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-section {
    padding: 1.25rem 1.25rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 1rem 0;
}

.sidebar-logout {
    color: rgba(239, 68, 68, 0.75) !important;
}

.sidebar-logout:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.sidebar-link-sub {
    padding-left: 2.5rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5) !important;
}

.sidebar-link-sub:hover {
    color: var(--secondary) !important;
}

.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    display: none;
}

.admin-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.admin-avatar {
    font-size: 1.2rem;
}

.admin-content {
    padding: 1.75rem 2rem;
    flex: 1;
}

/* ---- STATS GRID ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow);
    border-left: 4px solid;
}

.stat-blue {
    border-color: #3b82f6;
}

.stat-orange {
    border-color: #f59e0b;
}

.stat-green {
    border-color: #10b981;
}

.stat-purple {
    border-color: #8b5cf6;
}

.stat-card-icon {
    font-size: 2rem;
}

.stat-card-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ---- ADMIN CARDS ---- */
.admin-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.admin-card h2,
.admin-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.btn-link {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---- TABLE ---- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table thead th {
    background: var(--bg);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.admin-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.admin-table tbody tr:hover {
    background: var(--bg);
}

.admin-table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.td-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-edit {
    background: rgba(26, 111, 156, 0.1);
    color: var(--primary);
}

.btn-edit:hover {
    background: var(--primary);
    color: white;
}

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
}

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

code {
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--primary);
}

/* ---- QUICK MENU ---- */
.quick-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-item:hover {
    background: var(--primary);
    color: white;
}

/* ---- FILTER TABS ---- */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-muted);
    transition: all 0.2s;
}

.filter-tab.active,
.filter-tab:hover {
    background: var(--primary);
    color: white;
}

/* ---- FORMS (Admin) ---- */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.form-control {
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    background: white;
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 111, 156, 0.1);
}

.form-check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.25rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-full {
    width: 100%;
}

/* ---- BADGES (admin) ---- */
.badge-status {
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.status-Baru {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-Direview {
    background: #fef3c7;
    color: #92400e;
}

.status-Diterima {
    background: #d1fae5;
    color: #065f46;
}

.status-Ditolak {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status.badge-lg {
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-muted {
    background: var(--bg);
    color: var(--text-muted);
}

.badge-kategori {
    background: rgba(26, 111, 156, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-dokumen {
    display: inline-block;
    background: rgba(46, 204, 138, 0.12);
    color: #065f46;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: capitalize;
    border: 1px solid rgba(46, 204, 138, 0.3);
}

/* ---- DETAIL TABLE ---- */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.detail-table td {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-table td:first-child {
    color: var(--text-muted);
    width: 40%;
    font-weight: 600;
}

.status-current {
    margin-bottom: 1rem;
}

.motivasi-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius-sm);
    line-height: 1.7;
}

/* ---- ALERTS ---- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-grid-2 {
        grid-template-columns: 1fr;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}