/* ============================================================
   TechFix OS — Design System (Dark Theme · #FF8C00)
   ============================================================ */

:root {
  --bg: #0e0e11;
  --bg-2: #121216;
  --surface: #1a1a20;
  --surface-2: #202027;
  --surface-3: #282830;
  --border: #2a2a33;
  --border-strong: #3a3a46;

  --primary: #FF8C00;
  --primary-hover: #ff9e2e;
  --primary-soft: rgba(255, 140, 0, .14);
  --primary-soft-2: rgba(255, 140, 0, .07);
  --on-primary: #1a1200;

  --text: #ececf1;
  --text-2: #b6b6c0;
  --text-3: #7d7d8a;

  --success: #57c98a;
  --error: #ff6b6b;
  --info: #5aa7ff;
  --warning: #ffb84d;
  --purple: #b388ff;

  --radius: 14px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 18px rgba(0, 0, 0, .42);
  --shadow-3: 0 16px 44px rgba(0, 0, 0, .58);
  --sidebar-w: 262px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  font-family: Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(1100px 560px at 85% -10%, rgba(255, 140, 0, .06), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(255, 140, 0, .04), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

::selection { background: rgba(255, 140, 0, .35); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #33333d; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #454550; }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
.muted { color: var(--text-3); }
.fw-600 { font-weight: 600; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.hide-sm { }

/* ================= Layout ================= */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 34px 96px; }

/* ================= Sidebar ================= */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
  background: linear-gradient(180deg, #16161c, #0f0f13);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .3s var(--ease);
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #ffb65c);
  color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 140, 0, .35);
}
.brand-logo--img { background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.brand-logo--img img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; padding: 3px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1.08rem; letter-spacing: -.01em; }
.brand-text span { font-size: .72rem; color: var(--text-3); font-weight: 500; }

.sidebar__nav { flex: 1; padding: 6px 0; overflow-y: auto; }
.nav-group {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); padding: 16px 24px 6px;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 13px;
  padding: 11px 14px; margin: 2px 12px; border-radius: 12px;
  color: var(--text-2); cursor: pointer; border: none; background: transparent;
  font-size: .93rem; font-weight: 500; text-align: left; width: calc(100% - 24px);
  transition: background .18s var(--ease), color .18s var(--ease);
  overflow: hidden; white-space: nowrap;
}
.nav-item:hover { background: var(--primary-soft-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px;
  border-radius: 4px; background: var(--primary); box-shadow: 0 0 12px var(--primary);
}
.nav-item svg { flex-shrink: 0; }
.nav-item--cta {
  justify-content: center; margin-top: 10px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px dashed rgba(255, 140, 0, .4);
}
.nav-item--cta:hover { background: var(--primary); color: var(--on-primary); border-style: solid; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 18px; }

.sidebar__footer { padding: 14px 16px 18px; border-top: 1px solid var(--border); }
.sidebar__version { font-size: .7rem; color: var(--text-3); text-align: center; margin-top: 8px; }

.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 55;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
  backdrop-filter: blur(2px);
}
.scrim.show { opacity: 1; pointer-events: auto; }

/* ================= Topbar ================= */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 66px;
  display: flex; align-items: center; gap: 16px; padding: 0 34px;
  background: rgba(14, 14, 17, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__menu { display: none; }
.topbar__crumb { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-3); font-weight: 500; }
.crumb-root { color: var(--text-3); }
.crumb-sep { opacity: .5; }
.crumb-cur { color: var(--text); font-weight: 600; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar__user { display: flex; align-items: center; gap: 11px; padding: 6px 10px; border-radius: 12px; transition: background .18s; cursor: default; }
.topbar__user:hover { background: rgba(255, 255, 255, .05); }
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #ffb65c); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.topbar__user-label { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__user-label strong { font-size: .84rem; }
.topbar__user-label span { font-size: .68rem; color: var(--text-3); }

/* ================= Botões ================= */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 11px 18px; cursor: pointer;
  font-size: .92rem; font-weight: 600; letter-spacing: .01em;
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s, border-color .2s;
  overflow: hidden; user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn svg { flex-shrink: 0; }
.btn--filled { background: var(--primary); color: var(--on-primary); box-shadow: 0 5px 16px rgba(255, 140, 0, .32); }
.btn--filled:hover { background: var(--primary-hover); box-shadow: 0 7px 22px rgba(255, 140, 0, .45); }
.btn--tonal { background: var(--primary-soft); color: var(--primary); }
.btn--tonal:hover { background: rgba(255, 140, 0, .24); }
.btn--outlined { background: transparent; color: var(--text); border: 1.5px solid var(--border-strong); }
.btn--outlined:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft-2); }
.btn--text { background: transparent; color: var(--text-2); }
.btn--text:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.btn--danger { background: rgba(255, 107, 107, .12); color: #ff9d9d; }
.btn--danger:hover { background: rgba(255, 107, 107, .22); }
.btn--sm { padding: 7px 13px; font-size: .83rem; border-radius: 10px; }
.btn--lg { padding: 14px 24px; font-size: 1rem; border-radius: 14px; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: none; cursor: pointer;
  background: transparent; color: var(--text-2); overflow: hidden;
  transition: background .18s, color .18s, transform .14s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn--primary { background: var(--primary-soft); color: var(--primary); }
.icon-btn--primary:hover { background: rgba(255, 140, 0, .26); }
.icon-btn.danger:hover { background: rgba(255, 107, 107, .15); color: var(--error); }
.icon-btn--ok:hover { background: rgba(87, 201, 138, .15); color: var(--success); }

.fab {
  position: fixed; right: 30px; bottom: 30px; z-index: 40;
  width: 60px; height: 60px; border-radius: 18px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #ff9e2e); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(255, 140, 0, .5);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
}
.fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 16px 34px rgba(255, 140, 0, .6); }
.fab:active { transform: scale(.94); }

/* ================= Chips ================= */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600; letter-spacing: .02em;
  background: color-mix(in srgb, var(--c, var(--primary)) 16%, transparent);
  color: var(--c, var(--primary));
  border: 1px solid color-mix(in srgb, var(--c, var(--primary)) 32%, transparent);
  white-space: nowrap;
}
.fchip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; overflow: hidden;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1.5px solid var(--border-strong); color: var(--text-2);
  font-size: .84rem; font-weight: 500; transition: all .18s var(--ease); white-space: nowrap;
}
.fchip:hover { border-color: var(--primary); color: var(--text); }
.fchip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.fchip .count {
  font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .09); transition: background .18s;
}
.fchip.active .count { background: rgba(0, 0, 0, .22); color: var(--primary); }

