/* Colour variables extracted from the original app's config */
:root {
  --status-in:        #00cc00;
  --status-out:       #cc0000;
  --page-bg:          #f8f8ff;
  --title-colour:     #14428b;
  --table-bg:         #ffffff;
  --row-alt:          #e4edfe;
  --row-std:          #ffffff;
  --row-text:         #555;
  --header-bg:        #c4cddb;
  --header-text:      #14428b;
  --border-colour:    #779;
  --row-border:       #aaaaaa;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--page-bg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8em;
  margin: 0;
}

/* ── Title bar ────────────────────────────────── */
#titleDiv {
  color: var(--title-colour);
  text-align: center;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5em 1em;
  flex-wrap: wrap;
  gap: 0.5em;
}

.titleP {
  font-size: 1.8em;
  font-family: sans-serif;
  font-weight: bolder;
  color: var(--title-colour);
  margin: 0;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 0.75em;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  gap: 0.3em;
}

.search-form input[type=text] {
  border: 1px solid silver;
  padding: 2px 6px;
  color: #555;
}

.search-form button {
  border: 1px solid silver;
  background: var(--row-alt);
  padding: 2px 8px;
  cursor: pointer;
  color: #555;
}

.search-clear {
  background: transparent;
  border: none;
  color: #999;
  padding: 2px 4px;
  font-size: 0.9em;
  cursor: pointer;
}
.search-clear:hover { color: #555; }

.board-no-results {
  text-align: center;
  padding: 2em 1em;
  color: #999;
  font-style: italic;
}

.user-info {
  font-size: 0.9em;
  color: var(--title-colour);
}

.user-info a { color: var(--title-colour); }

/* ── Department filter tabs ───────────────────── */
.dept-filter {
  padding: 0.4em 1em;
  text-align: left;
}

.dept-tab {
  display: inline-block;
  padding: 2px 10px;
  margin-right: 4px;
  border: 1px solid var(--border-colour);
  text-decoration: none;
  color: var(--title-colour);
  background: var(--row-std);
  font-size: 0.9em;
}

.dept-tab.active,
.dept-tab:hover {
  background: var(--row-alt);
  font-weight: bold;
}

/* ── Main table ───────────────────────────────── */
#tableContainer {
  text-align: center;
  padding: 0 1%;
}

#mainTable {
  background: var(--table-bg);
  border: 1px var(--border-colour) solid;
  border-collapse: collapse;
  margin: 2px 0;
  width: 98%;
  text-align: left;
  color: var(--row-text);
}

#mainTable tr {
  border-bottom: 1px solid var(--row-border);
  font-size: 1em;
}

#mainTable tbody tr:nth-child(odd)  { background: var(--row-alt); }
#mainTable tbody tr:nth-child(even) { background: var(--row-std); }

#mainTable tr.tableHeader {
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--border-colour);
}

#mainTable th, #mainTable td {
  padding: 2px 4px;
}

#mainTable th {
  text-align: left;
  font-family: sans-serif;
  font-size: 1em;
}

/* ── Status colours ───────────────────────────── */
.status-in  { color: var(--status-in); }
.status-out { color: var(--status-out); }

.status-link {
  font-weight: bold;
  text-decoration: none;
}
.status-link:hover { text-decoration: underline; }

/* ── Status select dropdown ───────────────────── */
.inline-status-form { margin: 0; }
.inline-toggle-form { margin: 0; }

.status-select {
  border: 1px solid silver;
  min-width: 80px;
  background: white;
}

.mail-cell, .sms-cell, .phone-cell {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}
.comment-cell { min-width: 20%; }

/* ── Theme toggle ─────────────────────────────── */
.theme-toggle-form { margin: 0; }

.theme-toggle-btn {
  font-size: 0.75em;
  padding: 3px 10px;
  border: 1px solid var(--border-colour);
  background: transparent;
  color: var(--title-colour);
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
}
.theme-toggle-btn:hover { background: var(--row-alt); }

/* ── Board blurb ──────────────────────────────── */
.board-blurb {
  font-size: 0.9em;
  color: #669;
  margin: 6px 0 4px;
  padding: 0 4px;
}

/* ── Bottom updater ───────────────────────────── */
.bottom-updater {
  margin: 0.5em 1% 1em;
  text-align: left;
}

.updater-label {
  font-size: 0.9em;
  color: var(--title-colour);
  font-weight: bold;
  margin: 0 0 0.3em;
}

.updater-table {
  border-collapse: collapse;
  font-size: 0.95em;
  color: var(--row-text);
}

.updater-table th {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 2px 6px;
  text-align: left;
  font-family: sans-serif;
  border: 1px solid var(--border-colour);
}

.updater-table td {
  padding: 2px 4px;
  border: 1px solid var(--row-border);
  background: var(--row-std);
}

.updater-table select,
.updater-table input[type=text] {
  border: 1px solid silver;
  padding: 2px 4px;
  font-size: 1em;
  color: #555;
}

.updater-table input[type=text] { min-width: 180px; }

.updater-table button {
  padding: 2px 12px;
  border: 1px solid silver;
  background: var(--row-alt);
  color: var(--title-colour);
  font-weight: bold;
  cursor: pointer;
}

/* ── Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: white;
  border: 2px solid var(--border-colour);
  padding: 1.5em 2em;
  min-width: 320px;
  max-width: 480px;
  width: 100%;
}

.modal-box h2 {
  color: var(--title-colour);
  margin-top: 0;
  font-size: 1.2em;
}

.modal-box label {
  display: block;
  font-weight: bold;
  margin-top: 0.8em;
  margin-bottom: 0.2em;
  color: var(--title-colour);
}

.modal-box input[type=text],
.modal-box select {
  width: 100%;
  border: 1px solid silver;
  padding: 3px 6px;
  font-size: 1em;
  color: #555;
}

.modal-actions {
  margin-top: 1.2em;
  display: flex;
  gap: 0.5em;
}

.modal-actions button {
  padding: 4px 16px;
  border: 1px solid silver;
  cursor: pointer;
  font-size: 1em;
}

.modal-actions button[type=submit] {
  background: var(--row-alt);
  font-weight: bold;
  color: var(--title-colour);
}

/* ── Login page ───────────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: white;
  border: 1px solid var(--border-colour);
  padding: 2em 2.5em;
  width: 320px;
  text-align: center;
}

.login-title {
  color: var(--title-colour);
  font-size: 1.6em;
  margin-bottom: 1em;
}

.login-box label {
  display: block;
  text-align: left;
  font-weight: bold;
  color: var(--title-colour);
  margin-top: 0.8em;
  margin-bottom: 0.2em;
}

.login-box input {
  width: 100%;
  border: 1px solid silver;
  padding: 5px 8px;
  font-size: 1em;
  color: #555;
}

.login-box button {
  margin-top: 1.2em;
  width: 100%;
  padding: 6px;
  background: var(--row-alt);
  border: 1px solid var(--border-colour);
  color: var(--title-colour);
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
}

.login-box button:hover { background: var(--header-bg); }

.error-banner {
  color: white;
  background: darkred;
  border: 2px solid red;
  padding: 8px 12px;
  margin-bottom: 1em;
  font-size: 0.95em;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}
