:root {
  --bg: #eef5f7;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #dbe5ea;
  --primary: #00a38c;
  --primary-dark: #007b6d;
  --accent: #f05d5e;
  --blue: #2779ff;
  --amber: #f5a524;
  --soft: #e7fbf7;
  --warning: #a16207;
  --good: #00875a;
  --shadow: 0 20px 55px rgba(22, 34, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(0, 163, 140, 0.18), transparent 30vw),
    linear-gradient(135deg, #f7fbff 0%, var(--bg) 48%, #fff7ea 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(0, 163, 140, 0.2), transparent 32vw),
    linear-gradient(135deg, #f7fbff 0%, var(--bg) 54%, #fff7ea 100%);
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-brand h1 {
  color: var(--ink);
}

.login-brand p {
  color: var(--muted);
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 5px;
  background: #f8fafc;
}

.login-role-btn {
  min-height: 40px;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.login-role-btn.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(0, 163, 140, 0.18);
}

.login-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px;
  background: linear-gradient(180deg, #102335 0%, #0d3740 58%, #09312d 100%);
  color: #fff;
  box-shadow: 18px 0 60px rgba(16, 35, 53, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8d66d, #29d3b4);
  color: #102335;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(41, 211, 180, 0.22);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  stroke-width: 2.2;
}

.brand h1,
.brand p,
.panel-title h3,
.panel-title p,
.topbar h2,
.topbar p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p {
  color: #b8c1ce;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.08);
}

.role-btn {
  min-height: 36px;
  border-radius: 10px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 800;
}

.role-btn.active {
  background: #fff;
  color: var(--primary-dark);
}

.current-user-box {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.current-user-box span {
  color: #b8c1ce;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.current-user-box strong {
  color: #fff;
  line-height: 1.25;
}

.logout-btn {
  min-height: 34px;
  border-radius: 10px;
  color: #102335;
  background: #fff;
  font-weight: 900;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px;
  border-radius: 14px;
  background: transparent;
  color: #d6dde7;
  text-align: left;
  font-weight: 750;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.nav-item:hover {
  transform: translateX(3px);
}

.icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.nav-item.active .icon {
  background: #fff;
  color: var(--primary-dark);
}

.month-box {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.month-box label {
  color: #cbd5e1;
  font-size: 13px;
}

.month-box input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main {
  padding: 30px;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 32px;
  letter-spacing: 0;
}

.top-actions,
.button-row,
.admin-toolbar,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.row-actions {
  align-items: center;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 14px;
  padding: 0 15px;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary {
  background: linear-gradient(135deg, var(--primary), #20c7a8);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 163, 140, 0.22);
}

.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover {
  border-color: #b8c7d4;
  transform: translateY(-1px);
}

.icon-btn {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.icon-btn.active {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--soft);
}

.table-actions {
  justify-content: flex-end;
  margin: -6px 0 10px;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-transform: inherit;
}

.sort-btn::after {
  content: "↕";
  color: #98a2b3;
  font-size: 11px;
}

.sort-btn.active::after {
  content: "↓";
  color: var(--primary-dark);
}

.pancake-id {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.pancake-id.hidden {
  display: none;
}

.view {
  display: none;
}

.hidden {
  display: none !important;
}

.view.active {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  gap: 18px;
  min-width: 0;
}

.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel {
  padding: 22px;
}

.panel-title {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.panel-title h3 {
  font-size: 19px;
}

.panel-title p {
  color: var(--muted);
  font-size: 14px;
}

.form-grid,
.kpi-grid,
.settings-grid,
.levels {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  min-width: 0;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.settings-grid,
.levels {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  min-width: 0;
}

.schedule-day,
.need-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.check-row input {
  width: 16px;
  min-height: 16px;
}

.compact-check {
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.25;
}

.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  max-width: 360px;
  padding-top: 8px;
}

.muted-permissions {
  opacity: 0.55;
}

.setting-check {
  align-content: center;
  grid-template-columns: auto 1fr;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
}

.needs-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  min-width: 0;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.mono-id {
  color: #344054;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  word-break: break-all;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 0 12px;
  color: #b42318;
  background: #fff1f1;
  font-size: 12px;
  font-weight: 900;
}

.danger-button:hover {
  background: #ffe4e4;
}

.roster-list {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.roster-list strong {
  color: #344054;
  font-size: 12px;
}

.roster-list span {
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 107, 95, 0.14);
}

.employee-select-native {
  display: none;
}

.employee-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-select-button::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.employee-select-button:hover,
.employee-select-button:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 107, 95, 0.14);
}

textarea {
  resize: vertical;
}

.wide-field {
  margin-bottom: 18px;
}

.summary-panel {
  align-content: start;
}

.metric-stack {
  display: grid;
  gap: 10px;
}

.metric-stack div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--soft), #f7fbff);
  padding: 12px;
}

.metric-stack span,
.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-stack strong,
.stat-card strong {
  font-size: 18px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  overflow-wrap: anywhere;
}

th {
  color: #536175;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge.good {
  background: #dffaf0;
  color: var(--good);
}

.badge.warn {
  background: #fff1d1;
  color: var(--warning);
}

.badge.bad {
  background: #ffe6e6;
  color: var(--accent);
}

.mini-actions {
  margin-top: 4px;
}

.muted-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.inline-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.stat-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: #f8fafc;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.inline-stats strong {
  color: var(--ink);
}

.hidden-pages-panel {
  margin-bottom: 12px;
}

.mini-table {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}

.mini-table-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 180px) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.today-cell {
  background: #fff8db;
  box-shadow: inset 4px 0 0 #f7c948;
}

.schedule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 170px;
}

.schedule-list.compact {
  margin-top: 8px;
}

.shift-note {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-person {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border-left: 4px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #f8fafc;
  max-width: 100%;
}

.schedule-person.approved {
  border-left-color: var(--good);
  background: #effcf8;
}

.schedule-person.pending {
  border-left-color: #f7b955;
  background: #fff8e8;
}

.schedule-person.rejected {
  border-left-color: var(--accent);
  background: #fff1f1;
}

.schedule-person.off {
  border-left-color: #8a94a6;
  background: #eef2f7;
  opacity: 0.86;
}

.schedule-person small {
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.schedule-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.add-shift-btn {
  border: 1px dashed var(--primary);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--primary-dark);
  background: #effcf8;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.formula-notes {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: var(--muted);
  background: #f8fafc;
}

.formula-notes p {
  margin: 0;
  line-height: 1.5;
}

.metric-notes {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
}

.metric-notes strong {
  color: var(--ink);
  font-size: 14px;
}

.metric-notes p {
  margin: 0;
  line-height: 1.45;
}

.metric-notes b {
  color: #344054;
}

.schedule-panel {
  border-width: 2px;
}

.schedule-panel-next {
  background: #fffdf5;
  border-color: #f7d47b;
}

.schedule-panel-current {
  background: #f4fffb;
  border-color: #8ddfc9;
}

.schedule-panel-next .panel-title,
.schedule-panel-current .panel-title {
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.dashboard-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  min-width: 0;
}

.dashboard-strip article {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: radial-gradient(circle at top right, rgba(0, 163, 140, 0.16), transparent 34%), linear-gradient(180deg, #ffffff, #f5fffb);
  box-shadow: var(--shadow);
  min-width: 0;
}

.dashboard-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-strip strong {
  font-size: 28px;
}

.dashboard-strip small {
  color: var(--muted);
  line-height: 1.4;
}

.reward-milestones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reward-milestones b {
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--primary-dark);
  background: #e7fbf7;
  font-size: 11px;
}

@media (max-width: 760px) {
  .mini-table-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-stats {
    gap: 8px;
  }

  .dashboard-strip {
    grid-template-columns: 1fr;
  }

  .inline-stats span,
  .stat-pill {
    width: 100%;
    justify-content: space-between;
  }

  .work-grid,
  .report-cards,
  .form-grid,
  .kpi-grid,
  .settings-grid,
  .levels,
  .schedule-grid,
  .needs-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel {
    padding: 16px;
  }
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--primary-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  min-width: 0;
}

.stat-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -26px;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: rgba(0, 163, 140, 0.12);
}

.stat-card strong {
  font-size: 28px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-panel {
  width: min(680px, 100%);
  max-height: min(760px, 88vh);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3,
.modal-head p {
  margin: 0;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 20px;
  line-height: 1;
}

.employee-picker-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.employee-picker-search {
  width: calc(100% - 36px);
  margin: 14px 18px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

.employee-picker-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 163, 140, 0.14);
}

.employee-picker-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding: 0 18px 18px;
}

.employee-picker-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--ink);
  background: #f8fafc;
  text-align: left;
}

.employee-picker-row:hover:not(:disabled) {
  border-color: var(--primary);
  background: #effcf8;
}

.employee-picker-row span {
  display: grid;
  gap: 3px;
}

.employee-picker-row small {
  color: var(--muted);
  font-size: 12px;
}

.employee-picker-row em {
  color: var(--primary-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.employee-picker-row.disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.employee-picker-row.selected {
  border-color: var(--primary);
  background: #effcf8;
  box-shadow: inset 4px 0 0 var(--primary);
}

.empty-picker {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.encouragement-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.encouragement-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px;
}

.encouragement-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.encouragement-score {
  display: inline-grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #20c7a8);
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(0, 163, 140, 0.24);
}

.encouragement-milestones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.encouragement-milestones div,
.improvement-list {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}

.encouragement-milestones strong,
.improvement-list strong {
  color: var(--ink);
}

.encouragement-milestones span,
.encouragement-milestones small,
.improvement-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 12px 14px;
  transition: 0.2s ease;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.json-output {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    z-index: 20;
    position: static;
    gap: 14px;
    padding: 14px;
    border-radius: 0 0 22px 22px;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .role-switch {
    max-width: 360px;
    width: 100%;
    margin: 0;
  }

  .current-user-box {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .current-user-box span {
    grid-column: 1 / -1;
  }

  .logout-btn {
    min-width: 112px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .nav-item .icon {
    width: 30px;
    height: 30px;
  }

  .month-box {
    margin-top: 0;
  }

  .month-box input {
    max-width: 240px;
    margin: 0 auto;
  }

  .main {
    padding: 18px;
  }

  .work-grid,
  .form-grid,
  .kpi-grid,
  .settings-grid,
  .levels,
  .schedule-grid,
  .needs-grid,
  .report-cards {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }

  .top-actions,
  .button-row,
  .admin-toolbar {
    align-items: stretch;
    width: 100%;
  }

  .primary,
  .secondary {
    flex: 1 1 180px;
  }

  .panel {
    padding: 18px;
  }

  table {
    min-width: 680px;
  }
}

@media (max-width: 640px) {
  body {
    background: #f3f8f8;
  }

  .main,
  .sidebar {
    padding: 12px;
  }

  .app-shell {
    display: block;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand h1 {
    font-size: 17px;
  }

  .brand p {
    font-size: 12px;
  }

  .role-btn {
    min-height: 34px;
  }

  .current-user-box {
    grid-template-columns: 1fr;
  }

  .logout-btn {
    width: 100%;
  }

  .nav-item span:last-child {
    font-size: 12px;
  }

  .nav-item {
    max-width: 170px;
    white-space: normal;
  }

  .month-box {
    display: none;
  }

  .topbar h2 {
    font-size: 23px;
    line-height: 1.15;
  }

  .eyebrow {
    font-size: 11px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-strip {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .dashboard-strip article,
  .stat-card,
  .panel {
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(22, 34, 51, 0.08);
  }

  .dashboard-strip article {
    padding: 14px;
  }

  .dashboard-strip strong,
  .stat-card strong {
    font-size: 24px;
  }

  .panel-title {
    margin-bottom: 14px;
  }

  .panel-title h3 {
    font-size: 18px;
  }

  .form-grid,
  .kpi-grid,
  .settings-grid,
  .levels {
    gap: 10px;
    margin-bottom: 14px;
    grid-template-columns: minmax(0, 1fr);
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary,
  .secondary {
    width: 100%;
    min-height: 44px;
  }

  .table-wrap {
    margin-inline: -8px;
    padding-inline: 8px;
    border-radius: 10px;
  }

  table {
    min-width: 560px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .schedule-list {
    min-width: 0;
  }

  .roster-list {
    min-width: 0;
  }

  .schedule-person {
    width: 100%;
    justify-content: space-between;
  }

  .mini-table,
  .metric-stack div {
    border-radius: 13px;
  }

  .modal {
    align-items: end;
    padding: 10px;
  }

  .modal-panel {
    width: 100%;
    max-height: 86vh;
    border-radius: 16px;
  }

  .employee-picker-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .encouragement-milestones {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .login-screen {
    padding: 12px;
  }

  .login-card {
    border-radius: 18px;
    padding: 16px;
  }

  .sidebar {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .topbar h2 {
    font-size: 21px;
  }

  .dashboard-strip strong,
  .stat-card strong {
    font-size: 22px;
  }

  .panel {
    padding: 14px;
  }

  table {
    min-width: 500px;
  }

  .json-output {
    font-size: 12px;
  }
}
