/* TutorKit — style.css
   Mobile-first, ringan, tanpa framework CSS eksternal (SDD Appendix 13 & NFR 10). */

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #eff4ff;
    --color-accent: #f59e0b;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --color-bg: #f4f6fb;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition: 160ms ease;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.5;
    padding-bottom: 72px; /* ruang untuk bottom nav mobile */
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

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

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

/* ---------- Top bar ---------- */
.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    font-size: 18px;
    margin: 0;
    letter-spacing: -0.01em;
}

.topbar .user-name {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ---------- Cards ---------- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
    padding: 18px;
    margin-bottom: 12px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.card h2, .card h3 {
    margin-top: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 14px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    padding: 13px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field-error {
    color: var(--color-danger);
    font-size: 13px;
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 13px 18px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: var(--color-primary);
    color: #fff;
    width: 100%;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:hover {
    background: var(--color-primary-dark);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg);
}

.btn-danger {
    background: var(--color-danger);
}

.btn-sm {
    width: auto;
    min-height: 40px;
    padding: 9px 14px;
    font-size: 14px;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-hadir, .badge-kuasai, .badge-active, .badge-reviewed { background: #dcfce7; color: #166534; }
.badge-telat, .badge-proses, .badge-submitted { background: #fef3c7; color: #92400e; }
.badge-absen, .badge-belum, .badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-assigned { background: #e0e7ff; color: #3730a3; }

/* ---------- Lists ---------- */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    gap: 10px;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-title {
    font-weight: 600;
}

.list-item-sub {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ---------- Bottom nav (mobile-first) ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    z-index: 20;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 10px 4px 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    transition: color var(--transition);
}

.bottom-nav a.active {
    color: var(--color-primary);
    font-weight: 600;
}

.bottom-nav .icon {
    display: block;
    font-size: 18px;
    margin-bottom: 2px;
}

/* ---------- Utility ---------- */
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    padding: 32px 16px;
    font-size: 14px;
}
.loading {
    text-align: center;
    color: var(--color-text-muted);
    padding: 24px;
    font-size: 14px;
}

@media (min-width: 600px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
