/* ============================================================
   ScaleOn - Tema Retro Classic
   Palet: cream, coklat tua, terracotta, hijau lumut, aksen mustard
   Mobile-first, sidebar collapsible, quick access cards
   ============================================================ */

:root {
    --cream: #f4ecd8;
    --paper: #fffaf0;
    --brown-dark: #3b2a1a;
    --brown: #6b4423;
    --terracotta: #c1502e;
    --mustard: #e0a458;
    --moss: #5c7a52;
    --ink: #2b2118;
    --line: #d8c8a8;
    --shadow: 4px 4px 0 rgba(59, 42, 26, 0.25);
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Courier New', Courier, monospace, Georgia, serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.5;
}

a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; color: var(--brown-dark); letter-spacing: 0.5px; }

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

/* ---------- Topbar ---------- */
.topbar {
    background: var(--brown-dark);
    color: var(--cream);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--mustard);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar .brand { font-family: Georgia, serif; font-weight: bold; font-size: 1.25rem; color: var(--mustard); }
.topbar .brand span { color: var(--cream); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    background: none; border: none; color: var(--cream); font-size: 1.2rem; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: 2px solid var(--brown-dark);
    border-radius: var(--radius);
    background: var(--mustard);
    color: var(--brown-dark);
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--shadow);
    text-align: center;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 rgba(59,42,26,0.25); text-decoration: none; }
.btn-primary { background: var(--terracotta); color: var(--paper); }
.btn-outline { background: var(--paper); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* ---------- Cards / Panels ---------- */
.card {
    background: var(--paper);
    border: 2px solid var(--brown-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.card-title { margin-top: 0; border-bottom: 2px dashed var(--line); padding-bottom: 8px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
label { display: block; font-weight: bold; margin-bottom: 6px; color: var(--brown); }
input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--brown-dark);
    border-radius: var(--radius);
    background: var(--paper);
    font-family: inherit;
    font-size: 1rem;
}
input:focus, textarea:focus, select:focus { outline: 3px solid var(--mustard); }
.help-text { font-size: 0.8rem; color: var(--brown); }
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 2px solid; }
.alert-error { background: #fbe4df; border-color: var(--terracotta); color: var(--terracotta); }
.alert-success { background: #e7efe1; border-color: var(--moss); color: var(--moss); }

/* ---------- App shell (member/admin) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    background: var(--brown-dark);
    color: var(--cream);
    width: 230px;
    flex-shrink: 0;
    padding: 16px 0;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 100;
    border-right: 3px solid var(--mustard);
}
.sidebar.open { transform: translateX(0); }
.sidebar-brand { padding: 0 16px 16px; font-family: Georgia, serif; font-size: 1.2rem; color: var(--mustard); border-bottom: 1px solid rgba(244,236,216,0.2); margin-bottom: 4px; }
.sidebar-section-label {
    text-transform: uppercase; font-size: 0.68rem; letter-spacing: 1.2px;
    color: rgba(244,236,216,0.45); padding: 16px 16px 6px; font-family: Georgia, serif;
}
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--cream);
    border-left: 4px solid transparent;
}
.sidebar nav a .nav-icon {
    width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
    background: rgba(224,164,88,0.18); color: var(--mustard);
    display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(224,164,88,0.15);
    border-left-color: var(--mustard);
    text-decoration: none;
    color: var(--mustard);
}
.sidebar nav a:hover .nav-icon, .sidebar nav a.active .nav-icon {
    background: var(--mustard); color: var(--brown-dark);
}
.sidebar nav a.logout-link { margin-top: 6px; border-top: 1px solid rgba(244,236,216,0.15); padding-top: 14px; }
.sidebar nav a.logout-link .nav-icon { background: rgba(193,80,46,0.2); color: var(--terracotta); }
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90;
}
.sidebar-overlay.show { display: block; }

.main-content { flex: 1; padding: 16px; width: 100%; }

/* Quick access grid */
.quick-access { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.quick-access a {
    background: var(--paper);
    border: 2px solid var(--brown-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 10px;
    text-align: center;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.quick-access a:hover { text-decoration: none; transform: translate(-1px,-1px); }
.quick-access .qa-icon { font-size: 1.6rem; }
.quick-access .qa-label { font-size: 0.8rem; font-weight: bold; }

@media (min-width: 768px) {
    .sidebar { position: sticky; transform: none; }
    .sidebar-toggle { display: none; }
    .quick-access { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Top bar icons (bell/inbox/avatar) ---------- */
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn { position: relative; }
.badge-dot {
    position: absolute; top: -4px; right: -6px;
    background: var(--terracotta); color: #fff; border-radius: 8px;
    font-size: 0.6rem; padding: 1px 5px; min-width: 14px; text-align: center;
}
.avatar-circle {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--mustard); color: var(--brown-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-family: Georgia, serif; border: 2px solid var(--cream);
    text-decoration: none;
}

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-card {
    background: var(--paper); border: 2px solid var(--brown-dark); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 8px; text-align: center;
}
.stat-card .stat-icon { font-size: 1.4rem; }
.stat-card .stat-number { font-size: 1.5rem; font-weight: bold; color: var(--moss); font-family: Georgia, serif; margin: 2px 0; }
.stat-card .stat-label { font-size: 0.75rem; color: var(--brown); }

/* ---------- Quick access icon circle ---------- */
.quick-access .qa-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--cream); border: 2px solid var(--mustard);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin-bottom: 2px;
}

/* ---------- Bottom navigation (mobile) ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--paper); border-top: 3px solid var(--mustard);
    display: flex; justify-content: space-around; align-items: center;
    padding: 6px 0 8px; z-index: 80;
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--brown); font-size: 0.7rem; text-decoration: none; flex: 1;
}
.bottom-nav a .bn-icon { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--terracotta); font-weight: bold; }
.bottom-nav-spacer { height: 64px; }

@media (min-width: 768px) {
    .bottom-nav, .bottom-nav-spacer { display: none; }
}
    text-align: center;
    padding: 20px;
    color: var(--brown);
    font-size: 0.85rem;
    border-top: 2px dashed var(--line);
    margin-top: 30px;
}
