/* gui/styles.css
 * ShiftSwapper Pro MVP GUI — mirrors the product's visual identity:
 * light canvas (#f4f6fb), white cards, indigo primary (#1a237e), Segoe UI.
 * ------------------------------------------------------------------------- */

:root {
  --primary: #1a237e;
  --primary-soft: #e8eaf6;
  --canvas: #f4f6fb;
  --card: #ffffff;
  --ink: #263238;
  --ink-strong: #1a237e;
  --muted: #607d8b;
  --muted-2: #90a4ae;
  --line: #e3e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(26, 35, 126, 0.08), 0 8px 24px rgba(26, 35, 126, 0.06);
  --green: #2e7d32;
  --amber: #9a6700;
  --teal: #00695c;
  --red: #c62828;
  --slate: #546e7a;
  --font: 'Segoe UI', 'Inter', system-ui, -apple-system, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  color: var(--ink);
  margin: 0;
}

button {
  font-family: inherit;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 14px;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #24318f;
  box-shadow: 0 4px 12px rgba(26, 35, 126, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--card);
  border-color: #cdd6e4;
}

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-soft:hover:not(:disabled) {
  background: #dde2f4;
}

.btn-approve {
  background: #e8f5e9;
  color: #1b5e20;
}

.btn-approve:hover:not(:disabled) {
  background: #d7ecda;
}

.btn-deny {
  background: #fdecea;
  color: #b71c1c;
}

.btn-deny:hover:not(:disabled) {
  background: #fadfd9;
}

.btn-sm {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
}

.icon-btn {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  height: 38px;
  padding: 0;
  position: relative;
  width: 42px;
}

.icon-btn:hover {
  border-color: #cdd6e4;
}

/* ── Sign-in ─────────────────────────────────────────────────────────────── */

.signin {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.signin[hidden],
#app[hidden] {
  display: none !important;
}

.signin-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 620px;
  padding: 32px;
  width: 100%;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand--center {
  justify-content: center;
}

