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

:root {
    --red:        #ef0107;
    --red-dark:   #c40006;
    --red-muted:  #fef2f2;
    --gold:       #d4af37;
    --bg:         #f0f2f5;
    --surface:    #ffffff;
    --surface-2:  #f8f9fb;
    --border:     #e2e5ea;
    --text:       #1a1d23;
    --text-muted: #6b7280;
    --green:      #16a34a;
    --green-bg:   #f0fdf4;
    --orange:     #d97706;
    --orange-bg:  #fffbeb;
    --radius:     10px;
    --shadow:     0 2px 12px rgba(0,0,0,0.07);
    --shadow-lg:  0 8px 30px rgba(0,0,0,0.10);
    --transition: 0.18s ease;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ── Typography ─────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p  { color: var(--text-muted); font-size: 0.95rem; }

/* ── Layout ─────────────────────────────────────────────────────── */
.page-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 36px 40px;
    width: 100%;
    max-width: 460px;
}

.shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ── Header / Nav ───────────────────────────────────────────────── */
.topbar {
    background: var(--red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-brand {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

/* ── Tab Nav ────────────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color var(--transition), border-color var(--transition);
}

.tab-btn:hover { color: var(--red); }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }

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

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

.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.btn-ghost:hover { background: rgba(255,255,255,0.25); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(239,1,7,0.12);
}

/* ── Cards / List Items ─────────────────────────────────────────── */
.item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    transition: box-shadow var(--transition);
}

.item-card:hover { box-shadow: var(--shadow); }
.item-card.accent-red    { border-left-color: var(--red); }
.item-card.accent-green  { border-left-color: var(--green); }
.item-card.accent-orange { border-left-color: var(--orange); }
.item-card.accent-gray   { border-left-color: #9ca3af; }

.item-card-body { flex: 1; min-width: 0; }
.item-card-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.item-card-meta  { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 2px; }
.item-card-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-muted);  color: var(--red); }
.badge-orange { background: var(--orange-bg);  color: var(--orange); }
.badge-gray   { background: #f3f4f6; color: #6b7280; }
.badge-gold   { background: #fefce8; color: #92400e; }

/* ── Ticket counter widget ──────────────────────────────────────── */
.ticket-counter {
    display: inline-flex;
    align-items: center;
    background: var(--red-muted);
    border: 1.5px solid var(--red);
    border-radius: 8px;
    padding: 8px 20px;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--red);
    margin-bottom: 20px;
}

.ticket-counter span { font-size: 1.4rem; }

/* ── Section header ─────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Brand block (login/register) ───────────────────────────────── */
.brand-block {
    text-align: center;
    margin-bottom: 28px;
}

.brand-block .crest { font-size: 2.8rem; line-height: 1; }
.brand-block h2 { color: var(--red); margin-top: 6px; }
.brand-block p  { margin-top: 4px; font-size: 0.875rem; }
.brand-block .crest img {
    height: 56px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.topbar-brand img {
    height: 28px;
    width: auto;
    display: block;
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 14px;
}

.alert-error   { background: var(--red-muted);  color: #9b1c1c; }
.alert-success { background: var(--green-bg);   color: #14532d; }
.alert-info    { background: #eff6ff; color: #1e40af; }

/* ── Divider ────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Utility ────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.mt-4    { margin-top: 16px; }
.mt-8    { margin-top: 32px; }
.text-muted  { color: var(--text-muted); font-size: 0.875rem; }
.text-center { text-align: center; }
.flex-gap    { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── Profile grid ───────────────────────────────────────────────── */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.profile-field label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.profile-field span  { display: block; font-size: 0.95rem; font-weight: 600; margin-top: 2px; }

/* ── Allocation input row ───────────────────────────────────────── */
.alloc-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.alloc-row input[type="number"] {
    width: 80px;
    padding: 5px 8px;
    font-size: 0.85rem;
}

/* ── Empty state ────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.empty-state .icon { font-size: 2.5rem; margin-bottom: 8px; }

/* ── Sub-tabs (used inside Member View on admin panel) ──────────── */
.sub-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color var(--transition), border-color var(--transition);
}

.sub-tab-btn:hover { color: var(--red); }
.sub-tab-btn.active { color: var(--red); border-bottom-color: var(--red); }

.sub-tab-panel { display: none; }
.sub-tab-panel.active { display: block; }