:root {
  --bg: #080b11;
  --bg-alt: #0d1118;
  --surface: rgba(19, 23, 32, 0.92);
  --surface-strong: rgba(13, 16, 24, 0.97);
  --surface-alt: rgba(12, 16, 24, 0.88);
  --border: rgba(146, 161, 185, 0.16);
  --text: #f5f7fb;
  --text-soft: #c5cedc;
  --muted: #8d98aa;
  --primary: #16d497;
  --primary-strong: #10b981;
  --cyan: #24c8ff;
  --violet: #8b7dff;
  --danger: #ff6b7a;
  --success: #34d399;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(22, 212, 151, 0.3), 0 0 32px rgba(22, 212, 151, 0.18);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(22,212,151,0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(36,200,255,0.08), transparent 30%),
    linear-gradient(180deg, #07090d 0%, #090c12 50%, #070a10 100%);
  background-size: 76px 76px, 76px 76px, auto, auto, auto;
  color: var(--text);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0.34), transparent 28%, transparent 72%, rgba(0,0,0,0.24));
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.screen-backdrop { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 15% 15%, rgba(22,212,151,0.06), transparent 20%); }
.desktop-nav-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 1100;
  min-height: 46px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,14,20,0.92);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.desktop-nav-toggle-icon { font-size: 1rem; line-height: 1; }
