
:root {
    --primary: #0f4c81;
    --primary-dark: #0b3558;
    --primary-soft: #eaf3fb;
    --secondary: #f8fbff;
    --success: #15803d;
    --success-soft: #ecfdf3;
    --warning: #b45309;
    --warning-soft: #fff7ed;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --info: #1d4ed8;
    --info-soft: #eff6ff;
    --dark: #0f172a;
    --muted: #64748b;
    --border: #dbe4f0;
    --white: #ffffff;
    --body: #f4f7fb;
    --sidebar: #0b3558;
    --sidebar-soft: #102f4a;
    --shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    --sidebar-width: 242px;
    --topbar-height: 84px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--body);
    color: var(--dark);
    line-height: 1.55;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: 0.2s ease;
}

a:hover { color: var(--primary); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(15, 76, 129, 0.16);
    outline-offset: 2px;
}

.container {
    width: auto;
    max-width: calc(100vw - var(--sidebar-width) - 56px);
    margin: calc(var(--topbar-height) + 16px) 20px 24px calc(var(--sidebar-width) + 20px);
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    min-height: var(--topbar-height);
    background: linear-gradient(120deg, var(--primary-dark), var(--primary));
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    gap: 18px;
    flex-wrap: nowrap;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 4px;
}

.brand-title {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin-left: auto;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

.top-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.16);
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.14);
    width: min(430px, 100%);
    min-width: 0;
}

.top-search-form input {
    min-width: 0;
    width: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.96);
}
.top-search-form button span:first-child { font-size: 14px; }

.top-search-form button {
    white-space: nowrap;
    background: var(--dark);
}

.topbar-icon {
    position: relative;
    color: var(--white);
    font-size: 22px;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
}

.topbar-icon:hover { color: var(--white); background: rgba(255,255,255,0.2); }

.user-chip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    min-width: 0;
    max-width: 220px;
}

.user-chip-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.82;
}

.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-soft));
    color: var(--white);
    padding: 24px 18px;
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.12);
}

.sidebar-title {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 12px;
}

.sidebar-nav { display: grid; gap: 8px; }

.sidebar-nav a {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    padding: 11px 13px;
    border-radius: 12px;
    transition: 0.2s ease;
    font-weight: 600;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.13);
    color: var(--white);
}

.sidebar-nav .logout-menu {
    margin-top: 12px;
    background: rgba(239, 68, 68, 0.18);
}

.card,
.table-wrap,
.login-card {
    background: var(--white);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card,
.table-wrap { padding: 22px; margin-bottom: 20px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.stat-box {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}

.stat-box h3 { margin: 0; font-size: 14px; color: var(--muted); }
.stat-box p { margin: 8px 0 0; font-size: 28px; font-weight: 700; color: var(--primary-dark); }

h1, h2, h3, h4 { margin-top: 0; }

form label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--dark);
}

input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.08);
    outline: none;
}

textarea { resize: vertical; min-height: 120px; }

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    background: var(--primary);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    box-shadow: none;
    line-height: 1.2;
}

