:root {
  --primary: #365f5b;
  --primary-strong: #24433f;
  --primary-soft: #e7efed;
  --accent: #b88746;
  --bg: #f7f6f2;
  --surface: #fbfaf7;
  --card: rgba(255, 255, 255, 0.88);
  --text: #20231f;
  --muted: #6f746d;
  --faint: #92988f;
  --border: rgba(32, 35, 31, 0.1);
  --border-strong: rgba(32, 35, 31, 0.16);
  --ok: #25745b;
  --warn: #a8661f;
  --danger: #b23b35;
  --blue: #3f647a;
  --shadow-sm: 0 1px 2px rgba(32, 35, 31, 0.04), 0 10px 30px rgba(32, 35, 31, 0.05);
  --shadow-lg: 0 24px 70px rgba(32, 35, 31, 0.16);
  --radius: 8px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.56), rgba(255,255,255,0) 260px),
    radial-gradient(circle at 50% -160px, rgba(184, 135, 70, 0.12), transparent 340px),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.48;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--primary-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button {
  min-height: 36px;
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  font-family: inherit;
  letter-spacing: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 9px 20px rgba(36, 67, 63, 0.12);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

button:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

button.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,0.65) inset;
}

button.secondary:hover {
  background: #fff;
  border-color: rgba(32, 35, 31, 0.22);
}

button.danger {
  background: var(--danger);
  box-shadow: 0 9px 20px rgba(178, 59, 53, 0.13);
}

button.warn {
  background: var(--warn);
  box-shadow: 0 9px 20px rgba(168, 102, 31, 0.13);
}

button.small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(54, 95, 91, 0.5);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(54, 95, 91, 0.12);
}

input[type="color"] {
  padding: 4px;
}

label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0 4px;
  font-weight: 650;
  text-transform: uppercase;
}

code {
  color: var(--primary-strong);
  background: rgba(54, 95, 91, 0.08);
  border: 1px solid rgba(54, 95, 91, 0.12);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12px;
}

/* Layout */
#app { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  background: rgba(251, 250, 247, 0.88);
  color: var(--text);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.topbar .brand {
  font-weight: 720;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .brand img {
  height: 30px;
  max-width: 120px;
  object-fit: contain;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--primary-strong);
  background: linear-gradient(180deg, #fff, var(--primary-soft));
  border: 1px solid rgba(54, 95, 91, 0.18);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
}

.topbar .right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.topbar .right b {
  color: var(--text);
  font-weight: 650;
}

.topbar .bell {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 650;
}

.support-banner {
  position: sticky;
  top: 58px;
  z-index: 25;
  padding: 9px 24px;
  border-bottom: 1px solid rgba(168, 102, 31, 0.18);
  background: rgba(255, 247, 235, 0.92);
  color: #754611;
  font-size: 12px;
  font-weight: 650;
  backdrop-filter: blur(14px);
}

.topbar .bell:hover {
  background: #fff;
  border-color: var(--border-strong);
}

.topbar .bell .badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--surface);
  border-radius: 999px;
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-weight: 700;
  text-align: center;
  line-height: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 58px;
  width: 224px;
  align-self: start;
  min-height: calc(100vh - 58px);
  padding: 18px 12px;
  border-right: 1px solid var(--border);
  background: rgba(251, 250, 247, 0.58);
  backdrop-filter: blur(14px);
}

.sidebar a {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 3px;
  padding: 7px 10px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 560;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
}

.sidebar a.active {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--border);
  color: var(--primary-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,0.72) inset;
}

.content {
  flex: 1;
  width: min(1180px, 100%);
  padding: 34px 34px 72px;
}

/* Cards & tables */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

h1 {
  font-size: 24px;
  line-height: 1.16;
  margin: 0 0 6px;
  font-weight: 720;
}

h2 {
  font-size: 16px;
  line-height: 1.24;
  margin: 0 0 12px;
  font-weight: 690;
}

.sub {
  color: var(--muted);
  margin: 0 0 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.stat {
  position: relative;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat::before {
  content: "";
  display: block;
  width: 30px;
  height: 2px;
  margin-bottom: 13px;
  background: var(--accent);
  opacity: .78;
}

.stat .n {
  font-size: 29px;
  line-height: 1;
  font-weight: 720;
  color: var(--text);
}

.stat .l {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 650;
}

.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dash-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 720;
  text-transform: uppercase;
}

.dash-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.metric-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 20px rgba(32, 35, 31, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: fade-slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.metric-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 30px rgba(32, 35, 31, 0.1);
  border-color: rgba(255, 255, 255, 1);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary-soft), var(--primary));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.metric-card:hover::before {
  opacity: 1;
}

