/* =========================================================
   Portal do Cliente — Minimalismo técnico
   ========================================================= */

:root {
  --bg: #FFFFFF;
  --bg-subtle: #FAFAFA;
  --bg-muted: #F5F5F5;
  --border: #EAEAEA;
  --border-strong: #D4D4D4;
  --fg: #0A0A0A;
  --fg-2: #3A3A3A;
  --fg-3: #666666;
  --fg-4: #999999;
  --fg-5: #BDBDBD;
  --accent: #0A0A0A;
  --accent-soft: #666666;

  --green: #16a34a;
  --red: #dc2626;
  --amber: #b45309;
  --blue: #2563eb;

  --radius: 6px;
  --radius-lg: 10px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-w: 240px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.num  { font-variant-numeric: tabular-nums; }

/* ------------ App shell ------------ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--bg);
}

/* ------------ Sidebar ------------ */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--fg);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: -0.02em;
}
.brand-name {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px;
  color: var(--fg-4);
  font-family: var(--font-mono);
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-4);
  padding: 14px 8px 6px;
  font-weight: 500;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 5px;
  color: var(--fg-2);
  font-size: 13px;
  margin: 1px 0;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover { background: var(--bg-muted); color: var(--fg); }
.nav-item.active {
  background: var(--bg-muted);
  color: var(--fg);
  font-weight: 500;
}
.nav-item .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-4);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}
.nav-icon {
  width: 14px; height: 14px;
  color: currentColor;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 5px;
}
.user-avatar {
  width: 26px; height: 26px;
  background: var(--fg);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: 50%;
  font-weight: 600;
}
.user-name { font-size: 12px; font-weight: 500; }
.user-role { font-size: 10.5px; color: var(--fg-4); font-family: var(--font-mono); }

/* ------------ Main / Topbar ------------ */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 10;
}
.breadcrumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg-3);
}
.breadcrumbs .sep { color: var(--fg-5); }
.breadcrumbs .current { color: var(--fg); font-weight: 500; }

.topbar-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--fg-3);
}
.icon-btn:hover { background: var(--bg-muted); color: var(--fg); }

.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block;
  background: var(--fg-5);
}
.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22,163,74,0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74,0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* ------------ Page ------------ */
.page {
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.page-sub {
  font-size: 13px;
  color: var(--fg-3);
  font-family: var(--font-mono);
}
.page-actions { display: flex; gap: 8px; }

/* ------------ Buttons ------------ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
  transition: background 0.1s;
}
.btn:hover { background: var(--bg-muted); }
.btn.primary {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
}
.btn.primary:hover { background: #222; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--bg-muted); }
.btn .icon { width: 14px; height: 14px; }

/* ------------ Cards / Grid ------------ */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-2);
}
.card-sub { font-size: 11.5px; color: var(--fg-4); font-family: var(--font-mono); }
.card-body { padding: 18px; }

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

/* ------------ KPI ------------ */
.kpi {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-4);
  font-weight: 500;
}
.kpi-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  margin-top: 4px;
  color: var(--fg-3);
}
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--fg-4);
  font-family: var(--font-mono);
  display: flex; justify-content: space-between;
}

/* ------------ Pills / tags ------------ */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--fg-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}
.pill.green { color: var(--green); background: #f0fdf4; border-color: #dcfce7; }
.pill.amber { color: var(--amber); background: #fffbeb; border-color: #fef3c7; }
.pill.red   { color: var(--red);   background: #fef2f2; border-color: #fee2e2; }
.pill.blue  { color: var(--blue);  background: #eff6ff; border-color: #dbeafe; }
.pill.dark  { color: #fff; background: var(--fg); border-color: var(--fg); }

/* ------------ Progress bar ------------ */
.bar {
  height: 6px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--fg);
  border-radius: 999px;
}
.bar.thin { height: 3px; }

/* ------------ Image placeholder (striped) ------------ */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      -45deg,
      #F6F6F6 0 10px,
      #EFEFEF 10px 20px
    );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid; place-items: center;
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: 0.02em;
  aspect-ratio: 4/3;
}
.placeholder-label {
  background: #fff;
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
  color: var(--fg-3);
  max-width: 80%;
}

/* ------------ Tables ------------ */
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.t th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-4);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
table.t td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-2);
  vertical-align: middle;
}
table.t tr:last-child td { border-bottom: none; }
table.t tr:hover td { background: var(--bg-subtle); }

