/* ============================================================
   Camp 2026 Portal — Shared Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --emerald: #059669;
    --emerald-dark: #047857;
    --emerald-light: #d1fae5;
    --gray-bg: #f3f4f6;
    --gray-border: #e5e7eb;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--gray-bg);
    color: var(--text-dark);
}

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

/* ---------- Layout shell ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e7f7ef 100%);
}

.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 480px;
    padding: 36px;
}

.auth-card.wide { max-width: 760px; }

.brand-header { text-align: center; margin-bottom: 28px; }
.brand-header .badge {
    display: inline-block;
    background: var(--emerald-light);
    color: var(--emerald-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 10px;
}
.brand-header h1 { font-size: 22px; font-weight: 800; margin: 4px 0; }
.brand-header p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ---------- Form elements ---------- */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
}
label .req { color: var(--danger); }

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px var(--emerald-light);
}
textarea { resize: vertical; min-height: 70px; }

.checkbox-row { display: flex; align-items: flex-start; gap: 8px; }
.checkbox-row input { width: auto; margin-top: 3px; }
.checkbox-row label { font-weight: 400; font-size: 13px; margin: 0; }

fieldset {
    border: 1px solid var(--gray-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 18px;
}
fieldset legend {
    font-size: 13px;
    font-weight: 700;
    color: var(--emerald-dark);
    padding: 0 6px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--emerald); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--emerald-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text-dark); border: 1px solid var(--gray-border); }
.btn-secondary:hover { background: var(--gray-bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- Alerts / toasts ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
.alert.show { display: block; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #1f2937;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    min-width: 220px;
    animation: toast-in .2s ease;
}
.toast.success { background: var(--emerald-dark); }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Dashboard shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px;
    background: #fff;
    border-right: 1px solid var(--gray-border);
    padding: 20px 0;
    flex-shrink: 0;
}
.sidebar .brand { padding: 0 20px 20px; font-weight: 800; font-size: 17px; }
.sidebar .brand span { color: var(--emerald); }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.sidebar nav a.active {
    color: var(--emerald-dark);
    background: var(--emerald-light);
    border-left-color: var(--emerald);
    font-weight: 600;
}
.main-content { flex: 1; padding: 28px 32px; max-width: 1200px; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar h1 { font-size: 22px; font-weight: 800; margin: 0; }
.topbar .subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    border: 1px solid var(--gray-border);
}
.stat-card .label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat-card .value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.stat-card.accent .value { color: var(--emerald); }

/* ---------- Cards / tables ---------- */
.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-border);
    padding: 22px;
    margin-bottom: 20px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h2 { font-size: 16px; font-weight: 700; margin: 0; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--gray-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}
table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-border); }
table.data-table tr:hover td { background: #fafafa; }

.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-part-paid { background: #fef3c7; color: #92400e; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }

.progress-bar { background: var(--gray-border); border-radius: 100px; height: 8px; overflow: hidden; }
.progress-bar > div { background: var(--emerald); height: 100%; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 36px; margin-bottom: 10px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select, .toolbar input { width: auto; min-width: 160px; }

@media (max-width: 768px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; }
    .form-row { flex-direction: column; }
    .main-content { padding: 18px; }
}
