/* =========================================================
   SIMPARK - Style Utama
   ========================================================= */
:root {
    --navy: #0f2942;
    --navy-light: #17395c;
    --blue: #2563eb;
    --blue-light: #eff6ff;
    --green: #16a34a;
    --amber: #d97706;
    --red: #dc2626;
    --bg: #f4f6f9;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

/* ---------- Layout Login ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    padding: 20px;
}
.login-card {
    background: #fff;
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    text-align: center;
}
.login-card .logo-circle {
    width: 64px; height: 64px;
    background: var(--blue-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px;
}
.login-card h1 {
    font-size: 20px;
    margin: 0 0 4px;
    color: var(--navy);
}
.login-card p.subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 24px;
}
.login-card input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}
.login-card button {
    width: 100%;
    padding: 12px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}
.login-card button:hover { background: var(--navy-light); }

/* ---------- App Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px;
    background: var(--navy);
    color: #fff;
    flex-shrink: 0;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}
.sidebar .brand {
    padding: 0 20px 20px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}
.sidebar .brand small {
    display: block;
    font-weight: 400;
    font-size: 11px;
    color: #93c5fd;
    margin-top: 2px;
}
.sidebar nav { flex: 1; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px;
    color: #cbd5e1;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--blue);
    font-weight: 600;
}
.sidebar .user-box {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}
.sidebar .user-box .name { font-weight: 600; }
.sidebar .user-box .role { color: #93c5fd; font-size: 11px; text-transform: uppercase; }
.sidebar .user-box a.logout {
    display: inline-block;
    margin-top: 8px;
    color: #fca5a5;
    font-size: 12px;
}

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar h2 { margin: 0; font-size: 18px; color: var(--navy); }
.topbar .date { color: var(--text-muted); font-size: 13px; }

.content { padding: 24px; flex: 1; }

/* ---------- Cards / Stats ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}
.stat-card .label { color: var(--text-muted); font-size: 13px; margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-card .icon { font-size: 22px; margin-bottom: 8px; }

.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
}
.card h3 { margin: 0 0 16px; font-size: 16px; color: var(--navy); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    background: var(--blue-light);
    color: var(--navy);
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #f8fafc; }
.table-responsive { overflow-x: auto; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---------- Petugas: input transaksi ---------- */
.tariff-display {
    background: var(--blue-light);
    border: 1px dashed var(--blue);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}
.tariff-display .label { font-size: 13px; color: var(--text-muted); }
.tariff-display .amount { font-size: 28px; font-weight: 700; color: var(--navy); }

/* ---------- Struk Thermal 58mm ---------- */
.struk-58 {
    width: 58mm;
    margin: 0 auto;
    background: #fff;
    padding: 8px 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #000;
}
.struk-58 .center { text-align: center; }
.struk-58 .bold { font-weight: 700; }
.struk-58 .line { border-top: 1px dashed #000; margin: 6px 0; }
.struk-58 .row { display: flex; justify-content: space-between; }
.struk-58 h2 { font-size: 13px; margin: 4px 0; }
.struk-58 .big { font-size: 16px; }

.struk-page-actions { text-align: center; margin: 16px 0; }

@media print {
    body * { visibility: hidden; }
    .struk-58, .struk-58 * { visibility: visible; }
    .struk-58 { position: absolute; top: 0; left: 0; }
    .struk-page-actions { display: none; }
    @page { size: 58mm auto; margin: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; padding: 10px 0; }
    .sidebar nav { display: flex; overflow-x: auto; }
    .sidebar nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .sidebar nav a.active { border-left-color: transparent; border-bottom-color: var(--blue); }
    .sidebar .user-box { display: none; }
    .content { padding: 16px; }
}
