/* ============================================================
   GUILD TECNOLOGIA — Sistema OS
   Design System v2.0 — Professional Tech Dark
   ============================================================ */

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:          #060b12;
  --surface:     #0a1220;
  --card:        #0d1826;
  --card2:       #11202e;
  --border:      #1a2b3e;
  --border2:     #21334d;

  /* PRIMARY = GUILD RED (acento diagonal da logo) */
  --blue:        #c41a1a;
  --blue-h:      #a51515;
  --blue-dim:    rgba(196,26,26,0.12);
  --blue-glow:   rgba(196,26,26,0.28);

  --green:       #0a8f52;
  --green-h:     #097545;
  --green-dim:   rgba(10,143,82,0.12);

  --red:         #e53e3e;
  --red-h:       #c53030;
  --red-dim:     rgba(229,62,62,0.12);

  --amber:       #c97d10;
  --amber-dim:   rgba(201,125,16,0.12);

  --purple:      #6d3ee6;
  --purple-dim:  rgba(109,62,230,0.12);

  --cyan:        #2a6090;
  --cyan-dim:    rgba(42,96,144,0.12);
  --cyan-bright: #6fa8d8;

  --pink:        #b02a7a;
  --pink-dim:    rgba(176,42,122,0.12);

  --txt1:  #dce8f5;
  --txt2:  #6882a8;
  --txt3:  #3a5070;

  --sidebar-w: 238px;
  --topbar-h:  56px;
  --radius:    10px;
  --radius-sm: 7px;
  --radius-xs: 5px;

  /* Consistent component heights */
  --btn-h:    36px;
  --btn-h-sm: 30px;
  --btn-h-lg: 42px;
  --input-h:  38px;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(145deg, rgba(196,26,26,0.08) 0%, transparent 32%),
    linear-gradient(325deg, rgba(28,45,74,0.32) 0%, transparent 45%),
    var(--bg);
  background-size: 64px 64px, 64px 64px, 100% 100%, 100% 100%, 100% 100%;
  color: var(--txt1);
  min-height: 100vh;
  display: flex;
  line-height: 1.5;
}
a { color: var(--cyan-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(6,11,18,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(196,26,26,0.15);
  box-shadow: 4px 0 32px rgba(0,0,0,0.5), inset -1px 0 0 rgba(196,26,26,0.08);
  position: fixed;
  top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform 0.3s ease;
}
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, rgba(196,26,26,0.3) 60%, transparent 100%);
  z-index: 1;
}

/* Brand */
.sidebar-header {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 38px; height: 38px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}
.sidebar-brand strong {
  display: block;
  font-size: 13px; font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--txt1);
}
.sidebar-brand span {
  display: block;
  font-size: 10px; font-weight: 600;
  letter-spacing: 2.5px;
  color: var(--blue);
  text-transform: uppercase;
}

/* CTA button */
.sidebar-cta {
  margin: 12px 10px 4px;
  flex-shrink: 0;
}
.sidebar-cta button {
  width: 100%;
  height: var(--btn-h-lg);
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 7px;
  transition: background 0.15s;
  font-family: inherit;
}
.sidebar-cta button:hover { background: var(--blue-h); }
.sidebar-cta button .cta-icon { font-size: 16px; }

/* Nav */
.sidebar-nav { flex: 1; padding: 8px 8px; overflow-y: auto; }

.nav-group-label {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--txt3);
  text-transform: uppercase;
  padding: 10px 10px 4px;
  user-select: none;
}

.nav-item {
  display: flex; align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  border-left: 3px solid transparent;
  color: var(--txt2);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  background: none; width: 100%;
  text-align: left; font-family: inherit;
  transition: background 0.18s, color 0.18s, border-left-color 0.18s;
  white-space: nowrap;
}
.nav-item .nav-icon {
  width: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.55;
  transition: opacity 0.18s;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }
.nav-item:hover {
  background: rgba(196,26,26,0.10);
  color: var(--txt1);
  border-left-color: var(--blue);
}
.nav-item.active {
  background: rgba(196,26,26,0.15);
  color: #e2e8f0;
  font-weight: 600;
  border-left-color: var(--blue);
}

/* Footer */
.sidebar-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.07);
  padding: 14px 16px;
  font-size: 11px;
  color: var(--txt3);
  flex-shrink: 0;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Scrollbar do nav */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.18);
  border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.35); }

/* ── SIDEBAR NAV CARDS ──────────────────────────────────────── */
.nav-card {
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid rgba(55, 65, 81, 0.65);
  border-radius: 12px;
  padding: 8px 4px;
  margin-bottom: 8px;
}
.nav-card-label {
  display: block;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--txt3); padding: 4px 14px 8px;
  user-select: none;
}

/* CTA button */
.nav-item-nova-btn {
  width: 100%;
  height: var(--btn-h-lg);
  background: var(--blue);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 7px;
  transition: background 0.15s;
  font-family: inherit;
}
.nav-item-nova-btn:hover { background: var(--blue-h); }

