/* === shadcn-inspired tokens === */
:root {
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --muted: #64748b;
  --muted-bg: #f1f5f9;
  --radius: 0.375rem;
  --ring: rgba(15, 23, 42, 0.08);
  --primary: #0f172a;
  --primary-fg: #ffffff;
  --destructive: #dc2626;
  --destructive-light: #fef2f2;
}

/* === Base === */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

body {
  margin: 0;
  color: #0f172a;
  background-color: #f8fafc;
}

/* === Layout === */
.layout {
  display: flex;
  height: 100vh;
}

/* === Sidebar === */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.sidebar-brand:hover {
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
}

.sidebar-logo-text {
  height: 18px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow-y: auto;
}

.sidebar-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background-color: var(--muted-bg);
  color: #0f172a;
  text-decoration: none;
}

.sidebar-link.active {
  background-color: var(--muted-bg);
  color: #0f172a;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}

.sidebar-footer-link {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.sidebar-footer-link:hover {
  color: #0f172a;
  text-decoration: none;
}

/* === Main wrapper === */
.main-wrapper {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* === Top bar === */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  /* Fixed height so the topbar (and hence the content below) sits at the same
     vertical offset whether a Subtitle is set or not. ~96px fits a 2rem title
     plus a 0.8125rem subtitle with the 0.75rem top/bottom padding. */
  height: 96px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  flex-direction: column;
}

.topbar-title {
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.topbar-subtitle {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.3;
}

.page-breadcrumb {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  line-height: 1;
  padding: 0.75rem 1.5rem 0 1.5rem;
}

.page-breadcrumb-link {
  color: var(--muted);
  text-decoration: none;
}

.page-breadcrumb-link:hover {
  color: #0f172a;
  text-decoration: underline;
}

.page-breadcrumb-sep {
  color: var(--border-hover);
}

.page-breadcrumb-current {
  color: #0f172a;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === Auth links (topbar) === */
.topbar-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-auth-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  text-decoration: none;
}

.topbar-user-btn:hover {
  text-decoration: none;
}

.topbar-user-icon {
  flex-shrink: 0;
}

/* === Main content === */
.main-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* === Utility classes === */
.inline { display: inline; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }

/* === Dashboard === */
.dashboard-greeting {
  margin-bottom: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.dashboard-greeting h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #0f172a;
}

.dashboard-greeting p {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.25rem 0 0 0;
}

.dashboard-greeting .greeting-alert {
  color: var(--destructive);
  font-weight: 500;
}

.dashboard-section-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin: 1.25rem 0 0.75rem 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0.75rem;
}

.shifts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.shifts-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (max-width: 900px) {
  .shifts-row {
    grid-template-columns: 1fr;
  }
}

.stat-item-accent {
  border-left: 3px solid var(--primary);
}

.stat-item-revenue {
  border-left: 3px solid #15803d;
}

.stat-item-revenue .stat-count {
  color: #15803d;
}

/* Stat card color tints */
.stat-item.stat-item-queued { border-color: #fef3c7; background-color: #fffbeb; }
.stat-item-queued .stat-count { color: #b45309; }

.stat-item.stat-item-waiting { border-color: #fef3c7; background-color: #fffbeb; }
.stat-item-waiting .stat-count { color: #b45309; }

/* Clickable stat cards */
a.stat-item {
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s;
}

a.stat-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

/* View all link */
.view-all-link {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.view-all-link:hover {
  color: #0f172a;
  background: var(--muted-bg);
  text-decoration: none;
}

/* === Toast messages === */
.toast-container {
  margin-bottom: 1rem;
}

.toast-message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: toast-fade 4s ease-in-out forwards;
}

.toast-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.toast-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  padding: 0 0.25rem;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes toast-fade {
  0%, 80% { opacity: 1; }
  100% { opacity: 0; }
}

/* === Focus ring === */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
  box-shadow: 0 0 0 2px var(--ring);
  border-color: var(--border-hover);
  outline: none;
}

/* === Card container === */
.card-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-narrow {
  max-width: 600px;
}

/* === Page header (action buttons row) === */
.page-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1rem;
}

/* === Buttons (shadcn style) === */
.btn-shadcn {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  line-height: 1.5;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-shadcn:hover {
  background-color: var(--muted-bg);
  border-color: var(--border-hover);
}

.btn-shadcn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}

.btn-shadcn-primary:hover {
  background: #1e293b;
  border-color: #1e293b;
  color: var(--primary-fg);
  text-decoration: none;
}

a.btn-shadcn {
  text-decoration: none;
}

.btn-shadcn-destructive {
  color: var(--destructive);
  border-color: #fecaca;
  background: var(--destructive-light);
}

.btn-shadcn-destructive:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.btn-shadcn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-shadcn-ghost:hover {
  background: var(--muted-bg);
}

.btn-shadcn-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
}

/* === Inputs & selects (shadcn style) === */
.input-shadcn,
.select-shadcn {
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: #0f172a;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}

.input-shadcn::placeholder {
  color: #94a3b8;
}

.input-shadcn:focus,
.select-shadcn:focus {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 2px var(--ring);
  outline: none;
}

/* === Filter bar === */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

/* === Table (shadcn style) === */
.table-shadcn {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.table-shadcn thead th {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  white-space: nowrap;
}

.table-shadcn tbody td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-shadcn tbody tr:last-child td {
  border-bottom: none;
}

.table-shadcn tbody tr:hover {
  background-color: var(--muted-bg);
}

.table-shadcn .cell-primary {
  font-weight: 600;
  color: #0f172a;
}

.table-shadcn .cell-muted {
  color: var(--muted);
  font-size: 0.75rem;
}

.table-shadcn .cell-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 0.75rem;
}

/* === Status select (shadcn badge-style) === */
.status-select {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.2rem 1.75rem 0.2rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid;
  cursor: pointer;
  appearance: auto;
  background-color: transparent;
  line-height: 1.5;
  min-width: 130px;
}

.status-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
}

.status-select.status-queued {
  color: #b45309;
  border-color: #fde68a;
  background-color: #fefce8;
}

.status-select.status-inproduction {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background-color: #eff6ff;
}

.status-select.status-readytogo {
  color: #7c3aed;
  border-color: #ddd6fe;
  background-color: #f5f3ff;
}

.status-select.status-fulfilled {
  color: #15803d;
  border-color: #bbf7d0;
  background-color: #f0fdf4;
}

.status-select.status-archived {
  color: #6b7280;
  border-color: #e5e7eb;
  background-color: #f9fafb;
}

/* === Task status colors === */
.status-select.status-backlog {
  color: #6b7280;
  border-color: #e5e7eb;
  background-color: #f9fafb;
}

.status-select.status-waitingtostart {
  color: #b45309;
  border-color: #fde68a;
  background-color: #fefce8;
}

.status-select.status-inprogress {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background-color: #eff6ff;
}

.status-select.status-done {
  color: #15803d;
  border-color: #bbf7d0;
  background-color: #f0fdf4;
}

.status-select.status-task-archived {
  color: #6b7280;
  border-color: #e5e7eb;
  background-color: #f9fafb;
}

/* === Status badges (non-interactive, for detail pages) === */
.status-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid;
  display: inline-block;
}

.status-badge.status-queued { color: #b45309; border-color: #fde68a; background-color: #fefce8; }
.status-badge.status-inproduction { color: #1d4ed8; border-color: #bfdbfe; background-color: #eff6ff; }
.status-badge.status-readytogo { color: #7c3aed; border-color: #ddd6fe; background-color: #f5f3ff; }
.status-badge.status-fulfilled { color: #15803d; border-color: #bbf7d0; background-color: #f0fdf4; }
.status-badge.status-archived { color: #6b7280; border-color: #e5e7eb; background-color: #f9fafb; }
.status-badge.status-backlog { color: #6b7280; border-color: #e5e7eb; background-color: #f9fafb; }
.status-badge.status-waitingtostart { color: #b45309; border-color: #fde68a; background-color: #fefce8; }
.status-badge.status-inprogress { color: #1d4ed8; border-color: #bfdbfe; background-color: #eff6ff; }
.status-badge.status-done { color: #15803d; border-color: #bbf7d0; background-color: #f0fdf4; }
.status-badge.status-task-archived { color: #6b7280; border-color: #e5e7eb; background-color: #f9fafb; }
.status-badge.status-pending { color: #b45309; border-color: #fde68a; background-color: #fefce8; }

/* === Dashboard task table column alignment === */
.dashboard-task-table th:nth-child(1),
.dashboard-task-table td:nth-child(1) { width: 50%; }
.dashboard-task-table th:nth-child(2),
.dashboard-task-table td:nth-child(2) { width: 25%; }
.dashboard-task-table th:nth-child(3),
.dashboard-task-table td:nth-child(3) { width: 25%; }

/* === Date indicators === */
.cell-overdue {
  color: var(--destructive);
  font-weight: 500;
}

.cell-due-today {
  color: #b45309;
  font-weight: 500;
}

.cell-due-tomorrow {
  color: #92400e;
  font-weight: 500;
}

.date-indicator {
  font-size: 0.65rem;
  line-height: 1;
  margin-top: 0.125rem;
  padding-left: 0.375rem;
}

/* === Priority badges === */
.priority-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid;
  display: inline-block;
}

.priority-low {
  color: #6b7280;
  border-color: #e5e7eb;
  background-color: #f9fafb;
}

.priority-medium {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background-color: #eff6ff;
}

.priority-high {
  color: #b45309;
  border-color: #fde68a;
  background-color: #fefce8;
}

.priority-urgent {
  color: #dc2626;
  border-color: #fecaca;
  background-color: #fef2f2;
}

/* === Priority select (inline) === */
.priority-select {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.2rem 1.75rem 0.2rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid;
  cursor: pointer;
  appearance: auto;
  line-height: 1.5;
  min-width: 100px;
}

.priority-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
}

/* === Summary stat bar === */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.stat-count {
  font-weight: 700;
  font-size: 1.5rem;
  color: #0f172a;
  line-height: 1;
}

.stat-overdue {
  border-color: #fecaca;
  background: #fef2f2;
}

.stat-overdue .stat-count {
  color: var(--destructive);
}

/* === Comment feed === */
.comment-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-item {
  padding: 0.75rem;
  background: var(--muted-bg);
  border-radius: var(--radius);
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.375rem;
}

.comment-meta strong {
  color: #0f172a;
}

.comment-content {
  font-size: 0.8125rem;
  color: #0f172a;
  line-height: 1.5;
}

/* === Clickable cells === */
.cell-clickable {
  cursor: pointer;
  border-radius: var(--radius);
  padding: 0.125rem 0.25rem;
}

.cell-clickable:hover {
  background-color: var(--muted-bg);
}

/* === Expandable cells === */
.expandable-cell {
  position: relative;
}

.expandable-textarea {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  padding: 0.2rem 0.375rem;
  width: 100%;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.expandable-textarea.expandable-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}

.expandable-cell.expanded .expandable-textarea {
  overflow-y: auto;
  white-space: pre-wrap;
  text-overflow: unset;
  border-color: var(--border-hover);
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--ring);
}

.expandable-content {
  display: none;
  margin-top: 0.375rem;
  padding: 0.5rem;
  background: var(--muted-bg);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
}

.expandable-cell.expanded .expandable-content {
  display: block;
}

.expand-comment {
  font-size: 0.75rem;
  color: #0f172a;
  line-height: 1.4;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border);
}

.expand-comment:last-child {
  border-bottom: none;
}

.expand-comment-meta {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-bottom: 0.125rem;
}

/* === Inline text inputs === */
.inline-text-input {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.2rem 0.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #0f172a;
  width: 100%;
  line-height: 1.4;
}

.inline-text-input:hover {
  border-color: var(--border);
}

.inline-text-input:focus {
  border-color: var(--border-hover);
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--ring);
  outline: none;
}

.inline-text-muted {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--muted);
}

.inline-text-muted::placeholder {
  color: #cbd5e1;
}

/* === Inline date inputs === */
.inline-date-input {
  font-size: 0.75rem;
  padding: 0.2rem 0.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  width: 125px;
  display: block;
}

.inline-date-input:hover {
  border-color: var(--border);
}

.inline-date-input:focus {
  border-color: var(--border-hover);
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--ring);
  outline: none;
}

.inline-date-input.cell-overdue {
  color: var(--destructive);
}

.inline-date-input.cell-due-today {
  color: #b45309;
}

.inline-date-input.cell-due-tomorrow {
  color: #92400e;
}

.inline-time-input {
  font-size: 0.8125rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  width: 9em;
  font-family: inherit;
}
.inline-time-input:hover { border-color: var(--border); }
.inline-time-input:focus {
  border-color: var(--border-hover);
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--ring);
  outline: none;
}

/* === Status checkboxes === */
.status-checks {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.status-check {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: #0f172a;
  cursor: pointer;
}

.status-check input[type="checkbox"] {
  width: 0.875rem;
  height: 0.875rem;
  cursor: pointer;
  accent-color: var(--primary);
}

/* === Quick add === */
.quick-add-row td {
  padding: 0.5rem 0.75rem !important;
  background: #ffffff;
  border-bottom: 1px solid var(--border) !important;
}

.quick-add-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* === Inline select (for assigned-to in table) === */
.inline-select {
  font-size: 0.8125rem;
  padding: 0.2rem 1.75rem 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  appearance: auto;
  min-width: 130px;
}

.inline-select:focus {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 2px var(--ring);
  outline: none;
}

/* === Action links === */
.action-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  transition: background-color 0.15s, color 0.15s;
}

.action-link:hover {
  background-color: var(--muted-bg);
  color: #0f172a;
}

/* === Modal overrides === */
.modal-content {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-header {
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-top: 1px solid var(--border);
}

/* === Forms (shadcn style) === */
.form-shadcn {
  max-width: 480px;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 0.375rem;
}

.form-field .input-shadcn,
.form-field .select-shadcn {
  width: 100%;
}

.form-field .form-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.form-field .field-validation-error {
  font-size: 0.75rem;
  color: var(--destructive);
  margin-top: 0.25rem;
  display: block;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* === Input prefix (e.g. $ sign) === */
.input-prefix {
  display: flex;
  align-items: center;
}

.input-prefix-text {
  font-size: 0.8125rem;
  padding: 0.4rem 0.625rem;
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--muted);
}

.input-prefix .input-shadcn {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* === Detail list (shadcn style) === */
.detail-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
}

.detail-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
}

.detail-value {
  font-size: 0.8125rem;
  color: #0f172a;
  padding: 0.5rem 0.75rem;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

/* === Workflow card === */
.workflow-card {
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.workflow-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.75rem 0;
}

.workflow-card-fields {
  display: flex;
  gap: 1rem;
}

.workflow-card-fields .form-field {
  flex: 1;
  margin-bottom: 0;
}

/* === Sort headers === */
.sort-header {
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.sort-header:hover {
  color: #0f172a;
  text-decoration: none;
}

.sort-header.active {
  color: #0f172a;
}

/* === Expandable rows === */
.expand-chevron {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
  cursor: pointer;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.expand-chevron:hover {
  border-color: #0f172a;
}

.expand-chevron.expanded {
  transform: rotate(45deg);
}

.expand-row {
  background-color: var(--muted-bg);
}

.expand-cell {
  padding: 0.75rem 0.75rem 0.75rem 2rem !important;
  border-bottom: 1px solid var(--border) !important;
}

.subtable {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.subtable thead th {
  font-size: 0.6875rem;
}

.subtable tbody td {
  font-size: 0.75rem;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  gap: 0.25rem;
}

.pagination-btn {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
}

.pagination-btn:hover {
  background: var(--muted-bg);
  text-decoration: none;
}

.pagination-btn.active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}

.pagination-btn.disabled {
  color: var(--muted);
  background: var(--muted-bg);
  border-color: var(--border);
  cursor: default;
}

/* === Section headings === */
.section-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.75rem 0;
}

.section-heading-card {
  padding-bottom: 0;
}

.section-heading-card .table-shadcn {
  margin: 0 -1.25rem;
  width: calc(100% + 2.5rem);
}

.section-heading-card .cell-empty {
  padding: 1.5rem 0;
}

/* === Validation === */
.validation-summary-valid {
  display: none;
}

.field-validation-valid {
  display: none;
}

.input-validation-error {
  border-color: var(--destructive) !important;
}

.input-validation-error:focus {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15) !important;
}

/* === Delete warning === */
.delete-warning {
  background: var(--destructive-light);
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--destructive);
  font-weight: 500;
}

/* Calendar Week View */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.view-toggle a {
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--muted);
    background: transparent;
}
.view-toggle a.active {
    background: var(--primary);
    color: var(--primary-fg);
}

.week-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 0.5rem;
}
.week-toolbar > .day-count-toggle {
    justify-self: start;
}

.week-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}
.week-nav .week-label {
    font-weight: 600;
    margin: 0 0.5rem;
}

.week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    grid-template-rows: 68px;
    grid-auto-rows: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
    position: relative;
}
.week-grid .gridhead {
    background: var(--muted-bg);
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}
.week-grid .gridhead.today {
    background: var(--primary);
    color: var(--primary-fg);
}
.week-grid .gridhead-date {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    white-space: nowrap;
}
.week-grid .gridhead-weekday {
    font-weight: 700;
}
.week-grid .gridhead-hours {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--muted);
}
.week-grid .gridhead.today .gridhead-hours {
    color: rgba(255, 255, 255, 0.85);
}
.week-grid .gridhead-hours.gridhead-hours-empty {
    color: var(--destructive);
    font-style: italic;
}
.week-grid .gridhead.today .gridhead-hours.gridhead-hours-empty {
    color: #fecaca;
}
.week-grid .timecell {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
    padding: 0.15rem 0.4rem 0 0;
    border-right: 1px solid var(--border);
}
.week-grid .daycell {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.week-grid .daycell:hover {
    background-color: rgba(15, 23, 42, 0.025);
}
.week-grid .daycell::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(15, 23, 42, 0.05);
    pointer-events: none;
}