.metric-card.prime {
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(240, 248, 246, 0.8) 100%);
  border-color: rgba(54, 95, 91, 0.25);
}
.metric-card.prime::before {
  background: linear-gradient(90deg, #365f5b, #4ca195);
  opacity: 1;
}

.metric-card.warn {
  border-color: rgba(168, 102, 31, 0.25);
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(253, 245, 235, 0.8));
}
.metric-card.warn::before {
  background: linear-gradient(90deg, #a8661f, #f09a3e);
  opacity: 1;
}

.metric-card.good {
  border-color: rgba(37, 116, 91, 0.2);
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(239, 253, 247, 0.8));
}
.metric-card.good::before {
  background: linear-gradient(90deg, #25745b, #3bc297);
  opacity: 1;
}

@keyframes fade-slide-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(63, 100, 122, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(63, 100, 122, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(63, 100, 122, 0); }
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-primary {
  margin-top: 10px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  font-weight: 740;
}

.metric-note {
  font-size: 13px;
  color: var(--muted);
}

.pricing-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(32, 35, 31, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 30px rgba(32, 35, 31, 0.1);
  border-color: rgba(255, 255, 255, 1);
}

.pricing-card.pro {
  border: 2px solid var(--primary-strong);
  box-shadow: 0 8px 30px rgba(54, 95, 91, 0.15), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--primary-strong);
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(54, 95, 91, 0.3);
}

.dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 18px;
}

.action-panel {
  min-height: 100%;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head p {
  margin: 3px 0 0;
  font-size: 13px;
}

.insight-list,
.quiet-list {
  display: grid;
  gap: 10px;
}

.insight-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.insight-item[data-go]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(32, 35, 31, 0.08);
  background: rgba(255, 255, 255, 1);
}

.insight-item b {
  font-size: 13px;
}

.insight-item span {
  color: var(--muted);
  font-size: 13px;
}

.insight-item.good {
  border-color: rgba(37, 116, 91, 0.14);
}

.insight-item.warn {
  border-color: rgba(168, 102, 31, 0.18);
  background: rgba(168, 102, 31, 0.055);
}

.progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 35, 31, 0.08);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.quiet-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s ease;
}
.quiet-row[data-go]:hover {
  background: rgba(32, 35, 31, 0.03);
}

.quiet-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.quiet-row:first-child {
  padding-top: 0;
}

.quiet-row b,
.quiet-row span {
  display: block;
}

.quiet-row b {
  font-size: 13px;
  font-weight: 680;
}

.quiet-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.quiet-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  flex: 0 0 auto;
  text-align: right;
}

.quiet-meta span {
  margin-top: 0;
  white-space: nowrap;
}

.quiet-list.compact {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  column-gap: 20px;
}

.action-strip {
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(54, 95, 91, 0.035);
}

.premium-table th, .premium-table td {
  vertical-align: middle;
}

.premium-table tbody tr {
  transition: background 0.2s ease, transform 0.2s ease;
}

.row-actions-hover button {
  opacity: 0.3;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.premium-table tbody tr:hover .row-actions-hover button {
  opacity: 1;
}

.premium-table tbody tr:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 15px rgba(32, 35, 31, 0.05);
  transform: translateY(-1px);
}

th {
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  border: 1px solid transparent;
  line-height: 1.2;
}

.tag.gray { background: rgba(111, 116, 109, 0.09); color: #596058; border-color: rgba(111, 116, 109, 0.1); }
.tag.green { background: rgba(37, 116, 91, 0.1); color: var(--ok); border-color: rgba(37, 116, 91, 0.12); }
.tag.amber { background: rgba(168, 102, 31, 0.11); color: var(--warn); border-color: rgba(168, 102, 31, 0.14); }
.tag.red { background: rgba(178, 59, 53, 0.1); color: var(--danger); border-color: rgba(178, 59, 53, 0.14); }
.tag.blue { background: rgba(63, 100, 122, 0.1); color: var(--blue); border-color: rgba(63, 100, 122, 0.13); }

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.row > * {
  flex: 1;
  min-width: 160px;
}

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

/* Planner */
.planner-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.planner-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.planner-weekbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.planner-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.planner-tabs button {
  box-shadow: none;
}

.planner-tabs button.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.planner-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.planner-summary span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.planner-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
}

