:root {
  --brand: #38b6a0;
  --brand-dark: #2d8f7e;
  --brand-light: #e8f7f4;
  --brand-mid: #5dccb5;
  --success: #38b6a0;
  --success-light: #d1f5ee;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --bg: #0a0e14;
  --card: #111827;
  --border: #1f2937;
  --border-strong: #374151;
  --text: #f9fafb;
  --text-mid: #e5e7eb;
  --muted: #9ca3af;
  --muted-light: #6b7280;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow: 0 4px 16px rgba(0,0,0,.4), 0 1px 4px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4);
  --shadow-brand: 0 4px 16px rgba(56,182,160,.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN / CONFIRM — dark hero background
   ══════════════════════════════════════════════════════════════════════════ */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px 16px;
  background: linear-gradient(145deg, #0a0e14 0%, #111827 50%, #0f1c2a 100%);
  position: relative;
  overflow: hidden;
}

.page-center::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,182,160,.12) 0%, transparent 65%);
  pointer-events: none;
}

.page-center::after {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,182,160,.08) 0%, transparent 65%);
  pointer-events: none;
}

.card {
  background: rgba(17,24,39,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 22px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(56,182,160,.12);
  padding: 34px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
}

.card-logo {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 12px;
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════════════════════════════════════ */
h1 { font-size: 1.45rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.3px; }
h2 { font-size: 1.1rem; font-weight: 700; color: var(--brand); }
h3 { font-size: 0.97rem; font-weight: 700; color: var(--text); }

.logo {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--brand);
  margin-bottom: 2px;
  letter-spacing: -1px;
  line-height: 1;
}

.subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 26px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 16px;
  font-weight: 500;
  line-height: 1.5;
}
.alert-error   { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.alert-success { background: rgba(56,182,160,.12); color: #38b6a0; border: 1px solid rgba(56,182,160,.25); }
.alert-info    { background: rgba(56,182,160,.08); color: var(--brand-mid); border: 1px solid rgba(56,182,160,.2); }
.alert-warning { background: rgba(245,158,11,.12); color: #f59e0b; border: 1px solid rgba(245,158,11,.25); }

/* ══════════════════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-height: 50px;
  font-family: inherit;
}

input[type="password"] {
  background: var(--bg);
  color: var(--text);
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 4px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(56,182,160,.15);
}

input[inputmode="numeric"] {
  letter-spacing: 12px;
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  padding: 16px;
}

select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 15px 22px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
  min-height: 52px;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  letter-spacing: 0.1px;
  font-family: inherit;
}

.btn:active { transform: scale(.96); opacity: .92; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(56,182,160,.38); }

.btn-success {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-success:hover { box-shadow: 0 6px 22px rgba(56,182,160,.38); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220,38,38,.22);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}
.btn-outline:hover { background: rgba(56,182,160,.08); }

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 2px solid var(--border);
}
.btn-ghost:hover { background: var(--border); border-color: var(--border-strong); }

.btn-sm { padding: 9px 14px; font-size: 0.82rem; border-radius: 8px; min-height: 38px; }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════════════════════════════════════
   TOP NAVBAR
   ══════════════════════════════════════════════════════════════════════════ */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar .brand {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar .brand img {
  height: 28px;
  width: auto;
}

.navbar-right { display: flex; align-items: center; gap: 10px; }

.navbar-user {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  background: var(--bg);
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN BOTTOM TAB NAV
   ══════════════════════════════════════════════════════════════════════════ */
.admin-tab-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17,24,39,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
}

.admin-tab-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  text-decoration: none;
  color: var(--muted-light);
  font-size: 0.6rem;
  font-weight: 700;
  gap: 3px;
  min-height: 58px;
  transition: color 0.12s;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.admin-tab-link .tab-icon { font-size: 1.3rem; line-height: 1; }
.admin-tab-link.active { color: var(--brand); }
.admin-tab-link.active .tab-icon-bg {
  background: rgba(56,182,160,.12);
  border-radius: 10px;
  padding: 5px 14px;
}

/* ══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════════════════ */
.main-content {
  padding: 20px 16px;
  padding-bottom: calc(80px + var(--safe-bottom));
  max-width: 640px;
  margin: 0 auto;
}

.main-content-notabs {
  padding: 20px 16px;
  max-width: 640px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════════════════════════ */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 3px; letter-spacing: -0.3px; }
.page-header p  { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════════════════
   PANELS
   ══════════════════════════════════════════════════════════════════════════ */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════════════════
   SHIFT BADGE
   ══════════════════════════════════════════════════════════════════════════ */
.shift-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56,182,160,.12);
  color: var(--brand);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(56,182,160,.2);
}

/* ══════════════════════════════════════════════════════════════════════════
   TASK LIST
   ══════════════════════════════════════════════════════════════════════════ */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-user-select: none;
  user-select: none;
  min-height: 64px;
  box-shadow: var(--shadow-sm);
}

.task-item:active { transform: scale(.99); }

.task-item.done {
  background: rgba(56,182,160,.06);
  border-color: rgba(56,182,160,.4);
  box-shadow: none;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: var(--muted);
}

.task-checkbox {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 2.5px solid var(--border-strong);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.task-checkbox.checked {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--bg);
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(56,182,160,.3);
}

.task-text  { flex: 1; font-size: 0.95rem; font-weight: 600; line-height: 1.4; }
.task-time  {
  font-size: 0.72rem;
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
  background: rgba(56,182,160,.12);
  padding: 3px 8px;
  border-radius: 20px;
}

/* ══════════════════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--bg); }
th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-mid);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(56,182,160,.04); }

/* ══════════════════════════════════════════════════════════════════════════
   STATS GRID
   ══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-mid));
}

.stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 700;
  margin-top: 5px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ══════════════════════════════════════════════════════════════════════════
   IDENTITY CONFIRM
   ══════════════════════════════════════════════════════════════════════════ */
.name-confirm {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--brand);
  margin: 12px 0 8px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ══════════════════════════════════════════════════════════════════════════
   SUCCESS / SUBMISSION
   ══════════════════════════════════════════════════════════════════════════ */
.success-icon {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════════════════════════════
   LINKS
   ══════════════════════════════════════════════════════════════════════════ */
.admin-link {
  text-align: center;
  margin-top: 20px;
}

.admin-link a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.admin-link a:hover { color: var(--brand); }

.admin-return { text-align: center; margin-top: 16px; }
.admin-return a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
}
.admin-return a:hover { color: var(--brand); }

/* ══════════════════════════════════════════════════════════════════════════
   SUMMARY LIST
   ══════════════════════════════════════════════════════════════════════════ */
.summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
}

.summary-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════
   DATE BADGE
   ══════════════════════════════════════════════════════════════════════════ */
.date-badge {
  display: inline-block;
  background: var(--bg);
  border-radius: var(--radius-xs);
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--border);
}
.date-badge-today {
  background: rgba(245,158,11,.12);
  color: var(--warning);
  border-color: rgba(245,158,11,.25);
}