/* ── MAIN ───────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
}

/* Top bar */
.top-bar {
  height: var(--topbar-h);
  background: rgba(10,18,32,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(196,26,26,0.10), 0 4px 16px rgba(0,0,0,0.3);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.menu-toggle {
  display: none;
  width: var(--btn-h); height: var(--btn-h);
  background: none; border: 1px solid var(--border);
  color: var(--txt2); font-size: 16px; cursor: pointer;
  border-radius: var(--radius-xs);
  align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.menu-toggle:hover { background: var(--blue-dim); color: var(--txt1); border-color: var(--border2); }
.top-bar-title {
  flex: 1;
  font-size: 14.5px; font-weight: 600; color: var(--txt1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-bar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Content */
.content-area { flex: 1; padding: 22px 24px; }

/* Mobile overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  height: var(--btn-h);
  padding: 0 14px;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.13s, border-color 0.13s, color 0.13s, opacity 0.13s;
  letter-spacing: 0.1px;
  text-decoration: none;
  flex-shrink: 0;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-sm   { height: var(--btn-h-sm); padding: 0 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-lg   { height: var(--btn-h-lg); padding: 0 18px; font-size: 13.5px; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn-sm.btn-icon { width: var(--btn-h-sm); }

/* Variants */
.btn-primary   { background: var(--blue);  color: #fff; }
.btn-primary:hover:not(:disabled)   { background: var(--blue-h); }

.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled)   { background: var(--green-h); }

.btn-secondary {
  background: #1e3252;
  color: var(--txt1);
  border: 1px solid #2e4872;
}
.btn-secondary:hover:not(:disabled) { background: #253d68; border-color: #3a5888; }

.btn-danger {
  background: #b91c1c;
  color: #fff;
  border: none;
}
.btn-danger:hover:not(:disabled) {
  background: #991b1b;
}

.btn-warning {
  background: var(--amber-dim);
  color: #fbbf24;
  border: 1px solid rgba(201,125,16,0.3);
}
.btn-warning:hover:not(:disabled) { background: rgba(201,125,16,0.22); }

.btn-outline {
  background: #1a4a7a;
  color: #a8d4f5;
  border: 1px solid #2a6aaa;
}
.btn-outline:hover:not(:disabled) { background: #205a92; border-color: #3a80c0; color: #c8e8ff; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--txt1); display: flex; align-items: center; gap: 7px; }

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.page-header-left h1 { font-size: 19px; font-weight: 700; color: var(--txt1); }
.page-header-left p { font-size: 12.5px; color: var(--txt2); margin-top: 2px; }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: default;
}
.stat-card:hover { transform: translateY(-2px); }

/* Tech color variants */
.sc-blue   { --sc:#3b82f6; --sc-glow:rgba(59,130,246,.15); }
.sc-orange { --sc:#f97316; --sc-glow:rgba(249,115,22,.15); }
.sc-cyan   { --sc:#06b6d4; --sc-glow:rgba(6,182,212,.15); }
.sc-green  { --sc:#22c55e; --sc-glow:rgba(34,197,94,.15); }
.sc-purple { --sc:#a855f7; --sc-glow:rgba(168,85,247,.15); }
.sc-pink   { --sc:#ec4899; --sc-glow:rgba(236,72,153,.15); }
.sc-gold   { --sc:#eab308; --sc-glow:rgba(234,179,8,.15); }
.sc-blue,.sc-orange,.sc-cyan,.sc-green,.sc-purple,.sc-pink,.sc-gold {
  border-top: 2px solid var(--sc) !important;
  box-shadow: 0 4px 24px var(--sc-glow);
}
.sc-blue .stat-value,.sc-orange .stat-value,.sc-cyan .stat-value,
.sc-green .stat-value,.sc-purple .stat-value,.sc-pink .stat-value,
.sc-gold .stat-value { color: var(--sc) !important; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.si-blue   { background: var(--blue-dim); }
.si-green  { background: var(--green-dim); }
.si-amber  { background: var(--amber-dim); }
.si-purple { background: var(--purple-dim); }
.si-red    { background: var(--red-dim); }
.si-cyan   { background: var(--cyan-dim); }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; color: var(--txt1); min-height: 38px; display: flex; align-items: center; justify-content: center; }
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--txt2); }

/* ── TABLES ─────────────────────────────────────────────────── */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--card2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--txt2);
  border-bottom: 2px solid var(--blue);
  text-transform: uppercase; letter-spacing: 0.7px;
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(30,48,80,0.6);
  font-size: 13.5px; color: var(--txt1);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(196,26,26,0.04); }
tr.os-row-clickable { cursor: pointer; }
tr.os-row-clickable:hover { background: rgba(196,26,26,0.07); }
.action-btns { display: flex; gap: 6px; justify-content: flex-start; width: 100%; }
.action-btns > .btn:not(.btn-wa):not(.btn-del) { flex: 1; min-width: 0; text-align: center; }
.btn-del { flex: none; width: 36px; padding: 0; justify-content: center; }

/* ── INPUTS / FORMS ─────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-row { display: grid; gap: 12px; margin-bottom: 12px; }
.col-2  { grid-template-columns: 1fr 1fr; }
.col-3  { grid-template-columns: 1fr 1fr 1fr; }
.col-4  { grid-template-columns: 1fr 1fr 1fr 1fr; }
.col-13 { grid-template-columns: 1fr 3fr; }

label {
  font-size: 11.5px; font-weight: 600;
  color: var(--txt2); letter-spacing: 0.2px;
}
label .req { color: #f87171; margin-left: 2px; }

input[type=date]::-webkit-calendar-picker-indicator { display: none !important; opacity: 0; }
input[type=date] { -webkit-appearance: textfield; appearance: textfield; }

input[type=text], input[type=email], input[type=number], input[type=date],
input[type=tel], input[type=search], select, textarea {
  height: var(--input-h);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--txt1);
  font-size: 13.5px; font-family: inherit;
  padding: 0 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
textarea {
  height: auto; min-height: 80px;
  padding: 9px 12px; resize: vertical; line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10,143,82,0.20);
}
input[readonly] {
  background: rgba(255,255,255,0.02);
  color: var(--txt3); cursor: default;
}
select option { background: var(--card2); }
::placeholder { color: transparent; }
input:focus::placeholder, textarea:focus::placeholder { color: transparent; }

/* Search input */
input[type=search] { padding-left: 12px; }

/* ── BADGES / CHIPS ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.badge-aberta         { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.badge-em_andamento   { background: var(--amber-dim);  color: #fbbf24; border: 1px solid rgba(201,125,16,0.3); }
.badge-aguardando_pecas { background: var(--purple-dim); color: #a78bfa; border: 1px solid rgba(109,62,230,0.3); }
.badge-concluida      { background: var(--green-dim);  color: #34d399; border: 1px solid rgba(10,143,82,0.3); }
.badge-entregue       { background: var(--green-dim);  color: #6ee7b7; border: 1px solid rgba(10,143,82,0.3); }
.badge-cancelada      { background: var(--red-dim);    color: #f87171; border: 1px solid rgba(204,34,34,0.3); }
.badge-pago     { background: rgba(16,185,129,0.22); color: #34d399; border: 1px solid #10b981; font-weight: 700; box-shadow: 0 0 10px rgba(16,185,129,0.28); }
.badge-parcial  { background: rgba(245,158,11,0.22); color: #fbbf24; border: 1px solid #f59e0b; font-weight: 700; box-shadow: 0 0 10px rgba(245,158,11,0.28); }
.badge-pendente { background: rgba(239,68,68,0.22);  color: #f87171; border: 1px solid #ef4444; font-weight: 700; box-shadow: 0 0 10px rgba(239,68,68,0.28); }
.btn-wa { background: #25d366 !important; color: #fff !important; border-color: #25d366 !important; font-weight: 600; }
.btn-text-hide { display: none; }
.os-card-atrasada { border-left: 3px solid #f59e0b !important; }
.os-row-atrasada td:first-child { border-left: 3px solid #f59e0b; }

/* ── FOTO EDITOR ─────────────────────────────────────────────── */
.fe-wrap { display: flex; gap: 14px; align-items: flex-start; }
.fe-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.fe-canvas { border-radius: 50%; border: 2px solid var(--blue); cursor: grab; background: var(--card2); display: block; }
.fe-canvas:active { cursor: grabbing; }
.fe-drag-hint { font-size: 10px; color: var(--txt3); letter-spacing: 0.5px; }
.fe-side { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fe-zoom-row { display: flex; align-items: center; gap: 8px; }
.fe-zoom-lbl { font-size: 11px; color: var(--txt3); white-space: nowrap; }
.fe-zoom { flex: 1; accent-color: var(--blue); cursor: pointer; }
.fe-url { width: 100%; font-size: 12px; box-sizing: border-box; }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000; display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 12px;
  width: 100%; max-width: 560px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 820px; }
@keyframes modalIn {
  from { opacity:0; transform: scale(0.96) translateY(8px); }
  to   { opacity:1; transform: none; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  background: none; border: none;
  color: var(--txt2); font-size: 16px;
  cursor: pointer; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--red-dim); color: #f87171; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 9px;
  min-width: 250px;
  animation: toastIn 0.25s ease;
}
.toast.success { border-left: 3px solid #0a8f52; }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid #4d8ec4; }
.toast.warning { border-left: 3px solid #c97d10; }
.toast.removing { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn  { from { transform: translateX(108%); opacity:0; } to { transform:none; opacity:1; } }
@keyframes toastOut { to   { transform: translateX(108%); opacity:0; } }

/* ── EMPTY / LOADING ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 52px 20px;
  color: var(--txt2);
}
.empty-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.7; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--txt1); }
.empty-state p { font-size: 13.5px; }

.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 52px; gap: 12px;
  color: var(--txt2); font-size: 14px;
}
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--border2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TAB GROUP ──────────────────────────────────────────────── */
.tab-group {
  display: flex;
  gap: 8px;
  padding: 2px 0 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  max-width: 100%;
}
.tab-group::-webkit-scrollbar { display: none; }
.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--txt1);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.tab-btn svg { flex-shrink:0; opacity:0.65; transition: opacity 0.18s; }
.tab-btn:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.tab-btn:hover svg { opacity: 1; }
.tab-btn.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.tab-btn.active svg { opacity: 1; }
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 15px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  background: rgba(255,255,255,0.12);
  color: var(--txt1);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.18s;
}
.tab-btn.active .tab-badge {
  background: rgba(255,255,255,0.22);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}

/* ── FILTER BAR ─────────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
  max-width: 260px;
}

/* ── FORM SECTIONS (OS) ─────────────────────────────────────── */
.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: visible;
}
.s-cyan, .s-blue, .s-orange, .s-red, .s-green, .s-pink, .s-purple, .s-indigo { /* sem borda colorida */ }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.section-header h3 {
  font-size: 13px; font-weight: 700;
  color: var(--txt1); letter-spacing: 0.2px;
  display: flex; align-items: center; gap: 7px;
}
.section-body { padding: 16px; }
.section-body:has(.dyn-table-wrap) { padding: 0; }

/* OS Number */
.os-number-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
  display: flex; flex-direction: column; justify-content: center;
  height: var(--input-h);
}
.os-number-box .num {
  font-size: 18px; font-weight: 700;
  color: var(--txt1); letter-spacing: 1px; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.os-number-box small { font-size: 9.5px; color: var(--txt3); margin-top: 1px; display: block; }

/* ── AUTOCOMPLETE ───────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  max-height: 260px; overflow-y: auto;
  z-index: 2000;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
}
.autocomplete-item {
  padding: 11px 14px; cursor: pointer;
  font-size: 13.5px; color: var(--txt1);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.autocomplete-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.autocomplete-item:last-child { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.autocomplete-item:only-child { border-radius: var(--radius); }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--blue-dim); color: var(--txt1); }
.autocomplete-item small { display: block; color: var(--txt2); font-size: 11.5px; margin-top: 3px; }
.autocomplete-item strong { color: #fff; }

/* Selected client */
.selected-client-box {
  background: var(--green-dim);
  border: 1px solid rgba(10,143,82,0.3);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.selected-client-box .name { font-weight: 700; font-size: 14.5px; color: var(--txt1); }
.selected-client-box .info { font-size: 12.5px; color: var(--txt2); margin-top: 3px; display: flex; gap: 14px; flex-wrap: wrap; }

/* Technicians */
.tecnico-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tecnico-check-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px;
  transition: all 0.15s;
  white-space: nowrap;
}
.tecnico-check-item:hover { border-color: var(--blue); }
.tecnico-check-item.selected { border-color: var(--blue); background: var(--blue-dim); color: #60a5fa; }
.tecnico-check-item input[type=checkbox] { width: auto; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }

/* ── DYNAMIC TABLES (serviços/peças) ────────────────────────── */
.dyn-table-wrap { overflow-x: auto; }
.dyn-table { width: 100%; border-collapse: collapse; min-width: 400px; }
.dyn-table th {
  background: var(--card2);
  padding: 9px 12px;
  font-size: 11px; font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 2px solid var(--blue);
  text-align: left;
}
.dyn-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dyn-table td input[type=text],
.dyn-table td input[type=number],
.dyn-table td select {
  height: 36px; font-size: 13px; width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 0 10px;
  color: var(--txt1);
  transition: background 0.15s, border-color 0.15s;
}
.dyn-table td input[type=number]:hover {
  background: rgba(255,255,255,0.04);
}
.dyn-table td input:focus, .dyn-table td select:focus {
  background: var(--surface);
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(10,143,82,0.18);
  outline: none;
}
.dyn-table tr:hover td { background: rgba(255,255,255,0.02); }
.dyn-table tr:last-child td { border-bottom: none; }
.btn-del-row {
  background: none; border: none; cursor: pointer;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--txt3); font-size: 15px;
  transition: all 0.12s; flex-shrink: 0;
}
.btn-del-row:hover { background: var(--red-dim); color: #f87171; }

/* Inline autocomplete for services */
.svc-auto {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  max-height: 200px; overflow-y: auto;
  z-index: 2000;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
}
.svc-auto-item {
  padding: 10px 14px; cursor: pointer; font-size: 13px; color: var(--txt1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.12s;
}
.svc-auto-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.svc-auto-item:last-child { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.svc-auto-item:only-child { border-radius: var(--radius); }
.svc-auto-item:hover { background: var(--blue-dim); }
.svc-auto-item .price { color: #34d399; font-weight: 700; font-size: 12px; white-space: nowrap; margin-left: 8px; }

/* ── TOTALS ─────────────────────────────────────────────────── */
.totals-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
}
.total-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px; text-align: center;
}
.total-box.main-total {
  border-color: rgba(196,26,26,0.40);
  background: var(--blue-dim);
  border-left: 3px solid var(--blue);
}
.total-box label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--txt3); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 7px;
}
.total-box .tv { font-size: 22px; font-weight: 800; color: var(--txt1); }
.total-box.main-total .tv { color: var(--blue); font-size: 26px; }

/* ── PHOTO UPLOAD ───────────────────────────────────────────── */
.photo-drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}
.photo-drop-zone:hover, .photo-drop-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-dim);
}
.photo-drop-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.7; }
.photo-drop-text { font-size: 14px; color: var(--txt2); margin-bottom: 4px; }
.photo-drop-text span { color: #60a5fa; font-weight: 600; cursor: pointer; }
.photo-drop-hint { font-size: 12px; color: var(--txt3); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.photo-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--surface);
  border: 1px solid var(--border2);
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.photo-thumb-del {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.7);
  color: #f87171; border: none; border-radius: 50%;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.photo-thumb-del:hover { background: var(--red); color: #fff; }

/* Tipo pessoa toggle */
.tipo-toggle {
  display: flex; gap: 0;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 16px;
}
.tipo-toggle label {
  flex: 1; text-align: center;
  padding: 9px 14px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: var(--txt2); height: auto;
  transition: all 0.15s;
  user-select: none;
}
.tipo-toggle label.active { background: var(--blue); color: #fff; }
.tipo-toggle label:not(:last-child) { border-right: 1px solid var(--border2); }

/* ── UTILS ──────────────────────────────────────────────────── */
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-muted   { color: var(--txt2); }
.text-danger  { color: #f87171; }
.text-success { color: #34d399; }
.text-cyan    { color: var(--cyan-bright); }
.text-primary { color: #60a5fa; }
.fw-6 { font-weight: 600; }
.fw-7 { font-weight: 700; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a5a80; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.6); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .col-2, .col-3, .col-4 { grid-template-columns: 1fr; }
  .totals-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .top-bar-actions .btn span { display: none; }
}

/* ── MOBILE (≤ 640px) ──────────────────────────────────────── */
@media (max-width: 640px) {
  /* Previne overflow horizontal */
  body { overflow-x: hidden; }
  .main-content { min-width: 0; }
  .content-area { padding: 14px 12px; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-header-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

  .filter-bar { flex-direction: column; gap: 8px; }
  .filter-bar input, .filter-bar select { max-width: 100% !important; width: 100%; }

  /* Stat grid: 2 colunas forçadas */
  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 14px;
  }
  .stat-card { padding: 14px 8px 12px; }
  .stat-value { font-size: 24px; min-height: 30px; }
  .stat-label { font-size: 9px; }

  .top-bar { padding: 0 12px; gap: 8px; }
  .top-bar-title { font-size: 13px; }

  /* Cards */
  .card { padding: 14px; }

  /* OS desktop/mobile toggle */
  .os-desktop-view { display: none !important; }
  .os-mobile-view  { display: block; }

  /* Oculta colunas menos importantes */
  .os-col-entrada, .os-col-equip, .os-col-tecnico { display: none !important; }

  /* Força 1 coluna em TODOS os form-rows no mobile (inclusive inline styles) */
  .form-row { grid-template-columns: 1fr !important; }

  /* Dyn tables: scroll horizontal */
  .dyn-table-wrap { -webkit-overflow-scrolling: touch; }
  .dyn-table { min-width: 480px; }

  /* Totals: empilhado */
  .totals-row { grid-template-columns: 1fr; gap: 8px; }

  /* Seções do formulário */
  .section-body { padding: 12px; }
  .form-section { margin-bottom: 10px; }

  /* Touch targets maiores */
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
}

@media (min-width: 641px) {
  .os-desktop-view { display: block; }
  .os-mobile-view  { display: none !important; }
}

/* ── OS MOBILE CARDS ────────────────────────────────────────── */

.os-card-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.os-card-item:active { background: var(--card2); }
.os-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.os-card-num {
  font-size: 17px;
  font-weight: 800;
  color: var(--txt1);
}
.os-card-cliente {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt1);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-card-equip {
  font-size: 12.5px;
  color: var(--txt2);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  gap: 10px;
  flex-wrap: wrap;
}
.os-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--txt3);
}
.os-card-footer .action-btns { gap: 6px; }
.os-card-footer .btn-sm { height: 34px; padding: 0 12px; }

/* ── LOGIN — TECH EDITION ───────────────────────────────────── */
#tech-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  overflow: hidden;
}
.login-scene {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── Card principal ── */
.login-card-tech {
  position: relative;
  background: rgba(8,15,26,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(196,26,26,0.28);
  border-radius: 4px;
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 0 0 1px rgba(0,196,255,0.06),
    0 0 40px rgba(196,26,26,0.12),
    0 24px 64px rgba(0,0,0,0.6);
  overflow: hidden;
}

/* Scan line */
.lc-scan {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(196,26,26,0.7) 30%, rgba(0,196,255,0.5) 70%, transparent);
  animation: lc-scan-move 3s ease-in-out infinite;
  transform-origin: left;
  opacity: 0.8;
}
@keyframes lc-scan-move {
  0%   { transform: scaleX(0); opacity: 0; }
  10%  { opacity: 0.9; }
  80%  { transform: scaleX(1); opacity: 0.4; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* Corner brackets */
.lc-bracket {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(196,26,26,0.7);
  border-style: solid;
  animation: lc-bracket-pulse 2.5s ease-in-out infinite;
}
.lc-tl { top: 8px;  left: 8px;  border-width: 2px 0 0 2px; border-radius: 2px 0 0 0; }
.lc-tr { top: 8px;  right: 8px; border-width: 2px 2px 0 0; border-radius: 0 2px 0 0; }
.lc-bl { bottom: 8px; left: 8px;  border-width: 0 0 2px 2px; border-radius: 0 0 0 2px; }
.lc-br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; border-radius: 0 0 2px 0; }
@keyframes lc-bracket-pulse {
  0%, 100% { border-color: rgba(196,26,26,0.55); }
  50%       { border-color: rgba(196,26,26,1); box-shadow: 0 0 8px rgba(196,26,26,0.5); }
}

/* Logo zone */
.lc-logo-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  height: 155px;
  overflow: hidden;
}

/* Scan beam — efeito de autenticação tecnológico */
.lc-logo-scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(196,26,26,0.55) 25%,
    rgba(255,100,100,0.45) 50%,
    rgba(196,26,26,0.55) 75%,
    transparent 100%
  );
  box-shadow: 0 0 10px rgba(196,26,26,0.45), 0 0 4px rgba(255,100,100,0.3);
  z-index: 5;
  pointer-events: none;
  animation: lc-scan-logo 4.5s ease-in-out infinite;
}
@keyframes lc-scan-logo {
  0%   { top: 0%;   opacity: 0; }
  5%   { opacity: 1; }
  90%  { opacity: 0.8; }
  100% { top: 100%; opacity: 0; }
}

/* Logo image — ícone sem texto */
.lc-logo-img {
  height: 128px;
  width: auto;
  position: relative;
  z-index: 4;
  filter: drop-shadow(0 0 8px rgba(196,26,26,0.45));
  animation: lc-logo-glitch 7s ease-in-out infinite;
}
@keyframes lc-logo-glitch {
  0%, 82%, 100%  { filter: drop-shadow(0 0 8px rgba(196,26,26,0.45)); transform: none; }
  84%  { filter: drop-shadow(0 0 18px rgba(196,26,26,0.85)) brightness(1.15); transform: translateX(-3px); }
  85%  { filter: drop-shadow(0 0 5px rgba(196,26,26,0.35)) brightness(0.88); transform: translateX(4px); }
  86%  { filter: drop-shadow(0 0 24px rgba(196,26,26,0.9)) brightness(1.25); transform: translateX(0); }
  87%  { filter: drop-shadow(0 0 8px rgba(196,26,26,0.5)); transform: translateX(-1px); }
  88%  { filter: drop-shadow(0 0 8px rgba(196,26,26,0.45)); transform: none; }
}

/* Divider */
.lc-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.lc-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,26,26,0.4));
}
.lc-divider-line:last-child {
  background: linear-gradient(270deg, transparent, rgba(196,26,26,0.4));
}
.lc-divider-icon {
  font-size: 8px;
  color: rgba(196,26,26,0.7);
  animation: lc-icon-pulse 2s ease-in-out infinite;
}
@keyframes lc-icon-pulse {
  0%, 100% { color: rgba(196,26,26,0.5); }
  50%       { color: rgba(196,26,26,1); text-shadow: 0 0 8px rgba(196,26,26,0.8); }
}

/* Title */
.lc-title {
  text-align: center;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--txt1);
  margin: 0 0 4px;
}
.lc-sub {
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(0,196,255,0.6);
  margin: 0 0 24px;
}

/* Fields */
.lc-field { position: relative; }
.lc-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(196,26,26,0.75);
  margin-bottom: 6px;
}
.lc-input {
  width: 100%;
  background: rgba(6,11,18,0.7);
  border: 1px solid rgba(196,26,26,0.2);
  border-bottom: 1px solid rgba(196,26,26,0.45);
  border-radius: 3px;
  color: var(--txt1);
  font-size: 16px;
  padding: 0 12px;
  height: 42px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  letter-spacing: .02em;
}
.lc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.lc-input-icon {
  position: absolute;
  left: 11px;
  font-size: 15px;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}
