:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-soft: #f9f8f5;
  --ink: #16181d;
  --ink-secondary: #5e6472;
  --ink-muted: #8b92a1;
  --border: #e6e4de;
  --border-strong: #d5d2c9;

  --accent: #0f8a5f;
  --accent-bg: #e7f6f0;
  --accent-dark: #0a6d4b;

  --primary: #1f2430;
  --primary-hover: #11141c;

  --blue: #2563eb;
  --blue-bg: #eff5ff;
  --telegram: #229ed9;
  --telegram-hover: #1b88bd;

  --amber: #c26d0a;
  --amber-bg: #fef4e4;

  --danger: #d12e3b;
  --danger-bg: #fdecef;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(22, 24, 29, 0.04);
  --shadow-md: 0 8px 24px rgba(22, 24, 29, 0.08);
  --nav-height: 66px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: #eae8e1;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.07);
}

.hidden {
  display: none !important;
}

/* Top Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: rgba(245, 244, 240, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--primary);
  color: #22c58b;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--ink-secondary);
}

.manager-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  max-width: 175px;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.manager-pill:active {
  transform: scale(0.97);
}

.manager-pill-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 14px 14px calc(var(--nav-height) + 24px + env(safe-area-inset-bottom, 0px));
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeUp 0.18s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Summary Strip */
.summary-strip {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 0.72fr;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.summary-cell {
  text-align: center;
  padding: 0 6px;
}

.summary-label {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 3px;
}

.summary-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.summary-value.accent {
  color: var(--accent);
}

.summary-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* Active Timer Card */
.active-card {
  background: linear-gradient(155deg, #1b1f29 0%, #111319 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 12px 28px rgba(17, 19, 25, 0.22);
}

.active-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.active-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.14);
  padding: 4px 9px;
  border-radius: 999px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.active-rate-tag {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 9px;
  border-radius: 999px;
}

.active-task-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}

.active-metrics {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  margin-bottom: 12px;
}

.active-clock {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.active-live-pay {
  text-align: right;
}

.active-live-pay small {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
}

.active-live-pay strong {
  font-size: 20px;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
}

.active-note-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 10px;
}

.active-note-input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.active-note-input:focus {
  outline: none;
  border-color: #22c58b;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 11px;
  margin-bottom: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.stepper button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.stepper span {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.active-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-hint {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-secondary);
}

.link-btn {
  border: none;
  background: none;
  color: var(--blue);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
}

/* Task Grid */
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.task-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.task-card:active {
  transform: scale(0.98);
}

.task-card.is-running {
  border-color: var(--accent);
  background: #f2fbf7;
  box-shadow: 0 0 0 2px rgba(15, 138, 95, 0.15);
}

.task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.task-icon {
  font-size: 22px;
  line-height: 1;
}

.quick-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink-secondary);
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.quick-add-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.task-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.25;
}

.task-rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.task-rate-pill.hourly {
  background: var(--blue-bg);
  color: var(--blue);
}

.task-rate-pill.fixed {
  background: var(--accent-bg);
  color: var(--accent);
}