/* ================= Campos ================= */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: .76rem; font-weight: 600; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px;
  padding: 11px 14px; color: var(--text); font-size: .95rem; outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); background: var(--surface-3);
  box-shadow: 0 0 0 4px rgba(255, 140, 0, .13);
}
.field select {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237d7d8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field option { background: var(--surface-3); color: var(--text); }
input[type="date"], input[type="time"] { color-scheme: dark; }
.field__err { display: none; font-size: .78rem; color: var(--error); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--error); }
.field--error input:focus, .field--error select:focus, .field--error textarea:focus { box-shadow: 0 0 0 4px rgba(255, 107, 107, .14); }
.field--error .field__err { display: block; }

.field-select {
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px;
  padding: 10px 36px 10px 14px; color: var(--text); font-size: .88rem; cursor: pointer; outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237d7d8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color .2s, box-shadow .2s;
}
.field-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 140, 0, .13); }
.field-select option { background: var(--surface-3); color: var(--text); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg__opt {
  padding: 8px 18px; border-radius: 9px; border: none; background: transparent;
  color: var(--text-3); font-weight: 600; font-size: .85rem; cursor: pointer;
  transition: all .18s var(--ease);
}
.seg__opt:hover { color: var(--text); }
.seg__opt.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }
.seg__opt.active[data-pri="alta"] { color: var(--error); }
.seg__opt.active[data-pri="media"] { color: var(--warning); }
.seg__opt.active[data-pri="baixa"] { color: var(--success); }