.brand-mark {
  align-items: center;
  background: var(--primary);
  border-radius: 12px;
  color: #fff;
  display: inline-flex;
  font-size: 22px;
  font-weight: 800;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.brand h1 {
  font-size: 20px;
  color: var(--primary);
}

.brand p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.brand-text strong {
  color: var(--ink);
  display: block;
  font-size: 16px;
}

.brand-text .brand-location {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.signin-note {
  color: var(--muted);
  font-size: 14px;
  margin: 22px 0 18px;
  text-align: center;
}

.account-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.account-card {
  align-items: center;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 14px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  width: 100%;
}

.account-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(26, 35, 126, 0.12);
  transform: translateY(-1px);
}

.account-avatar {
  align-items: center;
  background: var(--primary);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 700;
  height: 42px;
  justify-content: center;
  text-transform: uppercase;
  width: 42px;
}

.account-avatar--manager {
  background: #00695c;
}

.account-meta {
  min-width: 0;
}

.account-meta strong {
  color: var(--ink);
  display: block;
}

.account-role {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.account-email {
  color: var(--muted-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-grid .account-card--section {
  background: var(--card);
  border: 0;
  color: var(--muted-2);
  cursor: default;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  text-transform: uppercase;
}

.signin-fine {
  color: var(--muted-2);
  font-size: 12px;
  margin: 20px 0 0;
  text-align: center;
}

/* ── App shell ───────────────────────────────────────────────────────────── */

.topbar {
  align-items: center;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.count-pill {
  background: var(--red);
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  padding: 1px 4px;
  position: absolute;
  right: -4px;
  text-align: center;
  top: -4px;
}

.persona {
  align-items: center;
  display: flex;
  gap: 8px;
}

.persona-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.persona select {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  max-width: 200px;
  padding: 7px 10px;
}

.layout {
  display: flex;
  gap: 18px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 18px;
}

.nav {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  width: 200px;
}

.nav-btn {
  appearance: none;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 14.5px;
  font-weight: 600;
  gap: 10px;
  padding: 11px 14px;
  text-align: left;
  width: 100%;
}

.nav-btn:hover {
  background: #eceff8;
  color: var(--ink);
}

.nav-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-emoji {
  font-size: 17px;
  width: 20px;
}

.nav-hint {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
  margin: 14px 6px 0;
}

.view {
  background: transparent;
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Cards & headings ───────────────────────────────────────────────────── */

.hero h2 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
}

.hero .muted {
  margin-top: 2px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 14px;
  padding: 18px;
}

.card-title {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.big-number {
  color: var(--primary);
  font-size: 34px;
  font-weight: 800;
  margin-top: 4px;
}

.muted {
  color: var(--muted);
  font-size: 13.5px;
}

.section-head {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 22px 2px 2px;
}

.section-title {
  color: #37474f;
  font-size: 17px;
  font-weight: 700;
}

.section-sub {
  color: var(--muted);
  font-size: 13px;
}

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

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

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted-2);
  margin-top: 14px;
  padding: 26px;
  text-align: center;
}

/* ── Status badges ───────────────────────────────────────────────────────── */

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  white-space: nowrap;
}

.badge--scheduled { background: #e8eaf6; color: var(--primary); }
.badge--available { background: #e8f5e9; color: var(--green); }
.badge--pending,
.badge--pending_manager { background: #fff8e1; color: var(--amber); }
.badge--swapped,
.badge--approved { background: #e0f2f1; color: var(--teal); }
.badge--completed { background: #eceff1; color: var(--slate); }
.badge--denied { background: #fdecea; color: var(--red); }

/* ── Shift rows / day groups ─────────────────────────────────────────────── */

.day-group {
  margin-top: 14px;
}

.day-label {
  align-items: center;
  color: #37474f;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  margin: 0 2px 8px;
}

.day-label .day-ago {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
}

.shift-item {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 14px 16px;
  flex-wrap: wrap;
}

.shift-when {
  align-items: center;
  background: var(--primary-soft);
  border-radius: 10px;
  color: var(--primary);
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  font-weight: 800;
  justify-content: center;
  min-width: 58px;
  padding: 8px 10px;
}

.shift-when .time {
  font-size: 12px;
  font-weight: 700;
}

.shift-main {
  flex: 1 1 200px;
  min-width: 0;
}

.shift-main strong {
  color: var(--ink);
  display: block;
  font-size: 15px;
}

.shift-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

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

.kicker {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* ── Pills (period selector etc.) ────────────────────────────────────────── */

.pill-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.pill {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
}

.pill.active {
  background: var(--primary);
  color: #fff;
}

/* ── Earnings ────────────────────────────────────────────────────────────── */

.earn-total {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.breakdown {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.earn-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 120px 1fr 90px;
}

.earn-label {
  color: var(--muted);
  font-size: 13px;
}

.earn-track {
  background: #eef1f8;
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}

.earn-fill {
  background: var(--primary);
  border-radius: 6px;
  height: 100%;
  transition: width 0.4s ease;
}

.earn-fill--tips { background: #00897b; }
.earn-fill--overtime { background: #f9a825; }
.earn-fill--holiday { background: #d81b60; }

.earn-value {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.table-wrap {
  overflow-x: auto;
}

table.shift-table {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
}

.shift-table th {
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  text-align: left;
  text-transform: uppercase;
}

.shift-table td {
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13.5px;
  padding: 10px;
}

/* ── Shift cycle ─────────────────────────────────────────────────────────── */

.cycle-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(14, 1fr);
  margin-top: 14px;
}

.cycle-day {
  background: #eceff1;
  border-radius: 8px;
  font-size: 11px;
  padding: 8px 2px;
  text-align: center;
}

.cycle-day.on {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.cycle-day .cd-dow {
  display: block;
  font-weight: 600;
  opacity: 0.75;
}

/* ── Forms & modals ──────────────────────────────────────────────────────── */

.modal-scrim {
  align-items: center;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 60;
}

.modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  max-width: 480px;
  padding: 22px;
  width: 100%;
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.modal .sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

.field label {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.field input,
.field select {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  padding: 9px 10px;
  width: 100%;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  outline: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.form-error {
  background: #fdecea;
  border-radius: 8px;
  color: #b71c1c;
  font-size: 13px;
  margin: 10px 0 0;
  padding: 8px 10px;
}

/* ── Activity drawer & toasts ────────────────────────────────────────────── */

.modal .act-list {
  max-height: 60vh;
  overflow: auto;
}

.act-item {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding: 11px 2px;
}

.act-item:last-child {
  border-bottom: 0;
}

.act-dot {
  border-radius: 6px;
  flex: 0 0 auto;
  height: 10px;
  margin-top: 6px;
  width: 10px;
}

.act-dot--request { background: #f9a825; }
.act-dot--approve { background: var(--green); }
.act-dot--deny { background: var(--red); }
.act-dot--post { background: var(--primary); }
.act-dot--complete { background: var(--slate); }
.act-dot--schedule { background: var(--teal); }

.act-body {
  min-width: 0;
}

.act-body .who {
  font-size: 13px;
  font-weight: 700;
}

.act-body .what {
  color: var(--ink);
  font-size: 13.5px;
}

.act-body .when {
  color: var(--muted-2);
  font-size: 11.5px;
  margin-top: 2px;
}

.toasts {
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  position: fixed;
  right: 18px;
  z-index: 80;
}

.toast {
  background: #263238;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.3);
  color: #fff;
  font-size: 13.5px;
  max-width: 360px;
  padding: 12px 14px;
  pointer-events: auto;
}

.toast b {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.toast--error {
  border-left-color: #ef5350;
}

.toast--success {
  border-left-color: #66bb6a;
}

/* ── Quick actions / misc ────────────────────────────────────────────────── */

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 14px 2px;
}

.quick-link {
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.quick-link:hover {
  text-decoration: underline;
}

.toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 22px;
  flex-wrap: wrap;
}

.reliability {
  color: var(--muted);
  font-size: 12.5px;
}

.reliability strong {
  color: var(--green);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .layout {
    flex-direction: column;
    padding: 12px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    order: 2;
    width: 100%;
  }

  .nav-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 9px 8px;
    width: auto;
  }

  .nav-hint {
    display: none;
  }

  .persona-label,
  .reset-label {
    display: none;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .earn-row {
    grid-template-columns: 100px 1fr 80px;
  }

  .brand-location {
    display: none;
  }
}