.planner-filters label {
  margin: 0;
}

.planner-filters select {
  margin-top: 4px;
}

.import-box input[type="file"] {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.62);
}

.import-preview {
  margin-top: 12px;
  max-height: 46vh;
  overflow: auto;
}

.planner-board {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

.planner-grid.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  min-width: 1180px;
}

.planner-day {
  min-height: 520px;
  border-right: 1px solid var(--border);
}

.planner-day:last-child {
  border-right: 0;
}

.planner-day-head,
.planner-head > div {
  min-height: 46px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(247, 246, 242, 0.82);
}

.planner-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.planner-day-head span,
.planner-resource span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.planner-stack,
.planner-cell {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.planner-matrix {
  min-width: 1180px;
}

.planner-employee-grid {
  min-width: 1280px;
}

.planner-employee-header,
.planner-employee-row {
  display: grid;
  grid-template-columns: 300px repeat(7, minmax(150px, 1fr));
}

.planner-employee-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.planner-demand-title {
  padding: 12px;
  border-right: 1px solid var(--border);
  background: rgba(247, 246, 242, 0.86);
}

.planner-demand-title select {
  min-height: 36px;
  text-transform: uppercase;
  font-weight: 720;
}

.planner-resource-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.planner-resource-tabs span {
  padding: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.68);
  border-right: 1px solid var(--border);
}

.planner-resource-tabs span:last-child {
  border-right: 0;
}

.planner-resource-tabs .active {
  color: var(--primary-strong);
  background: #fff;
}

.planner-date-head {
  min-height: 74px;
  padding: 14px 12px;
  border-right: 1px solid var(--border);
  background: rgba(247, 246, 242, 0.86);
}

.planner-date-head b,
.planner-date-head span {
  display: block;
}

.planner-date-head span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.planner-employee-row {
  border-bottom: 1px solid var(--border);
}

.planner-employee-row.demand {
  background: rgba(250, 252, 253, 0.66);
}

.planner-employee-row.totals {
  position: sticky;
  bottom: 0;
  background: rgba(247, 246, 242, 0.94);
  box-shadow: 0 -8px 24px rgba(32, 35, 31, 0.06);
}

.planner-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  padding: 12px;
  border-right: 1px solid var(--border);
  background: rgba(247, 246, 242, 0.54);
}

.planner-person b,
.planner-person small {
  display: block;
}

.planner-person small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #202936;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.avatar.free {
  background: #b83368;
  font-size: 18px;
}

.planner-total {
  min-height: 58px;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  color: var(--text);
  font-weight: 720;
  text-align: center;
}

button.published {
  color: #1e6b43;
  border-color: rgba(30, 107, 67, 0.18);
  background: rgba(226, 241, 232, 0.92);
}

button.published.active {
  color: #fff;
  background: #25745b;
  border-color: #25745b;
}

.planner-row {
  display: grid;
  grid-template-columns: 190px repeat(7, minmax(140px, 1fr));
  border-bottom: 1px solid var(--border);
}

.planner-row:last-child {
  border-bottom: 0;
}

.planner-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-transform: uppercase;
}

.planner-resource {
  min-height: 128px;
  padding: 12px;
  border-right: 1px solid var(--border);
  background: rgba(247, 246, 242, 0.54);
}

.planner-resource b {
  display: block;
  margin-bottom: 3px;
}

.planner-cell {
  min-height: 128px;
  border-right: 1px solid var(--border);
}

.planner-cell:last-child {
  border-right: 0;
}

.shift-block {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(63, 100, 122, 0.18);
  border-left-width: 3px;
  border-radius: 7px;
  background: rgba(240, 246, 249, 0.86);
  font-size: 12px;
}

.shift-block.good {
  border-color: rgba(37, 116, 91, 0.18);
  border-left-color: var(--ok);
  background: rgba(231, 239, 237, 0.9);
}

.shift-block.warn {
  border-color: rgba(168, 102, 31, 0.18);
  border-left-color: var(--warn);
  background: rgba(250, 242, 232, 0.92);
}

.shift-block.open {
  border-left-color: var(--blue);
}

.shift-block b {
  font-size: 13px;
}

.shift-block span,
.shift-block small,
.shift-time {
  color: var(--muted);
}

.shift-block button {
  justify-self: start;
  margin-top: 3px;
}

