﻿/* Ashario Task Manager â€” dashboard styles
   Palette derived from ashario.com (Apple-inspired light theme). */

:root {
  /* Apple-dark surfaces â€” matches ashario.com black sections */
  --bg: #000000;
  --bg-elev: #1c1c1e;          /* secondary surface */
  --bg-card: #1c1c1e;
  --bg-card-hover: #2c2c2e;
  --bg-input: #2c2c2e;
  --border: #38383b;
  --border-strong: rgba(0, 113, 227, 0.50);

  /* Text on dark */
  --text: #f5f5f7;
  --text-body: #f5f5f7;
  --text-dim: #98989d;
  --text-faint: #6e6e73;

  /* Brand accent â€” keep ashario.com Apple blue */
  --accent: #0071e3;
  --accent-hover: #2997ff;
  --accent-soft: rgba(0, 113, 227, 0.16);
  --accent-softer: rgba(0, 113, 227, 0.08);

  /* Status â€” danger uses a deep blood red, applied consistently across
     the banner, overdue rows, error alerts, and deadline pills. */
  --success: #30d158;
  --success-soft: rgba(48, 209, 88, 0.16);
  --danger: #b91c1c;
  --danger-bright: #dc2626;
  --danger-soft: rgba(185, 28, 28, 0.20);
  --danger-rgb: 185, 28, 28;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 40px;
  --radius-badge: 6px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", "Segoe UI", Roboto, Inter, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;

  --transition: 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  --topbar-h: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5 { color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* â”€â”€â”€â”€â”€ App shell â”€â”€â”€â”€â”€ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  background: rgba(10, 10, 10, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: transparent;
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  margin: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.nav-section { display: none; }
.nav-item {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: var(--bg-card-hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}
.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 820px) {
  .nav-section-label { display: none; }
}

.user-block {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text-dim); }
.user-logout {
  background: none; border: none; padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  display: grid; place-items: center;
}
.user-logout:hover { background: var(--danger-soft); color: var(--danger); }

/* â”€â”€â”€â”€â”€ Main â”€â”€â”€â”€â”€ */
.main {
  padding: 28px 36px 60px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text);
}
.page-sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.day-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.day-pill .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 113, 227, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); }
}

/* â”€â”€â”€â”€â”€ Cards â”€â”€â”€â”€â”€ */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card-meta { font-size: 12px; color: var(--text-dim); font-weight: 500; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-badge);
  font-size: 11px; font-weight: 600;
  background: var(--bg-elev); color: var(--text-dim);
  border: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warn { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* â”€â”€â”€â”€â”€ Buttons â”€â”€â”€â”€â”€ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-card-hover); text-decoration: none; }
.btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.success { background: var(--success); color: #fff; border-color: var(--success); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.lg { padding: 12px 22px; font-size: 14px; }

/* â”€â”€â”€â”€â”€ Auth screens â”€â”€â”€â”€â”€ */
.auth-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  background: var(--bg-elev);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.auth-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.auth-title {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}
.auth-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text); }
.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: #1c1c1e;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input.invalid { border-color: var(--danger); }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(255,59,48,0.2); }
.alert.success { background: var(--success-soft); color: var(--success); border: 1px solid rgba(52,199,89,0.2); }
.alert.info { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(0,113,227,0.2); }

/* â”€â”€â”€â”€â”€ Dashboard task list â”€â”€â”€â”€â”€ */
.shift-section {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}
.shift-section[open] { border-color: var(--border-strong); }
.shift-section > summary {
  list-style: none;
  cursor: pointer;
}
.shift-section > summary::-webkit-details-marker { display: none; }

