/*
 * Styled after WhenToHelp: dense, boxy, table-driven, small type. A coordinator
 * who used the old system should recognise every screen, so the proportions and
 * colours here are deliberately close to it.
 */

:root {
  --navy: #2e3d6b;          /* top menu, action buttons */
  --navy-dark: #1f2b50;
  --tab: #7b86c9;           /* inactive sub-tabs */
  --ink: #000000;
  --dim: #666666;
  --line: #b9bed0;
  --line-soft: #d6d9e4;
  --bg: #ffffff;
  --panel: #e8eaf3;         /* module heads, information panel */
  --panel-soft: #f1f2f8;
  --open: #ffff99;          /* unassigned highlight, as in WhenToHelp */
  --open-line: #d4b800;
  --danger: #c00000;
  --ok: #006600;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.4 Verdana, Geneva, Arial, Helvetica, sans-serif;
}

a { color: #1a3a8f; }
a:hover { color: #c00000; }

/* --------------------------------------------------------------- top menu */

.topmenu { background: var(--navy); border-bottom: 2px solid var(--navy-dark); }
.topmenu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.topmenu a, .topmenu button {
  display: block; padding: 7px 13px; color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.topmenu a:hover, .topmenu button:hover { background: var(--navy-dark); color: #fff; }
.topmenu a.on { background: #fff; color: var(--navy); }
.topmenu form { margin: 0; }

/* ------------------------------------------------------------- header band */

.headband { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
.hb-date {
  width: 15%; padding: 0 10px; font-size: 11px; color: #333;
  vertical-align: top; white-space: nowrap;
}
.hb-org { text-align: center; vertical-align: top; }
.hb-right { width: 15%; }
.orgname { font-size: 17px; font-weight: 700; }
.pagetitle { font-size: 17px; font-weight: 700; }

/* --------------------------------------------------------------- sub-tabs */

.subtabs {
  border-bottom: 1px solid var(--navy); margin: 8px 10px 0;
  padding-left: 14px; white-space: nowrap; overflow-x: auto;
}
.subtabs a {
  display: inline-block; padding: 4px 16px; margin-right: 3px;
  background: var(--tab); color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--navy); border-bottom: 0;
  border-radius: 5px 5px 0 0; position: relative; top: 1px;
}
.subtabs a:hover { background: #5f6bb5; color: #fff; }
.subtabs a.on { background: #fff; color: #000; border-bottom: 1px solid #fff; }

/* ------------------------------------------------------------------- page */

.page { padding: 10px; max-width: 1180px; margin: 0 auto; }
.page.wide { max-width: 100%; }

h1 { font-size: 15px; margin: 0 0 8px; }
h2 { font-size: 12px; margin: 14px 0 6px; font-weight: 700; }

/* ---------------------------------------------------------- action button */

.actionbar {
  display: flex; flex-wrap: wrap; gap: 1px; margin: 6px 0 0;
  border-bottom: 3px solid #cc0000;
}
.actionbar a, .actionbar button {
  flex: 1 1 auto; text-align: center; padding: 6px 10px;
  background: var(--navy); color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 700; border: 0; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.actionbar a:hover, .actionbar button:hover { background: var(--navy-dark); color: #fff; }
.actionbar form { display: contents; }

.btn {
  display: inline-block; padding: 4px 11px; background: var(--navy); color: #fff;
  border: 1px solid var(--navy-dark); border-radius: 3px; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 700; text-decoration: none;
}
.btn:hover { background: var(--navy-dark); color: #fff; }
.btn.plain { background: #eee; color: #222; border-color: #999; }
.btn.plain:hover { background: #ddd; color: #000; }
.btn.danger { background: #a11; border-color: #800; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ----------------------------------------------------------------- panels */

.module {
  width: 100%; border-collapse: collapse; margin-bottom: 10px;
  border: 1px solid var(--line);
}
.module-head {
  background: var(--panel); padding: 5px 9px; font-weight: 700; font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.module-body { padding: 9px; vertical-align: top; }

/* ------------------------------------------------------------------ table */

.grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.grid th, .grid td {
  padding: 3px 6px; text-align: left; border: 1px solid var(--line-soft);
  vertical-align: top;
}
.grid thead th {
  background: var(--panel); font-size: 11px; font-weight: 700; border-color: var(--line);
}
.grid tbody tr:hover { background: #ffffcc; }
.grid .num { text-align: right; }
.nowrap { white-space: nowrap; }
.dim { color: var(--dim); font-size: 11px; }

tr.open td, .cellshift.open, .calshift.open { background: var(--open); }
tr.openrow > th { background: var(--open); }

.matrix .rowhead { background: var(--panel-soft); font-weight: 700; white-space: nowrap; }
.cellshift { font-size: 11px; line-height: 1.3; margin-bottom: 2px; }
.cellshift .t { display: block; font-weight: 700; }
.cellshift .w { display: block; }
.cellshift .cat, .calshift .cat {
  display: inline-block; padding: 0 4px; background: var(--navy); color: #fff;
  font-size: 9px; border-radius: 2px;
}

.heat td { text-align: center; padding: 2px; font-size: 10px; }
.heatcell { background: color-mix(in srgb, var(--navy) calc(var(--v) * 65%), white); }
.heat .openhour { background: var(--open); box-shadow: inset 0 0 0 1px var(--open-line); }
.swatch-open {
  display: inline-block; width: 10px; height: 10px; vertical-align: -1px;
  background: var(--open); border: 1px solid var(--open-line);
}

/* --------------------------------------------------------- calendar grid */

.cal { table-layout: fixed; }
.cal thead th { text-align: center; }
.calday { height: 96px; vertical-align: top; padding: 2px 4px; }
.calday.outside { background: #f6f6f9; }
.calday.outside .daynum { color: #aaa; }
.calhead { display: flex; justify-content: space-between; align-items: center; }
.daynum { font-weight: 700; font-size: 12px; }
.calshift { font-size: 10.5px; line-height: 1.3; margin-bottom: 2px; padding: 1px 2px; }
.calshift .t { display: block; font-weight: 700; }
.calshift .p { display: block; }
.calshift .w { display: block; color: #333; }

/* -------------------------------------------------------------- home page */

.homecols {
  display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: start;
}
.homestack { display: flex; flex-direction: column; gap: 6px; }
.homestack a {
  display: block; padding: 9px; text-align: center; background: var(--panel);
  border: 1px solid var(--line); color: #1a3a8f; text-decoration: none;
  font-weight: 700; font-size: 12px;
}
.homestack a:hover { background: #dcdff0; color: #000; }
.homestack a .n { color: var(--danger); }
@media (max-width: 900px) { .homecols { grid-template-columns: 1fr; } }

/* -------------------------------------------------- permissions (YES/NO) */

.permtable { width: 100%; border-collapse: collapse; font-size: 12px; }
.permtable td, .permtable th { padding: 4px 7px; border-bottom: 1px solid var(--line-soft); }
.permtable thead th { background: var(--panel); font-size: 11px; text-align: center; }
.permtable thead th:first-child { text-align: left; }
.permtable .rownum { width: 22px; color: var(--dim); text-align: right; }
.permtable .yn { width: 60px; text-align: center; }
.permtable tbody tr:nth-child(odd) { background: #f7f8fc; }
.permsection {
  background: var(--panel); font-weight: 700; font-size: 12px; padding: 5px 7px;
  border-top: 1px solid var(--line);
}
.permnote { font-size: 11px; color: var(--dim); }

/* --------------------------------------------------------------- authority */

.scrollx { overflow-x: auto; border: 1px solid var(--line); }
.authgrid th { font-size: 10px; }
.authgrid thead th { vertical-align: bottom; min-width: 76px; text-align: center; }
.authcell { padding: 2px; }
.authcell.off { background: #f6f6f9; }
.authcell select { width: 100%; font: inherit; font-size: 11px; }

/* ------------------------------------------------------------------ forms */

input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="number"], select, textarea {
  font: inherit; font-size: 12px; padding: 2px 4px;
  border: 1px solid #7f8ba8; background: #fff; color: #000;
}
.stack label, .wide-form label { display: block; margin-bottom: 8px; font-size: 12px; }
.stack input, .wide-form input, .wide-form select { width: 100%; }
.wide-form .row { display: flex; gap: 10px; }
.wide-form .row label { flex: 1; }
.daypick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.daypick .day {
  flex: 1; min-width: 58px; text-align: center; border: 1px solid var(--line);
  padding: 4px 2px; background: #fff; cursor: pointer; margin: 0;
}
.daypick .day:has(input:checked) { background: #dde1f4; font-weight: 700; }
.daypick input { width: auto; }
.check { display: flex; gap: 6px; align-items: center; font-size: 12px; margin-bottom: 3px; }
.check input { width: auto; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--panel-soft); border: 1px solid var(--line);
  padding: 5px 8px; margin: 6px 0;
}
.counts { margin-left: auto; font-size: 11px; }
.filters, .jump { display: inline-flex; gap: 5px; align-items: center; margin: 0; }

/* week strip, as WhenToHelp draws it */
.weekstrip {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap; background: var(--panel-soft); border: 1px solid var(--line);
  padding: 5px; margin: 6px 0; font-size: 11px;
}
.weekstrip a { text-decoration: none; }
.weekstrip .current { font-weight: 700; font-size: 13px; }

.daytabs { margin: 6px 0 0; }
.daytabs a {
  display: inline-block; padding: 3px 14px; margin-right: 2px; background: var(--tab);
  color: #fff; text-decoration: none; font-size: 11px; font-weight: 700;
  border: 1px solid var(--navy); border-bottom: 0; border-radius: 4px 4px 0 0;
}
.daytabs a.on { background: #fff; color: #000; }

.viewpick { font-size: 12px; padding: 2px 4px; }

/* ----------------------------------------------------------- info + notes */

.infopanel {
  width: 100%; border-collapse: collapse; margin-top: 16px;
  border: 1px solid var(--line); background: var(--panel-soft);
}
.ip-head { padding: 4px 9px; font-weight: 700; font-size: 12px; }
.ip-help { padding: 4px 9px; text-align: right; font-size: 11px; }
.ip-body { padding: 4px 9px 9px; font-size: 11px; }
.ip-body p { margin: 2px 0; }

.pagefoot { text-align: center; margin: 22px 0 10px; font-size: 11px; color: var(--dim); }

.notice { padding: 5px 9px; margin: 6px 0; font-size: 12px; border: 1px solid; }
.notice-error { background: #ffe8e8; color: var(--danger); border-color: #e0a0a0; }
.notice-warn { background: #ffffcc; color: #665500; border-color: var(--open-line); }
.notice-info { background: #e6f0ff; color: #1a3a8f; border-color: #a8c0e8; }

.empty { padding: 14px; font-style: italic; color: var(--dim); }

.pill { display: inline-block; padding: 0 5px; font-size: 10px; background: #ddd; }
.pill.warn { background: var(--open); }
.pill.ok { background: #cceccc; color: var(--ok); }
.pill.bad { background: #ffd6d6; color: var(--danger); }
.tag { display: inline-block; padding: 0 4px; background: #e0e0e8; font-size: 10px; }

/* -------------------------------------------------------------- two-column */

.cols {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start;
}
.side { display: flex; flex-direction: column; gap: 10px; }
.card { border: 1px solid var(--line); padding: 9px; }
.card h2 { margin-top: 0; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ signin */

.signin-card {
  max-width: 330px; margin: 40px auto; border: 1px solid var(--line); padding: 20px;
}
.signin-card h1 { text-align: center; font-size: 15px; }
.signin-card .sub { text-align: center; color: var(--dim); font-size: 11px; }
.signin-card label { display: block; margin-top: 10px; font-size: 12px; }
.signin-card input { width: 100%; }
.signin-card button {
  width: 100%; margin-top: 14px; padding: 6px; background: var(--navy); color: #fff;
  border: 0; font: inherit; font-weight: 700; cursor: pointer;
}

.grid.mini { font-size: 11px; }
.permgroup { margin: 10px 0 4px; font-weight: 700; font-size: 11px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.weeknav { display: flex; gap: 4px; align-items: center; }
