/* Hooda & Co — dark theme only. Every colour is painted explicitly so the
   page never borrows the host's ground. */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* display:flex on .modal/.toast would otherwise defeat the hidden attribute */
[hidden] { display: none !important; }

:root {
  --navy:      #1B3A5C;
  --navy-deep: #16304C;
  --gold:      #E8B33D;

  --bg:        #0E1620;
  --surface:   #17222E;
  --surface-2: #1E2B39;
  --border:    #2A3846;
  --text:      #E7EDF3;
  --muted:     #93A3B4;
  --danger:    #FF7F70;
  --danger-bg: #3A1E1B;
  --ok:        #5BD08D;

  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ---------- Login / password screens ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(168deg, var(--navy) 0%, #102437 55%, var(--bg) 100%);
}

.login-mark { width: 76px; height: 76px; margin-bottom: 18px; }

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  color: #fff;
  font-size: 27px;
  letter-spacing: .3px;
  text-align: center;
}

.brand-sub {
  color: #9FB6CC;
  margin: 5px 0 26px;
  font-size: 12.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-align: center;
}

/* sentence-case subtitle, for prose rather than the firm's descriptor line */
.brand-note {
  color: #9FB6CC;
  margin: 8px 0 26px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  max-width: 330px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 12px;
  width: 100%; max-width: 380px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}

label {
  display: block; margin-bottom: 16px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.opt { font-weight: 400; color: var(--muted); }

input, textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
  border-color: var(--gold);
}

.btn-primary {
  width: 100%; padding: 13px;
  background: var(--gold); color: #23180A;
  border: none; border-radius: 9px;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-primary:active { background: #D2A032; }

.btn-ghost {
  padding: 13px 18px; background: transparent;
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 15px; cursor: pointer; color: var(--muted);
}

.error { color: var(--danger); font-size: 13px; margin-top: 12px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,.09);
}

/* min-width:0 + overflow let the name truncate instead of sliding under the buttons */
.lockup { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.lockup-mark { width: 38px; height: 38px; flex: none; }

.lockup-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px; font-weight: 500; color: #fff;
  line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-actions { display: flex; gap: 7px; flex: none; }
.icon-btn {
  background: rgba(255,255,255,.12); color: #fff;
  border: none; border-radius: 7px;
  padding: 7px 10px; font-size: 12px; cursor: pointer;
}
.icon-btn.enabled { background: var(--ok); color: #06301B; font-weight: 600; }

.whoami {
  background: var(--navy-deep);
  font-size: 11px;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.whoami-firm {
  color: var(--gold);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 9.5px;
  white-space: nowrap;
}
.whoami-user { color: #8FA6BC; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whoami-user span { color: #D9E4EE; font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
/* min-width:0 lets five tabs (admins see "Team" too) share the width
   instead of pushing "Done" off the edge of a phone screen */
.tab {
  flex: 1; min-width: 0;
  padding: 13px 4px;
  background: none; border: none;
  border-bottom: 3px solid transparent;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; white-space: nowrap;
}
.tab.active { color: #fff; border-bottom-color: var(--gold); }

/* ---------- Task list ---------- */
.task-list { padding: 14px 14px 104px; display: flex; flex-direction: column; gap: 10px; }

.task {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 11px;
  padding: 14px;
}
.task.overdue { border-left-color: var(--danger); }
.task.soon    { border-left-color: var(--gold); }
.task.done    { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }

.task-title { font-size: 15px; font-weight: 650; margin-bottom: 5px; line-height: 1.35; color: var(--text); }
.task-desc  { font-size: 13px; color: var(--muted); margin-bottom: 9px; white-space: pre-wrap; line-height: 1.45; }

.task-meta { display: flex; flex-wrap: wrap; gap: 7px; font-size: 11.5px; margin-bottom: 11px; }
.chip {
  background: var(--surface-2); color: #B7C5D4;
  padding: 3px 9px; border-radius: 20px;
}
.chip.due-overdue { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.chip.due-soon    { background: #3A2E12; color: var(--gold); font-weight: 600; }
.chip.unassigned  { background: #1C3350; color: #8FB4DC; font-weight: 600; }

.task-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.task-actions button {
  padding: 7px 12px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 7px; cursor: pointer; color: var(--text);
}
.task-actions .primary { background: var(--gold); color: #23180A; border-color: var(--gold); }
.task-actions .danger  { color: var(--danger); border-color: #4A2A26; background: transparent; }

.empty { text-align: center; color: var(--muted); padding: 56px 20px; font-size: 14px; }

/* ---------- Team view ---------- */
.group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
}

.group-head {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.group-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15.5px; color: #fff; font-weight: 500;
}
.group-name.muted { color: var(--muted); font-style: italic; }
.group-count { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.group-overdue {
  font-size: 11px; font-weight: 700; color: var(--danger);
  background: var(--danger-bg); padding: 2px 8px; border-radius: 20px;
}

.group-task {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}
.group-task:last-child { border-bottom: none; }
.group-task.overdue { border-left-color: var(--danger); }
.group-task.soon    { border-left-color: var(--gold); }

.group-task-title {
  font-size: 13.5px; color: var(--text); line-height: 1.35;
  flex: 1; min-width: 0;
}
.group-task .chip { flex: none; font-size: 11px; }

.group-clear {
  font-size: 12px; color: var(--muted);
  padding: 4px 4px 0; line-height: 1.5;
}

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  right: 20px; bottom: calc(env(safe-area-inset-bottom) + 20px);
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--gold); color: #23180A;
  border: none; font-size: 32px; line-height: 1;
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
  cursor: pointer; z-index: 20;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.66);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 30;
}
.modal-card {
  background: var(--surface);
  border-top: 1px solid var(--border);
  width: 100%; max-width: 480px;
  border-radius: 18px 18px 0 0;
  padding: 22px 20px calc(env(safe-area-inset-bottom) + 22px);
  max-height: 92vh; overflow-y: auto;
}
.modal-card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px; font-weight: 500; margin-bottom: 18px; color: #fff;
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn-primary { flex: 1; }

@media (min-width: 560px) {
  .modal { align-items: center; }
  .modal-card { border-radius: 16px; border: 1px solid var(--border); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 88px);
  left: 50%; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  padding: 11px 20px; border-radius: 22px;
  font-size: 13.5px; z-index: 40;
  max-width: 88vw; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
