:root {
  --background: #f5f7f4;
  --foreground: #18211d;
  --muted: #627067;
  --surface: #ffffff;
  --surface-soft: #eef3ec;
  --line: #d8e0d6;
  --green: #2f6f4e;
  --green-dark: #1f4f38;
  --blue: #275a82;
  --yellow: #f2c14e;
  --rose: #b85b5b;
  --shadow: 0 18px 50px rgba(31, 79, 56, 0.14);
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, rgba(47, 111, 78, 0.08), transparent 34%), linear-gradient(315deg, rgba(39, 90, 130, 0.1), transparent 30%), var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-panel {
  width: min(100%, 460px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  padding: 32px;
}
.brand-mark { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 8px; background: var(--green); color: #fff; font-weight: 800; }
.brand-mark.small { width: 42px; height: 42px; flex: 0 0 auto; }
.eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3 { margin: 0; line-height: 1.08; }
.login-panel h1 { margin-top: 18px; font-size: clamp(30px, 7vw, 46px); }
.login-copy { color: var(--muted); font-size: 16px; line-height: 1.55; }
.login-form { display: grid; gap: 10px; margin-top: 24px; }
.login-form label { color: var(--muted); font-size: 13px; font-weight: 700; }
.login-form input, .shift-input, .password-input, .emergency-form input, .emergency-form select, .emergency-form textarea, .status-select select, .status-select textarea, .swap-form input, .swap-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--foreground);
  min-height: 42px;
  outline: none;
  padding: 0 12px;
}
.emergency-form textarea, .status-select textarea { min-height: 120px; padding: 12px; resize: vertical; }
.status-select textarea { min-height: 86px; }
.login-form input:focus, .shift-input:focus, .password-input:focus, .emergency-form input:focus, .emergency-form select:focus, .emergency-form textarea:focus, .status-select select:focus, .status-select textarea:focus, .swap-form input:focus, .swap-form select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,111,78,.14); }
.login-form button, .primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}
.form-error { margin: 0; color: var(--rose); font-size: 13px; font-weight: 700; }
.demo-hint { margin: 18px 0 0; color: var(--muted); font-size: 13px; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; gap: 22px;
  border-right: 1px solid var(--line); background: rgba(255,255,255,.78); padding: 22px; backdrop-filter: blur(18px);
}
.portal-title { display: flex; align-items: center; gap: 12px; }
.portal-title strong, .portal-title span { display: block; }
.portal-title span { color: var(--muted); font-size: 13px; }
.portal-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
}
.sidebar nav { display: grid; gap: 8px; }
.sidebar button, .mobile-nav button, .chip, .segment button, .week-controls button, .week-tabs button, .lock-button {
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--foreground); min-height: 42px; padding: 0 14px; text-align: left;
}
.sidebar button:hover, .sidebar .nav-active, .mobile-nav .nav-active, .chip.active, .segment .active, .week-tabs .active {
  border-color: var(--line); background: var(--surface-soft); color: var(--green-dark); font-weight: 800;
}
.lock-button { margin-top: auto; color: var(--rose); }
.workspace { min-width: 0; padding: 26px; }
.pull-refresh-indicator {
  display: none;
  max-width: 1180px;
  margin: 0 auto 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.pull-refresh-indicator.active { display: block; }
.topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: start; max-width: 1180px; margin: 0 auto 22px; }
.topbar h1 { font-size: clamp(34px, 5vw, 62px); }
.topbar-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.icon-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
  padding: 0 12px;
}
.bell-button {
  position: relative;
  min-width: 44px;
  padding: 0 10px;
}
.bell-button span {
  font-size: 18px;
  line-height: 1;
}
.icon-button.active {
  background: var(--surface-soft);
}
.icon-button strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  padding: 0 6px;
}
.role-badge {
  display: inline-flex;
  max-width: min(100%, 420px);
  min-height: 30px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  padding: 6px 10px;
  overflow-wrap: anywhere;
}
.content-section { max-width: 1180px; margin: 0 auto; }
.push-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 26px rgba(31,79,56,.08);
  padding: 16px 18px;
}
.push-panel.muted {
  background: rgba(255,255,255,.76);
}
.push-panel h3 {
  margin: 0 0 6px;
  font-size: 22px;
}
.push-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.push-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}
.push-preferences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  flex: 1 1 100%;
  min-width: 100%;
}
.toggle-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.86);
  padding: 10px 12px;
  color: var(--foreground);
  font-weight: 800;
}
.toggle-row input {
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #d8ddd8;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.toggle-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.toggle-row input:checked {
  border-color: var(--green);
  background: var(--green);
}
.toggle-row input:checked::after { transform: translateX(20px); }
.push-message {
  margin-top: 8px !important;
  color: var(--green-dark) !important;
  font-size: 13px;
  font-weight: 700;
}
.today-workers {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 26px rgba(31,79,56,.08);
  margin-bottom: 16px;
  padding: 18px;
}
.today-workers-head {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}
.today-workers-head h2 { font-size: clamp(22px, 3vw, 32px); }
.today-workers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.today-center-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.today-center-card h3 { font-size: 18px; margin-bottom: 10px; }
.today-center-timer {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}
.today-center-card dl { display: grid; gap: 10px; margin: 0; }
.today-center-card dt { color: var(--green-dark); font-size: 13px; font-weight: 900; }
.today-center-card dd { margin: 2px 0 0; color: var(--foreground); line-height: 1.4; }
.today-center-card p { color: var(--muted); margin: 0; }
.today-worker-name {
  display: block;
}
.today-worker-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.status-grid div, .link-card, .employee-card, .ai-panel, .ai-roadmap, .person-schedule, .emergency-panel, .emergency-card, .request-card { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.92); box-shadow: 0 10px 26px rgba(31,79,56,.08); }
.status-grid div { padding: 18px; }
.status-grid span, .link-category, .employee-card span, .employee-card dt, .legend, .schedule-row small { color: var(--muted); font-size: 12px; font-weight: 700; }
.status-grid strong { display: block; font-size: 34px; line-height: 1; margin-top: 6px; }
.chip-row, .segment, .week-tabs { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; }
.chip, .segment button, .week-tabs button { flex: 0 0 auto; border-color: var(--line); background: #fff; text-align: center; white-space: nowrap; }
.link-grid, .employee-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.links-admin-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.link-create-form, .link-admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 26px rgba(31,79,56,.08);
}
.link-create-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}
.links-admin-list {
  display: grid;
  gap: 12px;
}
.link-admin-card {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
}
.link-admin-order, .link-admin-actions {
  display: grid;
  gap: 8px;
}
.link-admin-fields {
  display: grid;
  gap: 10px;
}
.link-create-form label, .link-admin-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.link-create-form input, .link-admin-fields input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--foreground);
  outline: none;
  padding: 0 12px;
}
.link-create-form input:focus, .link-admin-fields input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47,111,78,.14);
}
.checkbox-row {
  display: inline-flex !important;
  gap: 8px !important;
  align-items: center;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--green);
}
.link-card { display: grid; min-height: 164px; gap: 10px; padding: 18px; transition: transform .18s ease, border-color .18s ease; }
.link-card:hover { border-color: rgba(47,111,78,.5); transform: translateY(-2px); }
.static-link-card:hover { transform: none; }
.link-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 8px; background: #e4efe7; color: var(--green-dark); font-size: 13px; font-weight: 900; }
.link-card strong { font-size: 18px; line-height: 1.22; }
.link-card small { color: var(--muted); line-height: 1.35; }
.section-heading { display: flex; gap: 16px; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { font-size: clamp(26px, 4vw, 42px); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.legend span { border-radius: 8px; background: #fff; padding: 8px 10px; }
.admin-note { margin-bottom: 14px; border: 1px solid rgba(47,111,78,.24); border-radius: 8px; background: #edf6ef; color: var(--green-dark); font-size: 14px; font-weight: 700; line-height: 1.45; padding: 12px 14px; }
.week-controls { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: start; margin-bottom: 14px; }
.week-controls > button { min-height: 42px; border-color: var(--line); background: #fff; font-weight: 800; text-align: center; }
.week-controls > button:disabled { cursor: not-allowed; opacity: .42; }
.week-tabs { margin-bottom: 0; }
.schedule-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.schedule-row { display: grid; grid-template-columns: 250px repeat(var(--days-count, 7), minmax(92px,1fr)); min-width: 900px; }
.schedule-row > span, .employee-shift-button { display: grid; min-height: 58px; align-content: center; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 8px; overflow-wrap: anywhere; word-break: break-word; }
.employee-shift-button { border-top: 0; border-left: 0; border-radius: 0; background: #fff; color: var(--foreground); text-align: left; }
.employee-shift-button:hover, .employee-shift-button:focus-visible { background: #edf6ef; outline: none; }
.schedule-row.header > span { min-height: 44px; background: var(--green-dark); color: #fff; font-weight: 800; }
.today { outline: 3px solid var(--yellow); outline-offset: -3px; }
.off { background: #eef1f3; color: var(--muted); font-weight: 800; }
.away { background: #fff5d7; color: #7b5a06; font-weight: 800; }
.note { background: #e8f2ff; color: var(--blue); font-weight: 800; }
.shift-input { min-height: 36px; font-size: 13px; font-weight: 800; padding: 0 8px; }
.shift-select { padding-right: 26px; }
.schedule-hint { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.person-schedule { margin-top: 16px; overflow-x: auto; padding: 18px; }
.person-schedule-head { display: flex; gap: 14px; align-items: start; justify-content: space-between; margin-bottom: 16px; }
.person-schedule-head h3 { margin: 0 0 6px; font-size: 24px; }
.person-schedule-head span { color: var(--muted); }
.person-schedule-head button { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--green-dark); font-weight: 800; padding: 0 12px; }
.bulk-schedule-panel {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(241,243,236,.95);
  padding: 14px;
}
.bulk-schedule-panel p { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.bulk-schedule-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bulk-schedule-controls select { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 0 12px; font-weight: 700; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); min-width: 760px; gap: 8px; }
.month-weekday { display: grid; min-height: 34px; place-items: center; border-radius: 8px; background: var(--green-dark); color: #fff; font-size: 12px; font-weight: 900; }
.month-cell { display: grid; min-height: 76px; align-content: space-between; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 9px; }
.month-cell[data-select-day] { cursor: pointer; }
.month-cell.selected { border-color: var(--green-dark); box-shadow: inset 0 0 0 2px rgba(47,111,78,.3); background: #edf6ef; }
.month-cell span { color: var(--muted); font-size: 12px; font-weight: 800; }
.month-cell strong { font-size: 13px; line-height: 1.2; }
.month-cell.empty { border-style: dashed; background: rgba(238,243,236,.55); }
.swap-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.swap-form h3 { font-size: 22px; }
.swap-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.swap-form input:disabled, .swap-form select:disabled, .swap-form button:disabled {
  cursor: not-allowed;
  opacity: .58;
}
.request-list {
  display: grid;
  gap: 12px;
}
.request-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}
.notification-read { opacity: .82; }
.notification-unread { border-color: rgba(47,111,78,.28); }
.request-card-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}
.request-card-head h3 { margin-top: 8px; font-size: 22px; }
.request-card-head time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.request-swap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.request-swap div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.request-swap span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.request-swap strong { font-size: 16px; }
.request-swap em {
  color: var(--green-dark);
  font-style: normal;
  font-weight: 900;
}
.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-card { gap: 16px; }
.task-description {
  color: var(--text);
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.task-description a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.task-edit-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf7;
  padding: 14px;
}
.task-edit-form textarea {
  min-height: 180px;
  white-space: pre-wrap;
}
.task-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}
.task-completion {
  display: grid;
  gap: 6px;
}
.task-completion p {
  margin: 0;
  color: var(--green-dark);
}
.task-files {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.task-files a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.task-form-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.empty-state.compact { padding: 8px 0 0; }
.task-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  font-weight: 700;
}
.task-assignees {
  display: grid;
  gap: 10px;
}
.task-assignees-title {
  margin: 0;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
}
.task-assignees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.task-assignees-hint, .muted-inline {
  color: var(--muted);
  font-size: 13px;
}
.file-link-button {
  text-decoration: none;
}
.mobile-home-menu { display: none; }
.employee-card { display: grid; gap: 18px; padding: 18px; }
.employee-card h3 { margin: 6px 0; font-size: 20px; line-height: 1.18; }
.employee-card p { margin: 0; color: var(--muted); }
.employee-card dl { display: grid; gap: 10px; margin: 0; }
.employee-card dl div { display: grid; gap: 2px; }
.employee-card dd { margin: 0; overflow-wrap: anywhere; }
.employee-card a { color: var(--blue); font-weight: 700; }
.passwords-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.passwords-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) minmax(140px, .8fr) minmax(220px, 1fr);
  min-width: 860px;
}
.passwords-row > span {
  display: grid;
  min-height: 58px;
  align-content: center;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px 12px;
  overflow-wrap: anywhere;
}
.passwords-head > span {
  min-height: 44px;
  background: var(--green-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.passwords-row a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.password-input {
  min-height: 38px;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
}
.users-layout {
  display: grid;
  gap: 16px;
}
.user-create-form, .users-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 26px rgba(31,79,56,.08);
}
.user-create-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}
.user-create-form h3 { margin-bottom: 4px; font-size: 22px; }
.user-create-form label, .user-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.user-create-form input, .user-create-form select, .user-password-input, .user-card input, .user-card select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--foreground);
  outline: none;
  padding: 0 12px;
}
.user-create-form input:focus, .user-create-form select:focus, .user-password-input:focus, .user-card input:focus, .user-card select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47,111,78,.14);
}
.users-table {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.user-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
.user-card-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}
.user-card-head h3 { margin: 0; font-size: 20px; line-height: 1.2; }
.user-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.user-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}
.user-password-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}
.password-ready, .password-missing {
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.password-ready { color: var(--green-dark); }
.password-missing { color: var(--rose); }
.small-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf6ef;
  color: var(--green-dark);
  font-weight: 900;
  padding: 0 10px;
}
.emergency-layout {
  display: grid;
  grid-template-columns: minmax(320px, .85fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: start;
}
.emergency-panel { padding: 18px; }
.emergency-panel h3 { margin-bottom: 14px; font-size: 22px; }
.emergency-form { display: grid; gap: 12px; }
.emergency-form label, .status-select {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.emergency-message {
  margin: 12px 0 0;
  border: 1px solid rgba(47,111,78,.24);
  border-radius: 8px;
  background: #edf6ef;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  padding: 10px 12px;
}
.emergency-list-head {
  display: grid;
  gap: 10px;
}
.emergency-list-head .chip-row { margin-bottom: 4px; }
.emergency-admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.emergency-admin-tools button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  padding: 0 12px;
}
.selection-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.emergency-list { display: grid; gap: 12px; }
.emergency-card { display: grid; gap: 12px; padding: 14px; }
.emergency-card-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}
.emergency-card-head h3 { margin: 8px 0 4px; font-size: 20px; }
.emergency-card-head p, .emergency-card-head time, .emergency-no-photo { margin: 0; color: var(--muted); font-size: 13px; }
.emergency-card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.emergency-pick {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 0 9px;
}
.emergency-pick input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}
.status-pill {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  padding: 0 9px;
}
.status-pill.new { background: #fff5d7; color: #7b5a06; }
.status-pill.accepted { background: #e8f2ff; color: var(--blue); }
.status-pill.done { background: #edf6ef; color: var(--green-dark); }
.status-pill.rejected { background: #fff5f5; color: var(--rose); }
.emergency-description { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.emergency-comment {
  margin: 0;
  border: 1px solid rgba(39,90,130,.18);
  border-radius: 8px;
  background: #e8f2ff;
  color: var(--blue);
  line-height: 1.45;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}
.emergency-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.emergency-photos a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.danger-button {
  min-height: 40px;
  border: 1px solid rgba(184,91,91,.32);
  border-radius: 8px;
  background: #fff5f5;
  color: var(--rose);
  font-weight: 900;
  padding: 0 12px;
}
.ai-layout { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(280px,.9fr); gap: 16px; }
.ai-panel, .ai-roadmap { padding: 24px; }
.ai-panel p, .ai-roadmap li { color: var(--muted); line-height: 1.55; }
.ai-roadmap h3 { margin-top: 0; }
.ai-roadmap ul { display: grid; gap: 12px; margin: 0; padding-left: 20px; }
.mobile-nav { display: none; }
.loading, .empty-state { color: var(--muted); padding: 24px; }

@media (max-width: 980px) {
  .app-shell { display: block; padding-bottom: 96px; }
  .sidebar { display: none; }
  .workspace { padding: 18px; }
  .topbar, .status-grid, .link-grid, .employee-grid, .ai-layout, .emergency-layout, .users-layout, .request-swap { grid-template-columns: 1fr; }
  .user-profile-grid, .user-password-row { grid-template-columns: 1fr; }
  .user-card-head { display: grid; }
  .link-admin-card { grid-template-columns: 1fr; }
  .topbar-actions { justify-content: flex-start; }
  .push-panel { flex-direction: column; align-items: stretch; }
  .push-actions { width: 100%; }
  .push-actions button { width: 100%; }
  .today-workers-head { align-items: stretch; flex-direction: column; }
  .today-workers-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .legend { justify-content: flex-start; }
  .week-controls { grid-template-columns: 1fr 1fr; }
  .week-tabs { grid-column: 1 / -1; grid-row: 1; }
  .schedule-row { grid-template-columns: 220px repeat(var(--days-count,7), minmax(86px,1fr)); min-width: 740px; }
  .mobile-nav {
    position: fixed;
    z-index: 20;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--shadow);
    padding: 8px;
    backdrop-filter: blur(18px);
  }
  .mobile-nav button {
    position: relative;
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 44px;
    min-width: 0;
    padding: 6px 4px;
    text-align: center;
    white-space: normal;
  }
  .mobile-nav button span { font-size: 18px; line-height: 1; }
  .mobile-nav button small { font-size: 11px; font-weight: 800; }
  .mobile-nav .home-button {
    background: var(--green);
    color: #fff;
    box-shadow: 0 10px 22px rgba(31,79,56,.22);
  }
  .mobile-nav button strong {
    position: absolute;
    top: 2px;
    right: 8px;
    min-width: 19px;
    border-radius: 999px;
    background: var(--rose);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
  }
  .mobile-home-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
  }
  .mobile-home-menu button {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr);
    gap: 10px;
    align-items: center;
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.94);
    color: var(--foreground);
    padding: 10px;
    text-align: left;
    box-shadow: 0 8px 20px rgba(31,79,56,.07);
  }
  .mobile-home-menu button span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--green-dark);
    font-weight: 900;
  }
  .mobile-home-menu button strong {
    min-width: 0;
    font-size: 14px;
    line-height: 1.15;
  }
}

@media (max-width: 560px) {
  .login-panel { padding: 22px; }
  .workspace { padding: 14px; }
  .topbar h1 { font-size: 34px; }
  .status-grid { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .status-grid div { padding: 12px; }
  .status-grid strong { font-size: 26px; }
  .link-card { min-height: 150px; }
  .person-schedule-head { flex-direction: column; }
  .bulk-schedule-panel { flex-direction: column; align-items: stretch; }
  .bulk-schedule-controls { flex-direction: column; align-items: stretch; }
  .task-form-head { align-items: stretch; flex-direction: column; }
  .phone-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .emergency-card-head { flex-direction: column; }
}