.muted { color: var(--muted); }
.geo-detail { font-size: 11px; margin: 5px 0 0; }

/* Login */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 34px 16px;
}

.login-box {
  width: min(100%, 430px);
}

.login-card {
  padding: 28px;
}

.login-box h1 {
  margin-top: 22px;
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-card .sub {
  max-width: 34rem;
  margin-bottom: 22px;
  font-size: 14px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 720;
}

.tenant-login-detail {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.tenant-login-detail summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  list-style-position: outside;
}

.tenant-login-detail label {
  margin-top: 10px;
}

.login-submit {
  min-height: 42px;
}

.login-link {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
}

.login-link.secondary-line {
  margin-top: 8px;
  color: var(--muted);
}

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

.tabbtns button {
  min-height: 34px;
  font-size: 12px;
  padding: 7px 8px;
  white-space: normal;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.legal-links a {
  color: var(--muted);
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(32, 35, 31, .34);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  width: 480px;
  max-height: 88vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}

.modal h2 { margin-bottom: 14px; }

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 16px;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  font-weight: 650;
}

.onboarding-step b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 11px;
}

.onboarding-step.active {
  border-color: rgba(54, 95, 91, 0.22);
  color: var(--text);
  background: rgba(54, 95, 91, 0.07);
}

.onboarding-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.onboarding-section h3,
.onboarding-done h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.onboarding-section p,
.onboarding-done p {
  margin: 0 0 8px;
}

.onboarding-section.quiet {
  padding-bottom: 0;
}

.setup-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 320px) auto;
  align-items: center;
  gap: 20px;
  margin: 0 0 24px;
  padding: 18px 20px;
  border: 1px solid rgba(54, 95, 91, 0.22);
  border-radius: var(--radius);
  background: rgba(54, 95, 91, 0.055);
  cursor: pointer;
}

.setup-banner b { display: block; margin: 2px 0 3px; font-size: 16px; }
.setup-banner p { margin: 0; color: var(--muted); font-size: 13px; }
.setup-kicker { color: var(--primary-strong); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.setup-progress, .onboarding-progress { height: 6px; overflow: hidden; border-radius: 3px; background: rgba(32, 35, 31, 0.1); }
.setup-progress span, .onboarding-progress span { display: block; height: 100%; background: var(--primary); }
.onboarding-hero { align-items: flex-end; }
.onboarding-score { text-align: right; }
.onboarding-score b { display: block; color: var(--primary-strong); font-size: 32px; line-height: 1; }
.onboarding-score span { color: var(--muted); font-size: 13px; }
.onboarding-progress { height: 8px; margin: 4px 0 28px; }
.onboarding-checklist { border-top: 1px solid var(--border); }
.onboarding-task {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--border);
}
.onboarding-task-number { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--muted); font-size: 12px; font-weight: 750; }
.onboarding-task.complete .onboarding-task-number { border-color: rgba(36, 117, 91, 0.28); background: var(--ok-soft); color: var(--ok); }
.onboarding-task-copy h2 { margin: 0 0 3px; font-size: 16px; }
.onboarding-task-copy p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.onboarding-task-copy span { color: var(--text); font-size: 12px; font-weight: 650; }
.setup-complete { margin-top: 28px; padding: 18px 0; border-top: 1px solid var(--border); }
.setup-complete p { margin: 4px 0 14px; color: var(--muted); }

@media (max-width: 760px) {
  .setup-banner { grid-template-columns: 1fr; gap: 12px; }
  .onboarding-task { grid-template-columns: 30px minmax(0, 1fr); }
  .onboarding-task button { grid-column: 2; justify-self: start; }
}

