/* Royalty Board — plain CSS, no build step required. */

:root {
    --ink: #1f1a24;
    --muted: #6b6372;
    --line: #e4dee8;
    --paper: #ffffff;
    --wash: #f7f4f9;
    --brand: #6b2a6e;
    --brand-dark: #4d1c50;
    --brand-soft: #f3e9f3;
    --gold: #b8892d;
    --good: #1e7a46;
    --good-soft: #e5f4ea;
    --warn: #9a6a00;
    --warn-soft: #fbf1d9;
    --bad: #b3261e;
    --bad-soft: #fbe7e5;
    --radius: 8px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--wash);
    line-height: 1.5;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* ---------- Header & navigation ---------- */

.site-header {
    background: var(--brand);
    color: #fff;
    border-bottom: 4px solid var(--gold);
}
.site-header .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}
.brand { color: #fff; text-decoration: none; line-height: 1.2; }
.brand:hover { color: #fff; }
.brand strong { display: block; font-size: 1.05rem; }
.brand span { font-size: .85rem; opacity: .85; }

.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; align-items: center; }
.nav a, .nav button {
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: .92rem;
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer;
}
.nav a:hover, .nav button:hover, .nav a.active { background: rgba(255,255,255,.16); }
.nav form { margin: 0; }
.nav .who { opacity: .8; font-size: .85rem; padding: 0 6px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 48px; }

h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { margin: 0; color: var(--muted); }

/* ---------- Messages ---------- */

.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; }
.flash.ok { background: var(--good-soft); color: var(--good); border: 1px solid #bfe3cb; }
.flash.error { background: var(--bad-soft); color: var(--bad); border: 1px solid #f1c3be; }
.flash.notice { background: var(--warn-soft); color: #6d4b00; border: 1px solid #efd9a4; }
.flash ul { margin: 0; padding-left: 20px; }

/* ---------- Cards & tables ---------- */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 18px; }

.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfaFD; }
tr.past td { color: var(--muted); }
td.nowrap, .nowrap { white-space: nowrap; }
td.notes { min-width: 200px; }

.details { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 0; }
.details dt, .details dd { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.details dt { font-weight: 600; color: var(--muted); text-align: right; }
.details dt small { display: block; font-weight: 400; font-size: .8rem; }
.details dd:last-of-type, .details dt:last-of-type { border-bottom: 0; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--brand-soft); color: var(--brand-dark); margin-right: 3px; }
.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .82rem; white-space: nowrap; }
.status.good { background: var(--good-soft); color: var(--good); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.bad { background: var(--bad-soft); color: var(--bad); }
.status.muted { background: #efedf1; color: var(--muted); }

.muted { color: var(--muted); }
.private { border-left: 4px solid var(--gold); }

/* ---------- Buttons & links ---------- */

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-size: .93rem;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.3;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.danger { background: #fff; color: var(--bad); border-color: #e3b1ac; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 3px 9px; font-size: .82rem; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions form { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0; }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 20px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
label .hint, .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cfc6d4;
    border-radius: 6px;
    font: inherit;
    font-size: .95rem;
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.field-error { color: var(--bad); font-size: .85rem; margin-top: 3px; }
.is-invalid { border-color: var(--bad) !important; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; background: #fff; }
legend { font-weight: 700; padding: 0 6px; color: var(--brand-dark); }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.inline-form select, .inline-form input { width: auto; }
.checkbox { display: flex; gap: 8px; align-items: center; font-weight: 400; }

/* Attendance radio grid */
.attendance-grid th:first-child, .attendance-grid td:first-child { min-width: 190px; }
.attendance-grid td { text-align: center; }
.attendance-grid td:first-child { text-align: left; font-weight: 600; }
.attendance-grid th { white-space: normal; font-size: .8rem; text-align: center; min-width: 80px; }
.attendance-grid input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- Home ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); border-top: 4px solid var(--brand); }
.tile:hover { border-color: var(--brand); color: var(--ink); box-shadow: 0 2px 10px rgba(107,42,110,.12); }
.tile strong { display: block; font-size: 1.05rem; color: var(--brand-dark); margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: .9rem; }
.videos { padding-left: 20px; }
.videos li { margin-bottom: 6px; }

/* ---------- Login ---------- */

.login { max-width: 400px; margin: 40px auto; }
.login .card { padding: 28px; }
.login .field { margin-bottom: 16px; }

/* ---------- Email preview ---------- */

.email-preview { background: #fff; border: 1px dashed #cfc6d4; border-radius: var(--radius); padding: 20px; }
.recipients { font-size: .92rem; }
.recipients dt { font-weight: 600; float: left; width: 70px; }
.recipients dd { margin: 0 0 6px 78px; word-break: break-word; }

@media (max-width: 700px) {
    .details { grid-template-columns: 1fr; }
    .details dt { text-align: left; border-bottom: 0; padding-bottom: 0; }
    .nav { margin-left: 0; }
    main { padding: 18px 12px 40px; }
}

/* ---------- Printing (the old "PDF" schedule) ---------- */

@media print {
    body { background: #fff; font-size: 11pt; }
    .site-header, .no-print, .actions, .toolbar, .flash { display: none !important; }
    main { padding: 0; max-width: none; }
    .table-wrap, .card { border: 0; }
    th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit; text-decoration: none; }
}