.shift-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  user-select: none;
}
.shift-section[open] .shift-header { border-bottom: 1px solid var(--border); }
.shift-chevron {
  display: inline-flex;
  width: 22px; height: 22px;
  align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-dim);
  background: transparent;
  transition: transform var(--transition), color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.shift-section[open] .shift-chevron {
  transform: rotate(90deg);
  color: var(--accent);
  background: var(--accent-soft);
}
.shift-section > summary:hover .shift-chevron {
  color: var(--text);
  background: var(--bg-card-hover);
}
.shift-section[open] > summary:hover .shift-chevron {
  color: var(--accent);
  background: var(--accent-soft);
}
.shift-section .task-list {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
}
.shift-section .task-list .task-row {
  background: var(--bg-card);
  border-color: var(--border);
}
@media (max-width: 820px) {
  .shift-section .task-list { padding: 10px; }
  .shift-header { padding: 12px 14px; gap: 10px; }
}
.shift-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.shift-progress {
  flex: 1;
  height: 6px;
  background: var(--bg-elev);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 320px;
}
.shift-progress-bar {
  height: 100%;
  background: var(--success);
  width: 0%;
  transition: width 0.4s var(--transition);
}
.shift-progress.empty .shift-progress-bar { background: var(--accent); }
.shift-count {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.task-list {
  display: flex; flex-direction: column; gap: 10px;
}
.task-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "left right action"
    "left right action";
  align-items: start;
  column-gap: 16px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}
.task-left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.task-right {
  grid-area: right;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-row .task-action { grid-area: action; align-self: center; }
.task-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.task-row.completed {
  background: var(--success-soft);
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success),
              0 0 12px 0 rgba(52, 199, 89, 0.35);
}
.task-row.completed .task-name { color: var(--text-dim); text-decoration: line-through; }
.task-row.overdue {
  border-color: var(--danger);
  animation: task-overdue-glow 1.6s ease-in-out infinite;
}
.task-row.overdue .task-name { color: var(--text); }
.task-row.overdue .deadline-pill {
  background: var(--danger-soft);
  color: var(--danger);
  animation: deadline-pulse 1.6s ease-in-out infinite;
}
@keyframes deadline-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.18); }
}
@keyframes task-overdue-glow {
  0%, 100% {
    box-shadow: 0 0 0 1px var(--danger),
                0 0 8px 0 rgba(185, 28, 28, 0.35);
  }
  50% {
    box-shadow: 0 0 0 1px var(--danger),
                0 0 22px 4px rgba(185, 28, 28, 0.75);
  }
}

.task-sample {
  width: 80px; height: 80px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
}
.task-sample img { width: 100%; height: 100%; object-fit: cover; }
.task-sample.placeholder::after {
  content: "Sample";
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.task-meta-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.task-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.task-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.task-type {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg-elev, rgba(255,255,255,0.03));
}
.task-type-s     { color: var(--accent); border-color: rgba(0,113,227,0.35); }
.task-type-i     { color: var(--success); border-color: rgba(48,209,88,0.35); }
.task-type-s-i   { color: var(--text-dim); }

/* Weekday recurrence picker on manager_tasks_edit. */
.weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.weekday-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  user-select: none;
  background: var(--bg-elev, rgba(255,255,255,0.02));
  color: var(--text-dim);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.weekday-pill input { margin: 0; }
.weekday-pill:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0,113,227,0.35);
}

/* Category chips on the Edit Tasks page. Empty (registered-only)
   categories can be deleted with the inline × button; in-use ones cannot. */
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--accent-soft);
}
.category-chip-empty {
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
}
.category-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0 6px;
  height: 18px;
  border-radius: 9px;
  background: rgba(0,0,0,0.25);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.category-chip-empty .category-chip-count {
  background: rgba(255,255,255,0.06);
}
.category-chip-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  margin-left: -2px;
}
.category-chip-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.category-chip-pos-form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.category-chip-pos-input {
  width: 44px;
  height: 22px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0,0,0,0.18);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
}
.category-chip-pos-input::-webkit-outer-spin-button,
.category-chip-pos-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.category-chip-pos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
}
.category-chip-pos-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
}