/* ================= Cards / grids ================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card--pad { padding: 22px; }
.card__title { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; font-weight: 600; }
.card__title svg { color: var(--primary); }
.card__sub { color: var(--text-3); font-size: .84rem; margin-top: 3px; }

.grid { display: grid; gap: 20px; }
.grid--kpi { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: 1.9fr 1fr; }
.grid--2-1 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--clients { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }

.kpi {
  position: relative; padding: 20px; display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.kpi::after {
  content: ''; position: absolute; right: -34px; top: -34px; width: 110px; height: 110px;
  border-radius: 50%; background: radial-gradient(circle, var(--primary-soft), transparent 70%);
  pointer-events: none;
}
.kpi__icon {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.kpi__value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi__label { color: var(--text-3); font-size: .83rem; font-weight: 500; }
.kpi__trend { font-size: .78rem; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi__trend svg { color: var(--success); }

.bars { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.bar__head { display: flex; justify-content: space-between; align-items: center; font-size: .86rem; color: var(--text-2); margin-bottom: 7px; }
.bar__head b { color: var(--text); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--c, var(--primary)); width: 0; transition: width 1s var(--ease); }

/* ================= Tabela ================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
.table th {
  text-align: left; padding: 13px 18px; color: var(--text-3);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--primary-soft-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table__cell-main { color: var(--text); font-weight: 600; }
.table__cell-sub { color: var(--text-3); font-size: .8rem; margin-top: 2px; }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ================= Listas de OS ================= */
.os-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px;
  background: var(--surface); cursor: pointer;
  transition: border-color .18s, transform .18s var(--ease), background .18s;
}
.os-row:hover { border-color: var(--border-strong); transform: translateX(5px); background: var(--surface-2); }
.os-row__num { font-weight: 700; color: var(--primary); font-size: .92rem; min-width: 116px; font-variant-numeric: tabular-nums; }
.os-row__body { flex: 1; min-width: 0; }
.os-row__cli { font-weight: 600; color: var(--text); font-size: .92rem; }
.os-row__sub { color: var(--text-3); font-size: .8rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-row__right { display: flex; align-items: center; gap: 12px; }
.os-row__date { color: var(--text-3); font-size: .8rem; white-space: nowrap; }

/* ================= Cards de cliente ================= */
.cli-card { padding: 20px; display: flex; flex-direction: column; gap: 13px; transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
.cli-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.cli-card__head { display: flex; align-items: center; gap: 13px; }
.cli-card__name { font-weight: 600; font-size: 1rem; }
.cli-card__id { font-size: .72rem; color: var(--text-3); font-weight: 500; }
.cli-card__contact { display: flex; flex-direction: column; gap: 6px; }
.cli-card__stats {
  display: flex; justify-content: space-between; padding-top: 13px; border-top: 1px solid var(--border);
  color: var(--text-3); font-size: .8rem;
}
.cli-card__stats b { color: var(--text); font-weight: 600; }
.cli-card__actions { display: flex; gap: 8px; margin-left: auto; }

.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #ffb65c); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem;
}
.avatar--lg { width: 58px; height: 58px; font-size: 1.2rem; }

/* ================= Página ================= */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head__sub { color: var(--text-3); margin-top: 5px; font-size: .92rem; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary);
  padding: 5px 12px; border-radius: 999px; font-size: .76rem; font-weight: 600;
}
.badge svg { flex-shrink: 0; }

.filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 18px;
}
.filter-bar__search { position: relative; flex: 1; min-width: 210px; }
.filter-bar__search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.filter-bar__search input {
  width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px;
  padding: 10px 14px 10px 42px; color: var(--text); font-size: .9rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.filter-bar__search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 140, 0, .13); }