.close-x {
  float: right;
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.close-x:hover { color: var(--text); }

/* Notifications dropdown */
.notif-panel {
  position: absolute;
  right: 24px;
  top: 64px;
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  max-height: 70vh;
  overflow: auto;
}

.notif-item {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.notif-item.unread {
  background: rgba(54, 95, 91, 0.07);
}

.notif-item .t {
  font-weight: 680;
  font-size: 13px;
}

.notif-item .b {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.notif-actions {
  display: flex;
  gap: 8px;
  padding: 10px;
  flex-wrap: wrap;
}

.install-btn[hidden] { display: none; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #242721;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  z-index: 100;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  box-shadow: var(--shadow-lg);
}

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

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

.warnbox {
  background: rgba(168, 102, 31, 0.1);
  border: 1px solid rgba(168, 102, 31, 0.18);
  border-radius: var(--radius);
  padding: 11px;
  font-size: 13px;
  margin: 10px 0;
  color: #754611;
}

.shift-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.shift-detail {
  display: grid;
  gap: 16px;
}

.shift-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.shift-detail-head h2 {
  margin: 0;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-grid h3,
.shift-detail h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.timesheet-summary {
  align-self: end;
  justify-content: flex-end;
}

.timesheet-table td {
  vertical-align: top;
}

.timesheet-table .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 190px;
}

.timesheet-table .muted {
  line-height: 1.45;
}

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

.communications-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.announcement-message {
  white-space: pre-wrap;
  line-height: 1.55;
}

.announcement-list {
  border-top: 1px solid var(--border);
}

.announcement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--border);
}

.announcement-row.unread {
  border-left: 2px solid var(--primary);
  padding-left: 16px;
}

.announcement-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.announcement-heading h2 {
  margin: 0;
  font-size: 17px;
}

.announcement-row p {
  margin: 8px 0;
}

.notice-inline {
  margin: 12px 0;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-soft);
  border-left: 2px solid var(--accent);
  font-size: 13px;
  line-height: 1.45;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
  font-size: 13px;
  font-weight: 600;
}

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

.leave-balance {
  justify-content: flex-start;
  margin: 0 0 16px;
}

.leave-balance span {
  min-width: 130px;
}

.leave-balance b {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 18px;
}

.payroll-toolbar {
  justify-content: flex-start;
  gap: 8px;
}

.payroll-toolbar strong {
  min-width: 64px;
  text-align: center;
  font-size: 16px;
}

.payroll-rules-summary {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.payroll-table .month-name {
  text-transform: capitalize;
}

.payroll-table .actions {
  min-width: 220px;
  justify-content: flex-end;
}

.profitability-metrics {
  margin-bottom: 18px;
}

.profitability-table th,
.profitability-table td {
  white-space: nowrap;
}

.positive-value {
  color: var(--ok);
}

.negative-value {
  color: var(--danger);
}

@media (max-width: 640px) {
  .form-grid.two-columns {
    grid-template-columns: 1fr;
  }

  .communications-layout {
    grid-template-columns: 1fr;
  }

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

.offline-page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.offline-page h1, .offline-page p { margin: 0; }

.legal-page { background: var(--bg); }

.legal-doc {
  width: min(860px, calc(100% - 32px));
  margin: 32px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.legal-doc section { margin-top: 22px; }

.legal-doc p {
  color: #4f554e;
  line-height: 1.65;
  margin: 0;
}

.legal-doc .back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  text-decoration: none;
}

.legal-doc .back-link:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

@media (max-width: 820px) {
  .topbar {
    padding: 10px 12px;
    min-height: 56px;
  }

  .topbar .right > span:not(.bell) { display: none; }
  .topbar .bell { font-size: 0; width: 32px; padding: 0; justify-content: center; }
  .topbar .bell::before { content: "N"; font-size: 12px; }

  .layout { display: block; }

  .sidebar {
    width: 100%;
    min-height: 0;
    display: flex;
    overflow-x: auto;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 56px;
    z-index: 20;
  }

  .sidebar a {
    flex: 0 0 auto;
    margin: 0 4px 0 0;
    padding: 7px 10px;
  }

  .content {
    padding: 20px 12px 88px;
  }

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

  .dash-hero {
    display: grid;
  }

  .dash-hero-actions {
    justify-content: flex-start;
  }

  .dash-metrics,
  .dash-split {
    grid-template-columns: 1fr;
  }

  .detail-metrics,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .shift-detail-head {
    display: grid;
  }

  .quiet-row {
    display: grid;
  }

  .quiet-meta {
    justify-items: start;
    text-align: left;
  }

  .login-box {
    width: min(100%, 410px);
  }

  .modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .notif-panel {
    left: 12px;
    right: 12px;
    top: 62px;
    width: auto;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
  }

  .legal-doc {
    width: auto;
    margin: 12px;
    padding: 20px;
  }
}

@media (max-width: 420px) {
  body { font-size: 13px; }
  h1 { font-size: 22px; }
  .login-card { padding: 20px; }
  .login-box h1 { font-size: 22px; }
  .tabbtns { grid-template-columns: 1fr; }
  th, td { padding: 10px 8px; }
}
