/* Lynxtime — styles
   Palette and tone from docs/DESIGN.md. No build step. */

:root {
  --lm-teal: #009999;
  --lm-skobeloff: #08706e;
  --lm-hunter: #3c5845;
  --lm-viridian: #5b866d;
  --lm-olive: #686847;
  --lm-reseda: #828259;
  --lm-sunburst: #a0885a;
  --lm-night: #111111;
  --lm-onyx: #444444;
  --lm-soft-gray: #9ca3af;
  --lm-smoke: #f5f5f5;
  --lm-neutral: #f5f7f6;
  --lm-white: #ffffff;
  --lm-danger: #b91c1c;
  --lm-attention: #854d0e;
  --lm-attention-bg: #fcd34d;
  --lm-success-bg: #5eead4;

  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --muted: #6b7280;
  --radius: 12px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .06);
  --shadow-lg: 0 20px 50px rgba(17, 17, 17, .18);
  --focus-ring: 0 0 0 3px rgba(0, 153, 153, .22);
  --sidebar-w: 252px;

  --font-ui: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--lm-onyx);
  background: var(--lm-smoke);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--lm-hunter); margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--lm-teal); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: .92em; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; color: var(--lm-night); }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--lm-teal); outline-offset: 2px; }

/* ---------- Brand ---------- */
.brand { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none; }
.brand:hover { text-decoration: none; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 23px; letter-spacing: -.02em; color: #fff; }
.brand-sub { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--lm-soft-gray); margin-top: 3px; }
.brand-light .wordmark { color: var(--lm-night); }
.brand-light .brand-sub { color: var(--lm-teal); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(0, 153, 153, .14), transparent 60%),
    radial-gradient(700px 400px at 100% 110%, rgba(60, 88, 69, .14), transparent 60%),
    var(--lm-smoke);
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(17, 17, 17, .08);
  padding: 36px 32px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
}
.login-card .wordmark { font-size: 30px; }
.login-tagline { font-size: 15px; color: var(--lm-onyx); }
.login-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.login-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.login-error { color: var(--lm-danger); font-size: 13px; }
.login-foot { font-size: 12px; color: var(--lm-soft-gray); margin-top: 6px; }