.desktop-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(3,7,12,0.64);
}
.desktop-nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 88vw);
  z-index: 1101;
  background: rgba(10,14,20,0.98);
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
}
.desktop-nav-panel-inner {
  display: grid;
  gap: 20px;
  padding: 22px 18px;
}
.desktop-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.desktop-nav-title {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}
.desktop-nav-links {
  display: grid;
  gap: 10px;
}
.desktop-nav-links a {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  text-decoration: none;
  color: var(--text-soft);
}
.desktop-nav-links a:hover,
.desktop-nav-links a.active {
  color: var(--text);
  border-color: rgba(22,212,151,0.3);
  background: rgba(22,212,151,0.06);
}
.desktop-nav-footer {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.desktop-nav-logout {
  width: 100%;
  justify-content: center;
}
.app-shell { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; padding: 28px 20px 40px; }
.desktop-shell { max-width: 1260px; }
.mobile-shell { max-width: 760px; }
.desktop-shell.app-shell { max-width: 1360px; }
.login-shell { display: flex; align-items: center; justify-content: center; min-height: 100vh; max-width: 980px; padding-top: 40px; padding-bottom: 40px; }
.login-layout { width: 100%; display: grid; gap: 28px; align-items: center; }
.brand-lockup { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.brand-mark, .feature-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 18px;
  border: 1px solid rgba(22,212,151,0.24); background: linear-gradient(180deg, rgba(16,30,29,0.95), rgba(11,20,22,0.95));
  color: var(--primary); box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 12px 28px rgba(0,0,0,0.35);
}
.brand-name { margin: 4px 0 0; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.3em; font-size: 0.78rem; font-weight: 700; color: var(--primary); }
.hero-eyebrow { margin-bottom: 18px; }
.hero-title, .app-header h1, .detail-header h2, .section-title, .login-title { margin: 0; line-height: 1.02; letter-spacing: -0.04em; font-weight: 800; }
.hero-title { max-width: 760px; font-size: clamp(2.8rem, 5vw, 5.4rem); }
.hero-title span { background: linear-gradient(90deg, #44f2b7 0%, #22d3ee 50%, #8b7dff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.simple-login-title { max-width: 520px; font-size: clamp(2.1rem, 4vw, 3rem); }
.compact-hero { font-size: clamp(2.2rem, 4vw, 3.4rem); max-width: 900px; }
.header-copy, .helper-text, .detail-meta, .login-copy, .hero-copy { color: var(--text-soft); line-height: 1.65; }
.header-copy, .hero-copy { max-width: 720px; font-size: 1.15rem; }
.simple-login-copy { max-width: 460px; font-size: 1rem; }
.narrow-copy { max-width: 760px; }
.feature-stack { display: grid; gap: 16px; margin-top: 34px; }
.compact-feature-stack { margin-top: 10px; }
.feature-card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.feature-card { display: flex; gap: 18px; align-items: flex-start; padding: 24px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.45rem; letter-spacing: -0.03em; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.feature-cyan .feature-icon { color: var(--cyan); }
.feature-violet .feature-icon { color: var(--violet); }
.hero-footer-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 34px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,0.08); color: var(--muted); }
.hero-footer-meta span::before { content: '�'; margin-right: 8px; color: var(--primary); }
.login-card, .controls-panel, .detail-panel, .modal-card { background: var(--surface-strong); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.login-card { padding: 36px; max-width: 460px; width: 100%; }
.controls-panel, .detail-panel { padding: 26px; }
.login-title { font-size: 3rem; margin-bottom: 10px; }
.login-form, .admin-form-grid, .desktop-grid { display: grid; gap: 18px; }
.two-column-grid { grid-template-columns: 1fr; }
.section-heading-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.section-title { font-size: 2rem; }
.field-label { display: block; margin-bottom: 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.text-input {
  width: 100%; min-height: 58px; padding: 0 18px; border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,14,20,0.96); color: var(--text); outline: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.text-input:focus { border-color: rgba(22,212,151,0.64); box-shadow: var(--glow); }
.full-width { grid-column: 1 / -1; }
.status-message { min-height: 24px; margin: 4px 0 0; font-size: 0.95rem; font-weight: 600; color: var(--muted); }
.status-message.error { color: var(--danger); }
.status-message.success { color: var(--success); }
.primary-button, .secondary-button, .ghost-button, .primary-link-button, .numpad-key {
  border: none; border-radius: var(--radius-md); font-weight: 700; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.primary-button, .primary-link-button { min-height: 62px; padding: 0 22px; background: linear-gradient(180deg, #19d69c 0%, #10b981 100%); color: #04110d; box-shadow: 0 16px 42px rgba(16,185,129,0.28); }
.glow-button, .glow-link-button { box-shadow: 0 18px 44px rgba(16,185,129,0.25), 0 0 0 1px rgba(88,255,196,0.12) inset; }
.primary-button:hover, .primary-link-button:hover, .secondary-button:hover, .ghost-button:hover, .numpad-key:hover, .crop-card:hover { transform: translateY(-1px); }
.secondary-button, .ghost-button { min-height: 52px; padding: 0 16px; background: rgba(255,255,255,0.03); color: var(--text); border: 1px solid rgba(255,255,255,0.08); }
.ghost-button { margin-bottom: 0; }
.compact-button { min-height: 46px; padding: 0 14px; }
.create-user-button, .modal-save-button { width: auto; min-width: 146px; }
.dashboard-links, .directory-toolbar-actions, .row-action-group, .modal-action-row, .detail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.creatable-select { position: relative; min-width: 180px; }
.creatable-select-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,14,20,0.98);
  box-shadow: var(--shadow);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
}
.creatable-select-item {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  cursor: pointer;
}
.creatable-select-item:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.creatable-select-create { color: var(--primary); }
.matrix-footer-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.save-plan-button { width: auto; min-width: 180px; }
.matrix-page-grid {
  gap: 12px;
}
.matrix-page-panel {
  padding: 10px 10px 12px;
}
.matrix-toolbar-actions {
  gap: 6px;
  align-items: center;
}
.matrix-table-wrap {
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px;
  background: rgba(255,255,255,0.01);
}
.matrix-table {
  min-width: 1180px;
  table-layout: fixed;
}
.matrix-table th,
.matrix-table td {
  padding: 4px 5px;
  border-bottom: 1px solid rgba(255,255,255,0.035);
  vertical-align: middle;
}
.matrix-table th {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: rgba(197,206,220,0.78);
  background: rgba(255,255,255,0.012);
}
.matrix-input {
  min-height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  font-size: 0.78rem;
  border-color: rgba(255,255,255,0.06);
  background: rgba(8,12,18,0.78);
  box-shadow: none;
}
.matrix-save-plan-button {
  min-height: 34px;
  min-width: 104px;
  padding: 0 10px;
  font-size: 0.84rem;
  box-shadow: 0 6px 16px rgba(16,185,129,0.14);
}
.duplicate-row-button,
.remove-row-button {
  min-height: 24px;
  padding: 0 6px;
  font-size: 0.72rem;
  border-radius: 7px;
}
.row-action-group {
  gap: 4px;
  flex-direction: column;
  align-items: stretch;
}
.dashboard-ledger-actions {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
}

.dashboard-ledger-actions .inline-action-button {
  width: auto;
  flex: 0 0 auto;
}

.master-spec-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.master-specs-grid-wrap .tabulator-cell .master-spec-action-group {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  margin: 0;
}

.master-spec-action-button {
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.master-specs-grid-wrap .tabulator-cell .master-spec-action-button {
  margin: 0;
  vertical-align: middle;
}

.master-spec-action-button:hover {
  color: var(--text);
  border-color: rgba(22,212,151,0.28);
  background: rgba(22,212,151,0.08);
}

.master-spec-archive {
  color: #ffb4be;
}
.invalid-matrix-row td { background: rgba(255, 107, 122, 0.08); }
.unmatched-matrix-row td { background: rgba(255, 194, 92, 0.06); }
.readonly-input { border-color: rgba(22,212,151,0.28); background: rgba(22,212,151,0.06); }
.matrix-table .status-badge {
  min-height: 20px;
  padding: 0 6px;
  font-size: 0.64rem;
  gap: 4px;
  border-radius: 999px;
}
.matrix-table .creatable-select {
  min-width: 96px;
}
.matrix-table td:last-child,
.matrix-table th:last-child {
  width: 76px;
}
.matrix-table td:nth-child(4),
.matrix-table th:nth-child(4) {
  width: 86px;
}
.matrix-table td:nth-child(5),
.matrix-table th:nth-child(5),
.matrix-table td:nth-child(6),
.matrix-table th:nth-child(6),
.matrix-table td:nth-child(8),
.matrix-table th:nth-child(8),
.matrix-table td:nth-child(12),
.matrix-table th:nth-child(12),
.matrix-table td:nth-child(13),
.matrix-table th:nth-child(13),
.matrix-table td:nth-child(14),
.matrix-table th:nth-child(14),
.matrix-table td:nth-child(15),
.matrix-table th:nth-child(15) {
  width: 62px;
}
.matrix-table td:nth-child(1),
.matrix-table th:nth-child(1),
.matrix-table td:nth-child(2),
.matrix-table th:nth-child(2),
.matrix-table td:nth-child(3),
.matrix-table th:nth-child(3),
.matrix-table td:nth-child(7),
.matrix-table th:nth-child(7),
.matrix-table td:nth-child(9),
.matrix-table th:nth-child(9),
.matrix-table td:nth-child(10),
.matrix-table th:nth-child(10),
.matrix-table td:nth-child(11),
.matrix-table th:nth-child(11) {
  width: 82px;
}
.matrix-table .text-input:focus,
.matrix-table .matrix-input:focus {
  box-shadow: 0 0 0 1px rgba(22,212,151,0.22);
}
.matrix-table-wrap::-webkit-scrollbar {
  height: 10px;
}
.matrix-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}
.matrix-tabulator {
  min-height: 240px;
}
.matrix-tabulator.tabulator {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
}
.matrix-tabulator .tabulator-header {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.012);
}
.matrix-tabulator .tabulator-col,
.matrix-tabulator .tabulator-col-row-handle {
  background: transparent;
  border-right: 1px solid rgba(255,255,255,0.03);
}
.matrix-tabulator .tabulator-col .tabulator-col-content {
  padding: 8px 8px;
}

.matrix-tabulator .tabulator-header .tabulator-col .tabulator-col-content,
.matrix-tabulator .tabulator-header .tabulator-col .tabulator-col-title {
  padding-right: 4px !important;
}

.matrix-tabulator .tabulator-col-sorter {
  display: none !important;
}
.matrix-tabulator .tabulator-col[aria-sort] .tabulator-col-content,
.matrix-tabulator .tabulator-col[tabulator-field] .tabulator-col-content,
.matrix-tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  grid-template-columns: 1fr !important;
  display: block !important;
}
.matrix-tabulator .tabulator-col .tabulator-col-content {
  display: block !important;
  padding-right: 0;
  padding-left: 0;
}
.matrix-tabulator .tabulator-col-title-holder {
  width: 100%;
  display: block !important;
  flex: none;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
.matrix-tabulator .tabulator-header .tabulator-col {
  min-height: 48px;
}
.matrix-tabulator .tabulator-col-title {
  width: 100%;
  display: block !important;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(197,206,220,0.78);
  white-space: normal;
  line-height: 1.25;
  margin: 0;
  padding: 0;
}
.matrix-tabulator .tabulator-tableholder {
  background: transparent;
}
.matrix-tabulator .tabulator-row {
  background: rgba(255,255,255,0.01);
  border-bottom: 1px solid rgba(255,255,255,0.035);
}
.matrix-tabulator .tabulator-row .tabulator-cell {
  padding: 4px 5px;
  border-right: 1px solid rgba(255,255,255,0.025);
  vertical-align: middle;
}
.matrix-tabulator .tabulator-col.tabulator-frozen,
.matrix-tabulator .tabulator-cell.tabulator-frozen,
.matrix-tabulator .tabulator-frozen.tabulator-frozen-left {
  background: rgba(18, 22, 31, 0.98);
  z-index: 3;
}
.matrix-tabulator .tabulator-col.tabulator-frozen.tabulator-frozen-left,
.matrix-tabulator .tabulator-cell.tabulator-frozen.tabulator-frozen-left {
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: 8px 0 18px rgba(0, 0, 0, 0.18);
}
.matrix-tabulator .tabulator-header .tabulator-frozen {
  z-index: 4;
}
.master-specs-grid-wrap .tabulator-cell,
.master-specs-grid-wrap .tabulator-col,
.master-specs-grid-wrap .tabulator-col-row-handle {
  vertical-align: middle;
}

.master-specs-grid-wrap .tabulator-cell {
  line-height: 1.35;
}
.matrix-tabulator .tabulator-row.tabulator-selected,
.matrix-tabulator .tabulator-row:hover {
  background: rgba(255,255,255,0.025);
}
.matrix-tabulator input,
.matrix-tabulator select,
.matrix-tabulator textarea {
  width: 100%;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(8,12,18,0.78);
  color: var(--text);
  box-shadow: none;
}
.matrix-tabulator .tabulator-cell input:focus,
.matrix-tabulator .tabulator-cell select:focus,
.matrix-tabulator .tabulator-cell textarea:focus {
  outline: none;
  box-shadow: 0 0 0 1px rgba(22,212,151,0.22);
  border-color: rgba(22,212,151,0.28);
}
.matrix-action-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
}
.matrix-action-button {
  min-width: 34px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.matrix-action-button:hover {
  color: var(--text);
  border-color: rgba(22,212,151,0.28);
  background: rgba(22,212,151,0.08);
}
.matrix-action-button-danger:hover {
  border-color: rgba(255,107,122,0.34);
  background: rgba(255,107,122,0.1);
}
.matrix-grid-empty {
  padding: 18px;
}
.matrix-tabulator .tabulator-row.unmatched-matrix-row {
  background: rgba(255, 194, 92, 0.05);
}
.matrix-tabulator .tabulator-row.unmatched-matrix-row .tabulator-cell {
  box-shadow: inset 0 -1px 0 rgba(255, 194, 92, 0.08);
}
.master-specs-grid-wrap {
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px;
  background: rgba(255,255,255,0.01);
}

.master-specs-tabulator .tabulator-header .tabulator-col .tabulator-col-content,
.master-specs-tabulator .tabulator-header .tabulator-col .tabulator-col-title {
  padding-right: 4px !important;
}

.master-specs-tabulator .tabulator-col-title {
  white-space: normal;
}
.matrix-spec-link:hover { text-decoration: underline; }
.status-badge-warning { color: #ffc25c; border-color: rgba(255, 194, 92, 0.25); background: rgba(255, 194, 92, 0.08); }
.status-badge-danger { color: var(--danger); border-color: rgba(255, 107, 122, 0.22); background: rgba(255, 107, 122, 0.08); }
.table-scroll-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 18px 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: middle; }
.data-table th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.2em; }
.empty-table-cell { color: var(--muted); }
.status-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(22,212,151,0.08); border: 1px solid rgba(22,212,151,0.18); color: var(--primary); font-size: 0.8rem; font-weight: 700; }
.role-badge { text-transform: capitalize; }
.directory-panel-full { min-width: 0; }
.filter-accordion { border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-lg); background: rgba(255,255,255,0.02); padding: 18px; }
.filter-accordion summary { cursor: pointer; list-style: none; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.filter-grid, .measurement-form-grid, .location-row { display: grid; gap: 14px; }
.filter-grid, .measurement-form-grid { margin-top: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filter-button { width: 100%; }
.feed-list { margin-top: 18px; display: grid; gap: 16px; }
.crop-card {
  width: 100%; border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(18,22,31,0.95), rgba(14,17,25,0.98)); padding: 22px; box-shadow: var(--shadow); color: var(--text);
}
.crop-card h3 { margin: 10px 0; font-size: 1.5rem; letter-spacing: -0.03em; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.card-stat { padding: 14px 16px; border-radius: var(--radius-md); background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); }
.card-stat-label { display: block; margin-bottom: 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); }
.card-stat-value { font-size: 1rem; font-weight: 700; }
.panel-subtle { margin: 18px 0; padding: 18px; border-radius: var(--radius-lg); background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06); }
.chart-header-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.chart-canvas-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius-lg); background: rgba(5,10,16,0.96); border: 1px solid rgba(255,255,255,0.05); padding: 10px; }
.mobile-chart-wrap { padding: 8px; }
.chart-canvas { width: 100%; height: auto; display: block; }
.history-table { min-width: 100%; }
.inline-action-button { min-height: 38px; width: auto; }
.user-admin-action-group {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  width: auto;
}
.user-admin-action-button {
  min-height: 30px;
  padding: 0 10px;
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.82rem;
  border-radius: 10px;
}
.user-admin-inline-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}
.dashboard-chart-panel { grid-column: 1 / -1; }
.chart-panel-subtle { margin-top: 8px; }
.dashboard-chart-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dashboard-measurement-trigger {
  min-height: 34px;
  padding: 0 12px;
}
.dashboard-measurement-grid {
  align-items: end;
}
.dashboard-activity-notes {
  min-height: 110px;
  padding: 12px;
}
.dashboard-measurement-modal-card {
  width: min(100%, 420px);
}
.dashboard-measurement-modal-actions {
  justify-content: flex-end;
}
.measurement-display {
  min-height: 96px; padding: 20px 22px; border-radius: var(--radius-lg); background: rgba(5,10,16,0.96);
  border: 1px solid rgba(22,212,151,0.22); box-shadow: inset 0 0 0 1px rgba(22,212,151,0.06);
  color: #eafef7; font-size: 2.6rem; font-weight: 800; display: flex; align-items: center; justify-content: flex-end;
}
.numpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.numpad-key { min-height: 60px; background: rgba(255,255,255,0.03); color: var(--text); border: 1px solid rgba(255,255,255,0.08); font-size: 1.3rem; }
.numpad-key.muted { background: rgba(255,255,255,0.06); color: var(--text-soft); }
.numpad-key.wide { grid-column: span 3; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(3,7,12,0.72);
  display: flex; align-items: center; justify-content: center; padding: 22px;
}
.modal-card { width: min(100%, 580px); padding: 24px; }
.modal-heading-row { margin-bottom: 18px; }
.master-spec-modal-card { width: min(100%, 720px); }
.master-spec-form-grid { gap: 14px; }
.master-spec-input {
  min-height: 46px;
  padding: 0 14px;
}
.master-spec-modal-card {
  width: min(100%, 600px);
  padding: 18px;
}
.master-spec-modal-card .section-title {
  font-size: 1.5rem;
}
.master-spec-modal-card .helper-text {
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.master-spec-modal-card .field-label {
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}
.master-spec-form-grid {
  gap: 10px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.master-spec-form-grid .full-width {
  grid-column: 1 / -1;
}
.master-spec-input,
.master-spec-modal-card .text-input {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.95rem;
}
.master-spec-modal-card select.text-input {
  padding-right: 32px;
}
.master-spec-modal-card .status-message {
  min-height: 18px;
  font-size: 0.88rem;
  margin-top: 2px;
}
.master-spec-customer-tools {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}
.master-spec-inline-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
}
.master-spec-inline-save {
  min-width: 124px;
}
.master-spec-submodal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3,7,12,0.58);
  border-radius: inherit;
}
.master-spec-submodal-card {
  width: min(100%, 360px);
  padding: 16px;
  border-radius: 18px;
  background: rgba(13,16,24,0.98);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
}
.master-spec-submodal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.master-spec-submodal-title {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
.master-spec-submodal-body {
  display: grid;
  gap: 8px;
}
.master-spec-submodal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.master-spec-submodal-close {
  min-height: 34px;
}
.master-spec-modal-card .modal-heading-row {
  margin-bottom: 12px;
}
.master-spec-modal-card .modal-action-row {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.master-spec-modal-card .ghost-button,
.master-spec-modal-card .modal-save-button,
.master-spec-modal-card .compact-button {
  min-height: 38px;
  padding: 0 12px;
}
.master-spec-modal-card .modal-save-button {
  min-width: 126px;
}
.master-spec-archive-modal-card {
  width: min(100%, 480px);
}
.matrix-row-modal-card {
  width: min(100%, 640px);
  padding: 18px;
  max-height: min(88vh, 820px);
  overflow-y: auto;
}
.matrix-confirm-modal-card {
  width: min(100%, 460px);
  padding: 18px;
}
.danger-button {
  background: linear-gradient(180deg, #ff7b88 0%, #ff5d6d 100%);
  color: #180407;
  box-shadow: 0 16px 42px rgba(255, 93, 109, 0.24);
}
.matrix-confirm-modal-card .modal-action-row {
  justify-content: flex-end;
}
.matrix-row-form-grid {
  gap: 10px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.matrix-row-input {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 0.88rem;
}
.matrix-row-preview {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
}
.matrix-row-location-tools {
  display: flex;
  justify-content: flex-start;
  margin-top: -8px;
}
.matrix-inline-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.78rem;
}
.matrix-location-subpanel {
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
}
.matrix-location-subpanel-grid {
  display: grid;
  gap: 8px 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.matrix-row-modal-card .field-label {
  margin-bottom: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.matrix-row-modal-card .status-message {
  min-height: 18px;
  font-size: 0.84rem;
  margin-top: 0;
}

.matrix-row-modal-card .modal-action-row {
  gap: 6px;
  margin-top: 2px;
}

.matrix-row-modal-card .ghost-button,
.matrix-row-modal-card .modal-save-button,
.matrix-row-modal-card .compact-button {
  min-height: 34px;
  padding: 0 10px;
}

#matrixAdvancedFieldsPanel .matrix-row-input {
  min-height: 32px;
}
.master-spec-restore {
  color: var(--primary);
}
.dashboard-header {
  display: grid;
  gap: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(14,18,27,0.96), rgba(10,14,20,0.98));
}
.compact-admin-header {
  padding: 16px 20px;
  gap: 6px;
  margin-bottom: 12px;
}
.dashboard-title {
  margin: 0;
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
  letter-spacing: -0.04em;
}
.dashboard-subtitle {
  margin: 0;
  color: var(--text-soft);
  max-width: 620px;
  line-height: 1.5;
  font-size: 0.98rem;
}
.desktop-dashboard-layout {
  display: grid;
  gap: 16px;
}
.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.78fr);
  gap: 18px;
  align-items: start;
}
.dashboard-side-stack {
  display: grid;
  gap: 14px;
}
.dashboard-section-row {
  margin-bottom: 14px;
}
.compact-section-row {
  margin-bottom: 10px;
}
.dashboard-section-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.compact-admin-panel {
  padding: 20px;
}
.compact-toolbar-actions {
  gap: 8px;
}
.dashboard-inline-note {
  max-width: 280px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.dashboard-search-wrap {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}
.dashboard-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.92rem;
}
.dashboard-inline-toggle input {
  accent-color: var(--primary);
}
.dashboard-search-results {
  display: grid;
  gap: 10px;
}
.dashboard-program-grid-wrap {
  margin-top: 4px;
}
.dashboard-program-grid-table {
  min-width: 100%;
  --grid-cell-pad-x: 5px;
  --grid-cell-pad-y: 5px;
  table-layout: fixed;
  --col-customer: 100px;
  --col-size: 50px;
  --col-variety: 130px;
  --col-location: 115px;
  --col-start: 75px;
  --col-ready: 75px;
  --col-measured: 100px;
  --col-latest-height: 100px;
  --col-expected-min: 100px;
  --col-expected-max: 100px;
  --col-status: 110px;
}
.dashboard-program-grid-table th,
.dashboard-program-grid-table td {
  padding: var(--grid-cell-pad-y) var(--grid-cell-pad-x);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-program-grid-table th:nth-child(8),
.dashboard-program-grid-table th:nth-child(9),
.dashboard-program-grid-table th:nth-child(10) {
  white-space: normal;
  line-height: 1.15;
}
.dashboard-program-grid-table th:nth-child(1),
.dashboard-program-grid-table td:nth-child(1) {
  width: var(--col-customer);
}
.dashboard-program-grid-table th:nth-child(2),
.dashboard-program-grid-table td:nth-child(2) {
  width: var(--col-size);
}
.dashboard-program-grid-table th:nth-child(3),
.dashboard-program-grid-table td:nth-child(3) {
  width: var(--col-variety);
}
.dashboard-program-grid-table th:nth-child(4),
.dashboard-program-grid-table td:nth-child(4) {
  width: var(--col-location);
}
.dashboard-program-grid-table th:nth-child(5),
.dashboard-program-grid-table td:nth-child(5) {
  width: var(--col-start);
}
.dashboard-program-grid-table th:nth-child(6),
.dashboard-program-grid-table td:nth-child(6) {
  width: var(--col-ready);
}
.dashboard-program-grid-table th:nth-child(7),
.dashboard-program-grid-table td:nth-child(7) {
  width: var(--col-measured);
}
.dashboard-program-grid-table th:nth-child(8),
.dashboard-program-grid-table td:nth-child(8) {
  width: var(--col-latest-height);
}
.dashboard-program-grid-table th:nth-child(9),
.dashboard-program-grid-table td:nth-child(9) {
  width: var(--col-expected-min);
}
.dashboard-program-grid-table th:nth-child(10),
.dashboard-program-grid-table td:nth-child(10) {
  width: var(--col-expected-max);
}
.dashboard-program-grid-table th:nth-child(11),
.dashboard-program-grid-table td:nth-child(11) {
  width: var(--col-status);
}
.dashboard-chart-panel .history-table th,
.dashboard-chart-panel .history-table td {
  padding-top: 6px;
  padding-bottom: 6px;
}
.dashboard-program-row {
  cursor: pointer;
}
.dashboard-program-row:hover {
  background: rgba(255,255,255,0.03);
}
.dashboard-program-row.selected {
  background: rgba(22,212,151,0.08);
}
.dashboard-program-measured-yes {
  color: var(--success);
  font-weight: 700;
}
.dashboard-program-measured-no {
  color: #ffc25c;
  font-weight: 700;
}
.dashboard-search-result,
.dashboard-search-empty {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  color: var(--text);
}
.dashboard-search-result {
  cursor: pointer;
}
.dashboard-search-result:hover {
  border-color: rgba(22,212,151,0.34);
  background: rgba(22,212,151,0.04);
}
.dashboard-search-result-title,
.dashboard-module-title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}
.dashboard-search-result-copy,
.dashboard-search-result-meta,
.dashboard-module-copy {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}
.dashboard-search-result-meta {
  margin-top: 4px;
  font-size: 0.92rem;
}
.dashboard-module-list {
  display: grid;
  gap: 12px;
}
.dashboard-module-card {
  display: block;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  text-decoration: none;
}
.dashboard-module-link-inline {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  background: rgba(255,255,255,0.03);
  color: var(--text-soft);
  white-space: nowrap;
}
.dashboard-module-card:hover {
  border-color: rgba(22,212,151,0.34);
  background: rgba(22,212,151,0.04);
}
.master-specs-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.85fr);
}
.app-header {
  margin-bottom: 12px;
}
.app-header .eyebrow {
  margin-bottom: 8px;
}
.app-header .hero-title,
.app-header .compact-hero {
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
  max-width: 760px;
}
.app-header .header-copy,
.app-header .hero-copy {
  font-size: 0.98rem;
  max-width: 680px;
}
.modal-helper-text { margin-top: 8px; }
@media (min-width: 900px) {
  .app-shell { padding: 34px 30px 48px; }
  .two-column-grid { grid-template-columns: minmax(400px, 1fr) minmax(340px, 0.8fr); align-items: stretch; }
  .login-layout { grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr); gap: 40px; }
}
@media (max-width: 899px) {
  .hero-title { font-size: 2.7rem; }
  .login-card { padding: 28px; }
}
@media (max-width: 640px) {
  .app-shell { padding: 20px 14px 32px; }
  .brand-lockup { margin-bottom: 20px; }
  .brand-name { font-size: 1.6rem; }
  .hero-title, .compact-hero, .login-title { font-size: 2.2rem; }
  .feature-card, .controls-panel, .detail-panel, .modal-card { padding: 18px; }
  .feature-card { flex-direction: column; }
  .filter-grid, .measurement-form-grid, .card-grid { grid-template-columns: 1fr; }
  .section-heading-row, .directory-toolbar-actions, .modal-action-row, .row-action-group, .detail-actions { flex-direction: column; align-items: stretch; }
  .dashboard-header-actions { align-items: stretch; }
  .dashboard-inline-controls { justify-content: flex-start; }
  .chart-header-row { flex-direction: column; }
  .dashboard-chart-actions { align-items: stretch; }
  .primary-button, .secondary-button, .ghost-button, .primary-link-button, .create-user-button, .modal-save-button { width: 100%; }
  .user-admin-action-group { flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; justify-content: flex-start !important; }
  .user-admin-action-button { width: auto !important; flex: 0 0 auto !important; white-space: nowrap; }
  .master-spec-form-grid { grid-template-columns: 1fr; }
  .matrix-row-form-grid { grid-template-columns: 1fr; }
  .matrix-location-subpanel-grid { grid-template-columns: 1fr; }
  .master-spec-submodal-actions { flex-direction: column; }
  .dashboard-measurement-modal-actions { flex-direction: column; }
  .master-spec-modal-card .modal-action-row {
    justify-content: stretch;
  }
  .compact-admin-header,
  .compact-admin-panel { padding: 16px; }
  .desktop-nav-toggle {
    top: 12px;
    left: 12px;
  }
}

@media (max-width: 1100px) {
  .dashboard-main-grid,
  .master-specs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-inline-note {
    max-width: none;
  }
}
