@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --ink: #14202b;
  --ink-soft: #42515a;
  --muted: #849097;
  --line: #dfe5e1;
  --paper: #f5f6f1;
  --surface: #ffffff;
  --coral: #f06c4e;
  --coral-deep: #d95139;
  --yellow: #f6c667;
  --mint: #acdcca;
  --mint-soft: #e5f1eb;
  --blue-soft: #dce9ef;
  --shadow: 0 16px 40px rgba(20, 32, 43, .08);
  --radius: 7px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Sans", "Avenir Next", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(240, 108, 78, .28); outline-offset: 2px; }
.hidden { display: none !important; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3, .brand, .metric-value { font-family: "IBM Plex Sans", "Avenir Next", sans-serif; }

.eyebrow, .kicker, .metric-label, th, .form-field label, .login-panel label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow { color: var(--muted); }
.accent-eyebrow { color: var(--coral); }

.login-view {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr);
  min-height: 100vh;
  background: #e9ede7;
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100vh;
  overflow: hidden;
  padding: 42px 8vw 38px;
  color: #f7f8f2;
  background-color: var(--ink);
  background-image: linear-gradient(90deg, transparent 0 49.8%, rgba(255,255,255,.07) 49.8% 50%, transparent 50% 100%), linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-position: 0 0, 0 18px;
  background-size: 100% 100%, 100% 44px;
}

.login-intro::after {
  position: absolute;
  right: 8vw;
  bottom: 38px;
  width: 42px;
  height: 42px;
  border-right: 1px solid rgba(246, 198, 103, .72);
  border-bottom: 1px solid rgba(246, 198, 103, .72);
  content: "";
  opacity: .8;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; letter-spacing: .13em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 5px; font-size: 17px; letter-spacing: 0; }
.brand-light .brand-mark { color: var(--ink); background: var(--yellow); }
.brand-dark .brand-mark { color: var(--paper); background: var(--coral); }

