/* =====================================================================
   E-RAPOR - Design System
   Palet warna: teal modern + netral abu-abu, kartu dengan shadow lembut,
   transisi halus, tipografi sistem yang bersih.
   ===================================================================== */

:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --primary-50: #f0fdfa;

    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --border-light: #f0f1f3;

    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;

    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --warning: #d97706;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --transition: all 0.15s ease;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.01em; color: #111827; }
h2 { font-size: 1.4rem; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.85rem; }

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

/* ---------- Login page ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,0.05) 0%, transparent 40%),
        linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
}
.login-box {
    background: var(--card-bg);
    padding: 2.75rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 400px;
}
.login-box h1 {
    font-size: 1.3rem;
    margin: 0 0 0.35rem;
    color: var(--primary-dark);
    line-height: 1.3;
}
.login-box .subtitle {
    margin: 0 0 1.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.login-box label {
    display: block;
    margin: 0.9rem 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}
.login-box input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
}
.login-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.login-box button {
    margin-top: 1.75rem;
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.login-box button:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ---------- App layout ---------- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #0f766e, #115e59);
    color: white;
    padding: 0.85rem 1.75rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-brand {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.88rem;
}
.topbar-user em { font-style: normal; opacity: 0.8; font-size: 0.82rem; }
.btn-logout {
    background: rgba(255,255,255,0.14);
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
}
.btn-logout:hover { background: rgba(255,255,255,0.26); }

.layout { display: flex; min-height: calc(100vh - 60px); align-items: flex-start; }

.sidebar {
    width: 235px;
    flex-shrink: 0;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    padding: 1.1rem 0.75rem;
    min-height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
}
.sidebar a {
    display: block;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.15rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sidebar a:hover {
    background: var(--primary-50);
    color: var(--primary-dark);
}
.sidebar a.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.content { flex: 1; padding: 1.75rem 2.25rem; min-width: 0; }

.footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-light);
    font-size: 0.78rem;
}

/* ---------- Components ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.4rem;
}

.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.1rem;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
}
.alert-danger { background: var(--danger-bg); color: #991b1b; border-left-color: var(--danger); }
.alert-success { background: var(--success-bg); color: #166534; border-left-color: var(--success); }

table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.87rem;
}
th {
    background: #fafafa;
    font-weight: 600;
    color: #374151;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--primary-50); }

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin: 0.6rem 0 0.3rem;
}
input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="email"], input[type="file"],
select, textarea {
    padding: 0.5rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: white; color: #4b5563; border: 1.5px solid var(--border); }
.btn-secondary:hover { background: #f9fafb; border-color: #d1d5db; color: var(--text); transform: translateY(-1px); }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.4rem 1.5rem;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.1;
}
.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        position: static;
        min-height: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar a { flex: 1 1 auto; text-align: center; }
    .content { padding: 1.25rem 1rem; }
    .topbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
}
