/* ============================================================
 *  ePortal Arsa Sejahtera — Design System
 *  Identitas: logo BPRS ARSA (merah A + emas + biru tua)
 *  Aksen utama: kuning emas #ffa10a (brand arsa.co.id)
 *  Display: Sora · Body: Inter
 * ============================================================ */

/* ── Token ── */
:root {
    /* Brand ARSA */
    --brand-950: #0b1d3d;
    --brand-900: #10264f;
    --brand-800: #17325f;
    --brand-700: #1e3f7a;
    --gold:      #ffa10a;
    --gold-deep: #e28e00;
    --gold-soft: #fff3d6;
    --red:       #c92a2a;
    --red-deep:  #a01f1f;
    --red-soft:  #fdecec;

    /* Netral */
    --ink:   #0f172a;
    --slate: #475569;
    --muted: #64748b;
    --faint: #94a3b8;
    --paper: #f6f7f9;
    --surface: #ffffff;
    --line:  #e4e9f0;
    --line-soft: #eef2f7;

    /* Status */
    --ok-bg:   #dcfce7; --ok-fg:   #166534; --ok-dot: #16a34a;
    --wait-bg: #fef3c7; --wait-fg: #92400e; --wait-dot: #f59e0b;
    --no-bg:   #fee2e2; --no-fg:   #991b1b; --no-dot: #ef4444;

    /* Bentuk */
    --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
    --shadow-lg: 0 18px 40px rgba(16, 38, 79, .18);

    /* Tipografi */
    --font-display: 'Sora', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
    font-size: 14px;
}

:focus-visible { outline: 3px solid rgba(255, 161, 10, .45); outline-offset: 2px; border-radius: 4px; }

/* ── Logo ── */
.logo-img { height: 40px; width: auto; display: block; }
.logo-tile {
    background: #fff; border-radius: 10px; padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    display: inline-flex; align-items: center;
}
.logo-tile img { height: 40px; width: auto; display: block; }

/* ── Navbar ── */
.navbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px 16px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line-soft);
    padding: 10px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--brand-900); letter-spacing: -.01em; line-height: 1.15; }
.brand-sub  { font-size: 11px; color: var(--faint); letter-spacing: .02em; }

.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link {
    font-size: 13px; font-weight: 600; color: var(--slate);
    text-decoration: none; padding: 8px 14px; border-radius: 999px;
    transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--gold-soft); color: var(--brand-800); }
.nav-link.active { background: var(--gold-soft); color: var(--brand-900); box-shadow: inset 0 0 0 1px rgba(226,142,0,.28); }

.nav-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface);
}
.avatar {
    width: 28px; height: 28px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: linear-gradient(145deg, var(--red), var(--red-deep));
    color: #fff; font-size: 11px; font-weight: 700; font-family: var(--font-display);
    text-transform: uppercase;
}
.user-meta { line-height: 1.15; }
.user-name { font-size: 12px; font-weight: 700; color: var(--ink); }
.user-role { font-size: 10.5px; color: var(--faint); }

/* ── Layout halaman ── */
.container { max-width: 1080px; margin: 0 auto; padding: 26px 20px 56px; }