/* ------------ Divider with label ------------ */
.section-label {
  display: flex; align-items: center; gap: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-4);
  font-weight: 500;
  margin: 28px 0 12px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ------------ Login ------------ */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-left {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.login-right {
  background:
    repeating-linear-gradient(
      135deg,
      #F6F6F6 0 14px,
      #F0F0F0 14px 28px
    );
  border-left: 1px solid var(--border);
  position: relative;
  display: grid; place-items: center;
  padding: 40px;
}
.login-right-inner {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  max-width: 360px;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}
.login-right-inner h4 {
  font-family: var(--font-sans);
  font-size: 12px;
  margin: 0 0 12px;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.meta-row {
  display: flex; justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
}
.meta-row:last-child { border: none; }
.meta-row span:first-child { color: var(--fg-4); }
.meta-row span:last-child { color: var(--fg); }

.login-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 40px;
}
.login-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.login-sub {
  font-size: 14px;
  color: var(--fg-3);
  margin-bottom: 32px;
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: #fff;
  color: var(--fg);
  transition: border 0.1s, box-shadow 0.1s;
}
.field input:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.06);
}
.field input.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
.field-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--fg-3); margin-bottom: 20px;}
.field-row a { color: var(--fg); font-weight: 500; }

.btn-block {
  width: 100%;
  height: 40px;
  font-size: 13.5px;
  justify-content: center;
}
.login-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--fg-4);
  font-family: var(--font-mono);
  display: flex; justify-content: space-between;
}

/* ------------ Gantt ------------ */
.gantt {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}
.gantt-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-4);
}
.gantt-head > div:first-child {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
}
.gantt-months {
  display: grid;
  font-family: var(--font-mono);
}
.gantt-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.gantt-row:last-child { border-bottom: none; }
.gantt-label {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.gantt-label-name { font-size: 13px; font-weight: 500; }
.gantt-label-meta { font-size: 10.5px; color: var(--fg-4); font-family: var(--font-mono); }
.gantt-track {
  position: relative;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0 calc(100%/12 - 1px),
      var(--border) calc(100%/12 - 1px) calc(100%/12)
    );
}
.gantt-bar {
  position: absolute;
  top: 10px; bottom: 10px;
  background: var(--fg);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 11px;
  font-family: var(--font-mono);
}
.gantt-bar.done { background: var(--fg-3); }
.gantt-bar.future { background: var(--bg-muted); color: var(--fg-3); border: 1px dashed var(--border-strong); }
.gantt-bar .prog {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: rgba(255,255,255,0.15);
}
.gantt-today {
  position: absolute; top: 0; bottom: 0;
  width: 1px;
  background: var(--red);
}
.gantt-today::before {
  content: "HOJE";
  position: absolute;
  top: -14px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--red);
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ------------ Diário ------------ */
.diary-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
}
.diary-row:hover { background: var(--bg-subtle); }
.diary-row:last-child { border-bottom: none; }
.diary-date-block {
  border-right: 1px solid var(--border);
  padding-right: 20px;
  font-family: var(--font-mono);
}
.diary-date-day { font-size: 24px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.diary-date-mo { font-size: 11px; color: var(--fg-4); text-transform: uppercase; margin-top: 4px; }

/* ------------ Camera grid ------------ */
.cam {
  position: relative;
  aspect-ratio: 16/9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0A0A0A;
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
.cam-stripes {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.02) 0 2px,
      transparent 2px 4px
    );
}
.cam-overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.cam-top { display: flex; justify-content: space-between; }
.cam-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 3px;
  color: #fff;
}
.cam-live { color: #ff5e5e; }
.cam-bot {
  display: flex; justify-content: space-between;
  color: rgba(255,255,255,0.8);
  font-size: 10px;
}
.cam-name { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: #fff; margin-top: 4px; }
.cam-label-center {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}

/* ------------ File list ------------ */
.file-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
}
.file-row:hover { background: var(--bg-subtle); }
.file-row:last-child { border-bottom: none; }
.file-ico {
  width: 32px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 3px;
  position: relative;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--fg-4);
  display: grid; place-items: end center;
  padding-bottom: 4px;
}
.file-ico::after {
  content: "";
  position: absolute; top: 0; right: 0;
  width: 8px; height: 8px;
  background: var(--border);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.file-name { font-weight: 500; color: var(--fg); }
.file-meta { font-size: 11.5px; color: var(--fg-4); font-family: var(--font-mono); }

/* ------------ Photo grid (diary detail) ------------ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.photo-grid .placeholder { aspect-ratio: 1; }
.photo-grid .placeholder.hero {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

/* ------------ Charts ------------ */
.chart-wrap { position: relative; width: 100%; }
.chart-legend {
  display: flex; gap: 18px;
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono);
}
.legend-sw {
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 2px;
}