button:hover, .btn:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary {
    background: #f8fafc;
    color: #0f172a;
    border-color: #d8e0ea;
}
.btn-secondary:hover { background: #eef2f7; color: #0f172a; }
.btn-success { background: #166534; border-color: #166534; }
.btn-success:hover { background: #14532d; }
.btn-warning { background: #9a6700; border-color: #9a6700; }
.btn-warning:hover { background: #7c5200; }
.btn-info { background: #1e40af; border-color: #1e40af; }
.btn-info:hover { background: #1d3a99; }
.btn-danger { background: #b42318; border-color: #b42318; }
.btn-danger:hover { background: #912018; }
.btn-light {
    background: var(--white);
    color: var(--primary-dark);
    border: 1px solid var(--border);
}
.btn-light:hover { background: var(--primary-soft); color: var(--primary-dark); }
.btn-sm { padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.btn-outline-primary,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-success {
    background: #fff;
    box-shadow: none;
}
.btn-outline-primary { color: var(--primary-dark); border-color: #ccd6e2; }
.btn-outline-primary:hover { background: #f3f7fb; color: var(--primary-dark); }
.btn-outline-info { color: #1f4d78; border-color: #c7d4e2; }
.btn-outline-info:hover { background: #eff6ff; color: #1d4ed8; }
.btn-outline-warning { color: #6c5330; border-color: #dbcdb6; }
.btn-outline-warning:hover { background: #fff7ed; color: #9a6700; }
.btn-outline-success { color: #166534; border-color: #b7dfc3; }
.btn-outline-success:hover { background: #ecfdf3; color: #166534; }
.action-btn {
    min-width: 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 8px;
    box-shadow: none;
    background: #ffffff;
    border: 1px solid #cfd8e3;
    color: #284b6d;
}
.action-btn:hover {
    background: #f4f8fc;
    border-color: #9eb3c9;
    color: #173a5b;
}
.action-btn .action-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.action-btn .action-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}
.action-btn .action-text {
    display: none;
}
.action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.action-view {
    color: #1f4d78;
    border-color: #c7d4e2;
}
.action-view:hover {
    color: #163a5a;
    border-color: #91a9c0;
}
.action-review {
    color: #5b4a2f;
    border-color: #d7ccb9;
}
.action-review:hover {
    color: #493a22;
    border-color: #bca98c;
    background: #faf7f1;
}

.search-card { padding: 16px 18px; }
.search-inline {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}
.live-search-form input[name="q"] {
    background-image: linear-gradient(180deg, #ffffff, #f8fbff);
}
.live-search-form input[name="q"]:focus {
    box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.08), 0 10px 25px rgba(15,23,42,0.05);
}

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 15px;
    font-weight: 600;
}
.alert-success { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.table-wrap { overflow-x: auto; max-width: 100%; }
.table-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.table-hint { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td {
    padding: 13px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}
th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fafc;
}
tbody tr:hover { background: #f8fbff; }

td .btn { vertical-align: middle; }
.table-actions {
    width: 78px;
    min-width: 78px;
    text-align: center;
    white-space: nowrap;
}
.table-actions .btn {
    margin: 0 auto;
}

table .action-links a { margin-right: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}
.status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.9;
}
.status-semakan { background: #eef2f7; color: #405a75; border-color: #d4dde7; }
.status-tindakan { background: #faf5ec; color: #6c5330; border-color: #e7dac3; }
.status-selesai { background: #eef6f1; color: #365845; border-color: #d1e0d6; }
.status-tutup { background: #f4f5f7; color: #59636f; border-color: #dde2e8; }

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
}
.map-link:hover { background: #dbeafe; }

.inline-link,
.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary-dark);
}
.inline-link:hover,
.auth-link:hover { color: var(--primary); }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}
.gallery img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid #dbe4f0;
}

.comment-box {
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    padding: 15px;
    margin-bottom: 14px;
    background: #fff;
}
.comment-meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.notification-item { padding: 14px 0; border-bottom: 1px solid #e2e8f0; }

/* Auth Pages */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.2), transparent 32%),
        linear-gradient(135deg, #0b3558, #0f4c81 55%, #2e7bb7);
}

.auth-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 0.9fr);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.22);
    backdrop-filter: blur(8px);
}

.auth-panel {
    padding: 46px 42px;
    color: #fff;
    position: relative;
}
.auth-panel::after {
    content: "";
    position: absolute;
    inset: auto -40px -40px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}
.auth-brand img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 8px;
}
.auth-kicker {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.auth-panel h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.15; }
.auth-panel p { color: rgba(255,255,255,0.9); max-width: 520px; }
.auth-points {
    display: grid;
    gap: 12px;
    margin-top: 26px;
}
.auth-point {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.09);
}
.auth-point strong { display: block; margin-bottom: 2px; }
.auth-point-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    flex: 0 0 auto;
}

.login-card {
    width: 100%;
    padding: 40px 34px;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.login-card h2 { margin-bottom: 8px; font-size: 28px; }
.login-card p { margin-top: 0; }
.text-muted { color: var(--muted); }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: var(--border);
    flex: 1;
}
.auth-footer {
    margin-top: 18px;
    text-align: center;
}
.auth-actions { margin-top: 18px; }

.password-field { position: relative; }
.password-field input { padding-right: 54px; }
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #f8fafc;
    color: var(--muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe4f0;
}
.toggle-password:hover {
    background: #eef4fb;
    color: var(--primary-dark);
}
.toggle-password svg { width: 18px; height: 18px; }
.toggle-password .icon-slot { display: inline-flex; }

.flex-between {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.detail-list p { margin-top: 0; }

.print-header {
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 14px;
    margin-bottom: 18px;
}
.print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.print-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.print-gallery img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
}

.empty-state {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: var(--muted);
    background: #f8fafc;
}

.print-only { display: none; }
.no-print { }

@media (max-width: 1200px) {
    .topbar { flex-wrap: wrap; }
    .topbar-actions { width: 100%; }
    .top-search-form { width: 100%; }
    .user-chip { max-width: none; }
}

@media (max-width: 992px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-panel { display: none; }
    .container { max-width: none; margin: 96px 18px 18px 18px; }
    .sidebar {
        position: static;
        width: auto;
        margin: 90px 18px 0;
        border-radius: 18px;
        top: auto;
        bottom: auto;
    }
    .topbar { position: static; flex-wrap: wrap; }
}

@media (max-width: 768px) {
    .container { max-width: none; margin: 18px; }
    .topbar-actions { flex-wrap: wrap; }
    .top-search-form input { min-width: 160px; }
    .search-inline { grid-template-columns: 1fr; }
    .print-grid { grid-template-columns: 1fr; }
    .login-page { padding: 16px; }
    .login-card { padding: 28px 22px; }
    .grid-4 { grid-template-columns: 1fr; }
}

@media print {
    .no-print, .topbar, .sidebar { display: none !important; }
    .container { margin: 0; }
    .card, .table-wrap { box-shadow: none; border: 1px solid #cbd5e1; }
    .print-only { display: block; }
}

.table-actions { white-space: nowrap; }

/* ===== SIDEBAR DROPDOWN ===== */
.sidebar-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 15px;
    font-size: 14px;
    color: inherit;
    font-family: inherit;
    text-align: left;
    border-radius: 8px;
    transition: background 0.2s;
}
.sidebar-dropdown-toggle:hover,
.sidebar-dropdown-toggle.active {
    background: var(--primary);
    color: white;
}
.dropdown-arrow {
    transition: transform 0.2s;
    font-size: 12px;
}
.sidebar-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}
.sidebar-dropdown-menu {
    display: none;
    padding-left: 10px;
    margin-top: 2px;
}
.sidebar-dropdown-item {
    display: block;
    padding: 8px 15px;
    font-size: 13px;
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
    border-left: 2px solid #ddd;
    margin-bottom: 2px;
}
.sidebar-dropdown-item:hover,
.sidebar-dropdown-item.active {
    background: var(--primary);
    color: white;
    border-left-color: var(--primary-dark);
}

/* ===== TETAPAN FOOTER PAGE ===== */
.setting-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}
.setting-card h4 {
    margin-bottom: 15px;
    color: var(--primary-dark);
}