.page-head { margin-bottom: 20px; }
.page-eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--gold-deep);
}
.page-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); margin-top: 4px; letter-spacing: -.015em; }
.page-desc { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ── Kartu ── */
.box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}
.box-title {
    font-family: var(--font-display); font-size: 15px; font-weight: 700;
    color: var(--brand-900); margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.box-title::before {
    content: ""; width: 4px; height: 16px; border-radius: 2px;
    background: linear-gradient(var(--gold), var(--gold-deep));
}

.grid-2 { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 18px; align-items: start; }

/* ── Stat cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
.stat {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--shadow-sm);
    padding: 16px 18px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat::after {
    content: ""; position: absolute; right: -22px; top: -22px;
    width: 64px; height: 64px; border-radius: 50%;
    background: radial-gradient(circle, var(--gold-soft) 0%, transparent 70%);
    opacity: 0; transition: opacity .2s ease;
}
.stat:hover::after { opacity: 1; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--ink); margin-top: 4px; letter-spacing: -.02em; }
.stat-value em { font-style: normal; font-size: 14px; font-weight: 600; color: var(--faint); }
.stat-icon { margin-left: auto; color: var(--gold); }
.stat-icon svg { width: 20px; height: 20px; }
.stat--red .stat-icon { color: var(--red); }

/* ── Form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
label.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--slate); margin: 14px 0 5px; }
label.field-label .req { color: #dc2626; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 14px; font-family: inherit; color: var(--ink);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255,161,10,.18);
}
textarea { resize: vertical; }

/* ── Tombol ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: var(--gold); color: var(--brand-950);
    border: 1px solid transparent; border-radius: var(--r-sm);
    padding: 10px 18px; font-size: 13.5px; font-weight: 700; font-family: inherit;
    cursor: pointer; text-decoration: none;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--gold-deep); box-shadow: 0 4px 12px rgba(226,142,0,.30); }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-ghost { background: var(--surface); color: var(--slate); border-color: var(--line); }
.btn-ghost:hover { background: var(--gold-soft); color: var(--brand-800); box-shadow: none; }
.btn-danger-soft { background: var(--no-bg); color: var(--no-fg); border-color: transparent; }
.btn-danger-soft:hover { background: #fecaca; box-shadow: none; }
.btn-ok { background: var(--ok-bg); color: var(--ok-fg); }
.btn-ok:hover { background: #bbf7d0; box-shadow: none; }
.btn-lg { padding: 13px 20px; font-size: 14.5px; }

/* ── Alert ── */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    border-radius: var(--r-sm); padding: 12px 14px; font-size: 13.5px;
    border: 1px solid transparent; margin-bottom: 18px;
}
.alert-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: #bbf7d0; }
.alert-no { background: var(--no-bg); color: var(--no-fg); border-color: #fecaca; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ── Tabel ── */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    background: var(--gold-soft);
    color: var(--brand-900);
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 11px 14px; text-align: left; white-space: nowrap;
    border-bottom: 1px solid var(--line-soft);
}
tbody td { padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--gold-soft); }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--faint); }
.tbl-empty { text-align: center; color: var(--faint); padding: 26px 14px !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ── Badge status ── */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
    white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-menunggu  { background: var(--wait-bg); color: var(--wait-fg); }
.badge-disetujui { background: var(--ok-bg);   color: var(--ok-fg); }
.badge-ditolak   { background: var(--no-bg);   color: var(--no-fg); }

/* Dot berdenyut untuk yang menunggu keputusan */
.badge-menunggu .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,.45); }
    50%      { box-shadow: 0 0 0 5px rgba(245,158,11,0); }
}

/* ── Tag modul ── */
.tag {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.tag-cuti { background: var(--gold-soft); color: var(--brand-800); }
.tag-dinas { background: var(--red-soft); color: var(--red-deep); }

/* ── Halaman login ── */
.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(255,161,10,.12), transparent 60%),
        radial-gradient(900px 420px at 0% 110%, rgba(201,42,42,.10), transparent 55%),
        var(--paper);
}
.login-card {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 880px;
    background: var(--surface); border-radius: var(--r-lg); overflow: hidden;
    box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.login-brand {
    position: relative; padding: 40px 36px; color: #f2f5ef;
    background:
        linear-gradient(160deg, rgba(16,38,79,.96), rgba(11,29,61,.98)),
        var(--brand-900);
    display: flex; flex-direction: column; justify-content: space-between;
    min-height: 480px;
}
/* Motif khatam sebagai latar */
.login-brand::before {
    content: ""; position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1'%3E%3Cpath d='M36 4 L44 28 L68 36 L44 44 L36 68 L28 44 L4 36 L28 28 Z'/%3E%3Ccircle cx='36' cy='36' r='9'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 72px 72px;
    pointer-events: none;
}
.login-brand > * { position: relative; z-index: 1; }
.login-brand-top { display: flex; align-items: center; gap: 12px; }
.login-brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.login-brand-sub { font-size: 12px; opacity: .75; margin-top: 2px; }
.login-brand-hero { margin-top: 40px; }
.login-brand-hero h1 { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.login-brand-hero h1 span { color: var(--gold); }
.login-brand-hero p { margin-top: 12px; font-size: 13.5px; opacity: .82; line-height: 1.6; }
.login-points { margin-top: 28px; display: grid; gap: 10px; }
.login-point { display: flex; align-items: center; gap: 9px; font-size: 12.5px; opacity: .88; }
.login-point svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.login-brand-foot { font-size: 11.5px; opacity: .55; margin-top: 32px; }

.login-form-side { padding: 40px 36px; display: flex; flex-direction: column; justify-content: center; }
.login-form-side h2 { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--ink); }
.login-form-side .sub { color: var(--muted); font-size: 13px; margin-top: 4px; margin-bottom: 20px; }
.login-hint { font-size: 12px; color: var(--faint); text-align: center; margin-top: 16px; line-height: 1.5; }

/* ── Responsif ── */
@media (max-width: 760px) {
    .login-card { grid-template-columns: 1fr; max-width: 420px; }
    .login-brand { min-height: 0; padding: 26px 24px; }
    .login-brand-hero, .login-points, .login-brand-foot { display: none; }
    .login-form-side { padding: 28px 24px 32px; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .navbar { padding: 10px 14px; }
    .container { padding: 18px 14px 44px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .badge-menunggu .dot { animation: none; box-shadow: none; }
}
