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

:root {
    --primary:   #2563eb;
    --primary-d: #1d4ed8;
    --success:   #16a34a;
    --danger:    #dc2626;
    --warning:   #d97706;
    --bg:        #f8fafc;
    --surface:   #ffffff;
    --border:    #e2e8f0;
    --text:      #1e293b;
    --muted:     #64748b;
    --radius:    8px;
    --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

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

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

img { max-width: 100%; display: block; }

/* ===== Layout ===== */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.page-center { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem 1rem; }

/* ===== Navbar ===== */
nav.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
}
.navbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px;
}
.navbar-brand {
    font-weight: 700; font-size: 1.1rem; color: var(--primary);
    display: flex; align-items: center; gap: .5rem;
}
.navbar-links { display: flex; align-items: center; gap: 1rem; }
.navbar-links a { color: var(--text); font-size: .9rem; padding: .25rem .5rem; border-radius: 4px; }
.navbar-links a:hover, .navbar-links a.active { background: var(--bg); color: var(--primary); text-decoration: none; }

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.card-header { margin-bottom: 1.25rem; }
.card-title { font-size: 1.1rem; font-weight: 600; }

/* ===== Auth card ===== */
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: .25rem; }
.auth-card .subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; }
.form-control {
    width: 100%; padding: .55rem .75rem;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: .95rem; color: var(--text);
    background: var(--surface);
    transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1.1rem; border-radius: 6px; font-size: .9rem; font-weight: 500;
    cursor: pointer; border: 1px solid transparent; transition: background .15s, opacity .15s;
    text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary   { background: var(--primary);   color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); border-color: var(--primary-d); }
.btn-success   { background: var(--success);   color: #fff; border-color: var(--success); }
.btn-danger    { background: var(--danger);     color: #fff; border-color: var(--danger); }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-ghost     { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-sm        { padding: .3rem .7rem; font-size: .82rem; }
.btn-full      { width: 100%; }

/* ===== Alerts ===== */
.alert {
    padding: .75rem 1rem; border-radius: 6px; font-size: .9rem;
    border: 1px solid transparent; margin-bottom: 1rem;
}
.alert-success { background: #f0fdf4; color: var(--success); border-color: #bbf7d0; }
.alert-error   { background: #fef2f2; color: var(--danger);  border-color: #fecaca; }
.alert-info    { background: #eff6ff; color: var(--primary);  border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: var(--warning);  border-color: #fde68a; }

/* ===== Badges ===== */
.badge {
    display: inline-block; padding: .15rem .5rem; border-radius: 99px;
    font-size: .75rem; font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th { background: var(--bg); padding: .6rem .75rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; }
tbody td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }

/* ===== Grids ===== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
    padding: .5rem 1rem; font-size: .9rem; font-weight: 500; cursor: pointer;
    border: none; background: none; color: var(--muted); border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: color .15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Event cards ===== */
.event-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.event-card img { width: 100%; height: 160px; object-fit: cover; }
.event-card-body { padding: 1rem; }
.event-card-title { font-weight: 600; margin-bottom: .25rem; }
.event-card-meta  { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }

/* ===== Modal ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 200;
    align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface); border-radius: var(--radius);
    width: 100%; max-width: 520px; max-height: 90vh;
    overflow-y: auto; padding: 1.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title  { font-size: 1.1rem; font-weight: 600; }
.modal-close  { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); line-height: 1; }

/* ===== Utilities ===== */
.hidden   { display: none !important; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.text-muted  { color: var(--muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.flex        { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.spinner {
    width: 20px; height: 20px; border: 2px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .navbar-links .hide-mobile { display: none; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