/* Feedback loop — inline thread on Submissions, my-feedback page, report. */
.feedback-thread { margin-top: 6px; }
.feedback-thread summary { cursor: pointer; list-style: none; }
.feedback-thread summary::-webkit-details-marker { display: none; }
.feedback-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
}
.feedback-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.feedback-author {
  font-weight: 700;
  color: var(--text);
}
.feedback-body {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
}
.feedback-response {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Tiny red badge on the "Feedback" nav item for unacknowledged items. */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.task-desc {
  font-size: 13.5px; color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.5;
}
.task-desc p { margin: 0; }
.task-desc ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-desc ul li {
  position: relative;
  padding-left: 16px;
}
.task-desc ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}
.task-extra {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

/* Notes block on task cards — for free-text clarification set by managers. */
.task-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.task-notes-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}
.task-notes-body { color: var(--text); }
.task-row.completed .task-notes { opacity: 0.7; }

.deadline-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.task-left .deadline-pill { width: 80px; }
.deadline-pill.overdue { background: var(--danger-soft); color: var(--danger); }
.deadline-pill.done { background: var(--success-soft); color: var(--success); }

.completed-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
  margin-top: 4px;
}
.completed-by {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  background: var(--success-soft);
  color: var(--success);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 11.5px;
}
.completed-thumbs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.completed-thumb {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.completed-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }

.task-action {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.task-action form {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.photo-input {
  position: relative;
  display: inline-flex;
}
.photo-input input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0;
  cursor: pointer;
}
.photo-input .photo-input-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.photo-input:hover .photo-input-label,
.photo-input input:focus-visible + .photo-input-label {
  border-color: var(--accent);
  color: var(--accent);
}
.photo-input.has-file .photo-input-label {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* ── Smart prompts ─────────────────────────────────────────────────────────
   A pair of contextual nudges shown above the shift feed: which shift to
   tackle next, and the next deadline-driven task. Each chip opens the right
   <details> and smooth-scrolls. */
.smart-prompts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.smart-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
a.smart-prompt:hover,
a.smart-prompt:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  outline: none;
}
.smart-prompt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.smart-prompt-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.smart-prompt-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}
.smart-prompt-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.smart-prompt-meta {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.smart-prompt-overdue .smart-prompt-icon {
  background: var(--danger-soft);
  color: var(--danger);
}
.smart-prompt-clear .smart-prompt-icon {
  background: rgba(48, 209, 88, 0.16);
  color: var(--success, #30d158);
}

/* Brief highlight when a smart-prompt scrolls a task row into view. */
@keyframes task-row-pulse-anim {
  0%   { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.55); }
  60%  { box-shadow: 0 0 0 8px rgba(0, 113, 227, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); }
}
.task-row.task-row-pulse {
  animation: task-row-pulse-anim 1.6s ease-out;
  border-color: var(--accent);
}

/* Overdue banner â€” alert pulse + static glow fallback.
   Intentionally bypasses prefers-reduced-motion: this is a safety alert,
   not a decorative animation. Sticks BELOW the topbar so neither overlaps. */
.overdue-banner {
  position: sticky;
  top: calc(var(--topbar-h) + 8px);
  z-index: 90;            /* below topbar (z=100) so the topbar wins */
  background: var(--danger);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 14.5px;
  display: none;
  align-items: center; gap: 10px;
  /* Static fallback glow so the banner reads as an alert even if the
     pulse animation is suppressed for any reason. */
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.35),
              0 8px 24px rgba(185, 28, 28, 0.45);
}
.overdue-banner.visible {
  display: flex;
  animation: banner-fade 0.3s ease-out,
             banner-pulse 1.2s ease-in-out infinite;
}
@keyframes banner-fade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes banner-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.35),
                0 8px 24px rgba(185, 28, 28, 0.45);
    background: var(--danger);
  }
  50% {
    box-shadow: 0 0 0 18px rgba(185, 28, 28, 0),
                0 8px 24px rgba(185, 28, 28, 0.45);
    background: var(--danger-bright);
  }
}

