/* ── Overview stat cards ── */
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .hub-grid { grid-template-columns: 1fr; } }
.stat-card { display: flex; flex-direction: column; gap: 8px; }
.stat-label { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 30px; font-weight: 600; color: var(--ink); }
.card-title { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 10px; }

/* ── Views ── */
.view.hidden { display: none; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.opt { color: var(--faint); font-weight: 400; margin-left: 5px; font-size: 11px; text-transform: none; }

/* ── Task/shift table row helpers ── */
tr.hub-row td:first-child { border-left: 3px solid transparent; }
tr.hub-row.pr-Urgent td:first-child { border-left-color: var(--urgent); }
tr.hub-row.pr-High td:first-child { border-left-color: var(--open); }
tr.hub-row.pr-Normal td:first-child { border-left-color: var(--progress); }
tr.hub-row.pr-Low td:first-child { border-left-color: var(--seam); }
.task-action-select { min-width: 130px; }

/* ── Modals ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(6,6,9,.72); z-index: 300; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--seam); border-radius: var(--radius-lg);
  padding: 22px 24px 24px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.field-stack { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-stack label {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .4px;
}
.field-stack input, .field-stack textarea {
  background: var(--panel-2); border: 1px solid var(--seam); color: var(--ink);
  border-radius: 6px; padding: 9px 11px; font-size: 13px; font-family: 'Inter', sans-serif;
}
.field-stack input:focus, .field-stack textarea:focus { outline: none; border-color: var(--brand); }
.field-stack textarea { min-height: 90px; resize: vertical; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.field-row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 480px) { .field-row-3, .field-row-2 { grid-template-columns: 1fr; } }

/* ── Shift timer ── */
.timer-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer-status { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--dim); }

/* ── Notifications ── */
.notif-card {
  background: var(--panel-2); border: 1px solid var(--seam); border-left: 3px solid var(--brand);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
}
.notif-card.read { border-left-color: var(--seam); opacity: .68; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.notif-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.notif-time { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.notif-body { font-size: 12.5px; color: var(--dim); line-height: 1.5; }
.notif-actions { margin-top: 8px; display: flex; gap: 8px; }

/* ── Schedule calendar ── */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-range { font-family: 'Space Grotesk', sans-serif; font-size: 14.5px; font-weight: 600; min-width: 190px; text-align: center; }
.cal-toolbar-right { display: flex; align-items: center; gap: 10px; }
.cal-toolbar-right .custom-select { min-width: 150px; }
.cal-card { padding: 0; overflow: hidden; }
.cal-scroll { overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); min-width: 900px; }
.cal-day { border-left: 1px solid var(--seam); display: flex; flex-direction: column; min-height: 480px; }
.cal-day:first-child { border-left: none; }
.cal-day-head {
  padding: 12px 12px 10px; border-bottom: 1px solid var(--seam); text-align: center;
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.cal-day-head .cal-dow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .6px; }
.cal-day-head .cal-dom { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.cal-day.is-today .cal-day-head { background: var(--brand-dim); }
.cal-day.is-today .cal-dom { color: var(--brand); }
.cal-day-body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cal-shift {
  background: var(--panel-2); border: 1px solid var(--seam); border-left: 3px solid var(--brand);
  border-radius: 7px; padding: 7px 9px; font-size: 11.5px; cursor: default; transition: border-color .15s;
}
.cal-shift.mine { border-left-color: var(--resolved); background: rgba(79,195,138,.08); }
.cal-shift.night { border-left-color: var(--progress); }
.cal-shift-time { font-family: 'IBM Plex Mono', monospace; color: var(--dim); font-size: 10.5px; display: flex; justify-content: space-between; gap: 6px; }
.cal-shift-time button { background: none; border: none; color: var(--faint); cursor: pointer; padding: 0; font-size: 11px; line-height: 1; }
.cal-shift-time button:hover { color: var(--urgent); }
.cal-shift-staff { color: var(--ink); font-weight: 600; margin-top: 3px; }
.cal-shift-title { color: var(--faint); margin-top: 2px; }
.cal-day-empty { color: var(--faint); font-size: 11px; text-align: center; padding: 14px 6px; font-family: 'IBM Plex Mono', monospace; }

/* ── Settings ── */
.settings-subnav { display: flex; gap: 6px; flex-wrap: wrap; }
.settings-tab {
  background: none; border: 1px solid var(--seam); color: var(--dim);
  border-radius: 7px; padding: 8px 14px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: color .15s, border-color .15s, background .15s;
}
.settings-tab:hover { color: var(--ink); }
.settings-tab.active { color: var(--brand); border-color: var(--brand); background: var(--brand-dim); }
.settings-pane.hidden { display: none; }

.role-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--seam); border-radius: 999px;
  padding: 6px 8px 6px 14px; font-size: 12.5px; color: var(--ink);
}
.role-chip button {
  background: none; border: none; color: var(--faint); cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
}
.role-chip button:hover { color: var(--urgent); background: rgba(255,93,93,.12); }

.rules-block { padding-top: 18px; border-top: 1px solid var(--seam); margin-top: 18px; }
.rules-block:first-of-type { padding-top: 0; border-top: none; margin-top: 0; }
.rules-block h4 {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--faint); margin-bottom: 12px; font-weight: 500;
}
.rules-block .field-row-3 { margin-bottom: 14px; }

.country-rule-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--seam); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 8px; font-size: 12.5px;
}
.country-rule-row .country-rule-summary { color: var(--dim); }
.country-rule-row .country-rule-summary strong { color: var(--ink); }

.days-off-row { display: flex; gap: 6px; flex-wrap: wrap; }
.day-toggle {
  background: var(--panel-2); border: 1px solid var(--seam); color: var(--dim);
  border-radius: 6px; padding: 7px 11px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.day-toggle.active { background: var(--brand-dim); color: var(--brand); border-color: var(--brand); }

.paycheck-card {
  background: var(--panel-2); border: 1px solid var(--seam); border-radius: 10px; padding: 18px 20px;
  max-width: 420px;
}
.paycheck-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: var(--dim); }
.paycheck-row strong { color: var(--ink); }
.paycheck-row.total { border-top: 1px solid var(--seam); margin-top: 6px; padding-top: 12px; font-size: 15px; }
.paycheck-note { font-size: 11px; color: var(--faint); margin-top: 12px; line-height: 1.5; }

/* ── Messages ── */
.messages-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 780px) { .messages-shell { grid-template-columns: 1fr; } }
.conversation-list { padding: 14px; }
.conversation-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 8px; border-radius: 7px; cursor: pointer; margin-bottom: 2px;
}
.conversation-item:hover { background: var(--panel-2); }
.conversation-item.active { background: var(--brand-dim); }
.conversation-item-name { font-size: 13px; color: var(--ink); font-weight: 500; }
.conversation-item-preview { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.conversation-unread {
  background: var(--brand); color: #0f0f14; font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; font-family: 'IBM Plex Mono', monospace;
}
.conversation-thread { min-height: 420px; display: flex; flex-direction: column; }
.thread-head { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--seam); }
.thread-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 480px; margin-bottom: 14px; }
.thread-bubble { max-width: 78%; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.thread-bubble.mine { align-self: flex-end; background: var(--brand); color: #0f0f14; }
.thread-bubble.theirs { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--seam); color: var(--ink); }
.thread-bubble-time { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10px; opacity: .65; margin-top: 4px; }
.thread-compose { display: flex; gap: 10px; align-items: flex-end; }
.thread-compose textarea { flex: 1; min-height: 44px; max-height: 120px; }
