:root {
  --bg: #f4f6f5; --fg: #1d2521; --muted: #66706b; --card: #fff; --line: #dde3df;
  --brand: #15803d; --brand-dark: #0f5f2d; --danger: #b91c1c; --warn: #b45309;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--fg); }
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: .4em 0 .6em; }
h2 { font-size: 1.15rem; margin-top: 1.6em; }
a { color: var(--brand-dark); }
.muted { color: var(--muted); }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 10px 16px; background: var(--brand); color: #fff; }
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.1rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.topbar nav a { padding: 6px 10px; border-radius: 6px; }
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.18); }
.topbar .user { font-size: .9rem; }
.badge { background: #fbbf24; color: #1d2521; border-radius: 10px; padding: 0 7px; font-size: .8rem; font-weight: 700; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 8px 0; background: #dcfce7; border: 1px solid #86efac; }
.flash-error { background: #fee2e2; border-color: #fca5a5; }
.flash-warn { background: #fef3c7; border-color: #fcd34d; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.narrow { max-width: 420px; }
label { display: block; margin-bottom: 10px; font-size: .9rem; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--fg); }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #c5cdc8; border-radius: 6px; background: #fff; color: var(--fg); }
label input:not([type=checkbox]), label select, label textarea { display: block; width: 100%; margin-top: 3px; }
input.short { width: 80px; }
input[type=color] { padding: 2px; width: 48px; height: 34px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

button, .btn { display: inline-block; font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; }
.btn { background: #fff; color: var(--brand-dark); }
.btn.active { background: var(--brand); color: #fff; }
button.ok { background: var(--brand); }
button.danger { background: var(--danger); border-color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }
.toolbar, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.row input { flex: 1; min-width: 200px; }
form.inline { display: inline; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; margin: 8px 0 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pending-swatch { background: repeating-linear-gradient(45deg, #999 0 3px, #fff 3px 6px); border: 1px solid #999; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
thead th { background: #eef2ef; font-size: .9rem; }
table.list td input:not([type=checkbox]):not([type=color]) { width: 100%; }
tr.new td { background: #f7fbf8; }
tr.inactive td { color: var(--muted); }

table.week { min-width: 900px; table-layout: fixed; }
table.week th:first-child { width: 140px; }
table.week th.today { background: #d1fae5; }
table.week th.pitch small { display: block; font-weight: 400; color: var(--muted); }
table.week td { position: relative; padding: 4px 4px 22px; min-height: 60px; }
.slot { display: block; margin-bottom: 4px; padding: 4px 6px; border-radius: 5px; font-size: .8rem; text-decoration: none; color: #fff;
        background: var(--c); border-left: 4px solid rgba(0,0,0,.25); overflow-wrap: anywhere; }
.slot small { display: block; opacity: .9; }
.slot.pending { color: var(--fg); background: repeating-linear-gradient(45deg, #fff 0 6px, #f1f1f1 6px 12px); border: 1px dashed var(--c); border-left: 4px solid var(--c); }
.add { position: absolute; right: 4px; bottom: 2px; font-size: 1.1rem; text-decoration: none; color: var(--muted); opacity: .4; }
td:hover .add { opacity: 1; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .8rem; color: #fff; background: var(--c); }
.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .8rem; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-cancelled { background: #e5e7eb; color: #374151; }