/* ------------ Modal ------------ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.4);
  z-index: 40;
  display: grid; place-items: center;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: min(920px, 94vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: popIn 0.2s ease-out;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-body {
  padding: 20px;
  overflow: auto;
  flex: 1;
}

/* ------------ Misc ------------ */
.stack-tight > * + * { margin-top: 8px; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--fg-4); }
.small { font-size: 12px; }
.tiny  { font-size: 11px; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollbar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.scrollbar::-webkit-scrollbar-track { background: transparent; }

/* Tweaks panel */
.tweaks {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 280px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 14px;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  font-size: 12px;
}
.tweaks h5 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  display: flex; justify-content: space-between;
}
.tweaks-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.tweaks-row:first-of-type { border-top: none; }
.tweaks-row label { color: var(--fg-3); font-size: 11.5px; }
.tweaks-row .seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.tweaks-row .seg button {
  border: none; background: transparent;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono);
}
.tweaks-row .seg button.on {
  background: var(--fg);
  color: #fff;
}

/* =========================================================
   REFINED MOTION
   ========================================================= */

:root {
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.35, 0.64, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 380ms;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Global transitions on common UI ---- */
.btn {
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-0.5px); }
.btn:active { transform: translateY(0); transition-duration: 40ms; }
.btn.primary:hover {
  box-shadow: 0 2px 10px rgba(10,10,10,0.12);
}