.lc-input-wrap .lc-input { padding-left: 36px; }
.lc-pw-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity .15s;
}
.lc-pw-toggle:hover { opacity: 1; }
.lc-input::placeholder { color: rgba(108,130,168,0.5); }
.lc-input:focus {
  border-color: rgba(196,26,26,0.7);
  box-shadow: 0 0 0 2px rgba(196,26,26,0.1), 0 0 16px rgba(196,26,26,0.08);
}

/* Error */
.lc-error {
  font-size: 12px;
  color: #f87171;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 3px;
  padding: 8px 12px;
  margin-top: 8px;
}

/* Button */
.lc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  margin-top: 20px;
  background: #c41a1a;
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.lc-btn:hover:not(:disabled) {
  background: #a51515;
  transform: translateY(-1px);
}
.lc-btn:active:not(:disabled) { transform: translateY(0); }
.lc-btn:disabled { opacity: .6; cursor: not-allowed; }
.lc-btn.loading { animation: lc-btn-pulse 0.8s ease-in-out infinite; padding: 0; }
@keyframes lc-btn-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* ── CHIP ANIVERSÁRIO (topbar) ───────────────────────────────── */
.birthday-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(168,85,247,0.10);
  border: 1px solid rgba(168,85,247,0.28);
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.birthday-chip:hover { background: rgba(168,85,247,0.20); border-color: rgba(168,85,247,0.5); }