/* Entries List */
.entries-list, .stack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.entry-left {
  display: flex;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.entry-emoji {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.entry-body {
  min-width: 0;
  flex: 1;
}

.entry-title {
  font-weight: 650;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 2px;
}

.entry-meta {
  font-size: 12px;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.entry-note {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  background: var(--surface-soft);
  padding: 4px 8px;
  border-radius: 7px;
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
}

.entry-right {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.entry-pay {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.entry-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
}

.icon-btn.danger:hover {
  color: var(--danger);
  border-color: #f3c2c7;
  background: var(--danger-bg);
}

/* Filters & Chips */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

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

.select-compact {
  flex: 1;
}

.total-badge {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Cards & Analytics */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.settings-card {
  padding: 16px;
  margin-bottom: 14px;
}

.card-header-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.card-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.analytics-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.kpi-card.kpi-highlight {
  background: linear-gradient(155deg, #1b1f29 0%, #12151d 100%);
  color: #fff;
  border-color: transparent;
}

.kpi-label {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 5px;
}

.kpi-highlight .kpi-label {
  color: rgba(255, 255, 255, 0.68);
}

.kpi-value {
  font-size: 22px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.kpi-highlight .kpi-value {
  color: #4ade80;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--ink-secondary);
  line-height: 1.3;
}

.kpi-highlight .kpi-sub {
  color: rgba(255, 255, 255, 0.72);
}

/* Live now list */
.live-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.live-timer {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-size: 14px;
}

/* Manager Analytics Card */
.mgr-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.mgr-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mgr-id-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mgr-name {
  font-weight: 700;
  font-size: 15px;
}

.mgr-role {
  font-size: 12px;
  color: var(--ink-secondary);
}

.mgr-total-pay {
  font-size: 18px;
  font-weight: 750;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.mgr-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.mini-pill {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.mgr-top-tasks {
  font-size: 12px;
  color: var(--ink-secondary);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

/* Task breakdown bars */
.bar-row {
  margin-bottom: 12px;
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 5px;
}

.bar-label {
  font-weight: 600;
}

.bar-meta {
  font-size: 12px;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #eceae3;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.bar-fill.hourly {
  background: var(--blue);
}

/* Lock Card */
.lock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  margin-top: 18px;
}

.lock-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.lock-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.lock-card p {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

/* Forms & Buttons */
.form-group {
  margin-bottom: 11px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 5px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.15s ease;
}

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

.input-with-btn {
  display: flex;
  gap: 6px;
}

.input-with-btn .input {
  flex: 1;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 41px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
}

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

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

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-telegram {
  background: var(--telegram);
  color: #ffffff;
}

.btn-telegram:hover {
  background: var(--telegram-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger-ghost {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f6ccd0;
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row .btn {
  flex: 1;
}

.badge {
  font-size: 11.5px;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-success {
  background: var(--accent-bg);
  color: var(--accent);
}

.badge-muted {
  background: #eceae3;
  color: var(--ink-secondary);
}

.helper-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.helper-box ol {
  margin: 6px 0 0;
  padding-left: 18px;
}

.helper-box li {
  margin-bottom: 3px;
}

.helper-box code {
  background: #eae8e1;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink);
}

/* Telegram Preview */
.tg-preview {
  margin-top: 12px;
  background: #e9f5fb;
  border: 1px solid #c5e3f3;
  border-radius: 14px;
  padding: 13px;
  font-size: 13px;
  line-height: 1.48;
  white-space: pre-wrap;
  color: #15222b;
}

.tg-logs {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.tg-log-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed var(--border);
}

/* Admin Lists */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.admin-item.inactive {
  opacity: 0.55;
}

.admin-item-info {
  min-width: 0;
}

.admin-item-title {
  font-weight: 650;
  font-size: 14px;
}

.admin-item-sub {
  font-size: 12px;
  color: var(--ink-secondary);
}

.danger-zone {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  text-align: center;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}

.nav-item {
  border: none;
  background: none;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.nav-item.active {
  color: var(--ink);
}

.nav-item.active svg {
  stroke: var(--accent);
}

/* Modal Sheet */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 19, 25, 0.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  animation: fadeIn 0.14s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-sheet {
  width: 100%;
  max-width: 496px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 22px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  animation: slideUp 0.18s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.picker-option.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.emoji-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 18px;
  cursor: pointer;
}

.emoji-btn.active {
  border-color: var(--primary);
  background: #e6e8ef;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 26px 14px;
  color: var(--ink-muted);
  font-size: 13.5px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 200;
  max-width: min(460px, calc(100% - 28px));
  padding: 11px 16px;
  border-radius: 12px;
  background: #16181d;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  text-align: center;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--accent-dark);
}

@media (max-width: 360px) {
  .task-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* Brand Role Badge */
.brand-text-wrap {
  min-width: 0;
}

.brand-top-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-badge {
  border: none;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  flex-shrink: 0;
}

.role-badge.role-manager {
  background: #e9e7e0;
  color: var(--ink-secondary);
}

.role-badge.role-supervisor {
  background: #e0ecff;
  color: #1d4ed8;
}

.role-badge.role-admin {
  background: #dcfce7;
  color: #0a6d4b;
}

/* Role Access Banner */
.role-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border-color: #d7e2fb;
}

/* Workday Shift Card */
.shift-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.shift-card.shift-idle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f5faf7 100%);
  border-color: #cfe9dd;
}

.shift-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.shift-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.shift-status.ended {
  color: var(--ink-secondary);
}

.shift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.shift-metric {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 6px;
  text-align: center;
}

.shift-metric span {
  display: block;
  font-size: 10.5px;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.shift-metric strong {
  font-size: 13.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.shift-metric.metric-tasks strong {
  color: var(--blue);
}

.shift-metric.metric-free strong {
  color: var(--amber);
}

.shift-bar-wrap {
  margin-bottom: 8px;
}

.shift-bar-track {
  height: 7px;
  border-radius: 999px;
  background: #fde8c8;
  overflow: hidden;
}

.shift-bar-tasks {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.shift-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-secondary);
}

.shift-foot strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Planned Item Cards (Daily Plan & Calendar Agenda) */
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  box-shadow: var(--shadow-sm);
}

.plan-card.type-meeting { border-left-color: #7c3aed; }
.plan-card.type-measurement { border-left-color: #d97706; }
.plan-card.type-day_off { border-left-color: #e11d48; background: #fff9fa; }
.plan-card.type-other { border-left-color: #475569; }
.plan-card.status-completed { opacity: 0.78; background: #f8fbf9; }

.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.plan-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.ev-pill {
  font-size: 11px;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ev-pill.type-task { background: #eff5ff; color: #1d4ed8; }
.ev-pill.type-meeting { background: #f3e8ff; color: #6d28d9; }
.ev-pill.type-measurement { background: #fef3c7; color: #b45309; }
.ev-pill.type-day_off { background: #ffe4e6; color: #be123c; }
.ev-pill.type-other { background: #f1f5f9; color: #334155; }

.plan-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 4px;
}

.plan-meta {
  font-size: 12px;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 6px;
}

.plan-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  margin-bottom: 6px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink);
}

.person-chip.co {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

.plan-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* Calendar Grid */
.cal-top-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.cal-card {
  padding: 13px;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-month-title {
  font-weight: 750;
  font-size: 15.5px;
  text-transform: capitalize;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1 / 1.05;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 2px;
}

.cal-day.other-month {
  opacity: 0.34;
}

.cal-day.is-today {
  border-color: var(--accent);
  color: var(--accent);
}

.cal-day.is-selected {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.cal-dots {
  display: flex;
  gap: 2px;
  height: 5px;
  align-items: center;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.dot-task { background: #2563eb; }
.dot-meeting { background: #7c3aed; }
.dot-measurement { background: #d97706; }
.dot-day_off { background: #e11d48; }
.dot-other { background: #64748b; }

.cal-day.is-selected .dot {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--ink-secondary);
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Event Type Picker in Modal */
.ev-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ev-type-btn {
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.ev-type-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.preset-chip {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
}

.preset-chip.active {
  background: var(--blue-bg);
  border-color: var(--blue);
  color: var(--blue);
}

/* Analytics Manager Task Breakdown */
.mgr-task-breakdown {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mgr-task-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.mgr-task-line strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
