/* ── Reset & Variables ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #f4f6f9;
    --card:       #ffffff;
    --border:     #e2e8f0;
    --primary:    #3b6de8;
    --primary-dk: #2d55c4;
    --success:    #16a34a;
    --success-bg: #dcfce7;
    --error:      #dc2626;
    --error-bg:   #fee2e2;
    --muted:      #64748b;
    --text:       #1e293b;
    --approve:    #16a34a;
    --reject:     #dc2626;
    --radius:     14px;
    --shadow:     0 1px 3px rgba(0,0,0,.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:         #0f172a;
        --card:       #1e293b;
        --border:     #334155;
        --text:       #f1f5f9;
        --muted:      #94a3b8;
        --success-bg: #14532d;
        --error-bg:   #7f1d1d;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* ── Header ──────────────────────────────────────────────────── */
header {
    background: var(--primary);
    color: #fff;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}
.logo { font-size: 1.1rem; font-weight: 700; }
.btn-logout {
    background: rgba(255,255,255,.2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .35rem .8rem;
    font-size: .85rem;
    cursor: pointer;
}
.btn-logout:hover { background: rgba(255,255,255,.3); }

/* ── Main / Cards ────────────────────────────────────────────── */
main {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.center-card {
    max-width: 400px;
    margin: 2rem auto 0;
}

.card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* ── Balance Card ────────────────────────────────────────────── */
.balance-card {
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
    text-align: center;
    color: #fff;
    box-shadow: var(--shadow);
}
.balance-positive { background: linear-gradient(135deg, #16a34a, #22c55e); }
.balance-negative { background: linear-gradient(135deg, #dc2626, #ef4444); }
.balance-admin    { background: linear-gradient(135deg, #3b6de8, #6366f1); }

.balance-label  { font-size: .85rem; opacity: .85; margin-bottom: .25rem; }
.balance-amount { font-size: 2.5rem; font-weight: 700; line-height: 1.1; }
.balance-detail { font-size: .8rem; opacity: .75; margin-top: .4rem; }

/* ── Forms ───────────────────────────────────────────────────── */
h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.25rem; }

.field { margin-bottom: 1rem; }
.field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: .35rem;
}
.optional { font-weight: 400; }

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: .7rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

.minute-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.btn-minute {
    padding: .45rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: .9rem;
    cursor: pointer;
    transition: all .15s;
}
.btn-minute:hover, .btn-minute.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dk); }
.btn-full { width: 100%; }

.btn-approve, .btn-reject {
    border: none;
    border-radius: 8px;
    padding: .55rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}
.btn-approve { background: var(--success-bg); color: var(--approve); }
.btn-reject  { background: var(--error-bg);   color: var(--reject); }
.btn-approve:hover { background: #bbf7d0; }
.btn-reject:hover  { background: #fecaca; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error   { background: var(--error-bg);   color: var(--error); }

/* ── Entry List ──────────────────────────────────────────────── */
.entry-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }

.entry-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .75rem 1rem;
}
.entry-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: .2rem;
}
.entry-activity { font-weight: 600; }
.entry-minutes  { font-weight: 700; color: var(--primary); }
.entry-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .2rem;
}
.entry-date { font-size: .8rem; color: var(--muted); }
.entry-note {
    font-size: .82rem;
    color: var(--muted);
    margin-top: .3rem;
}
.admin-note { color: var(--primary); }

.empty { color: var(--muted); font-size: .9rem; text-align: center; padding: .5rem 0; }

/* ── Status Badges ───────────────────────────────────────────── */
.status-badge {
    font-size: .75rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 20px;
}
.status-approved { background: var(--success-bg); color: var(--approve); }
.status-rejected { background: var(--error-bg);   color: var(--reject); }
.status-pending  { background: #fef9c3; color: #854d0e; }

/* ── Review Form (Admin) ─────────────────────────────────────── */
.review-form { margin-top: .75rem; }
.review-form input[type="text"] { margin-bottom: .5rem; font-size: .9rem; }
.review-buttons { display: flex; gap: .5rem; }

/* ── Header Reload ───────────────────────────────────────────── */
a.logo {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}
a.logo:hover { opacity: .85; }

.header-right {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.btn-reload {
    background: rgba(255,255,255,.2);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .3s;
}
.btn-reload:hover {
    background: rgba(255,255,255,.3);
}
.btn-reload.spinning {
    animation: spin .4s linear;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