/* ---------- Shell / sidebar ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--lm-night);
  color: #fff;
  position: fixed; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  z-index: 30;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 18px; }
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .12);
  background: transparent; cursor: pointer; padding: 0 10px;
}
.hamburger span { display: block; height: 2px; background: #fff; border-radius: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: #d1d5db; font-weight: 500; text-decoration: none; font-size: 14px;
  transition: background .12s, color .12s;
}
.nav a svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.active { background: var(--lm-teal); color: #fff; }
.nav a.active svg { opacity: 1; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--lm-soft-gray); padding: 16px 12px 6px; }

.sidebar-user { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 10px; }
.sidebar-user-info { display: flex; flex-direction: column; padding: 0 8px; min-width: 0; }
.sidebar-user-name { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 12px; color: var(--lm-soft-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { background: transparent; border: 1px solid rgba(255, 255, 255, .16); color: #e5e7eb; width: 100%; }
.btn-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.content { flex: 1; min-width: 0; margin-left: var(--sidebar-w); padding: 30px 36px 56px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-intro { color: var(--muted); margin: -10px 0 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; min-height: 38px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 500; line-height: 1.2; color: inherit;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--lm-teal); color: #fff; }
.btn-primary:hover { background: var(--lm-skobeloff); }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--lm-hunter); }
.btn-secondary:hover { background: var(--lm-neutral); }
.btn-ghost { background: transparent; color: var(--lm-teal); }
.btn-ghost:hover { background: rgba(0, 153, 153, .08); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--lm-danger); }
.btn-danger:hover { background: #fee2e2; }
.btn-danger-solid { background: var(--lm-danger); color: #fff; }
.btn-danger-solid:hover { background: #991b1b; }
.btn-sm { padding: 5px 10px; min-height: 30px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-lg { padding: 11px 18px; min-height: 44px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-xs); border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1;
}
.icon-btn:hover { background: var(--lm-neutral); color: var(--lm-night); }
.link-btn { background: none; border: 0; padding: 0; color: var(--lm-teal); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: #eeeeee; color: #444;
}
.badge-draft { background: #eeeeee; color: #444444; }
.badge-submitted, .badge-pending { background: #fef3c7; color: #854d0e; }
.badge-approved { background: #ccfbf1; color: #08706e; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }
.badge-cancelled { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }
.badge-neutral { background: var(--lm-neutral); color: var(--muted); }
.badge-count { background: var(--lm-teal); color: #fff; min-width: 22px; justify-content: center; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; line-height: 1.4;
  padding: 2px 8px; border-radius: 999px; border: 1px solid transparent;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #e5e7eb; color: var(--lm-onyx);
}
.chip-ferias { background: #ccfbf1; color: #08706e; border-color: #99f6e4; }
.chip-doenca { background: #fef3c7; color: #854d0e; border-color: #fde68a; }
.chip-sem_vencimento { background: #ecebdd; color: #686847; border-color: #d9d7bd; }
.chip-outro { background: #e4ede7; color: #3c5845; border-color: #c9dbd0; }
.chip-holiday { background: #fff; color: var(--lm-attention); border: 1px solid var(--lm-attention-bg); }
.chip.is-pending { background: #fff; border-style: dashed; }
.chip-ferias.is-pending { color: #08706e; border-color: #08706e; }
.chip-doenca.is-pending { color: #854d0e; border-color: #a0885a; }
.chip-sem_vencimento.is-pending { color: #686847; border-color: #828259; }
.chip-outro.is-pending { color: #3c5845; border-color: #5b866d; }

/* ---------- Cards / panels ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card, .panel {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.card { display: flex; flex-direction: column; gap: 10px; }
.card h3, .panel > h3, .panel-title {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}
.card-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--lm-hunter); line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card-link { margin-top: auto; font-weight: 500; align-self: flex-start; }
.card-admin { border-color: #b2e5e5; background: linear-gradient(180deg, #f3fbfb, #fff 60%); }
.card ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.card ul.plain li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card ul.plain li .dim { color: var(--muted); font-size: 12.5px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 0; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats dt { font-size: 11.5px; color: var(--muted); }
.mini-stats dd { margin: 0; font-family: var(--font-mono); font-weight: 600; color: var(--lm-hunter); }
.progress { height: 6px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--lm-teal); border-radius: 999px; transition: width .3s; }

.panel { margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { font-size: 17px; }
.section-title { font-size: 17px; margin: 26px 0 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.stat { background: var(--lm-neutral); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--lm-hunter); margin-top: 2px; }
.stat-hi { background: #e6f7f7; border-color: #b2e5e5; }
.stat-hi .stat-value { color: var(--lm-skobeloff); }

/* ---------- Tables ---------- */
.table-wrap {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: auto; max-height: 76vh;
  -webkit-overflow-scrolling: touch;
}
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
.tbl thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--lm-neutral); box-shadow: inset 0 -1px 0 var(--border);
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.tbl tbody tr:last-child td, .tbl tbody tr:last-child th { border-bottom: 0; }
.tbl.hover tbody tr:hover td { background: #fafcfb; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .wrap { white-space: normal; min-width: 220px; }
.tbl tr.inactive td { color: var(--lm-soft-gray); }
.tbl tr.inactive td .strong { color: var(--muted); }
.tbl .actions { text-align: right; }
.tbl .actions .btn + .btn { margin-left: 4px; }
.tbl tfoot td, .tbl tr.total-row td, .tbl tr.total-row th { font-weight: 600; background: var(--lm-neutral); color: var(--lm-hunter); }
.tbl tfoot td { position: sticky; bottom: 0; box-shadow: inset 0 1px 0 var(--border); }
.tbl input[type="number"], .tbl select { min-height: 34px; padding: 5px 8px; }
.tbl .cell-input { width: 90px; }
.tbl .cell-select { max-width: 180px; }
.tbl-sticky-first th:first-child, .tbl-sticky-first td:first-child { position: sticky; left: 0; background: #fff; z-index: 2; }
.tbl-sticky-first thead th:first-child { z-index: 4; background: var(--lm-neutral); }
.tbl-sticky-first tr.total-row th:first-child { background: var(--lm-neutral); }

/* ---------- Forms ---------- */
input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="search"], select, textarea {
  font: inherit; color: var(--lm-night);
  padding: 8px 10px; min-height: 38px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .12s, box-shadow .12s;
  max-width: 100%;
}
textarea { min-height: 80px; resize: vertical; width: 100%; }
select { padding-right: 28px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lm-teal); box-shadow: var(--focus-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--lm-neutral); color: var(--muted); cursor: not-allowed; }
input[type="checkbox"] { accent-color: var(--lm-teal); width: 16px; height: 16px; margin: 0; }
input[type="number"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 500; color: var(--lm-hunter); }
.field .hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; color: var(--lm-hunter); }
.check.disabled { color: var(--lm-soft-gray); cursor: not-allowed; }
.estimate { background: #e6f7f7; border: 1px solid #b2e5e5; color: var(--lm-skobeloff); border-radius: var(--radius-sm); padding: 8px 12px; font-weight: 500; }
.estimate.warn { background: #fef3c7; border-color: #fde68a; color: var(--lm-attention); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.seg .btn { border-radius: 0; border: 0; min-height: 36px; }
.seg .btn + .btn { border-left: 1px solid var(--border); }
.seg .btn:hover { background: var(--lm-neutral); }
.year-select { font-weight: 600; color: var(--lm-hunter); }

/* ---------- States ---------- */
.loading { color: var(--muted); padding: 28px 0; display: flex; align-items: center; gap: 10px; }
.loading::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #d1d5db; border-top-color: var(--lm-teal);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty {
  background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; color: var(--muted);
}
.empty.inline { padding: 14px; border-style: solid; border-color: var(--border); }
.empty.compact { padding: 8px 0; border: 0; background: transparent; text-align: left; }
.error-box { background: #fee2e2; border: 1px solid #fecaca; color: var(--lm-danger); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice { background: #fef3c7; border: 1px solid #fde68a; color: var(--lm-attention); border-radius: var(--radius-sm); padding: 10px 14px; }
.notice-info { background: #e6f7f7; border-color: #b2e5e5; color: var(--lm-skobeloff); }
.notice-danger { background: #fee2e2; border-color: #fecaca; color: var(--lm-danger); }
.unsaved { color: var(--lm-attention); font-weight: 600; }
.unsaved::before { content: "●"; margin-right: 6px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  background: var(--lm-night); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(17, 17, 17, .22); font-size: 13.5px; line-height: 1.4;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
  border-left: 4px solid var(--lm-soft-gray);
}
.toast.show { opacity: 1; transform: none; }
.toast-success { background: var(--lm-skobeloff); border-left-color: var(--lm-success-bg); }
.toast-error { border-left-color: #f87171; }
.toast-info { border-left-color: var(--lm-teal); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17, 17, 17, .45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto;
  display: flex; flex-direction: column;
}
.modal.modal-lg { max-width: 720px; }
.modal.modal-sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; max-height: 50vh; overflow: auto; padding: 4px 0; }
.check-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-xs); cursor: pointer; }
.check-list label:hover { background: var(--lm-neutral); }
.check-list .sub { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ---------- Timesheet grid ---------- */
.week-label { font-size: 18px; }
.ts-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.review-comment { background: #fee2e2; border: 1px solid #fecaca; color: var(--lm-danger); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; }
.review-comment strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.ts-grid th.ts-proj-col { min-width: 210px; }
.ts-grid tbody th.ts-proj { font-weight: 500; text-align: left; white-space: normal; min-width: 210px; max-width: 280px; }
.ts-grid .ts-code { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--lm-teal); font-weight: 600; }
.ts-grid .ts-name { display: block; color: var(--lm-night); }
.ts-grid thead th.ts-day { text-align: center; min-width: 96px; vertical-align: top; }
.ts-grid thead th.ts-day .ts-dow { display: block; }
.ts-grid .ts-dnum { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--lm-hunter); text-transform: none; letter-spacing: 0; line-height: 1.2; }
.ts-grid thead th.is-today .ts-dnum { color: var(--lm-teal); }
.ts-grid .ts-tag { display: block; font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; max-width: 120px; margin: 2px auto 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-grid .ts-tag-hol { color: var(--lm-attention); }
.ts-grid .ts-tag-leave { color: var(--lm-skobeloff); }
.ts-grid .ts-tag-leave.is-pending { color: var(--lm-sunburst); }
.ts-grid td.ts-cell { padding: 4px 6px; position: relative; }
.ts-grid td.ts-cell input { width: 100%; min-width: 84px; text-align: right; padding: 6px 28px 6px 8px; min-height: 36px; border-radius: var(--radius-xs); }
.ts-grid td.ts-cell input:disabled { background: transparent; border-color: transparent; color: var(--lm-onyx); }
.ts-grid td.ts-cell input:disabled::placeholder { color: transparent; }
.note-btn {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; padding: 2px; line-height: 1;
  font-size: 13px; opacity: .3; border-radius: 4px; filter: grayscale(1);
}
.note-btn:hover, .note-btn:focus-visible { opacity: 1; filter: none; }
.note-btn.has-note { opacity: 1; filter: none; }
.ts-grid td.ts-cell input:disabled + .note-btn:not(.has-note) { display: none; }
.ts-grid .is-weekend { background: #f1f3f2; }
.ts-grid .is-holiday { background: #fdf3d4; }
.ts-grid .is-leave { background: #d9f5f0; }
.ts-grid .is-leave.leave-doenca { background: #fdebd0; }
.ts-grid .is-leave.leave-sem_vencimento { background: #ebeadb; }
.ts-grid .is-leave.leave-outro { background: #e2ece6; }
.ts-grid thead th.is-weekend { background: #e9ecea; }
.ts-grid thead th.is-holiday { background: #f8e8b3; }
.ts-grid thead th.is-leave { background: #bfeee6; }
.ts-grid thead th.is-leave.leave-doenca { background: #f8dcae; }
.ts-grid thead th.is-leave.leave-sem_vencimento { background: #dedcc2; }
.ts-grid thead th.is-leave.leave-outro { background: #cfdfd5; }
.ts-grid td.ts-rowtotal, .ts-grid th.ts-total-col { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; min-width: 80px; }
.ts-grid td.ts-rowtotal { font-weight: 600; color: var(--lm-hunter); }
.ts-grid tr.total-row td { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ts-grid tr.total-row td.ts-week-total { color: var(--lm-skobeloff); font-size: 15px; }
.ts-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ts-actions .spacer { flex: 1; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.history-list li:last-child { border-bottom: 0; }
.history-list .hl-week { font-weight: 500; color: var(--lm-night); min-width: 180px; }
.history-list .hl-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* ---------- Team calendar ---------- */
.today-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.today-strip .label { font-weight: 600; color: var(--lm-hunter); margin-right: 4px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-head { background: var(--lm-neutral); padding: 8px 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); text-align: center; }
.cal-day { background: #fff; min-height: 104px; padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.weekend { background: #f8f9f9; }
.cal-day.other { background: #fafafa; }
.cal-day.other .cal-dnum { color: #c4c8cc; }
.cal-day-head { display: flex; align-items: center; gap: 6px; }
.cal-dnum { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--lm-hunter); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .cal-dnum { background: var(--lm-teal); color: #fff; }
.cal-dow-m { display: none; font-size: 12px; color: var(--muted); }
.cal-hol { font-size: 11.5px; color: var(--lm-attention); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day.holiday { background: #fffbeb; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-more { font-size: 11.5px; color: var(--muted); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; align-items: center; font-size: 12.5px; color: var(--muted); }

/* ---------- Leave map ---------- */
.lm-table td.lm-edit { cursor: pointer; }
.lm-table td.lm-edit:hover { background: #e6f7f7; color: var(--lm-skobeloff); }
.lm-table td.lm-month { text-align: center; }
.lm-table .lm-pending { color: var(--lm-sunburst); font-size: 12px; }
.lm-table td.lm-zero { color: #c4c8cc; }

/* ---------- Holidays ---------- */
.hol-list { display: flex; flex-direction: column; gap: 8px; }
.hol-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; align-items: center; }
.hol-row .dow { font-size: 12px; color: var(--muted); }

/* ---------- Misc ---------- */
details.collapsible { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
details.collapsible summary { cursor: pointer; padding: 14px 20px; font-family: var(--font-display); font-weight: 600; color: var(--lm-hunter); font-size: 16px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.collapsible summary::-webkit-details-marker { display: none; }
details.collapsible summary::before { content: "▸"; color: var(--muted); font-size: 13px; transition: transform .15s; }
details.collapsible[open] summary::before { transform: rotate(90deg); }
details.collapsible .collapsible-body { padding: 0 20px 18px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.forbidden { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .content { padding: 24px 24px 48px; }
}
@media (max-width: 899px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: sticky; top: 0; left: auto; bottom: auto; width: auto;
    padding: 10px 12px; box-shadow: 0 2px 8px rgba(17, 17, 17, .25);
  }
  .sidebar-top { padding: 0 4px; }
  .hamburger { display: flex; }
  .nav, .sidebar-user { display: none; }
  .shell.nav-open .nav { display: flex; padding-top: 6px; }
  .shell.nav-open .sidebar-user { display: flex; }
  .sidebar-user { margin-top: 10px; }
  .content { margin-left: 0; padding: 18px 16px 48px; }
  .page-head { margin-bottom: 16px; }
  h1 { font-size: 22px; }
  .table-wrap { max-height: none; }
  .hol-row { grid-template-columns: 1fr; }
}
@media (max-width: 699px) {
  .cal { display: flex; flex-direction: column; gap: 0; background: #fff; }
  .cal-head { display: none; }
  .cal-day { min-height: 0; flex-direction: row; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--border); padding: 8px 10px; }
  .cal-day:last-child { border-bottom: 0; }
  .cal-day.other, .cal-day.empty { display: none; }
  .cal-day-head { flex: 0 0 76px; }
  .cal-dow-m { display: inline; }
  .cal-chips { flex-direction: row; flex-wrap: wrap; }
  .modal-foot .btn, .form-actions .btn { flex: 1 1 auto; }
  .history-list .hl-week { min-width: 0; }
}
@media (max-width: 420px) {
  .content { padding: 14px 12px 40px; }
  .card, .panel { padding: 14px 14px; }
  .btn { padding: 8px 11px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 14px; padding-right: 14px; }
}
@media print {
  .sidebar, .page-actions, .toasts, .btn { display: none !important; }
  .content { margin: 0; padding: 0; }
  .table-wrap { max-height: none; overflow: visible; box-shadow: none; }
}

.text-danger { color: var(--lm-danger); }

.cell-input.team-name { width: 100%; min-width: 220px; max-width: 420px; text-align: left; font-family: var(--font-sans); }
#teams-panel .tbl td.num { width: 1%; white-space: nowrap; }

.text-success { color: var(--lm-skobeloff); }

/* ---- folha de horas mensal ---- */
.ts-month thead th.ts-day { min-width: 46px; padding: 6px 2px; }
.ts-month .ts-dnum { font-size: 14px; }
.ts-month .ts-dow { font-size: 10px; color: var(--muted); }
.ts-month .ts-mark { display: block; font-size: 10px; line-height: 1; margin-top: 2px; }
.ts-month .ts-mark-hol { color: var(--lm-attention); font-weight: 700; }
.ts-month .ts-mark-leave { color: var(--lm-skobeloff); }
.ts-month .ts-mark-leave.is-pending { color: var(--lm-sunburst); }
.ts-month td.ts-cell { padding: 2px; }
.ts-month td.ts-cell input { min-width: 42px; width: 46px; padding: 6px 4px; text-align: center; min-height: 32px; font-size: 13px; -moz-appearance: textfield; }
.ts-month td.ts-cell input::-webkit-outer-spin-button, .ts-month td.ts-cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ts-month tbody th.ts-proj, .ts-month thead th.ts-proj-col { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 170px; max-width: 220px; box-shadow: 1px 0 0 var(--line); }
.ts-month tr.total-row td, .ts-month tr.expected-row td { text-align: center; padding: 6px 2px; font-size: 12.5px; }
.ts-month tr.total-row td.is-short { color: var(--lm-attention); }
.ts-month tr.total-row td.is-over { color: var(--lm-danger); }
.ts-month tr.total-row td:first-child, .ts-month tr.expected-row td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }
.ts-month tr.expected-row td { color: var(--muted); }
.ts-wrap { overflow-x: auto; }

/* ---- member picker ---- */
.member-picker { display: flex; flex-direction: column; gap: 8px; }
.member-picker .chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.chip-user { display: inline-flex; align-items: center; gap: 6px; background: #e6f4f3; color: var(--lm-hunter); border-radius: 999px; padding: 4px 8px 4px 10px; font-size: 13px; }
.chip-user button { border: 0; background: transparent; color: var(--lm-skobeloff); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
.chip-user button:hover { color: var(--lm-danger); }
.picker-input { position: relative; }
.picker-input input { width: 100%; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(17,17,17,.12); max-height: 260px; overflow: auto; }
.suggest li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--radius-xs); cursor: pointer; }
.suggest li:hover, .suggest li.active { background: #e6f4f3; }