/* ══════════════════════════════════════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════════════════════════════════════ */
.text-danger  { color: var(--danger); font-weight: 600; }
.text-success { color: var(--success); font-weight: 600; }
.text-muted   { color: var(--muted); }
.form-stack   { display: flex; flex-direction: column; gap: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════════════════════════════════════ */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 7px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ══════════════════════════════════════════════════════════════════════════
   FLOATING ACTION
   ══════════════════════════════════════════════════════════════════════════ */
.floating-action {
  position: fixed;
  bottom: calc(18px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  max-width: 608px;
  margin: 0 auto;
  z-index: 90;
}

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN SHIFT BUILDER — drag-and-drop task rows
   ══════════════════════════════════════════════════════════════════════════ */
.task-edit-list {
  display: flex;
  flex-direction: column;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.12s;
  position: relative;
}

.task-row:last-child { border-bottom: none; }

.task-row.is-dragging { opacity: 0.35; }

.task-row.drag-over-top    { box-shadow: 0 -2px 0 var(--brand); }
.task-row.drag-over-bottom { box-shadow:  0 2px 0 var(--brand); }

.drag-handle {
  color: var(--muted-light);
  font-size: 1.05rem;
  padding: 4px 3px;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
}

.drag-handle:active { cursor: grabbing; }

.task-num {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 22px;
  flex-shrink: 0;
}

.task-edit-name {
  flex: 1;
  font-size: 0.9rem;
  cursor: text;
  outline: none;
  border-radius: var(--radius-xs);
  padding: 3px 5px;
  min-width: 0;
  line-height: 1.4;
  word-break: break-word;
  -webkit-user-modify: read-write-plaintext-only;
}

.task-edit-name:focus {
  background: rgba(56,182,160,.09);
  box-shadow: 0 0 0 2px rgba(56,182,160,.25);
  cursor: text;
}

.task-edit-name--dirty {
  box-shadow: 0 0 0 2px rgba(251,191,36,.55);
  background: rgba(251,191,36,.07);
  outline: none;
}

.task-edit-name:not(:focus):hover { background: rgba(255,255,255,.04); }

/* ── Save-feedback animations ─────────────────────────────────────────────── */
@keyframes row-saved-flash {
  0%   { background: rgba(56,182,160,.28); box-shadow: 0 0 0 1px rgba(56,182,160,.35); }
  100% { background: transparent;          box-shadow: none; }
}
@keyframes list-saved-flash {
  0%   { background: rgba(56,182,160,.10); }
  100% { background: transparent; }
}

.task-row.row-saved {
  border-radius: var(--radius-xs);
  animation: row-saved-flash 1.1s ease-out forwards;
}

.task-edit-list.list-saved {
  border-radius: var(--radius-xs);
  animation: list-saved-flash 1.1s ease-out forwards;
}

/* ── Save toast ────────────────────────────────────────────────────────────── */
.save-toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 0.84rem;
  color: var(--text-mid);
  box-shadow: var(--shadow);
  z-index: 9999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s;
  white-space: nowrap;
}
.save-toast.toast-error {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239,68,68,.08);
}
.save-toast.toast-hidden { opacity: 0; }