/* ── TOPBAR RIGHT ───────────────────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-right: 8px;
}
.topbar-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt2);
  transition: background 0.15s, color 0.15s;
}
.topbar-icon-btn:hover { background: var(--card); color: var(--txt1); }

/* Sino de notificações — mesma caixinha do chip de aniversário */
#notif-btn {
  background: rgba(196,26,26,0.10);
  border: 1px solid rgba(196,26,26,0.25);
}
#notif-btn:hover {
  background: rgba(196,26,26,0.20);
  border-color: rgba(196,26,26,0.50);
}
.notif-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--card2);
  pointer-events: none;
}
.topbar-birthday-wrapper, .topbar-notif-wrapper, .topbar-user-wrapper { position: relative; }
.birthday-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  max-height: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 1000;
  flex-direction: column;
  overflow: hidden;
}

/* User button */
.topbar-user-btn {
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  border-radius: 10px;
  color: var(--txt1);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.topbar-user-btn:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.topbar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.topbar-user-name {
  font-size: 13px;
  font-weight: 700;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.topbar-user-role {
  font-size: 10px;
  font-weight: 500;
  color: var(--txt3);
  white-space: nowrap;
  line-height: 1.3;
}
.topbar-chevron {
  font-size: 9px;
  color: var(--txt3);
  margin-left: 2px;
  flex-shrink: 0;
}
.user-dd-icon { font-size: 14px; flex-shrink: 0; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-dim);
  border: 1.5px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar span { font-size: 11px; font-weight: 700; color: var(--blue); }

/* Notification panel */
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-height: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 1000;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--txt1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.notif-mark-all {
  font-size: 10px;
  background: none;
  border: 1px solid var(--border);
  color: var(--txt3);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 5px;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.notif-mark-all:hover { background: var(--card); color: var(--txt1); }
#notif-content { overflow-y: auto; }

/* Lista flat de itens */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--card); }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 4px;
}
.notif-item.seen .notif-dot {
  background: transparent;
  border: 1.5px solid var(--border);
}
.notif-body { flex: 1; min-width: 0; }
.notif-body strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--txt1);
}
.notif-sub {
  display: block;
  font-size: 11px;
  color: var(--txt3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.notif-time {
  font-size: 10px;
  color: var(--txt3);
  flex-shrink: 0;
  margin-top: 3px;
  white-space: nowrap;
}

/* ── SYNC LOCAL (topbar) ─────────────────────────────────────── */
.topbar-sync-wrapper { position: relative; }
.sync-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  background: rgba(201,125,16,0.12);
  border: 1px solid rgba(201,125,16,0.38);
  border-radius: 8px;
  color: #d4910e;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.sync-btn:hover { background: rgba(201,125,16,0.22); border-color: rgba(201,125,16,0.65); }
#sync-badge {
  background: #c97d10;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  line-height: 16px;
  text-align: center;
}
.sync-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid #c97d10;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 1000;
  flex-direction: column;
  overflow: hidden;
}

