@font-face {
  font-family: "Aptos Narrow";
  src: url("/fonts/Aptos-Narrow.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Aptos Narrow";
  src: url("/fonts/Aptos-Narrow-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --bg-0: #0b1218;
  --bg-1: #111d26;
  --bg-2: #152531;
  --card: #142430;
  --card-2: #10202b;
  --border: #285067;
  --text: #f1f5f8;
  --muted: #9bb2bf;
  --accent: #4fc3a1;
  --accent-2: #2a93d5;
  --danger: #d95f5f;
  --ok: #6dd9a8;
  --warning: #f8c67a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Aptos Narrow", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, #1f3a4b 0%, transparent 55%),
    radial-gradient(900px 500px at 5% 0%, #173041 0%, transparent 60%),
    linear-gradient(150deg, var(--bg-0), var(--bg-1) 40%, var(--bg-2));
}

.app-shell {
  max-width: 1280px;
  margin: 20px auto;
  padding: 0 16px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.2px;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.tab {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #1b3546, #142834);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.tab:hover {
  transform: translateY(-1px);
  border-color: var(--accent-2);
}

.tab.is-active {
  background: linear-gradient(180deg, #23506a, #1c3f54);
  border-color: var(--accent-2);
}

.tab-panel {
  display: none;
  animation: fade-in 0.22s ease;
}

.tab-panel.is-active {
  display: block;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card {
  background: linear-gradient(165deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.hint {
  margin: 0 0 8px;
  color: var(--muted);
}

textarea,
select,
input[type="text"] {
  width: 100%;
  border: 1px solid #2e5f7a;
  border-radius: 8px;
  background: #0f1d26;
  color: var(--text);
  padding: 10px;
  font: inherit;
}

textarea[readonly] {
  opacity: 0.98;
}

.btn {
  border: 1px solid #3e6b84;
  background: linear-gradient(180deg, #2b4f64, #204154);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}

.btn:hover {
  border-color: var(--accent-2);
}

.btn-primary {
  background: linear-gradient(180deg, #1f7a65, #135f4d);
  border-color: #2da385;
}

.btn-danger {
  background: linear-gradient(180deg, #8b3d3d, #702d2d);
  border-color: #bf5f5f;
}

.compact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#guardSearchInput {
  max-width: 440px;
}

#scheduleSearchInput {
  max-width: 520px;
}

.split-actions {
  justify-content: space-between;
}

.actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.split-actions .status {
  width: 100%;
}

.status {
  color: var(--ok);
  min-height: 1.1em;
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: center;
}

.count-pill {
  border: 1px solid #33647f;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: #102532;
}

.summary {
  margin-top: 0;
  color: var(--warning);
  font-weight: 700;
}

.shift-preview {
  padding: 9px;
  border: 1px dashed #38647b;
  border-radius: 8px;
  color: #d6e2e9;
}

.table-wrap {
  max-height: 380px;
  overflow: auto;
  border: 1px solid #2a4d62;
  border-radius: 8px;
}

.table-wrap-main {
  max-height: none;
  overflow: visible;
}

.table-wrap-main th {
  position: static;
}

#mainCallListWrap {
  max-height: none !important;
  overflow: visible !important;
}

.message-grid {
  align-items: start;
}

.message-block label {
  display: block;
  margin: 8px 0 6px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid #213b4c;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.checkbox-cell {
  text-align: center;
  white-space: nowrap;
}

.checkbox-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.call-cell {
  white-space: nowrap;
}

.btn-call {
  padding: 6px 10px;
}

.btn-call:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

th {
  position: sticky;
  top: 0;
  background: #173041;
  z-index: 1;
}

.badge {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.88rem;
  border: 1px solid transparent;
  display: inline-block;
}

.badge-a {
  color: #d7fff2;
  background: #1b5f4b;
  border-color: #2f9072;
}

.badge-called {
  color: #dbefff;
  background: #254f77;
  border-color: #4b86b8;
}

.badge-working {
  color: #ffe6e6;
  background: #783737;
  border-color: #b05656;
}

.badge-loa {
  color: #fff1d8;
  background: #7b5b2f;
  border-color: #c29343;
}

.badge-dnb {
  color: #e8deff;
  background: #51417d;
  border-color: #8c74c9;
}

.badge-inactive {
  color: #e2e7ef;
  background: #445462;
  border-color: #7d92a5;
}

.history-layout {
  align-items: start;
}

@media (max-width: 980px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .split-actions {
    justify-content: flex-start;
  }

  table {
    min-width: 540px;
  }

  .topbar {
    flex-direction: column;
  }
}