.now-line {
    position: absolute;
    height: 2px;
    background: #dc2626;
    z-index: 20;
    pointer-events: none;
}
.now-line::before {
    content: '';
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc2626;
    box-shadow: 0 0 0 2px white;
}
.shift-card {
    position: absolute;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    /* left, width set inline per-card to support side-by-side rendering of overlapping shifts */
}
.shift-card:hover { opacity: 0.9; }
.shift-card .shift-name { font-weight: 600; display: block; line-height: 1.2; }
.shift-card .shift-role { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; display: block; line-height: 1.2; }
.shift-card .shift-time { font-size: 0.7rem; opacity: 0.85; display: block; line-height: 1.2; margin-top: 0.1rem; }
.shift-card .shift-hours { display: block; font-size: 0.625rem; font-weight: 600; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-card.role-florist { background: #16a34a; }
.shift-card.role-manager { background: #2563eb; }
.shift-card.role-production { background: #ea580c; }

/* Staircase modifier for 7-day mode. Cards stack with a small lateral plus vertical offset. */
.shift-card.shift-stacked .shift-name { font-size: 0.75rem; line-height: 1.15; }
.shift-card.shift-stacked .shift-role { font-size: 0.6rem; line-height: 1.15; }
.shift-card.shift-stacked .shift-time { font-size: 0.65rem; line-height: 1.15; }
.shift-card.shift-stacked { padding: 0.15rem 0.3rem; }

.stack-overflow-badge {
    position: absolute;
    right: 2px;
    bottom: 2px;
    padding: 0.05rem 0.3rem;
    font-size: 0.6rem;
    font-weight: 600;
    color: white;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 4px;
    pointer-events: none;
}

/* Shifts that extend past the calendar's visible end hour get a striped bottom edge */
.shift-card.shift-clipped::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 12px;
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0) 0 4px,
        rgba(255,255,255,0.35) 4px 8px
    );
    pointer-events: none;
}

/* === Auth pages (Login, Register) === */
.auth-body {
    background: #f8fafc;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    padding: 1.75rem;
    box-sizing: border-box;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.auth-brand-icon {
    width: 32px;
    height: 32px;
}

.auth-brand-text {
    height: 20px;
    width: auto;
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.25rem 0;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.8125rem;
    color: var(--muted);
    margin: 0 0 1.25rem 0;
    text-align: center;
}

.auth-form .form-field {
    margin-bottom: 0.875rem;
}

.auth-error {
    font-size: 0.8125rem;
    color: var(--destructive);
    background: var(--destructive-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.875rem;
}

.auth-error:empty {
    display: none;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #0f172a;
    cursor: pointer;
    margin: 0;
}

.auth-checkbox input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
}

.auth-link {
    color: #0f172a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-link:hover {
    color: #1e293b;
}

.auth-submit {
    width: 100%;
    padding: 0.55rem 0.875rem;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.auth-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--muted);
    text-align: center;
}

.auth-footer-meta {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auth-footer-meta a {
    color: var(--muted);
    text-decoration: none;
}

.auth-footer-meta a:hover {
    color: #0f172a;
    text-decoration: underline;
}

/* Identity Manage area */
.settings-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    align-items: start;
}
.settings-nav { position: sticky; top: 1rem; }
.settings-nav-list { display: flex; flex-direction: column; gap: 0.25rem; }
.settings-nav-link {
    display: block;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius);
    color: inherit;
    text-decoration: none;
    font-size: 0.95rem;
}
.settings-nav-link:hover { background: var(--muted-bg); }
.settings-nav-link.active {
    background: var(--muted-bg);
    color: var(--primary);
    font-weight: 600;
}
.settings-content { min-width: 0; }