/* ── PAGINAÇÃO ───────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 4px;
}
.pagination-info {
  font-size: 13px;
  color: var(--txt2);
  min-width: 70px;
  text-align: center;
  font-weight: 600;
}

/* User dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 1000;
  flex-direction: column;
  overflow: hidden;
}
.user-dd-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.user-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-dim);
  border: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar-lg img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar-lg span { font-size: 16px; font-weight: 700; color: var(--blue); }
.user-dd-info { min-width: 0; }
.user-dd-info strong { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dd-info small  { font-size: 11px; color: var(--txt3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.user-dd-divider { height: 1px; background: var(--border); }
.user-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--txt1);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.user-dd-item:hover { background: var(--card); }
.user-dd-item svg { color: var(--txt3); flex-shrink: 0; }
.user-dd-sair     { color: #f87171; }
.user-dd-sair svg { color: #f87171; }

/* ── TÉCNICO AVATAR ─────────────────────────────────────────── */
.tec-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-dim);
  border: 1.5px solid var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.tec-avatar img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.tec-avatar span { font-size: 12px; font-weight: 700; color: var(--blue); }
.tec-nome-cell  { display: flex; align-items: center; gap: 10px; }
.tec-nome-info strong { display: block; font-weight: 600; }
.tec-nome-info small  { display: block; font-size: 11px; color: var(--txt3); margin-top: 1px; }