.intro-copy { position: relative; z-index: 1; max-width: 560px; margin-top: auto; margin-bottom: 38px; }
.kicker { margin-bottom: 22px; color: var(--yellow); }
.intro-copy h1 { max-width: 600px; font-size: clamp(38px, 4.6vw, 67px); line-height: .98; letter-spacing: -.025em; }
.intro-copy > p:last-child { max-width: 420px; margin-top: 26px; color: #b7c1c0; font-size: 16px; line-height: 1.6; }

.login-rail { display: flex; align-items: center; gap: 0; width: min(100%, 380px); margin-top: auto; margin-bottom: 26px; border-top: 1px solid rgba(255,255,255,.25); border-bottom: 1px solid rgba(255,255,255,.25); color: #d3dbd7; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .08em; }
.login-rail span { flex: 1; padding: 13px 10px; border-right: 1px solid rgba(255,255,255,.16); text-align: center; }
.login-rail span:first-child { padding-left: 0; text-align: left; }
.login-rail span:last-child { padding-right: 0; border-right: 0; text-align: right; }
.login-intro-footer { display: flex; justify-content: space-between; gap: 24px; width: min(100%, 380px); color: #829196; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .02em; }
.ledger-top, .ledger-total { display: flex; align-items: center; gap: 14px; color: #9ba9aa; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.ledger-top strong { margin-left: auto; color: #f7f8f2; font-size: 12px; }
.ledger-status { padding: 5px 7px; color: var(--ink); border-radius: 3px; background: var(--mint); font-size: 8px; }
.ledger-line { display: grid; grid-template-columns: 1.7fr .9fr .6fr; gap: 14px; margin-top: 23px; }
.ledger-line::after { grid-column: 1 / -1; height: 1px; margin-top: -8px; background: rgba(255,255,255,.11); content: ""; }
.ledger-line span, .ledger-line i, .ledger-line b { display: block; height: 7px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.ledger-line i { background: rgba(172, 220, 202, .58); }
.ledger-line b { background: rgba(246, 198, 103, .55); }
.ledger-line.short { grid-template-columns: 1.1fr .8fr .5fr; opacity: .58; }
.ledger-total { justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.16); }
.ledger-total strong { color: var(--yellow); font-family: "Space Grotesk", sans-serif; font-size: 20px; letter-spacing: 0; }
.intro-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: #93a0a3; font-size: 12px; }
.signal-dot, .period-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(172, 220, 202, .13); }

.login-panel { display: grid; place-items: center; padding: 50px 7vw; background: #f3f4ef; }
.login-card { width: min(100%, 390px); }
.login-card h2 { margin-top: 11px; font-size: 35px; letter-spacing: -.035em; }
.login-muted { max-width: 330px; margin-top: 12px; color: var(--ink-soft); line-height: 1.6; }
.stack-form { display: flex; flex-direction: column; margin-top: 34px; }
.stack-form label { margin: 16px 0 8px; color: var(--ink-soft); }
.stack-form input, .form-field input, .search-field input { min-width: 0; border: 1px solid #cdd7d2; border-radius: 4px; color: var(--ink); background: rgba(255,255,255,.74); transition: border-color .2s, box-shadow .2s; }
.stack-form input { width: 100%; padding: 14px 15px; }
.stack-form input:focus, .form-field input:focus, .search-field input:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(240, 108, 78, .11); outline: 0; }
.stack-form input::placeholder, .form-field input::placeholder, .search-field input::placeholder { color: #9aa5a5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 42px; padding: 0 17px; border: 0; border-radius: 4px; font-size: 12px; font-weight: 700; transition: transform .18s, background .18s, color .18s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--coral); }
.button-primary:hover { background: var(--coral-deep); }
.button-dark { color: #f9faf5; background: var(--ink); }
.button-dark:hover { background: #223442; }
.button-wide { width: 100%; margin-top: 28px; min-height: 51px; justify-content: space-between; padding: 0 18px 0 20px; }
.button-arrow, .button-plus { color: var(--yellow); font-size: 19px; line-height: 1; }
.form-error { min-height: 18px; margin-top: 10px; color: #bc452f; font-size: 12px; }
.login-note { margin-top: 18px; color: #8a9694; font-size: 11px; line-height: 1.5; }

.app-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; animation: appear .35s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.sidebar { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 29px 17px 20px; color: #f2f6ef; background: var(--ink); }
.sidebar-top { display: flex; flex-direction: column; gap: 38px; }
.workspace-chip { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; background: rgba(255,255,255,.05); }
.workspace-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 4px; color: var(--ink); background: var(--yellow); font-size: 9px; font-weight: 700; }
.workspace-chip strong, .workspace-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-chip strong { font-size: 11px; }
.workspace-chip small { margin-top: 3px; color: #869599; font-size: 10px; }
.chip-chevron { color: #7e8c91; font-size: 18px; transform: translateY(-3px); }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 11px 12px; border: 0; border-radius: 4px; color: #96a4a7; background: transparent; text-align: left; font-size: 12px; font-weight: 600; }
.nav-item:hover { color: #f8faf4; background: rgba(255,255,255,.06); }
.nav-item.active { color: var(--ink); background: var(--mint); }
.nav-icon { font-size: 13px; text-align: center; }
.nav-count { min-width: 18px; padding: 2px 5px; border-radius: 10px; color: #adbdc0; background: rgba(255,255,255,.09); font-size: 9px; text-align: center; }
.nav-item.active .nav-count { color: var(--ink); background: rgba(20,32,43,.12); }
.sidebar-bottom { display: grid; gap: 19px; }
.privacy-note { display: flex; align-items: center; gap: 10px; padding: 13px 10px; border-top: 1px solid rgba(255,255,255,.11); border-bottom: 1px solid rgba(255,255,255,.11); }
.privacy-note strong, .privacy-note small { display: block; }
.privacy-note strong { font-size: 11px; }
.privacy-note small { margin-top: 3px; color: #829196; font-size: 10px; }
.logout-button { display: inline-flex; align-items: center; gap: 9px; width: fit-content; padding: 4px 10px; border: 0; color: #93a1a4; background: transparent; font-size: 11px; }
.logout-button:hover { color: #fff; }

.main-content { min-width: 0; padding: 35px clamp(22px, 4vw, 64px) 58px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; max-width: 1320px; margin: 0 auto 42px; }
.topbar-heading h1 { margin-top: 8px; font-size: 30px; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.sync-label { color: var(--muted); font-size: 11px; }
.view-section { max-width: 1320px; margin: 0 auto; animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.section-lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-lead h2 { margin-top: 8px; font-size: 26px; letter-spacing: -.04em; }
.section-muted { margin-top: 8px; color: var(--ink-soft); line-height: 1.5; }
.period-badge { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid #d4ddd8; border-radius: 4px; color: var(--ink-soft); background: rgba(255,255,255,.45); font-size: 11px; font-weight: 600; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 155px; padding: 20px 21px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.73); }
.metric-card.metric-primary { color: #f8faf5; border-color: var(--ink); background: var(--ink); }
.metric-top, .metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-label { color: var(--muted); }
.metric-primary .metric-label { color: #91a1a3; }
.metric-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--ink); background: var(--yellow); font-size: 13px; }
.metric-icon.pale { color: #5a706d; background: var(--mint-soft); }
.metric-value { display: block; margin-top: 21px; font-size: 30px; letter-spacing: -.055em; }
.metric-foot { margin-top: 17px; color: var(--muted); font-size: 10px; }
.metric-primary .metric-foot { color: #87989b; }
.metric-trend { font-weight: 700; }
.metric-trend.up { color: var(--mint); }
.metric-trend.neutral { color: var(--ink-soft); }
.metric-primary .metric-trend.neutral { color: var(--yellow); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr); gap: 12px; margin-top: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.76); }
.composition-panel, .runs-panel { min-height: 300px; padding: 22px 23px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel-heading h3 { margin-top: 7px; font-size: 17px; letter-spacing: -.025em; }
.panel-mark { color: #a1aaa8; font-family: "Space Grotesk", sans-serif; font-size: 12px; }
.composition-main { display: flex; align-items: center; gap: 38px; min-height: 187px; }
.donut-wrap { display: grid; place-items: center; min-width: 166px; }
.donut { display: grid; place-items: center; width: 156px; height: 156px; border-radius: 50%; background: conic-gradient(var(--coral) 0 70%, var(--yellow) 70% 100%); transform: rotate(-25deg); }
.donut::before { width: 112px; height: 112px; border-radius: 50%; background: var(--surface); content: ""; }
.donut > div { position: absolute; display: grid; place-items: center; transform: rotate(25deg); }
.donut strong { font-family: "Space Grotesk", sans-serif; font-size: 28px; letter-spacing: -.05em; }
.donut span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.composition-copy { display: grid; min-width: 0; }
.composition-copy strong { font-family: "Space Grotesk", sans-serif; font-size: 22px; letter-spacing: -.045em; }
.composition-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.composition-rule { width: 100%; max-width: 210px; height: 1px; margin: 16px 0 14px; background: var(--line); }
.legend-row { display: flex; align-items: center; gap: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; }
.legend-swatch.net { background: var(--coral); }
.legend-swatch.deductions { background: var(--yellow); }
.legend-period { margin-left: auto; color: var(--muted); }
.runs-list { display: grid; gap: 3px; margin-top: 22px; }
.run-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid #e9eeeb; }
.run-item:last-child { border-bottom: 0; }
.run-month { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 4px; color: var(--ink); background: var(--blue-soft); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.run-item:nth-child(2n) .run-month { background: var(--mint-soft); }
.run-item:nth-child(3n) .run-month { background: #faebd8; }
.run-info strong, .run-info span { display: block; }
.run-info strong { font-size: 12px; }
.run-info span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.run-amount { text-align: right; }
.run-amount strong, .run-amount span { display: block; }
.run-amount strong { font-family: "Space Grotesk", sans-serif; font-size: 13px; }
.run-amount span { margin-top: 4px; color: #45866f; font-size: 9px; font-weight: 700; }
.text-button { display: inline-flex; align-items: center; gap: 8px; padding: 2px 0; border: 0; color: var(--coral-deep); background: transparent; font-size: 11px; font-weight: 700; }
.text-button:hover { color: var(--ink); }
.team-panel { margin-top: 12px; padding: 22px 23px 5px; }
.team-table-wrap, .payroll-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 620px; }
th { padding: 17px 10px 13px; color: #9aa5a2; text-align: left; white-space: nowrap; }
td { padding: 14px 10px; border-top: 1px solid #e9eeeb; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; color: var(--ink); background: var(--mint); font-size: 10px; font-weight: 700; }
.person-cell strong, .person-cell small { display: block; }
.person-cell strong { color: var(--ink); font-size: 12px; }
.person-cell small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; color: #4b8e73; font-size: 10px; font-weight: 700; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status.inactive { color: #a7784a; }
.salary-cell { color: var(--ink); font-family: "Space Grotesk", sans-serif; font-size: 12px; }

.compact-lead { align-items: center; margin-bottom: 25px; }
.compact-lead h2 { font-size: 25px; }
.lead-stat { display: flex; align-items: baseline; gap: 8px; padding: 9px 0; color: var(--muted); }
.lead-stat strong { color: var(--ink); font-family: "Space Grotesk", sans-serif; font-size: 28px; letter-spacing: -.05em; }
.lead-stat span { font-size: 11px; }
.accent-stat strong { color: var(--coral-deep); }
.full-panel { padding: 0 23px 14px; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0 15px; border-bottom: 1px solid var(--line); }
.search-field { display: flex; align-items: center; gap: 9px; width: min(100%, 310px); padding: 0 11px; border: 1px solid #d3ddd8; border-radius: 4px; background: #fff; }
.search-field > span { color: var(--muted); font-size: 19px; transform: rotate(-20deg); }
.search-field input { width: 100%; padding: 9px 0; border: 0; outline: 0; background: transparent; font-size: 11px; box-shadow: none !important; }
.filter-pills { display: inline-flex; align-items: center; gap: 4px; }
.filter-pill { padding: 7px 10px; border: 0; border-radius: 3px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.filter-pill.active, .filter-pill:hover { color: var(--ink); background: var(--mint-soft); }
.table-action { padding: 4px 8px; border: 1px solid #d5dfda; border-radius: 3px; color: var(--ink-soft); background: transparent; font-size: 10px; font-weight: 700; }
.table-action:hover { border-color: var(--coral); color: var(--coral-deep); }
.payroll-table td { padding-top: 16px; padding-bottom: 16px; }
.period-cell strong, .period-cell small { display: block; }
.period-cell strong { color: var(--ink); font-family: "Space Grotesk", sans-serif; font-size: 12px; }
.period-cell small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.payroll-net { color: #3f826b; font-family: "Space Grotesk", sans-serif; font-size: 12px; }
.notice-strip { display: flex; align-items: flex-start; gap: 11px; max-width: 760px; margin-top: 16px; color: #697776; }
.notice-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; color: var(--ink); background: var(--yellow); font-size: 11px; font-weight: 700; }
.notice-strip p { font-size: 11px; line-height: 1.5; }
.empty-state { padding: 40px 20px 32px; color: var(--muted); text-align: center; font-size: 12px; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20, 32, 43, .58); animation: fade-in .2s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: min(100%, 570px); padding: 26px; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; background: #f6f7f2; box-shadow: 0 25px 80px rgba(0,0,0,.25); animation: modal-in .25s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-heading { display: flex; justify-content: space-between; gap: 20px; }
.modal-heading h2 { margin-top: 8px; font-size: 25px; letter-spacing: -.04em; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 13px; }
.icon-button:hover { color: var(--ink); background: var(--line); }
.modal-form { margin-top: 27px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 13px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field.wide { grid-column: 1 / -1; }
.form-field label { color: var(--ink-soft); }
.form-field input { width: 100%; padding: 12px 13px; background: #fff; font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.button-quiet { color: var(--ink-soft); background: transparent; }
.button-quiet:hover { color: var(--ink); background: #e6ebe6; }
.calculation-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 14px; padding: 14px; border: 1px solid #d9e3dd; border-radius: 4px; background: var(--mint-soft); }
.calculation-preview span, .calculation-preview strong { display: block; }
.calculation-preview span { color: var(--ink-soft); font-size: 10px; }
.calculation-preview strong { margin-top: 7px; font-family: "Space Grotesk", sans-serif; font-size: 19px; }

.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 44px); padding: 12px 15px 12px 12px; border: 1px solid #c2dfd1; border-radius: 5px; color: #275d4d; background: #e9f5ed; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .25s ease both; }
.toast.error { color: #8b392a; border-color: #ecc0b5; background: #fff0eb; }
.toast-mark { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #e9f5ed; background: #4d9a7b; font-size: 11px; }
.toast.error .toast-mark { color: #fff0eb; background: #c45843; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1080px) {
  .login-view { grid-template-columns: minmax(360px, .9fr) minmax(360px, 1.1fr); }
  .login-intro { padding-right: 5vw; padding-left: 5vw; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .composition-panel, .runs-panel { min-height: auto; }
}

@media (max-width: 780px) {
  .login-view { display: block; }
  .login-intro { min-height: 420px; padding: 26px 25px 27px; }
  .intro-copy { margin: 70px 0 24px; }
  .intro-copy h1 { max-width: 490px; font-size: 42px; }
  .intro-copy > p:last-child, .ledger-art { display: none; }
  .login-panel { min-height: calc(100vh - 420px); padding: 45px 25px; }
  .app-shell { display: block; }
  .sidebar { min-height: auto; padding: 17px 15px 12px; }
  .sidebar-top { gap: 16px; }
  .sidebar .brand { padding: 0 4px; }
  .workspace-chip { display: none; }
  .main-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 1px; }
  .nav-item { grid-template-columns: 20px auto auto; width: auto; min-width: max-content; padding: 9px 11px; }
  .sidebar-bottom { display: none; }
  .main-content { padding: 25px 17px 40px; }
  .topbar { align-items: flex-start; margin-bottom: 32px; }
  .topbar-actions { gap: 0; }
  .sync-label { display: none; }
  .button-dark { padding: 0 12px; }
  .topbar-actions .button-dark { min-height: 38px; font-size: 10px; }
  .button-plus { display: none; }
  .section-lead { align-items: flex-start; flex-direction: column; gap: 15px; }
  .section-lead h2 { font-size: 23px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 130px; }
  .metric-value { margin-top: 13px; }
  .metric-foot { margin-top: 13px; }
  .composition-main { gap: 18px; }
  .donut-wrap { min-width: 135px; }
  .donut { width: 130px; height: 130px; }
  .donut::before { width: 92px; height: 92px; }
  .donut strong { font-size: 23px; }
  .legend-row { gap: 10px; flex-wrap: wrap; }
  .legend-period { margin-left: 0; width: 100%; }
  .panel-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .search-field { width: 100%; }
  .filter-pills { justify-content: flex-start; }
  .full-panel, .team-panel, .composition-panel, .runs-panel { padding-right: 15px; padding-left: 15px; }
  .team-panel { padding-bottom: 3px; }
  .panel-heading h3 { font-size: 15px; }
  .modal-card { padding: 21px 18px; }
}

@media (max-width: 430px) {
  .intro-copy h1 { font-size: 36px; }
  .login-panel { padding: 36px 21px; }
  .topbar-heading h1 { font-size: 25px; }
  .topbar-actions .button-dark span:first-child { max-width: 94px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .composition-main { align-items: flex-start; flex-direction: column; padding: 18px 0 21px; }
  .donut-wrap { align-self: center; }
  .composition-copy { width: 100%; grid-template-columns: 1fr 1fr; column-gap: 10px; }
  .composition-copy strong { font-size: 19px; }
  .composition-copy span { grid-row: 2; }
  .composition-rule { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.wide { grid-column: auto; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}

/* Detalle de corrida y recibo imprimible */
.run-detail-card { max-width: 860px; width: min(92vw, 860px); }
.run-detail-table td, .run-detail-table th { white-space: nowrap; }
.run-detail-table tfoot td { border-top: 2px solid rgba(20, 32, 43, 0.25); }

@media print {
  body * { visibility: hidden; }
  #runDetailModal:not(.hidden), #runDetailModal:not(.hidden) * { visibility: visible; }
  #runDetailModal { position: absolute; inset: 0; background: #fff; padding: 0; }
  #runDetailModal .modal-card { box-shadow: none; max-width: 100%; width: 100%; }
  .no-print { display: none !important; }
}