/* ================= Detalhes / listas descritivas ================= */
.dl { display: flex; flex-direction: column; }
.dl__row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.dl__row:last-child { border-bottom: none; }
.dl__row .lbl { color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.dl__row .lbl svg { flex-shrink: 0; }
.dl__row .val { color: var(--text); font-weight: 500; text-align: right; }

.info-row { display: flex; gap: 11px; align-items: flex-start; color: var(--text-2); font-size: .88rem; padding: 7px 0; }
.info-row svg { color: var(--text-3); flex-shrink: 0; margin-top: 2px; }
.info-row strong { color: var(--text); font-weight: 600; }

/* ================= Stepper ================= */
.stepper { display: flex; align-items: flex-start; margin-top: 20px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; text-align: center; }
.step::before { content: ''; position: absolute; top: 17px; right: 50%; width: 100%; height: 3px; background: var(--border-strong); z-index: 0; }
.step:first-child::before { display: none; }
.step__dot {
  position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 2px solid var(--border-strong); color: var(--text-3);
  font-size: .8rem; font-weight: 700; transition: all .25s var(--ease);
}
.step.active .step__dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 6px rgba(255, 140, 0, .16); }
.step.done .step__dot { background: rgba(87, 201, 138, .14); border-color: var(--success); color: var(--success); }
.step.done::before { background: var(--success); }
.step.active::before { background: var(--primary); }
.step__label { font-size: .72rem; color: var(--text-3); font-weight: 500; max-width: 90px; }
.step.active .step__label { color: var(--primary); font-weight: 700; }
.step.done .step__label { color: var(--success); }