.icon-btn {
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { transform: scale(1.04); }
.icon-btn:active { transform: scale(0.96); transition-duration: 60ms; }

.card {
  transition: border-color var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              transform var(--dur) var(--ease-out);
}

.pill {
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

/* ---- Sidebar nav: sliding indicator ---- */
.nav-list {
  padding: 0;
}
.nav-indicator {
  position: absolute;
  left: 0; right: 0;
  background: var(--bg-muted);
  border-radius: 5px;
  z-index: 0;
  pointer-events: none;
  transition:
    top   var(--dur) var(--ease-out),
    height var(--dur) var(--ease-out),
    opacity 180ms var(--ease-out);
}
.nav-item {
  position: relative;
  z-index: 1;
  transition:
    color var(--dur-fast) var(--ease-out),
    padding-left 180ms var(--ease-out);
  background: transparent !important;
}
.nav-item:hover:not(.active) { color: var(--fg); }
.nav-item:hover:not(.active) .nav-icon { transform: translateX(1px); }
.nav-item .nav-icon { transition: transform 180ms var(--ease-out); }
.nav-item.active { background: transparent !important; }
.nav-item.active .nav-icon { transform: translateX(0); }

/* ---- Page transitions ---- */
.page-transition {
  animation: pageIn 320ms var(--ease-out) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* staggered page content */
.page > * {
  animation: contentIn 420ms var(--ease-out) both;
}
.page > *:nth-child(1) { animation-delay: 20ms; }
.page > *:nth-child(2) { animation-delay: 70ms; }
.page > *:nth-child(3) { animation-delay: 120ms; }
.page > *:nth-child(4) { animation-delay: 170ms; }
.page > *:nth-child(5) { animation-delay: 220ms; }
.page > *:nth-child(6) { animation-delay: 260ms; }
.page > *:nth-child(7) { animation-delay: 300ms; }
@keyframes contentIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb crumb swap */
.crumb-anim {
  display: inline-block;
  animation: crumbSwap 260ms var(--ease-out) both;
}
@keyframes crumbSwap {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- KPI subtle hover + value count ---- */
.kpi {
  transition: border-color var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              transform var(--dur) var(--ease-out);
}
.kpi:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 20px -8px rgba(10,10,10,0.08);
  transform: translateY(-1px);
}
.kpi-value {
  animation: numIn 520ms var(--ease-out) both;
}
@keyframes numIn {
  from { opacity: 0; transform: translateY(6px); letter-spacing: -0.04em; }
  to   { opacity: 1; transform: translateY(0); letter-spacing: -0.02em; }
}

/* ---- Progress bar fill animation ---- */
.bar > span {
  animation: barFill 900ms var(--ease-out) both;
  transform-origin: left center;
}
@keyframes barFill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ---- Gantt bar grow ---- */
.gantt-bar {
  animation: ganttIn 620ms var(--ease-out) both;
  transform-origin: left center;
  transition: filter 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.gantt-bar:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 2px rgba(10,10,10,0.08);
  cursor: pointer;
}
@keyframes ganttIn {
  from { transform: scaleX(0); opacity: 0.2; }
  to   { transform: scaleX(1); opacity: 1; }
}
.gantt-row:nth-child(2) .gantt-bar { animation-delay: 40ms; }
.gantt-row:nth-child(3) .gantt-bar { animation-delay: 80ms; }
.gantt-row:nth-child(4) .gantt-bar { animation-delay: 120ms; }
.gantt-row:nth-child(5) .gantt-bar { animation-delay: 160ms; }
.gantt-row:nth-child(6) .gantt-bar { animation-delay: 200ms; }
.gantt-row:nth-child(7) .gantt-bar { animation-delay: 240ms; }
.gantt-row:nth-child(8) .gantt-bar { animation-delay: 280ms; }
.gantt-row:nth-child(9) .gantt-bar { animation-delay: 320ms; }
.gantt-row:nth-child(10) .gantt-bar { animation-delay: 360ms; }
.gantt-row:nth-child(11) .gantt-bar { animation-delay: 400ms; }

.gantt-bar .prog {
  animation: progFill 1.1s var(--ease-out) 600ms both;
  transform-origin: left center;
}
@keyframes progFill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.gantt-today {
  animation: todayIn 400ms var(--ease-out) 700ms both;
}
@keyframes todayIn {
  from { opacity: 0; transform: scaleY(0); }
  to   { opacity: 1; transform: scaleY(1); }
}

/* ---- Diary list row hover ---- */
.diary-row, .file-row {
  transition: background var(--dur-fast) var(--ease-out),
              padding-left var(--dur-fast) var(--ease-out);
}
.file-row:hover { padding-left: 18px; }

/* ---- Table rows ---- */
table.t tr {
  transition: background var(--dur-fast) var(--ease-out);
}
table.t td {
  transition: color var(--dur-fast) var(--ease-out);
}

/* ---- Photo grid ---- */
.placeholder {
  transition: transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}
.photo-grid .placeholder {
  animation: photoIn 520ms var(--ease-out) both;
}
.photo-grid .placeholder:nth-child(1) { animation-delay: 0ms; }
.photo-grid .placeholder:nth-child(2) { animation-delay: 50ms; }
.photo-grid .placeholder:nth-child(3) { animation-delay: 100ms; }
.photo-grid .placeholder:nth-child(4) { animation-delay: 150ms; }
.photo-grid .placeholder:nth-child(5) { animation-delay: 200ms; }
.photo-grid .placeholder:nth-child(6) { animation-delay: 250ms; }
.photo-grid .placeholder:nth-child(7) { animation-delay: 300ms; }
.photo-grid .placeholder:nth-child(8) { animation-delay: 350ms; }
.photo-grid .placeholder:hover {
  transform: scale(1.015);
  box-shadow: 0 8px 24px -8px rgba(10,10,10,0.18);
  border-color: var(--border-strong);
  z-index: 2;
  cursor: zoom-in;
}
@keyframes photoIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---- Camera feed: subtle scanline drift + recording blink ---- */
.cam {
  transition: transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
  animation: camIn 520ms var(--ease-out) both;
}
.cam:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.4);
}
.cam-stripes {
  animation: scanDrift 8s linear infinite;
}
@keyframes scanDrift {
  from { background-position: 0 0; }
  to   { background-position: 0 200px; }
}
@keyframes camIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cam-tag .cam-live {
  animation: liveBlink 1.6s ease-in-out infinite;
}
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ---- Status dot "live" (already exists pulse) reuse --- */

/* ---- Notification dot ---- */
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220,38,38,0.7);
  animation: notifPulse 2.4s ease-in-out infinite;
}
@keyframes notifPulse {
  0%   { box-shadow: 0 0 0 0 rgba(220,38,38,0.55); }
  60%  { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

/* ---- Modal enter (backdrop + content) ---- */
.modal-backdrop {
  animation: backdropIn 180ms var(--ease-out) both;
}
@keyframes backdropIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(4px); }
}
.modal {
  animation: modalIn 280ms var(--ease-out) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Tweaks panel ---- */
@keyframes tweakIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tweaks-row .seg button {
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

/* ---- Login form ---- */
.login-left { animation: loginLeftIn 520ms var(--ease-out) both; }
.login-right { animation: loginRightIn 620ms var(--ease-out) both; }
.login-right-inner { animation: loginMetaIn 620ms var(--ease-out) 120ms both; }
@keyframes loginLeftIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes loginRightIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes loginMetaIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.field input {
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

/* ---- Brand mark on hover ---- */
.brand-mark {
  transition: transform var(--dur) var(--ease-spring);
}
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.05); }

/* ---- Chart paths draw in ---- */
.card svg path[stroke]:not([stroke-dasharray]) {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 1.4s var(--ease-out) 150ms forwards;
}
.card svg path[stroke-dasharray="4 3"] {
  opacity: 0;
  animation: fadeInPath 600ms var(--ease-out) 900ms forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes fadeInPath { to { opacity: 1; } }
.card svg circle {
  opacity: 0;
  animation: dotIn 300ms var(--ease-out) both;
}
.card svg circle:nth-child(10) { animation-delay: 900ms; }
.card svg circle:nth-child(11) { animation-delay: 960ms; }
.card svg circle:nth-child(12) { animation-delay: 1020ms; }
.card svg circle:nth-child(13) { animation-delay: 1080ms; }
.card svg circle:nth-child(14) { animation-delay: 1140ms; }
.card svg circle:nth-child(15) { animation-delay: 1200ms; }
@keyframes dotIn {
  from { opacity: 0; transform: scale(0.4); transform-origin: center; }
  to   { opacity: 1; transform: scale(1); }
}

/* ---- Bars in chart ---- */
.card svg rect {
  transform-origin: bottom;
  animation: rectGrow 620ms var(--ease-out) both;
}
.card svg rect:nth-of-type(1) { animation-delay: 80ms; }
.card svg rect:nth-of-type(2) { animation-delay: 140ms; }
.card svg rect:nth-of-type(3) { animation-delay: 200ms; }
.card svg rect:nth-of-type(4) { animation-delay: 260ms; }
.card svg rect:nth-of-type(5) { animation-delay: 320ms; }
.card svg rect:nth-of-type(6) { animation-delay: 380ms; }
.card svg rect:nth-of-type(7) { animation-delay: 440ms; }
.card svg rect:nth-of-type(8) { animation-delay: 500ms; }
@keyframes rectGrow {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* ---- Donut draw ---- */
.card svg circle[stroke-dasharray] {
  animation: donutDraw 1.1s var(--ease-out) both;
}
@keyframes donutDraw {
  from { stroke-dashoffset: 999; }
}

/* ---- Milestone rows ---- */
.milestone-row {
  animation: contentIn 500ms var(--ease-out) both;
}

/* ---- Focus states (accessibility) ---- */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10,10,10,0.08);
  border-radius: 5px;
}
