/* assets/style.css */
/* -------------------------------------------------
   Global & Typography
-------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: radial-gradient(circle at top left, #e0f2fe 0, #eef2ff 40%, #fdf2ff 75%, #f9fafb 100%);
    color: #0f172a;
}

/* Scrollbar halus */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.03);
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.8);
    border-radius: 999px;
}

/* -------------------------------------------------
   Layout Shell
-------------------------------------------------- */

.page {
    max-width: 1120px;
    margin: 32px auto 40px;
    padding: 0 18px;
}

/* Topbar (atas hitam elegan) */
.topbar {
    background: linear-gradient(135deg, #0f172a, #111827);
    color: #f9fafb;
    padding: 10px 0;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(14px);
}

.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-logo {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-logo::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 12px;
    background: conic-gradient(from 160deg, #38bdf8, #4f46e5, #a855f7, #f97316, #38bdf8);
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.3);
}

.topbar-user {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 12px;
}

.topbar-user a:hover {
    background: rgba(55, 65, 81, 0.9);
}

/* -------------------------------------------------
   Header
-------------------------------------------------- */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

.header-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.header-sub {
    font-size: 13px;
    color: #6b7280;
}

.header form input[type="date"] {
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.9);
}

/* -------------------------------------------------
   Card (glassmorphism)
-------------------------------------------------- */

.card {
    position: relative;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.95) 0, rgba(248, 250, 252, 0.96) 45%, rgba(241, 245, 249, 0.98) 100%);
    border-radius: 18px;
    padding: 16px 18px 18px;
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(148, 163, 184, 0.2);
    margin-bottom: 16px;
    overflow: hidden;
    backdrop-filter: blur(16px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.card::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at top right,
        rgba(56, 189, 248, 0.08),
        rgba(129, 140, 248, 0.06),
        transparent 60%);
    opacity: 0.7;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(129, 140, 248, 0.25);
}

/* Card content layering */
.card > * {
    position: relative;
    z-index: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 12px;
    color: #6b7280;
}

/* -------------------------------------------------
   Grid system
-------------------------------------------------- */

.grid {
    display: grid;
    gap: 16px;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* -------------------------------------------------
   Badges & Tags
-------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(129, 140, 248, 0.16));
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 500;
    gap: 4px;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.tag-status {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.tag-status.pending {
    background: rgba(254, 243, 199, 0.95);
    color: #92400e;
}

.tag-status.approved {
    background: rgba(220, 252, 231, 0.95);
    color: #166534;
}

.tag-status.rejected {
    background: rgba(254, 226, 226, 0.95);
    color: #991b1b;
}

/* -------------------------------------------------
   Metric Text
-------------------------------------------------- */

.value-lg {
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
    letter-spacing: 0.01em;
}

.value-sm {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.small-text {
    font-size: 11px;
    color: #6b7280;
}

/* -------------------------------------------------
   Forms & Inputs
-------------------------------------------------- */

form label {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
    font-weight: 500;
    color: #4b5563;
}

form input[type="text"],
form input[type="number"],
form input[type="date"],
form input[type="password"],
form select,
form textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(209, 213, 219, 0.9);
    padding: 8px 11px;
    font-size: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.92);
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, transform 0.08s ease;
}

form textarea {
    resize: vertical;
    min-height: 70px;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
    background: #ffffff;
    transform: translateY(-1px);
}

/* -------------------------------------------------
   Buttons
-------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.35);
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease, opacity 0.14s ease;
    letter-spacing: 0.01em;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 16px 34px rgba(99, 102, 241, 0.45);
}

.button:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35);
}

.button.secondary {
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
    color: #111827;
    box-shadow: 0 6px 16px rgba(148, 163, 184, 0.35);
}

.button.secondary:hover {
    filter: brightness(1.02);
}

.button.danger {
    background: linear-gradient(135deg, #f97373, #ef4444);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.4);
}

.button + .button {
    margin-left: 6px;
}

/* -------------------------------------------------
   Tables
-------------------------------------------------- */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table th,
.table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    text-align: left;
}

.table th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.table tr:hover td {
    background: rgba(249, 250, 251, 0.9);
}

/* -------------------------------------------------
   Links
-------------------------------------------------- */

a {
    color: #4f46e5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------
   Chart Container
-------------------------------------------------- */

canvas {
    position: relative;
    z-index: 1;
}

/* -------------------------------------------------
   Responsive tweaks
-------------------------------------------------- */

@media (max-width: 768px) {
    .page {
        margin-top: 24px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