/* Location grid (selector) â€” legacy, kept for reference */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* Store cards with cover image */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
/* Desktop: lock to one row of 4. */
@media (min-width: 980px) {
  .store-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.store-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.store-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  text-decoration: none;
}
.store-card-hitarea {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}
.store-card-hitarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.store-card .store-row {
  position: relative;
  z-index: 3;
}
.store-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-elev);
  overflow: hidden;
}
.store-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.store-card:hover .store-cover img { transform: scale(1.05); }
.store-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.55) 100%);
}
.store-pill {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.store-pill.danger {
  background: var(--danger);
  border-color: transparent;
}
.store-body {
  padding: 16px 18px 18px;
}
/* === New sectioned card layout (mirrors master.ashario.com preview) === */
.store-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
  transition: transform 0.5s ease;
}
.store-card:hover .store-image { transform: scale(1.03); }
.store-overdue-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--danger);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.store-header {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.store-name {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  line-height: 1.2;
}
.store-name .store-brand,
.store-name .store-loc { display: block; }
.store-addr {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--accent);
}
.store-progress-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
}
.store-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.store-section {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.store-section:last-child { border-bottom: none; }
.store-section-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.store-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 5px 6px;
  margin: 0 -6px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  min-width: 0;
}
.store-row:hover,
.store-row:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  outline: none;
}
.store-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.store-row:hover .store-row-icon,
.store-row:focus-visible .store-row-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.store-row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.store-row-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 1px;
}
.store-row-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Contact strip (location picker + manager-overview cards) ───────────── */
/* Default: stacked rows on the picker — chip per contact, label above value. */
.contact-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.contact-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  margin: 0 -4px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  min-width: 0;          /* allow flex children to shrink and ellipsize */
}
.contact-chip:hover,
.contact-chip:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: var(--text);
  outline: none;
}
.contact-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.contact-chip:hover .contact-chip-icon,
.contact-chip:focus-visible .contact-chip-icon {
  background: rgba(0, 113, 227, 0.18);
  color: var(--accent);
}
.contact-chip-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.contact-chip-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}
.contact-chip-value {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact variant: row of icon-only chips for the manager-overview cards. */
.contact-strip.compact {
  flex-direction: row;
  gap: 8px;
  padding: 12px 0 0;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  background: transparent;
}
.contact-strip.compact .contact-chip {
  flex: 1;
  justify-content: center;
  padding: 8px 10px;
  margin: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.contact-strip.compact .contact-chip-body {
  display: none;
}
.contact-strip.compact .contact-chip-icon {
  background: transparent;
}
.contact-strip.compact .contact-chip:hover {
  background: rgba(0, 113, 227, 0.12);
  border-color: var(--accent);
}

@media (max-width: 600px) {
  .store-grid { grid-template-columns: 1fr; }
}

/* Tables */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap th, .table-wrap td {
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.table-wrap th {
  background: var(--bg-elev);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tr:hover td { background: var(--accent-softer); }

/* Empty states */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
}
.empty-state .icon {
  font-size: 32px; margin-bottom: 8px; opacity: 0.5;
}

/* Photo lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 24px;
  cursor: pointer;
}
.lightbox.visible { display: grid; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); }

/* Manager rotate controls, pinned to the bottom of the lightbox. */
.lightbox-tools {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 1001;
  cursor: default;
}
.lb-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s ease;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.32); }
.lb-btn:active { background: rgba(255, 255, 255, 0.45); }
.lb-btn:disabled { opacity: 0.5; cursor: default; }

/* Toasts */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: rgba(28, 28, 30, 0.96);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 88vw;
  text-align: center;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: rgba(48, 209, 88, 0.95); color: #fff; border-color: transparent; }
.toast.error   { background: rgba(185, 28, 28, 0.95); color: #fff; border-color: transparent; }

/* Tablet */
@media (max-width: 1024px) {
  .main { padding: 22px 24px 50px; }
  .topbar { padding: 9px 18px; gap: 12px; }
}

/* Mobile */
@media (max-width: 820px) {
  :root { --topbar-h: 52px; }
  .topbar { padding: 8px 12px; gap: 10px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-name { font-size: 14px; }
  .brand-sub { display: none; }
  .nav-item { padding: 6px 11px; font-size: 13px; }
  .user-meta { display: none; }
  .user-avatar { width: 30px; height: 30px; font-size: 12px; }
  .user-block { padding-left: 8px; gap: 6px; }

  .main { padding: 14px; }
  .page-title { font-size: 22px; }
  .page-header { margin-bottom: 18px; }
  .toolbar { gap: 6px; }

  .overdue-banner {
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Mobile: keep the horizontal sample+time / name+desc split, action goes below. */
  .task-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "left right"
      "action action";
    column-gap: 12px;
    row-gap: 12px;
    padding: 14px;
  }
  .task-sample { width: 64px; height: 64px; }
  .task-left .deadline-pill { width: 64px; padding: 4px 6px; font-size: 11.5px; }
  .task-name { font-size: 15px; }
  .task-action { width: 100%; justify-content: stretch; align-self: stretch; }
  .task-action form {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .task-action .btn,
  .task-action .photo-input,
  .task-action .photo-input-label {
    flex: 1;
    justify-content: center;
  }
  .task-action .btn,
  .task-action .photo-input-label {
    padding: 12px 16px;
    font-size: 14px;
  }

  .completed-meta { flex-wrap: wrap; gap: 6px; }
  .completed-thumb { width: 32px; height: 32px; }

  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}

/* Wide tables → stacked cards on mobile.
   .table-wrap clips its overflow, so a table with more columns than the
   viewport can hold silently loses its right-hand side — on the deliveries
   queue that meant the Verify button was unreachable on a phone. Opt a table
   in with .table-cards: below 820px every cell becomes its own labelled row,
   reading its heading from data-label. Tables without the class are
   unaffected. */
@media (max-width: 820px) {
  .table-cards thead { display: none; }
  .table-cards table,
  .table-cards tbody,
  .table-cards tr,
  .table-cards td { display: block; width: 100%; }

  .table-cards tr { padding: 14px; border-bottom: 1px solid var(--border); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards tr:hover td { background: transparent; }

  .table-cards td {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    align-items: start;
    padding: 5px 0;
    border-bottom: 0;
    white-space: normal;
  }
  .table-cards td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 2px;
  }
  /* Cells carrying no data collapse rather than leaving a stranded label. */
  .table-cards td:empty { display: none; }

  /* Photos sit side by side, label above, and get a bigger tap target. */
  .table-cards td.cell-photo {
    display: inline-grid;
    width: auto;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-right: 12px;
    padding-top: 8px;
  }
  .table-cards td.cell-photo img {
    width: 84px !important;
    height: 84px !important;
  }

  /* Two thumbnails sharing one cell — keep them inline, just make them bigger. */
  .table-cards td.cell-photos img {
    width: 68px !important;
    height: 68px !important;
  }

  /* The action is the point of the row on mobile — full width, thumb-sized. */
  .table-cards td.cell-action {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: 12px;
  }
  .table-cards td.cell-action::before { display: none; }
  .table-cards td.cell-action .btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* Very narrow phones */
@media (max-width: 420px) {
  .task-row { column-gap: 10px; padding: 12px; }
  .task-sample { width: 56px; height: 56px; }
  .task-left .deadline-pill { width: 56px; padding: 3px 6px; font-size: 11px; }
  .task-name { font-size: 14px; }
  .task-desc { font-size: 13px; }

  .table-cards td { grid-template-columns: 84px 1fr; gap: 8px; }
  .table-cards td.cell-photo img { width: 76px !important; height: 76px !important; }
}

/* ── Date/time picker fields ──────────────────────────────────────────────
   Paired with the showPicker() handler in base.html: the whole box opens
   the picker, so the calendar glyph is stretched over the full control and
   made invisible rather than sitting as a small target at the right edge.
   The cursor stays a pointer so it reads as clickable. */
.input.due-picker {
  cursor: pointer;
  position: relative;
  color-scheme: dark;              /* native picker panel matches the app */
}
.input.due-picker::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;                      /* invisible, but covers the whole box */
}
.input.due-picker:hover { border-color: var(--border-strong); }