/* ================= Timeline ================= */
.timeline { position: relative; padding-left: 30px; margin-top: 16px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -30px; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--c, var(--primary));
}
.tl-item--current::before { box-shadow: 0 0 0 5px rgba(255, 140, 0, .18); }
.tl-item__title { font-weight: 600; font-size: .92rem; color: var(--text); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tl-item__meta { font-size: .78rem; color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.tl-item__note {
  margin-top: 8px; background: var(--surface-2); border-left: 3px solid var(--c, var(--primary));
  border-radius: 10px; padding: 10px 13px; font-size: .85rem; color: var(--text-2);
}

.banner { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: 12px; font-size: .88rem; }
.banner svg { flex-shrink: 0; margin-top: 1px; }
.banner--danger { background: rgba(255, 107, 107, .1); color: #ff9d9d; border: 1px solid rgba(255, 107, 107, .28); }
.banner--info { background: var(--primary-soft); color: #ffb65c; border: 1px solid rgba(255, 140, 0, .3); }
.banner--success { background: rgba(87, 201, 138, .1); color: #7bdcab; border: 1px solid rgba(87, 201, 138, .28); }

/* ================= Empty ================= */
.empty { text-align: center; padding: 52px 20px; color: var(--text-3); }
.empty__icon {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 20px;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3);
}
.empty h3 { color: var(--text-2); font-weight: 600; margin-bottom: 6px; font-size: 1.02rem; }
.empty p { font-size: .88rem; max-width: 360px; margin: 0 auto; }
.empty .btn { margin-top: 18px; }

/* ================= Dialog ================= */
.dialog-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .64); backdrop-filter: blur(4px);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity .22s var(--ease);
}
.dialog-overlay.open { opacity: 1; }
.dialog {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px;
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-3);
  transform: translateY(18px) scale(.96); transition: transform .26s cubic-bezier(.34, 1.35, .4, 1);
}
.dialog-overlay.open .dialog { transform: none; }
.dialog--lg { max-width: 620px; }
.dialog__head { padding: 22px 24px 0; display: flex; align-items: center; gap: 12px; }
.dialog__icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.dialog__title { font-size: 1.12rem; font-weight: 600; flex: 1; }
.dialog__close { margin-left: auto; }
.dialog__body { padding: 20px 24px; }
.dialog__body .field + .field { margin-top: 16px; }
.dialog__foot { padding: 8px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.dialog__msg { color: var(--text-2); font-size: .92rem; line-height: 1.55; }

/* ================= Snackbar ================= */
.snack-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.snack {
  display: flex; align-items: center; gap: 10px;
  background: #26262f; border: 1px solid var(--border-strong); color: var(--text);
  padding: 13px 18px; border-radius: 14px; box-shadow: var(--shadow-3); font-size: .9rem; font-weight: 500;
  animation: snackIn .32s cubic-bezier(.34, 1.3, .4, 1); max-width: 92vw;
}
.snack__icon { display: flex; }
.snack--success .snack__icon { color: var(--success); }
.snack--error .snack__icon { color: var(--error); }
.snack--warn .snack__icon { color: var(--warning); }
.snack--info .snack__icon { color: var(--info); }
.snack.out { animation: snackOut .26s var(--ease) forwards; }
@keyframes snackIn { from { transform: translateY(22px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes snackOut { to { transform: translateY(14px); opacity: 0; } }

/* ================= Ripple / animações ================= */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, .38); transform: scale(0); animation: ripple .58s ease-out forwards;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.view { animation: viewIn .34s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.result-box { margin-top: 20px; }

/* ================= Auth (login) ================= */
body.auth-mode .sidebar,
body.auth-mode .topbar,
body.auth-mode .scrim,
body.auth-mode .fab { display: none !important; }
body.auth-mode .main { margin-left: 0; }
body.auth-mode .content { max-width: none; padding: 0; min-height: 100vh; }

.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 32px 18px; position: relative;
}
.auth-wrap::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 420px at 18% 12%, rgba(255, 140, 0, .1), transparent 60%),
    radial-gradient(560px 380px at 85% 90%, rgba(255, 140, 0, .07), transparent 55%);
}
.auth-card {
  position: relative; width: 100%; max-width: 430px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 24px;
  padding: 36px 34px 30px; box-shadow: var(--shadow-3);
  animation: authIn .4s cubic-bezier(.34, 1.3, .4, 1);
}
@keyframes authIn { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-card.shake { animation: authShake .4s var(--ease); }
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}
.auth-card__brand { display: flex; align-items: center; gap: 13px; justify-content: center; margin-bottom: 24px; }
.auth-card__brand .brand-logo { width: 48px; height: 48px; border-radius: 15px; }
.auth-card__title { text-align: center; font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.auth-card__sub { text-align: center; color: var(--text-3); font-size: .88rem; margin-top: 5px; }

.auth-input { position: relative; }
.auth-input > svg:first-child {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none; z-index: 1;
}
.auth-input input {
  width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 13px;
  padding: 12px 48px 12px 42px; color: var(--text); font-size: .95rem; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-input input:focus {
  border-color: var(--primary); background: var(--surface-3); box-shadow: 0 0 0 4px rgba(255, 140, 0, .13);
}
.auth-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 10px; border: none; background: transparent;
  color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .18s, color .18s;
}
.auth-eye:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

.auth__error {
  display: flex; align-items: center; gap: 9px; margin-top: 16px; font-size: .85rem; font-weight: 500;
  color: #ff9d9d; background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .3);
  border-radius: 12px; padding: 11px 14px;
}
.auth__error:not(.show) { display: none; }
.auth__error svg { flex-shrink: 0; }

.auth-submit { width: 100%; margin-top: 22px; }

.auth-foot { color: var(--text-3); font-size: .78rem; position: relative; }

/* ================= Empresa (logotipo) ================= */
.emp-logo-row { display: flex; gap: 14px; align-items: center; }
.emp-logo-prev {
  width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0;
  border: 1px dashed var(--border-strong); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: .72rem; overflow: hidden;
}
.emp-logo-prev img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.emp-thumb { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #fff; padding: 2px; }
.field__help { font-size: .74rem; color: var(--text-3); margin: 7px 0 0; }

/* ================= Usuários ================= */
.user-list { margin-top: 16px; display: flex; flex-direction: column; }
.user-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 2px;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row__body { flex: 1; min-width: 0; }
.user-row__name { font-weight: 600; color: var(--text); font-size: .94rem; display: flex; align-items: center; gap: 8px; }
.user-row__me { font-size: .68rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; }
.user-row__sub { color: var(--text-3); font-size: .78rem; margin-top: 2px; }
.user-row__chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.user-row__chips .chip svg { flex-shrink: 0; }
.user-row__actions { display: flex; gap: 5px; margin-left: 8px; }
@media (max-width: 640px) {
  .user-row { flex-wrap: wrap; }
  .user-row__chips { order: 3; width: 100%; justify-content: flex-start; padding-left: 60px; }
  .user-row__actions { margin-left: auto; }
}

.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.perm-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 15px 17px; }
.perm-col__title { margin-bottom: 10px; }
.perm-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.perm-col li { font-size: .84rem; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.perm-col li::before { content: '✓'; color: var(--success); font-weight: 700; font-size: .78rem; }
@media (max-width: 560px) { .perm-grid { grid-template-columns: 1fr; } }

/* ================= Switch ================= */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: relative; width: 42px; height: 24px; border-radius: 999px; flex-shrink: 0;
  background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .2s, border-color .2s;
}
.switch__slider::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-3); transition: transform .22s var(--ease), background .2s;
}
.switch input:checked + .switch__slider { background: rgba(87, 201, 138, .2); border-color: var(--success); }
.switch input:checked + .switch__slider::before { transform: translateX(18px); background: var(--success); }

/* ================= Menu de conta (topbar) ================= */
.user-menu { position: relative; }
.user-menu__drop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 90; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow-3); padding: 7px; display: none;
  transform-origin: top right; animation: dropIn .18s var(--ease);
}
.user-menu__drop.open { display: block; }
@keyframes dropIn { from { opacity: 0; transform: scale(.94) translateY(-6px); } to { opacity: 1; transform: none; } }
.user-menu__item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 13px;
  border: none; background: transparent; color: var(--text-2); font-size: .88rem; font-weight: 500;
  border-radius: 11px; cursor: pointer; text-align: left; transition: background .16s, color .16s;
}
.user-menu__item:hover { background: var(--primary-soft); color: var(--text); }
.user-menu__item svg { flex-shrink: 0; }
.user-menu__item[data-act="logout"]:hover { background: rgba(255, 107, 107, .12); color: #ff9d9d; }
.user-menu__sep { height: 1px; background: var(--border); margin: 6px 8px; }

/* ================= Responsivo ================= */
@media (max-width: 1180px) {
  .grid--kpi { grid-template-columns: repeat(2, 1fr); }
  .grid--2 { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow-3); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .topbar__menu { display: inline-flex; }
}
@media (max-width: 720px) {
  .content { padding: 20px 16px 96px; }
  .topbar { padding: 0 16px; }
  .topbar__user-label { display: none; }
  .topbar__user { padding: 6px 4px; }
  .grid--kpi, .grid--3 { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .os-row__date { display: none; }
  .page-head h1 { font-size: 1.35rem; }
}

/* ================= Editor de itens (orçamentos) ================= */
.orc-items { display: flex; flex-direction: column; gap: 10px; }
.orc-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 66px 110px 40px;
  gap: 10px; align-items: center;
}
.orc-item__prod { display: flex; gap: 6px; align-items: center; min-width: 0; }
.orc-item__prod select { flex: 1; min-width: 0; }
.orc-item select,
.orc-item input[type="number"] {
  width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px;
  padding: 10px 12px; color: var(--text); font-size: .9rem; outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.orc-item select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237d7d8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.orc-item select:focus,
.orc-item input[type="number"]:focus {
  border-color: var(--primary); background: var(--surface-3);
  box-shadow: 0 0 0 4px rgba(255, 140, 0, .13);
}
.orc-item option { background: var(--surface-3); color: var(--text); }
.orc-item input[type="number"] { text-align: right; }
.orc-item__sub { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--text); }
.orc-item--error select,
.orc-item--error input[type="number"] { border-color: var(--error); }
.orc-items__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); gap: 12px;
}
.orc-total { font-size: 1.2rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ================= Documentos (PDFs salvos no histórico) ================= */
.doc-list { display: flex; flex-direction: column; }
.doc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--border);
}
.doc-row:last-child { border-bottom: none; }
.doc-row__icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.doc-row__body { flex: 1; min-width: 0; }
.doc-row__name { font-weight: 600; color: var(--text); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row__sub { color: var(--text-3); font-size: .76rem; margin-top: 2px; }
@media (max-width: 720px) {
  .orc-item { grid-template-columns: 1fr 1fr; }
  .orc-item__sub { text-align: left; }
  .orc-item .icon-btn { grid-column: 1 / -1; justify-self: end; }
}

/* Public consultation page (no auth shell) */
body.public-mode .sidebar,
body.public-mode .topbar,
body.public-mode .scrim,
body.public-mode .fab { display: none !important; }
body.public-mode .main { margin-left: 0; }
body.public-mode .content { max-width: none; padding: 0; min-height: 100vh; }

.pub-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 16px;
}
.pub-card {
  width: 100%; max-width: 560px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 36px 32px 32px; box-shadow: var(--shadow-3);
  animation: authIn .4s cubic-bezier(.34, 1.3, .4, 1);
}
.pub-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px;
}
.pub-logo {
  width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #ffb65c);
  color: var(--on-primary); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 140, 0, .35);
}
.pub-logo--img { background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.pub-logo--img img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; padding: 3px; }
.pub-head h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }

.pub-search {
  display: flex; gap: 10px;
}
.pub-search input {
  flex: 1; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 13px;
  padding: 12px 16px; color: var(--text); font-size: .95rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.pub-search input:focus {
  border-color: var(--primary); background: var(--surface-3);
  box-shadow: 0 0 0 4px rgba(255, 140, 0, .13);
}

.pub-table-wrap { margin-top: 18px; overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.pub-table {
  width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 420px;
}
.pub-table th {
  text-align: left; padding: 12px 16px; color: var(--text-3);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.pub-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-2);
}
.pub-table tbody tr:last-child td { border-bottom: none; }
.pub-table tbody tr:hover { background: var(--primary-soft-2); }

/* ================= Skeleton Screens ================= */
/* Skeleton wrapper: positioned outside .app, visible only during auth-pending */
#skeletonRoot {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
}
body.auth-pending #skeletonRoot { display: flex; }

.skeleton-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 18px; width: 100%;
}
.skeleton-card {
  width: 100%; max-width: 430px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 24px; padding: 36px 34px 30px;
  box-shadow: var(--shadow-3);
}
.skeleton-card--pub { max-width: 560px; }

/* Shimmer animation */
@keyframes shimmer {
  0% { background-position: -460px 0; }
  100% { background-position: 460px 0; }
}
.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 920px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* Login skeleton layout */
.skel-brand { display: flex; align-items: center; gap: 13px; justify-content: center; margin-bottom: 24px; }
.skel-logo  { width: 48px; height: 48px; border-radius: 15px; }
.skel-texts { display: flex; flex-direction: column; gap: 6px; }
.skel-w120  { width: 120px; height: 18px; }
.skel-w180  { width: 180px; height: 13px; }

.skel-title  { width: 220px; height: 24px; margin: 0 auto 8px; }
.skel-sub    { width: 280px; height: 14px; margin: 0 auto 24px; }

.skel-field  { margin-bottom: 16px; }
.skel-label  { width: 80px; height: 10px; margin-bottom: 8px; }
.skel-input  { width: 100%; height: 44px; border-radius: 13px; }
.skel-btn    { width: 100%; height: 48px; border-radius: 14px; margin-top: 22px; }
.skel-foot   { width: 240px; height: 10px; margin: 18px auto 0; }

/* Consultation skeleton layout */
.skel-pub-head  { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.skel-pub-logo  { width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0; }
.skel-pub-texts { display: flex; flex-direction: column; gap: 6px; }
.skel-pub-w160  { width: 160px; height: 22px; }
.skel-pub-w240  { width: 240px; height: 13px; }
.skel-pub-row   { display: flex; gap: 10px; }
.skel-pub-input { flex: 1; height: 44px; border-radius: 13px; }
.skel-pub-btn   { width: 120px; height: 44px; border-radius: 12px; }
