/* SIMBORA - design system: black, white, graphite. Mobile first. */

:root {
  --ink: #0a0a0a;
  --ink-soft: #1c1c1c;
  --g900: #262626;
  --g700: #404040;
  --g500: #737373;
  --g400: #a3a3a3;
  --g300: #d4d4d4;
  --g200: #e5e5e5;
  --g100: #f0f0f0;
  --g50: #f7f7f7;
  --paper: #ffffff;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --pad: 16px;

  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .06);
  --shadow: 0 4px 20px -6px rgba(10, 10, 10, .14), 0 1px 3px rgba(10, 10, 10, .06);
  --shadow-lg: 0 24px 60px -16px rgba(10, 10, 10, .30);

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

  --nav-h: 66px;
  --rail-w: 232px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--g50);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ boot */

.boot {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-content: center; gap: 18px; justify-items: center;
  background: var(--ink); color: var(--paper);
}
.boot-logo { width: 62px; height: 62px; color: var(--paper); }
.boot-mark { font-size: 30px; font-weight: 750; letter-spacing: .34em; padding-left: .34em; }
.boot-bar { width: 140px; height: 2px; background: #333; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--paper); animation: slide 1.1s infinite ease-in-out; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ------------------------------------------------------------------ login */

.login {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--ink);
  color: var(--paper);
}
.login-hero { padding: 48px 24px 28px; }
.login-hero .eyebrow { font-size: 10px; letter-spacing: .3em; color: var(--g500); font-weight: 700; }
.login-hero .wordmark { font-size: 40px; font-weight: 750; letter-spacing: .14em; margin-top: 6px; }
.login-hero p { color: var(--g400); margin-top: 10px; max-width: 34ch; font-size: 14px; }
.login-card {
  background: var(--paper); color: var(--ink);
  border-radius: 26px 26px 0 0;
  padding: 30px 22px calc(34px + var(--safe-b));
}
.login-card .field { margin-bottom: 14px; }
.login-hint {
  margin-top: 20px; padding: 14px; border-radius: var(--radius-sm);
  background: var(--g50); border: 1px solid var(--g200);
  font-size: 12.5px; color: var(--g700);
}
.login-hint b { color: var(--ink); }

/* Termo de parceria: porta de entrada bloqueante do influenciador. */
.term-doc {
  max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px; border: 1px solid var(--g200); border-radius: var(--radius-sm);
  background: var(--g50); font-size: 13px; line-height: 1.65; color: var(--g900);
}
.term-doc h4 { font-size: 13px; margin: 16px 0 4px; color: var(--ink); }
.term-doc h4:first-child { margin-top: 0; }
.term-doc p { margin: 0 0 8px; }
.term-meta {
  margin-top: 10px; font-family: var(--mono); font-size: 10.5px;
  color: var(--g500); overflow-wrap: anywhere;
}
.login-hint code { font-family: var(--mono); font-size: 12px; }

/* ------------------------------------------------------------------ shell */

.shell { min-height: 100%; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--ink); color: var(--paper);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.topbar .mark { font-size: 15px; font-weight: 750; letter-spacing: .22em; }
.topbar .sub { font-size: 10px; letter-spacing: .18em; color: var(--g500); font-weight: 700; }
.topbar .grow { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { flex: none; width: 30px; height: 30px; color: currentColor; }
.login-hero .brand-logo { width: 54px; height: 54px; margin-bottom: 14px; }
.topbar-btn {
  border: 1px solid #333; background: #141414; color: var(--paper);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.topbar-btn:active { background: #222; }
.topbar-btn .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--paper); }

.scope-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid #333; border-radius: 999px; padding: 4px 10px; color: var(--g300);
}

.main { padding: var(--pad) var(--pad) 32px; max-width: 1180px; margin: 0 auto; }

.page-head { margin-bottom: 16px; }
.page-head .kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; color: var(--g500); text-transform: uppercase; }
.page-head h1 { margin-top: 4px; }
.page-head .lead { color: var(--g500); font-size: 13.5px; margin-top: 6px; max-width: 62ch; }

/* ------------------------------------------------------------- bottom nav */

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--g200);
  padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
}
.nav a {
  text-decoration: none; color: var(--g500);
  display: grid; justify-items: center; gap: 3px;
  padding: 9px 2px 8px; font-size: 10px; font-weight: 650; letter-spacing: .01em;
  position: relative;
}
.nav a svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--ink); }
.nav a.on::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2px; background: var(--ink); border-radius: 0 0 2px 2px;
}
.nav .badge {
  position: absolute; top: 5px; right: 50%; margin-right: -20px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--ink); color: var(--paper);
  border-radius: 999px; font-size: 9.5px; font-weight: 750;
  display: grid; place-content: center; border: 2px solid var(--paper);
}

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--paper);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }
.card-pad { padding: var(--pad); }
.card-head {
  padding: 14px var(--pad); border-bottom: 1px solid var(--g100);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { flex: 1; }
.card-head .hint { font-size: 11.5px; color: var(--g500); font-weight: 500; }

.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }

/* ------------------------------------------------------------------- kpis */

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi {
  background: var(--paper); border: 1px solid var(--g200); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: var(--shadow-sm);
}
.kpi .k-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--g500); }
.kpi .k-value { font-size: 27px; font-weight: 700; letter-spacing: -.03em; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 14px; font-weight: 650; color: var(--g500); letter-spacing: 0; }
.kpi .k-foot { font-size: 11.5px; color: var(--g500); margin-top: 3px; }
.kpi.dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.kpi.dark .k-label { color: var(--g400); }
.kpi.dark .k-foot { color: var(--g400); }
.kpi.wide { grid-column: 1 / -1; }

.delta { font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.delta.up { color: var(--ink); }
.delta.down { color: var(--g700); }
.delta.flat { color: var(--g400); }

/* ------------------------------------------------------------------ chips */

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--g300); background: var(--paper); color: var(--g700);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex: none;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip:disabled { opacity: .45; cursor: default; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--g300); color: var(--g700);
  background: var(--paper); white-space: nowrap;
}
.tag.solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tag.ghost { border-style: dashed; color: var(--g500); }
.tag.demo { border-color: var(--g400); background: var(--g100); color: var(--g700); letter-spacing: .12em; }
.tag.alta { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tag.media { background: var(--g200); border-color: var(--g300); color: var(--ink); }
.tag.baixa { background: var(--paper); }
.tag.warn { border-style: dashed; border-color: var(--ink); color: var(--ink); }

/* Anexos de acoes de marketing: tira de miniaturas quadradas. */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumb {
  position: relative; display: block; width: 74px; height: 74px; flex: none;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--g300); background: var(--g100);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0;
  border-radius: 50%; background: var(--ink); color: var(--paper);
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
}

.prose { font-size: 14px; line-height: 1.6; color: var(--g900); overflow-wrap: anywhere; }

.dot-state { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot-state.ativo { background: var(--ink); }
.dot-state.pausado { background: var(--g400); }
.dot-state.cancelado { background: var(--paper); border: 1.5px solid var(--g400); }
.dot-state.pendente { background: repeating-linear-gradient(45deg, var(--ink) 0 2px, var(--paper) 2px 4px); border: 1px solid var(--g400); }

/* ----------------------------------------------------------------- inputs */

.field label, .field > .lbl {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--g500); margin-bottom: 6px;
}
.field .help { font-size: 11.5px; color: var(--g500); margin-top: 5px; line-height: 1.35; }
.field .err { font-size: 12px; color: var(--ink); font-weight: 600; margin-top: 5px; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--g300); border-radius: var(--radius-sm);
  background: var(--paper); appearance: none;
  font-size: 15px; /* keeps iOS from zooming on focus */
}
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23737373' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background: var(--g100); color: var(--g500); }
.field.invalid input, .field.invalid select { border-color: var(--ink); background: var(--g100); }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 3px 0; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: #0a0a0a; }
.check span { font-size: 14px; }
.check small { display: block; color: var(--g500); font-size: 12px; }

.seg { display: flex; border: 1px solid var(--g300); border-radius: var(--radius-sm); overflow: hidden; }
.seg button {
  flex: 1; border: 0; background: var(--paper); color: var(--g700);
  padding: 10px 8px; font-size: 13px; font-weight: 650; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--g300); }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg button:disabled { color: var(--g400); background: var(--g100); cursor: not-allowed; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  border-radius: var(--radius-sm); padding: 12px 17px;
  font-size: 14.5px; font-weight: 650; cursor: pointer; text-decoration: none;
  min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--g300); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--g700); padding: 9px 11px; }
