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

:root {
    --green:    #2d7d4f;
    --green-lt: #e8f5ee;
    --red:      #c0392b;
    --red-lt:   #fdecea;
    --yellow:   #e67e22;
    --yellow-lt:#fef5e7;
    --blue:     #2471a3;
    --blue-lt:  #eaf2fb;
    --gray:     #6c757d;
    --gray-lt:  #f8f9fa;
    --border:   #dee2e6;
    --text:     #212529;
    --radius:   6px;
    --shadow:   0 1px 3px rgba(0,0,0,.12);
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #f0f2f5;
    line-height: 1.5;
}

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

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 52px;
    box-shadow: var(--shadow);
}
.nav-brand { font-weight: 700; font-size: 1rem; letter-spacing: .02em; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: rgba(255,255,255,.85); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: #fff; text-decoration: none; }
.nav-links a.active { border-bottom: 2px solid #fff; padding-bottom: 2px; }
.nav-logout { color: rgba(255,255,255,.65) !important; font-size: .85rem; }

/* ── Container ──────────────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }

/* ── Page header ────────────────────────────────────────────────────── */
.page-header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1.25rem; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.header-actions { margin-left: auto; display: flex; gap: .5rem; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
    font-size: .72rem; font-weight: 600; padding: 2px 8px;
    border-radius: 999px; background: var(--gray-lt); color: var(--gray);
}
.badge-confirmed { background: var(--green-lt); color: var(--green); }
.badge-pending   { background: var(--yellow-lt); color: var(--yellow); }
.badge-total     { background: var(--blue-lt); color: var(--blue); }
.badge-waitlist  { background: #f3e5f5; color: #7b1fa2; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .42rem .9rem; border-radius: var(--radius);
    font-size: .85rem; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; white-space: nowrap;
    text-decoration: none; transition: opacity .15s;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary   { background: var(--green); color: #fff; border-color: var(--green); }
.btn-secondary { background: var(--blue);  color: #fff; border-color: var(--blue); }
.btn-danger    { background: var(--red);   color: #fff; border-color: var(--red); }
.btn-ghost     { background: transparent;  color: var(--gray); border-color: var(--border); }
.btn-sm        { padding: .25rem .6rem; font-size: .78rem; }
.btn-full      { width: 100%; justify-content: center; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
    padding: .7rem 1rem; border-radius: var(--radius);
    margin-bottom: 1rem; font-size: .88rem;
}
.alert-success { background: var(--green-lt); color: var(--green); }
.alert-danger  { background: var(--red-lt);   color: var(--red); }
.alert-warning { background: var(--yellow-lt);color: var(--yellow); }
.alert-info    { background: var(--blue-lt);  color: var(--blue); }

/* ── Filter bar ─────────────────────────────────────────────────────── */
.filter-bar {
    display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.filter-input {
    padding: .4rem .75rem; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: .85rem; flex: 1; min-width: 180px;
}
.filter-select {
    padding: .4rem .75rem; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: .85rem; background: #fff;
}

/* ── Data table ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table {
    width: 100%; border-collapse: collapse; background: #fff;
    font-size: .83rem;
}
.data-table th {
    background: #f1f3f5; text-align: left; padding: .6rem .8rem;
    font-weight: 600; border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: .55rem .8rem; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8f9fa; }
.data-table .center { text-align: center; }
.actions { display: flex; gap: .35rem; }

/* Row status tints */
.row-cancelled td { opacity: .5; }
.row-waitlist  td { background: #fafafa; }

/* Payment colours */
.paid   { color: var(--green); font-weight: 600; }
.unpaid { color: var(--red);   font-weight: 600; }
.muted  { color: var(--gray);  font-size: .82rem; }

/* ── Chips ──────────────────────────────────────────────────────────── */
.chip {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: .75rem; font-weight: 600;
    background: var(--gray-lt); color: var(--gray);
}
.chip-vendor  { background: #e8f4fd; color: #1a6ea8; }
.chip-crafter { background: #fef9e7; color: #9a7d0a; }
.chip-baking  { background: #fdf2e9; color: #a04000; }
.chip-artist  { background: #f5eef8; color: #7d3c98; }
.chip-garage  { background: #eafaf1; color: #1e8449; }
.chip-whatever{ background: #fdfefe; color: #555; }

.chip-status-confirmed { background: var(--green-lt); color: var(--green); }
.chip-status-pending   { background: var(--yellow-lt); color: var(--yellow); }
.chip-status-waitlist  { background: #f3e5f5; color: #7b1fa2; }
.chip-status-cancelled { background: var(--red-lt); color: var(--red); }

/* ── Summary bar (payments) ─────────────────────────────────────────── */
.summary-bar {
    display: flex; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.summary-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: .9rem 1.2rem;
    min-width: 120px; box-shadow: var(--shadow);
}
.summary-value { font-size: 1.5rem; font-weight: 700; }
.summary-label { font-size: .78rem; color: var(--gray); margin-top: 2px; }
.summary-card-green { border-left: 4px solid var(--green); }
.summary-card-red   { border-left: 4px solid var(--red); }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-section {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem 1.5rem;
    margin-bottom: 1rem; box-shadow: var(--shadow);
}
.form-section h2 {
    font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
    padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.form-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem; margin-bottom: .75rem;
}
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.full-width { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font-weight: 500; font-size: .85rem; }
.field input, .field select, .field textarea {
    padding: .4rem .65rem; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: .85rem; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--green); border-color: var(--green);
}
.field textarea { resize: vertical; }
.field-check {
    display: flex; align-items: center; gap: .5rem; padding-top: .25rem;
}
.static-field {
    padding: .4rem .65rem; background: var(--gray-lt);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: .85rem;
}
.req { color: var(--red); }

.form-actions {
    display: flex; gap: .75rem; padding-top: .5rem;
}

/* ── Inline forms (payments quick-mark) ──────────────────────────────── */
.inline-form { display: flex; gap: .35rem; align-items: center; }
.inline-select {
    padding: .25rem .5rem; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: .78rem; background: #fff;
}

/* ── Login ──────────────────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: #f0f2f5;
}
.login-card {
    background: #fff; border-radius: 10px; padding: 2.5rem;
    width: 100%; max-width: 360px; box-shadow: 0 4px 20px rgba(0,0,0,.1);
    text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: .5rem; }
.login-card h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.login-sub { color: var(--gray); font-size: .9rem; margin-bottom: 1.5rem; }
.login-card .field { text-align: left; margin-bottom: 1rem; }

/* ── Import ─────────────────────────────────────────────────────────── */
.import-instructions {
    background: var(--blue-lt); border: 1px solid #aed6f1;
    border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.import-instructions h3 { font-size: .95rem; margin-bottom: .5rem; }
.import-instructions ol { padding-left: 1.2rem; font-size: .88rem; }
.import-form {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
    margin-bottom: 1.5rem; box-shadow: var(--shadow);
}
.preview-section h2 { font-size: 1.1rem; margin-bottom: .5rem; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 3rem; color: var(--gray);
    background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
}

/* ── Assignments ─────────────────────────────────────────────────────── */
.alert-panel {
    background: var(--yellow-lt); border: 1px solid #f0c080;
    border-radius: var(--radius); margin-bottom: 1.25rem;
    overflow: hidden;
}
.alert-panel-header {
    background: #f5d28a; padding: .6rem 1rem;
    font-weight: 600; font-size: .88rem;
}
.unassigned-list {
    padding: .75rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem;
}
.unassigned-chip {
    background: #fff; border: 1px solid #e0c070;
    border-radius: var(--radius); padding: .35rem .75rem;
    font-size: .82rem; display: flex; align-items: center; gap: .4rem;
}
.elec-badge {
    font-size: .75rem; background: #fff3cd;
    border-radius: 999px; padding: 1px 5px;
}
.all-assigned-banner {
    background: var(--green-lt); border: 1px solid #a8d5b5;
    border-radius: var(--radius); padding: .75rem 1rem;
    font-weight: 600; color: var(--green); margin-bottom: 1.25rem;
}

/* Zone header rows */
.zone-header-row td {
    background: #e9ecef; font-weight: 700; font-size: .8rem;
    text-transform: uppercase; letter-spacing: .06em;
    padding: .4rem .8rem; color: #495057;
}

/* Assigned / vacant row tints */
.row-vacant td { background: #fafef8; }
.row-assigned td { background: #fff; }
.vacant-label { color: #adb5bd; font-style: italic; font-size: .82rem; }

/* Location preference chips */
.chip-loc-gym     { background: #e8f4fd; color: #1a6ea8; }
.chip-loc-commons { background: #eafaf1; color: #1e8449; }
.chip-loc-anywhere{ background: #f5f5f5; color: #666; }