/* ── FUNCIONÁRIOS ───────────────────────────────────────────── */
.perm-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--txt2);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--card2);
  user-select: none;
}
.perm-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.perm-chip-sm {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.25);
}
.role-badge-admin {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(139,92,246,0.15);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.3);
}
.role-badge-usuario {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.3);
}
.status-ativo   { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); vertical-align: middle; }
.status-inativo { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6b7280; vertical-align: middle; }

/* ── PRINT ──────────────────────────────────────────────────── */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .no-print, .sidebar, .top-bar, .toast-container, .modal-overlay, .sidebar-overlay,
  .print-preview-bar { display: none !important; }
  body { background: white !important; color: #000 !important; }
  .main-content { margin-left: 0 !important; }
  .content-area { padding: 0 !important; display: none !important; }
  .print-area { display: block !important; padding: 0 !important; }
  .print-preview-wrap { position: static !important; background: none !important; overflow: visible !important; display: block !important; }
  .print-preview-body { padding: 0 !important; display: block !important; }
  .os-totals-tbl th { background-color: #f3f4f6 !important; }
  .os-timbrado-header { position: relative !important; display: block !important; }
  .os-timbrado-footer {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .footer-spacer { display: none !important; }
  .footer-spacer-print { display: block !important; }
  .os-doc * { color: #000 !important; border-color: #000 !important; }
}
@page         { margin: 12mm 0 0 0; }
@page :first  { margin: 0; }
.print-area { display: none; }

/* ── PRINT PREVIEW OVERLAY ──────────────────────────────────── */
.print-preview-wrap {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #525659;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.print-preview-bar {
  position: sticky;
  top: 0;
  z-index: 10000;
  background: rgba(12, 16, 28, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 12px 24px;
  flex-shrink: 0;
}
.print-preview-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 220mm;
  margin: 0 auto;
}
.print-preview-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.3px;
}
.print-preview-actions { display: flex; gap: 10px; }
.print-preview-btn-close {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #9ca3af;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.print-preview-btn-close:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.print-preview-btn-print {
  padding: 8px 18px;
  background: #c41a1a;
  border: none;
  color: #fff;
  border-radius: 8px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.print-preview-btn-print:hover { background: #a51515; }

/* Botão Salvar PDF */
.print-preview-btn-pdf {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #c8e0ff;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.print-preview-btn-pdf:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Botão WhatsApp */
.print-preview-btn-wa {
  padding: 8px 18px;
  background: #25d366;
  border: none;
  color: #fff;
  border-radius: 8px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s;
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
}
.print-preview-btn-wa:hover { background: #1ebe5d; }
.print-preview-btn-wa:disabled { opacity: 0.6; cursor: not-allowed; }

.print-preview-body {
  flex: 1;
  padding: 30px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
}
.print-iframe-wrap {
  display: inline-block;
  overflow: visible;
}
.print-iframe {
  width: 210mm;
  min-height: 297mm;
  border: none;
  background: #fff;
  display: block;
  box-shadow: 0 2px 32px rgba(0,0,0,0.5);
}

/* ── MOBILE PRINT PREVIEW ───────────────────────────────────── */
@media (max-width: 768px) {
  .print-preview-bar { padding: 10px 12px; }
  .print-preview-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-width: 100%;
  }
  .print-preview-title { font-size: 12px; text-align: center; }
  .print-preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .print-preview-btn-close,
  .print-preview-btn-pdf,
  .print-preview-btn-wa,
  .print-preview-btn-print {
    justify-content: center;
    padding: 11px 10px;
    font-size: 13px;
    border-radius: 9px;
  }
  .print-preview-btn-wa {
    grid-column: 1 / -1; /* Ocupa linha inteira no mobile */
    font-size: 14px;
    padding: 12px 10px;
  }
  .print-preview-body {
    padding: 10px 0;
    overflow-x: auto;
    justify-content: flex-start;
    align-items: flex-start;
  }
  .print-iframe-wrap {
    padding: 0 8px 20px;
    transform-origin: top left;
  }
  .print-iframe {
    box-shadow: 0 2px 20px rgba(0,0,0,0.6);
  }
}

/* ════════════════ OS PRINT DOCUMENT ════════════════════════════ */
.os-doc {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8pt;
  color: #000;
  background: #fff;
  max-width: 210mm;
  margin: 0 auto;
  padding: 0;
  line-height: 1.3;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  overflow: hidden;
}

/* ── Timbrado (cabeçalho e rodapé) ──────────────────────────── */
.os-timbrado-header {
  width: 100%;
  display: block;
  line-height: 0;
  position: relative;
}
.os-header-logo-overlay {
  position: absolute;
  left: 8mm;
  top: 50%;
  transform: translateY(-50%);
  height: 26mm;
  width: auto;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.os-timbrado-footer {
  width: 100%;
  display: block;
  line-height: 0;
  margin-top: 8mm;
}
.os-timbrado-img {
  width: 100%;
  display: block;
  height: auto;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.os-doc-content { padding: 0 8mm; }

/* ── Dados da empresa (absoluto, canto direito do cabeçalho) ── */
.os-letterhead-data {
  position: absolute;
  right: 8mm;
  bottom: 5px;
  text-align: right;
  line-height: normal;
}
.os-letterhead-data .os-co-name {
  display: block;
  font-size: 8pt;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.3px;
  margin: 0 0 1px;
}
.os-letterhead-data p {
  margin: 0;
  font-size: 7pt;
  color: #000;
  line-height: 1.5;
}

/* ── Número da OS ───────────────────────────────────────────── */
.os-doc-number {
  text-align: center;
  font-size: 12pt;
  font-weight: bold;
  color: #000;
  letter-spacing: 0.3px;
  padding: 8px 0 10px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* ── Cards (seções) ─────────────────────────────────────────── */
.os-card {
  border: none;
  border-radius: 0;
  margin-bottom: 10px;
  break-inside: auto;
}
.os-card-hdr {
  display: block;
  padding: 0 0 3px 0;
  background: none;
  color: #000;
  font-size: 10pt;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  border: none;
}
.os-card-bdy {
  padding: 0;
  border: 1px solid #000;
}

/* ── Tabela de informações (células label + valor) ──────────── */
.os-info-tbl { width: 100%; border-collapse: collapse; }
.os-info-tbl td {
  border: 1px solid #000;
  padding: 6px 10px;
  vertical-align: top;
}
.os-info-tbl tr:first-child td { border-top: none; }
.os-info-tbl tr:last-child td { border-bottom: none; }
.os-info-tbl td:first-child { border-left: none; }
.os-info-tbl td:last-child { border-right: none; }
.os-lbl {
  display: block;
  font-size: 8pt;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.os-val {
  font-size: 8pt;
  font-weight: 400;
  color: #000;
  word-break: break-word;
}
.os-val-nome {
  font-size: 8pt;
  font-weight: 500;
  color: #000;
}
.os-val-pre { white-space: pre-wrap; }

/* ── Status chips ───────────────────────────────────────────── */
.os-status-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 9pt; font-weight: 700; border: 1px solid #9ca3af; }
.chip-aberta          { background:#e5e7eb; color:#374151; }
.chip-em_andamento    { background:#fef3c7; color:#b45309; }
.chip-aguardando_pecas{ background:#e5e7eb; color:#374151; }
.chip-concluida       { background:#dcfce7; color:#15803d; }
.chip-entregue        { background:#d1fae5; color:#065f46; }
.chip-cancelada       { background:#fee2e2; color:#b91c1c; }

/* ── Tabela de serviços / peças ─────────────────────────────── */
.os-svc-tbl { width: 100%; border-collapse: collapse; font-size: 9pt; }
.os-svc-tbl thead tr { background: #f0f0f0; }
.os-svc-tbl th {
  padding: 5px 8px;
  font-size: 9pt;
  font-weight: 700;
  text-transform: uppercase;
  color: #000 !important;
  background: #f0f0f0 !important;
  border: 1px solid #000;
  text-align: left;
}
.os-svc-tbl td {
  padding: 5px 8px;
  border: 1px solid #000;
  color: #000;
}
.os-svc-tbl tr:first-child th { border-top: none; }
.os-svc-tbl tr:last-child td  { border-bottom: none; }
.os-svc-tbl th:first-child, .os-svc-tbl td:first-child { border-left: none; }
.os-svc-tbl th:last-child,  .os-svc-tbl td:last-child  { border-right: none; }
.os-svc-tbl .col-center { text-align: center; }
.os-svc-tbl .col-right  { text-align: right; }
.os-svc-tbl .col-bold   { font-weight: 700; }
.os-svc-tbl .col-empty  { text-align: center; color: #000; font-size: 9pt; padding: 14px; }

/* Sub-cabeçalho Peças / Materiais */
.os-subsec-hdr {
  background: #f3f4f6;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 6px 12px;
  font-size: 11pt;
  font-weight: 700;
  text-transform: uppercase;
  color: #000;
}

/* ── Totais: layout horizontal (3 colunas) ──────────────────── */
.os-totals-box { border: 1px solid #000; margin-bottom: 10px; break-inside: avoid; page-break-inside: avoid; }
.os-totals-tbl { width: 100%; border-collapse: collapse; }
.os-totals-tbl th {
  padding: 6px 12px;
  text-align: right;
  font-size: 9pt;
  font-weight: 700;
  color: #000;
  background: #f0f0f0;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}
.os-totals-tbl th:last-child { border-right: none; }
.os-totals-tbl td {
  padding: 8px 12px;
  text-align: right;
  font-size: 10pt;
  font-weight: 700;
  color: #000;
  border-right: 1px solid #000;
}
.os-totals-tbl td:last-child { border-right: none; }
.os-totals-tbl .total-os-val { font-size: 12pt; font-weight: 900; }

/* ── Termos ─────────────────────────────────────────────────── */
.os-terms {
  border: 1px solid #1c2d4a;
  border-left: 4px solid #c81e1e;
  border-radius: 0 6px 6px 0;
  background: #fffbeb;
  padding: 8px 13px;
  margin-bottom: 15px;
  font-size: 8.5pt;
  color: #78350f;
  line-height: 1.6;
}

/* ── Assinaturas ────────────────────────────────────────────── */
.os-signatures {
  display: flex;
  flex-direction: column;
  margin-top: 70px;
  margin-bottom: 15px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.os-sign-date-row { text-align: left; }
.os-sign-row { display: flex; justify-content: center; gap: 60px; margin-top: 100px; }
.os-sign-block { text-align: center; }
.os-sign-space { height: 48px; }
.os-sign-line { border-top: 1px solid #000; width: 220px; margin: 0 auto 7px; }
.os-sign-name { font-size: 10pt; font-weight: 700; color: #000; }
.os-sign-role { font-size: 9pt; color: #000; margin-top: 2px; }
.os-sign-date { font-size: 10pt; color: #000; font-weight: 500; white-space: nowrap; }

/* ── Seção Cliente: endereço + tabela OS ─────────────────── */
.os-client-section {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  width: 100%;
  break-inside: avoid;
  page-break-inside: avoid;
}
.os-client-box {
  flex: 1;
  border: 1px solid #000;
  padding: 8px 12px;
  min-width: 50%;
}
.os-client-name {
  font-size: 10pt;
  font-weight: 700;
  color: #000;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
.os-client-row {
  font-size: 8pt;
  color: #000;
  line-height: 1.6;
}
/* ── Tabela de metadados da OS (datas/horas) ─────────────── */
.os-meta-tbl {
  border-collapse: collapse;
  border: 1px solid #000;
  flex-shrink: 0;
  align-self: flex-start;
  width: auto;
}
.os-meta-tbl td {
  border: 1px solid #000;
  padding: 5px 10px;
  text-align: center;
  vertical-align: middle;
  min-width: 96px;
  color: #000;
}
.meta-lbl {
  font-size: 6pt;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: 0.3px;
}
.meta-val {
  font-size: 9pt;
  font-weight: 600;
  color: #000;
  line-height: 1.3;
  margin-top: 3px;
}

/* ── Seções estilo Bling ────────────────────────────────────── */
.os-sec-lbl {
  font-size: 10pt;
  font-weight: 700;
  color: #000;
  margin: 6px 0 3px;
  display: block;
  break-after: avoid;
  page-break-after: avoid;
}
.os-sec-box {
  border: 1px solid #000;
  padding: 8px 10px;
  margin-bottom: 8px;
  min-height: 28px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.os-svc-wrap {
  border: 1px solid #000;
  margin-bottom: 8px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.os-tecnico-lbl {
  font-size: 12pt;
  font-weight: 900;
  color: #000;
  margin: 14px 0 4px;
}
.os-concordo {
  font-size: 8pt;
  color: #000;
  margin-bottom: 16px;
}
.os-sign-bling {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 24px;
  margin-bottom: 15px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.os-sign-bling-date {
  font-size: 8pt;
  color: #000;
  white-space: nowrap;
}
.os-sign-bling-resp {
  text-align: center;
  min-width: 240px;
}
.os-sign-bling-line {
  border-top: 1px solid #000;
  margin: 0 0 5px;
}
.os-sign-bling-label {
  font-size: 8pt;
  color: #000;
}

/* ── Rodapé ─────────────────────────────────────────────────── */
.os-footer-strip {
  text-align: center;
  font-size: 8pt;
  color: #1c2d4a;
  padding-top: 8px;
  border-top: 1px solid #1c2d4a;
  font-weight: 500;
}

/* Fotos */
.os-photo-print {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 4px 0;
}
.os-photo-print img {
  width: calc(32% - 4px);
  height: 170px;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 3px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