.btn.sm { padding: 8px 13px; font-size: 13px; min-height: 38px; }
.btn.xs { padding: 6px 10px; font-size: 12px; min-height: 32px; border-radius: 8px; }
.btn.danger { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ lists */

.list { display: grid; }
.list > * + * { border-top: 1px solid var(--g100); }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px var(--pad); background: none; border: 0; width: 100%;
  text-align: left; cursor: pointer; font: inherit;
}
.item:active { background: var(--g50); }
.item .t { font-weight: 600; font-size: 14.5px; }
.item .s { font-size: 12px; color: var(--g500); margin-top: 2px; }
.item .chev { color: var(--g400); flex: none; }
.item.static { cursor: default; }
.item.static:active { background: none; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--g100); border: 1px solid var(--g200);
  display: grid; place-content: center;
  font-size: 13px; font-weight: 700; color: var(--g700); letter-spacing: .02em;
}
.avatar.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.rank {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--paper); border: 1px solid var(--g300);
  display: grid; place-content: center;
  font-size: 14px; font-weight: 750; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--g700);
}
.rank.top { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.meter { height: 5px; background: var(--g200); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.meter.soft i { background: var(--g400); }

/* ------------------------------------------------------------------ table */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
table.data th, table.data td { padding: 10px 12px; text-align: right; white-space: nowrap; }
table.data th {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--g500); font-weight: 700; border-bottom: 1px solid var(--g200);
  position: sticky; top: 0; background: var(--paper);
}
table.data th:first-child, table.data td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); }
table.data tbody tr + tr td { border-top: 1px solid var(--g100); }
table.data tfoot td { border-top: 2px solid var(--ink); font-weight: 700; }
table.data td.num { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- charts */

.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--g500); font-size: 9.5px; }
.chart .axis { stroke: var(--g200); stroke-width: 1; }
.chart .grid { stroke: var(--g100); stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.soft { stroke: var(--g400); stroke-width: 1.6; stroke-dasharray: 4 3; }
.chart .area { fill: var(--g100); }
.chart .pt { fill: var(--ink); }
.chart .bar { fill: var(--ink); }
.chart .bar.soft { fill: var(--g400); }
.chart .bar.light { fill: var(--g200); }
.chart .bar.neg { fill: var(--paper); stroke: var(--g700); stroke-width: 1; }
.chart .ref { stroke: var(--g400); stroke-dasharray: 3 3; stroke-width: 1; }
.chart .proj { fill: var(--g300); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--g500); }
.chart-legend b { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart-legend .s-ink { background: var(--ink); }
.chart-legend .s-mid { background: var(--g400); }
.chart-legend .s-lite { background: var(--g200); }
.chart-legend .s-out { background: var(--paper); box-shadow: inset 0 0 0 1px var(--g700); }

.spark { display: block; width: 100%; height: 30px; }
.spark path { fill: none; stroke: var(--ink); stroke-width: 1.6; }

/* ------------------------------------------------------------- attendance */

.att-row { display: flex; align-items: center; gap: 12px; padding: 11px var(--pad); }
.att-row + .att-row { border-top: 1px solid var(--g100); }
.att-row.marked { background: var(--g50); }
.att-pick {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  border: 1.5px solid var(--g300); background: var(--paper);
  display: grid; place-content: center; cursor: pointer; padding: 0;
}
.att-pick.on { background: var(--ink); border-color: var(--ink); }
.att-pick svg { width: 15px; height: 15px; stroke: var(--paper); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.att-pick.on svg { opacity: 1; }
.att-state { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.att-state.registrada { color: var(--ink); }
.att-state.sem_registro { color: var(--g400); }

.bulkbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
  z-index: 35; background: var(--ink); color: var(--paper);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 11px 13px; display: flex; align-items: center; gap: 10px;
}
.bulkbar .n { font-size: 13px; font-weight: 650; }
.bulkbar .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.bulkbar .btn.ghost { background: transparent; color: var(--paper); border-color: #444; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-size: 10px; font-weight: 700; color: var(--g400); text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.cal .cell {
  aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--g200);
  display: grid; place-content: center; gap: 1px; font-size: 12px;
  background: var(--paper); cursor: pointer; padding: 0;
}
.cal .cell .d { font-weight: 650; font-variant-numeric: tabular-nums; }
.cal .cell .n { font-size: 9px; color: var(--g500); }
.cal .cell.registrada { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cal .cell.registrada .n { color: var(--g400); }
.cal .cell.futuro { background: var(--g50); color: var(--g300); border-style: dashed; cursor: default; }
.cal .cell.empty { border: 0; background: none; cursor: default; }
.cal .cell.today { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------------------------------------------------------------- voucher */

.vcard {
  border: 1px solid var(--g200); border-radius: var(--radius); overflow: hidden;
  background: var(--paper); box-shadow: var(--shadow-sm);
}
.vcard .vhead { background: var(--ink); color: var(--paper); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.vcard .vcode { font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.vcard .vbody { padding: 13px 14px; }
.vcard .vmoney { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vcard .vmoney .big { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.vcard .vmoney .lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g500); }
.vstatus { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }

/* ------------------------------------------------------------ feedback UI */

.empty { padding: 38px 22px; text-align: center; }
.empty .mark {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  border: 1px dashed var(--g300); display: grid; place-content: center; color: var(--g400);
}
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--g500); font-size: 13.5px; max-width: 42ch; margin: 0 auto 16px; }

.skel { background: var(--g100); border-radius: 8px; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.skel-line { height: 12px; }
.skel-card { height: 82px; border-radius: var(--radius); }

.errbox {
  border: 1px solid var(--ink); border-radius: var(--radius); padding: 15px;
  background: var(--paper);
}
.errbox h3 { margin-bottom: 5px; }
.errbox p { font-size: 13.5px; color: var(--g700); margin-bottom: 12px; }

.notice {
  border: 1px solid var(--g300); background: var(--g50);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13px; color: var(--g700);
}
.notice.strong { border-color: var(--ink); background: var(--paper); color: var(--ink); }
.notice.strong b { font-weight: 700; }

.toasts {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  z-index: 70; display: grid; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13.5px; box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: flex-start;
  animation: rise .22s ease-out;
}
.toast.warn { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }

/* ------------------------------------------------------------------ sheet */

.sheet { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet .veil { position: absolute; inset: 0; background: rgba(10, 10, 10, .45); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet .panel {
  position: relative; background: var(--paper);
  border-radius: 22px 22px 0 0; max-height: 92vh;
  display: flex; flex-direction: column; animation: up .26s cubic-bezier(.2, .8, .2, 1);
  box-shadow: var(--shadow-lg);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet .grip { width: 38px; height: 4px; border-radius: 999px; background: var(--g300); margin: 9px auto 0; flex: none; }
.sheet .s-head { padding: 12px var(--pad) 10px; display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--g100); }
.sheet .s-head h2 { flex: 1; }
.sheet .s-head .s-sub { font-size: 12.5px; color: var(--g500); margin-top: 3px; }
.sheet .s-body { padding: var(--pad); overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.sheet .s-foot {
  padding: 12px var(--pad) calc(12px + var(--safe-b));
  border-top: 1px solid var(--g200); display: flex; gap: 9px; background: var(--paper);
}
.sheet .s-foot .btn { flex: 1; }
.icon-btn {
  border: 1px solid var(--g300); background: var(--paper); border-radius: 50%;
  width: 34px; height: 34px; display: grid; place-content: center; cursor: pointer; flex: none; padding: 0;
}
.icon-btn svg { width: 16px; height: 16px; stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; }

/* ----------------------------------------------------------------- misc */

.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--g500); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 650; }
.up { text-transform: uppercase; letter-spacing: .08em; }
.nowrap { white-space: nowrap; }
.sep { height: 1px; background: var(--g200); }
.hr-label { display: flex; align-items: center; gap: 10px; color: var(--g400); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 6px 0; }
.hr-label::before, .hr-label::after { content: ""; flex: 1; height: 1px; background: var(--g200); }
.trail { display: grid; gap: 10px; }
.trail .t-item { display: grid; grid-template-columns: 9px 1fr; gap: 10px; align-items: start; }
.trail .t-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--g300); margin-top: 5px; }
.trail .t-item:first-child .t-dot { background: var(--ink); }

/* ------------------------------------------------------------- desktop */

@media (min-width: 860px) {
  body { font-size: 14.5px; }
  .shell { padding-bottom: 0; padding-left: var(--rail-w); }
  .nav {
    top: 0; right: auto; bottom: 0; width: var(--rail-w);
    border-top: 0; border-right: 1px solid var(--g200);
    grid-auto-flow: row; grid-auto-columns: none; align-content: start;
    padding: 84px 12px 20px; gap: 2px; background: var(--paper); backdrop-filter: none;
  }
  .nav a {
    grid-auto-flow: column; justify-items: start; justify-content: start;
    gap: 11px; padding: 11px 13px; font-size: 13.5px; border-radius: var(--radius-sm);
  }
  .nav a.on { background: var(--ink); color: var(--paper); }
  .nav a.on::before { display: none; }
  .nav .badge { position: static; margin: 0 0 0 auto; border: 0; }
  .nav a.on .badge { background: var(--paper); color: var(--ink); }
  .topbar { padding: 13px 20px; }
  .main { padding: 24px 24px 48px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi.wide { grid-column: auto; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .toasts { left: auto; right: 20px; bottom: 20px; width: 360px; }
  .bulkbar { left: calc(var(--rail-w) + 20px); right: 20px; bottom: 20px; }
  .sheet { justify-content: center; align-items: center; padding: 24px; }
  .sheet .panel { border-radius: var(--radius-lg); width: 100%; max-width: 620px; max-height: 88vh; }
  .sheet .grip { display: none; }
  .sheet .s-foot { padding-bottom: 14px; }
  .login { grid-template-columns: 1.1fr .9fr; grid-template-rows: 1fr; align-items: center; }
  .login-hero { padding: 48px 56px; }
  .login-hero .wordmark { font-size: 58px; }
  .login-card { border-radius: var(--radius-lg); margin: 24px 48px 24px 0; padding: 32px; }
  h1 { font-size: 29px; }
}

@media (min-width: 1100px) {
  .main { padding: 28px 34px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .nav, .topbar, .toasts, .bulkbar { display: none !important; }
  .shell { padding: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}
