/* FFN Casting. Operational tool. dark, high contrast, readable backstage in low light. */
:root {
  --bg: #0e0f12;
  --panel: #171a20;
  --panel2: #1f232b;
  --line: #2c313c;
  --text: #e9ecf1;
  --dim: #9aa3b2;
  --blood: #b3121b;
  --blood-hi: #e0202b;
  --amber: #e2a032;
  --green: #2f9e5f;
  --radius: 6px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: #7fb3ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- nav ---------- */
.topnav {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--panel); border-bottom: 2px solid var(--blood);
  padding: 10px 18px; position: sticky; top: 0; z-index: 50;
}
.brand { font-weight: 800; letter-spacing: 1px; color: var(--text); font-size: 18px; }
.brand span { color: var(--blood-hi); margin-left: 4px; }
.navlinks { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.navlinks a {
  color: var(--dim); padding: 8px 12px; border-radius: var(--radius);
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.navlinks a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.navuser { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who { color: var(--dim); }
.who em { color: var(--amber); font-style: normal; text-transform: uppercase; font-size: 11px; margin-left: 4px; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 20px 18px 60px; }

/* ---------- cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.card h1, .card h2 { margin-top: 0; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
.err-card { max-width: 560px; }

.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .n { font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat .l { color: var(--dim); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- buttons ---------- */
.btn, .btn-sm, button {
  display: inline-block; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px; font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; font-family: inherit;
}
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn:hover, button:hover { background: #262b34; text-decoration: none; }
.btn-primary { background: var(--blood); border-color: var(--blood-hi); color: #fff; }
.btn-primary:hover { background: var(--blood-hi); }
.btn-danger { background: #3a1418; border-color: #6b1f26; color: #ffb3b8; }
.btn-ghost { background: transparent; }

/* ---------- forms ---------- */
label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--dim); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=time], input[type=file], select, textarea {
  display: block; width: 100%; margin-top: 5px;
  background: #0f1114; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 12px; font-size: 16px; font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blood); outline-offset: -1px; }
.formrow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.checkrow { display: flex; flex-wrap: wrap; gap: 8px; }
.checkrow label {
  display: flex; align-items: center; gap: 7px; margin: 0;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 20px;
  padding: 8px 14px; color: var(--text); cursor: pointer; font-size: 14px;
}
.checkrow input { width: auto; margin: 0; }
.checkrow .child { margin-left: 16px; opacity: .9; font-size: 13px; }

/* ---------- login ---------- */
.loginbody { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.loginbox {
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--blood);
  border-radius: 8px; padding: 32px; width: 100%; max-width: 380px;
}
.loginbox h1 { margin: 0 0 22px; font-size: 22px; letter-spacing: 1px; }
.loginbox h1 span { color: var(--blood-hi); margin-left: 4px; }
.loginbox button { width: 100%; margin-top: 6px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tbody tr:hover { background: var(--panel2); }
.tablewrap { overflow-x: auto; }

/* ---------- badges + alerts ---------- */
.badge {
  display: inline-block; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 2px 9px; font-size: 12px; font-weight: 600; margin-right: 4px;
}
.badge-speaking { background: #17304d; border-color: #2a5580; color: #9ecbff; }
.badge-creature { background: #3d2140; border-color: #6b3a70; color: #e3aeea; }
.badge-stunt    { background: #14392c; border-color: #24614a; color: #86e0b5; }
.badge-out      { background: #4a2410; border-color: #7d3f1c; color: #ffbe90; }

.alert {
  background: #3a1418; border: 1px solid var(--blood); border-left: 4px solid var(--blood-hi);
  color: #ffc9cd; padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px;
}
.alert-warn { background: #3a2f10; border-color: var(--amber); border-left-color: var(--amber); color: #ffe0a8; }
.alert-ok { background: #102e1e; border-color: var(--green); border-left-color: var(--green); color: #a6e8c2; }

/* ALLERGIES: safety field, must be impossible to miss */
.allergy-box {
  background: #4a0d12; border: 2px solid var(--blood-hi); border-radius: var(--radius);
  padding: 13px 15px; margin: 14px 0; color: #ffd5d8;
}
.allergy-box strong { display: block; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: #ff8a92; margin-bottom: 4px; }
.allergy-inline { color: #ff9ba2; font-weight: 700; }

/* ---------- schedule ---------- */
.nightstrip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.nightstrip a {
  flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 13px; color: var(--dim);
  font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap;
}
.nightstrip a.on { background: var(--blood); border-color: var(--blood-hi); color: #fff; }
.nightstrip a .lbl { display: block; font-size: 10px; color: var(--amber); text-transform: uppercase; }
.nightstrip a.on .lbl { color: #ffd9dc; }

.room {
  background: var(--panel2); border: 1px solid var(--line);
  border-left: 4px solid var(--green); border-radius: var(--radius);
  padding: 13px; margin-bottom: 11px;
}
.room.understaffed { border-left-color: var(--amber); }
.room.empty { border-left-color: var(--blood-hi); }
.room h4 { margin: 0 0 3px; font-size: 15px; }
.room .meta { color: var(--dim); font-size: 12px; margin-bottom: 9px; }
.room .count { font-weight: 700; }
.room .count.short { color: var(--amber); }
.room .count.ok { color: var(--green); }
.assigned-actor {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #12151a; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 11px; margin-bottom: 6px; font-size: 14px;
}
.assigned-actor form { margin: 0; }
.addform { display: flex; gap: 7px; flex-wrap: wrap; align-items: flex-end; margin-top: 9px; }
.addform select { min-width: 190px; margin: 0; }
.addform input[type=time] { width: 120px; margin: 0; }
.addform button { padding: 11px 15px; }

.thumb { width: 42px; height: 42px; border-radius: 4px; object-fit: cover; background: var(--panel2); border: 1px solid var(--line); }
.thumb-lg { width: 150px; height: 150px; border-radius: var(--radius); object-fit: cover; background: var(--panel2); border: 1px solid var(--line); }
.nophoto { display: inline-flex; align-items: center; justify-content: center; color: var(--dim); font-size: 10px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters label { margin: 0; }
.filters select, .filters input { margin-top: 4px; }

.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { margin: 0; }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 15px; color: var(--dim); font-weight: 600; font-size: 14px; }
.tabs a.on { background: var(--blood); border-color: var(--blood-hi); color: #fff; }

.availgrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.availcell { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px; }
.availcell .d { font-size: 12px; color: var(--dim); margin-bottom: 5px; font-weight: 700; }
.availcell select { margin: 0; padding: 7px; font-size: 14px; }

@media (max-width: 640px) {
  .navlinks a { padding: 7px 9px; font-size: 13px; }
  .wrap { padding: 14px 12px 50px; }
  .card { padding: 14px; }
  .addform select, .addform input[type=time] { width: 100%; min-width: 0; }
  .addform { flex-direction: column; align-items: stretch; }
  .addform button { width: 100%; }
}

/* ---------- PRINT: light background, dark text, save toner ---------- */
@media print {
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .topnav, .navlinks, .navuser, .noprint, .btn, button { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card { background: #fff !important; border: none; padding: 0; margin: 0 0 12pt; }
  table { font-size: 10pt; }
  th, td { border-bottom: 1px solid #999; padding: 5pt 6pt; color: #000; }
  th { color: #000; background: #eee; }
  h1, h2, h3, h4 { color: #000; }
  .allergy-print { font-weight: 700; color: #000; }
  .attr-block { page-break-inside: avoid; margin-bottom: 14pt; }
  .unfilled { background: #fdd !important; }
}
.printsheet { background: #fff; color: #000; padding: 24px; }
.printsheet table { width: 100%; }
.printsheet th, .printsheet td { border-bottom: 1px solid #bbb; color: #000; }
.printsheet th { background: #eee; }
.printsheet h1, .printsheet h2, .printsheet h3 { color: #000; }
.printsheet .unfilled { background: #fdd; }
.printsheet .allergy-print { font-weight: 700; }
