@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Rajdhani:wght@600;700&display=swap');

:root {
  --primary: #9e0b0b;
  --primary-dark: #700808;
  --primary-active: #5a0606;
  --primary-2: var(--primary-dark);
  --secondary: #111111;
  --accent: #c91616;
  --background: #f5f6f7;
  --surface: #ffffff;
  --surface-hover: #f8f8f8;
  --surface-selected: #fff1f1;
  --border: #d9d9d9;
  --border-strong: #b9b9b9;
  --text: #161616;
  --muted: #62666b;
  --text-on-primary: #ffffff;
  --text-on-dark: #ffffff;
  --success: #9e0b0b;
  --success-bg: #fff1f1;
  --warning: #b36b00;
  --warning-bg: #fff5df;
  --danger: #c62828;
  --danger-bg: #fdecec;
  --focus-ring: rgba(158, 11, 11, 0.18);
  --disabled-bg: #d6d6d6;
  --disabled-text: #777777;
  --sidebar-bg: #111111;
  --sidebar-text: #e5e5e5;
  --sidebar-muted: #a9a9a9;
  --sidebar-hover: #272727;
  --sidebar-active: #9e0b0b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.20);
  /* aliases mantidos para componentes existentes */
  --bg: var(--background);
  --bg-accent: var(--background);
  --card: var(--surface);
  --card-border: var(--border);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg-accent);
  min-height: 100vh;
}
.sidebar { display: none; }
.mobile-drawer { position: fixed; top: 0; right: -360px; width: min(360px, 88vw); height: 100vh; background: #fff; backdrop-filter: blur(8px); z-index: 2200; transition: right .22s ease; padding: 16px 16px 96px; box-shadow: -12px 0 32px rgba(15,23,42,.18); display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--card-border); overflow-y: auto; overscroll-behavior: contain; }
.mobile-drawer.open { right: 0; }
.mobile-drawer a { display: flex; align-items: center; gap: 8px; padding: 11px 10px; text-decoration: none; color: #1e293b; border-radius: 12px; font-weight: 600; }
.mobile-drawer a:hover { background: #f1f5f9; }
.mobile-drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mobile-drawer-header button { width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 10px; display: grid; place-items: center; background: #e2e8f0; color: #1f2937; }
.mobile-drawer-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 2100; backdrop-filter: blur(2px); }
.content { padding: 18px 16px 120px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
  background: rgba(255,255,255,.68); border: 1px solid var(--card-border); border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(7px);
}
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}
.card h3, .card h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.dashboard-card .kpi-icon{
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148,163,184,.25);
}
.dashboard-card .money-toggle{
  margin-left: auto;
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #000 !important;
  padding: 0;
}
.dashboard-card .money-toggle:hover,
.dashboard-card .money-toggle:focus,
.dashboard-card .money-toggle:active{
  background: transparent !important;
  filter: none !important;
  transform: none !important;
}
.dashboard-card .money-toggle i{
  color: #000 !important;
}
.dashboard-card .kpi-icon i{ width:18px; height:18px; }
.dashboard-card:nth-child(1) .kpi-icon{ background:#fde2e2; color:#9f1239; }
.dashboard-card:nth-child(2) .kpi-icon{ background:#dbeafe; color:#1d4ed8; }
.dashboard-card:nth-child(3) .kpi-icon{ background:#fef3c7; color:#b45309; }
.dashboard-card:nth-child(4) .kpi-icon{ background:#fff1f1; color:#9e0b0b; }
.dashboard-card:nth-child(5) .kpi-icon{ background:#ede9fe; color:#6d28d9; }
.dashboard-card:nth-child(6) .kpi-icon{ background:#fee2e2; color:#991b1b; }
.dashboard-card:nth-child(7) .kpi-icon{ background:#fff1f1; color:#9e0b0b; }
.dashboard-card:nth-child(8) .kpi-icon{ background:#fce7f3; color:#be185d; }
.dashboard-card:nth-child(9) .kpi-icon{ background:#e0f2fe; color:#0369a1; }
.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.flash-success { background: #fff1f1; color: #700808; border: 1px solid #efcaca; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar form, .toolbar input, .toolbar select, .toolbar button { width: auto; }
.toolbar form { display: flex; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { height: 52px; margin: 0; }
.toolbar button { height: 52px; margin-top: 0; display: inline-flex; align-items: center; justify-content: center; }
.table-wrap { overflow: auto; border: 1px solid #e2e8f0; border-radius: 14px; }
.table-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.icon-btn { width:44px; height:44px; min-width:44px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; padding:0; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1600;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal-sheet {
  position: fixed; right: -680px; top: 0; bottom: 0; width: min(680px, 100vw);
  background: rgba(255,255,255,.98); backdrop-filter: blur(8px);
  border-left: 1px solid #dbe3ef; box-shadow: -14px 0 34px rgba(15,23,42,.18);
  z-index: 1700; transition: right .26s ease, opacity .22s ease, transform .26s ease; display: grid;
  grid-template-rows: auto 1fr; overflow: hidden;
  opacity: .35; transform: translateX(18px);
}
.modal-sheet.open { right: 0; opacity: 1; transform: translateX(0); }
.modal-sheet-header {
  display:flex; align-items:center; justify-content:space-between; padding:14px 16px;
  border-bottom:1px solid #e5edf8; background: #f8fbff;
}
.modal-sheet-body { padding:16px; overflow:auto; }
.toast-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 3000;
  display: grid; gap: 8px; width: min(360px, calc(100vw - 24px));
}
.toast {
  border-radius: 12px; border: 1px solid #cbd5e1; background: rgba(15,23,42,.96);
  color: #f8fafc; padding: 10px 12px; font-size: 14px; box-shadow: 0 10px 24px rgba(2,6,23,.35);
}
.toast.success { border-color: rgba(16,185,129,.55); }
.toast.error { border-color: rgba(239,68,68,.55); }
.toast.warning { border-color: rgba(245,158,11,.55); }
.confirm-backdrop {
  position: fixed; inset: 0; background: rgba(2,6,23,.45); z-index: 3200;
  display: none; align-items: center; justify-content: center; padding: 14px;
}
.confirm-backdrop.open { display: flex; }
.confirm-card {
  width: min(460px, 100%); background: #fff; border-radius: 14px; border: 1px solid #dbe3ef;
  box-shadow: 0 20px 40px rgba(15,23,42,.22); padding: 16px;
}
.confirm-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
.btn-ghost {
  background: #e2e8f0 !important; color: #0f172a !important;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; background: rgba(255,255,255,.78); }
th, td { padding: 10px; border-bottom: 1px solid #e8edf6; text-align: left; white-space: nowrap; }
th { background: #f8fafc; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.muted { color: var(--muted); font-size: 12px; }
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary-2);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, #e2e8f0);
  font-size: 12px;
  font-weight: 800;
}
.badge-soft i { width: 14px; height: 14px; }
.bottombar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.95); display: grid; grid-template-columns: repeat(5,1fr); border-top: 1px solid #dbe3ef; backdrop-filter: blur(8px); z-index: 1050; }
.bottombar a { padding: 10px 8px; text-align: center; text-decoration: none; color: #1f2a3d; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; }
.scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 58px;
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 16px;
  z-index: 2600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(.94);
  box-shadow: 0 14px 30px rgba(15,23,42,.22);
  transition: opacity .18s ease, transform .18s ease, filter .15s ease;
}
.scroll-top-btn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.scroll-top-btn i {
  width: 20px;
  height: 20px;
}
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.auth-card { max-width: 430px; width: 100%; display: grid; gap: 10px; }
input, button, select, textarea {
  width: 100%;
  border: 1px solid #cdd8e8;
  border-radius: 12px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 15px;
  background: rgba(255,255,255,.84);
}
input[type="file"] {
  padding: 8px;
  background: rgba(255,255,255,.9);
}
input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  margin-right: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  filter: brightness(1.05);
}
input[type="color"].color-square {
  width: 64px;
  height: 64px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #cdd8e8;
  background: #fff;
  cursor: pointer;
}
input[type="color"].color-square::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].color-square::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}
input[type="color"].color-square::-moz-color-swatch {
  border: 0;
  border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}
form { display: grid; gap: 10px; }
.card form + form { margin-top: 12px; }
button {
  margin-top: 2px;
  border: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
button:hover { filter: brightness(1.05); }
button:active { transform: translateY(1px); }
label { font-size: 13px; font-weight: 700; color: #334155; display: block; margin-bottom: 4px; }
.check-row { display:flex; align-items:center; gap:10px; }
.check-row input[type="checkbox"] { width:auto; margin:0; accent-color: var(--primary); transform: translateY(1px); }
.check-row label { margin:0; font-weight:600; color: var(--muted); cursor:pointer; }
.check-row span { display:grid; gap:2px; }
.check-row small { color: var(--muted); font-weight: 500; }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px !important; min-width: 36px; height: 36px; border: 0; background: transparent; color: #5f6f86; display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: none; }
.password-toggle i { width: 18px; height: 18px; }
.password-toggle:hover,
.password-toggle:focus,
.password-toggle:active {
  background: transparent !important;
  filter: none !important;
  transform: translateY(-50%) !important;
}
button i, a i, h2 i, h3 i { width: 16px; height: 16px; }
.btn-inline { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: #0f172a; font-weight: 600; }
button.btn-inline {
  width: auto;
  border: 0;
  background: transparent;
  color: #0f172a;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  border-radius: 0;
  box-shadow: none;
}
button.btn-inline:hover,
button.btn-inline:focus,
button.btn-inline:active {
  background: transparent !important;
  color: #0f172a !important;
  filter: none !important;
  transform: none !important;
}
.menu-badge{
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  background: rgba(255,255,255,.92);
  border-top: 1px solid #dbe3ef;
  backdrop-filter: blur(6px);
}

@media (min-width: 980px) {
  .sidebar {
    display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: 250px;
    background: rgba(255,255,255,.88); backdrop-filter: blur(10px);
    flex-direction: column; padding: 18px 18px 26px; gap: 10px; border-right: 1px solid #dde5f0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sidebar h2 { display: flex; align-items: center; gap: 8px; }
  .sidebar-group-title {
    margin-top: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
  }
  .sidebar a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #22314e; padding: 10px 12px; border-radius: 12px; font-weight: 600; }
  .sidebar a:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: #fff;
  }
  .content { margin-left: 250px; padding-bottom: 88px; }
  .bottombar { display: none; }
  .grid { grid-template-columns: repeat(3,1fr); gap: 16px; }
  .card { padding: 20px; margin-bottom: 16px; }
}
@media (max-width: 979px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
  footer { bottom: 0; }
  .bottombar { bottom: 33px; }
  .scroll-top-btn { bottom: 112px; right: 14px; }
  body.mobile-drawer-open { overflow: hidden; }
  body.mobile-drawer-open .scroll-top-btn { opacity: 0; pointer-events: none; transform: translateY(14px) scale(.94); }
  .mobile-drawer {
    right: min(-86vw, -320px);
    width: min(86vw, 340px);
    padding: 18px 14px 96px;
    background: #fff;
  }
  .mobile-drawer a {
    min-height: 46px;
    font-size: 15px;
    background: #fff;
  }
  .mobile-drawer.open { right: 0; }
  .mobile-drawer-backdrop {
    background: rgba(2, 6, 23, .58);
    z-index: 2100;
  }
  .content {
    max-width: 100vw;
    overflow-x: hidden;
    padding: 12px 10px 132px;
  }
  .card {
    padding: 14px;
    border-radius: 16px;
  }
  .topbar,
  .table-header,
  .toolbar {
    align-items: stretch;
  }
  .topbar {
    flex-direction: column;
    gap: 8px;
    border-radius: 14px;
    padding: 12px 14px;
  }
  .topbar > * {
    max-width: 100%;
  }
  .card h1 {
    font-size: 1.55rem;
    line-height: 1.18;
  }
  .card h2,
  .table-header h2 {
    font-size: 1.25rem;
    line-height: 1.18;
  }
  .table-header {
    flex-direction: column;
    gap: 12px;
  }
  .toolbar,
  .toolbar form,
  .inline-form,
  .filter-row,
  .search-row {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .toolbar input,
  .toolbar select,
  .toolbar textarea,
  .toolbar button,
  .inline-form input,
  .inline-form select,
  .inline-form textarea,
  .inline-form button,
  .filter-row input,
  .filter-row select,
  .filter-row button,
  .search-row input,
  .search-row select,
  .search-row button {
    min-height: 46px;
    width: 100% !important;
  }
  .toolbar .btn-inline {
    width: 100%;
    justify-content: center;
    min-height: 42px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: rgba(255,255,255,.78);
  }
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table {
    min-width: 680px;
  }
  table {
    font-size: 13px;
  }
  th, td {
    padding: 9px 8px;
  }
  input,
  button,
  select,
  textarea {
    font-size: 16px;
    max-width: 100%;
  }
  .grid-2,
  .form-grid,
  .dashboard-grid,
  .cards-grid,
  .stats-grid,
  .pdv-grid {
    grid-template-columns: 1fr !important;
  }
  .form-actions,
  .modal-actions,
  .action-row,
  .actions-row,
  .pdv-actions,
  .cart-actions,
  .payment-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .form-actions button,
  .form-actions a,
  .modal-actions button,
  .modal-actions a,
  .action-row button,
  .action-row a,
  .actions-row button,
  .actions-row a,
  .pdv-actions button,
  .pdv-actions a,
  .cart-actions button,
  .cart-actions a,
  .payment-actions button,
  .payment-actions a {
    justify-content: center;
    width: 100%;
  }
  .modal-sheet {
    max-width: 100vw;
    right: -100vw;
    width: 100vw;
  }
  .modal-sheet-body {
    padding: 14px 12px 110px;
  }
  .pdv-layout.content {
    margin-left: 0 !important;
    padding-bottom: 132px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .pdv-layout {
    max-width: 100% !important;
    min-width: 0;
    width: 100%;
  }
  .pdv-layout .card {
    min-width: 0;
    overflow: hidden;
  }
  .pdv-layout .toolbar {
    min-width: 0;
  }
  .pdv-layout .toolbar h2,
  .pdv-layout .toolbar h3 {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .pdv-layout .toolbar button {
    white-space: normal;
  }
  .pdv-products {
    max-height: none !important;
  }
  .pdv-product-item {
    grid-template-columns: 1fr !important;
    min-width: 0;
  }
  .pdv-product-item > div {
    min-width: 0;
  }
  .pdv-meta {
    gap: 6px;
    overflow-wrap: anywhere;
  }
  .pdv-actions input,
  .cart-actions input,
  .payment-actions input {
    width: 100% !important;
  }
}
@media (min-width:980px){ .mobile-drawer,.mobile-drawer-backdrop{display:none !important;} }
@media print { .sidebar, .topbar, .bottombar, button { display:none !important; } body { background:#fff; } .card { box-shadow:none; } }
/* Sistema visual REYNAM - Guia de Identidade Visual */
h1,h2,h3,.dashboard-card p,.sidebar h2,.auth-brand strong{
  font-family:"Rajdhani","Inter",sans-serif;
  letter-spacing:.01em;
}
body{background:var(--background);color:var(--text)}
a{color:var(--primary)}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid var(--focus-ring);
  outline-offset:2px;
}
.content{background:var(--background)}
.topbar{
  background:var(--secondary);
  color:var(--text-on-dark);
  border:0;
  border-bottom:2px solid var(--primary);
  border-radius:10px;
  box-shadow:var(--shadow-sm);
  backdrop-filter:none;
}
.card{
  background:var(--surface);
  border:1px solid #e2e2e2;
  border-radius:10px;
  box-shadow:var(--shadow-sm);
  backdrop-filter:none;
}
.card h2,.card h3,.table-header h2{color:var(--text)}
.dashboard-card{position:relative;overflow:hidden;border-left:4px solid var(--primary)}
.dashboard-card p{font-size:1.8rem;font-weight:700;margin:.35rem 0 0;color:var(--primary)}
.dashboard-card .kpi-icon,
.dashboard-card:nth-child(n) .kpi-icon{
  background:var(--surface-selected);
  color:var(--primary);
  border-color:#f0caca;
  border-radius:8px;
}
.flash{border-radius:8px}
.flash-success{background:var(--success-bg);color:var(--success);border-color:#efcaca}
.flash-error{background:var(--danger-bg);color:var(--danger);border-color:#efbcbc}
input,select,textarea{
  background:var(--surface);
  border:1px solid var(--border);
  color:var(--text);
  border-radius:8px;
}
input::placeholder,textarea::placeholder{color:#777c81}
input:focus,select:focus,textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--focus-ring);
  outline:none;
}
label{color:var(--text)}
button{
  background:var(--primary);
  border:1px solid var(--primary);
  border-radius:8px;
  color:var(--text-on-primary);
  box-shadow:none;
  transition:background .15s ease,border-color .15s ease,transform .08s ease;
}
button:hover{background:var(--primary-dark);border-color:var(--primary-dark);filter:none}
button:active{background:var(--primary-active);border-color:var(--primary-active)}
button:disabled,input:disabled,select:disabled,textarea:disabled{background:var(--disabled-bg);color:var(--disabled-text);cursor:not-allowed;opacity:1}
.btn-inline,button.btn-inline{
  width:auto;
  min-height:34px;
  padding:7px 10px;
  border:1px solid var(--border);
  border-radius:7px;
  background:var(--surface);
  color:var(--text);
  line-height:1;
}
.btn-inline:hover,button.btn-inline:hover,
.btn-inline:focus,button.btn-inline:focus{
  background:#f1f1f1 !important;
  border-color:var(--border-strong) !important;
  color:var(--text) !important;
}
.icon-btn{border-radius:8px}
.btn-ghost{background:var(--surface)!important;color:var(--text)!important;border:1px solid var(--border)!important}
input[type="file"]::file-selector-button{background:var(--primary);border-radius:7px}
input[type="file"]::file-selector-button:hover{background:var(--primary-dark);filter:none}
.table-wrap{border-color:var(--border);border-radius:10px}
table{background:var(--surface);color:var(--text)}
thead,th{background:#f0f1f2;color:var(--text)}
th,td{border-bottom:1px solid #e5e5e5}
tbody tr{background:var(--surface)}
tbody tr:hover{background:var(--surface-hover)}
tbody tr.is-selected{background:var(--surface-selected);border-left:3px solid var(--primary)}
.muted{color:var(--muted)}
.badge-soft{background:var(--surface-selected);color:var(--primary);border-color:#efcaca}
.menu-badge{background:var(--accent)}
.modal-backdrop,.confirm-backdrop{background:rgba(0,0,0,.58);backdrop-filter:none}
.modal-sheet{
  background:var(--surface);
  color:var(--text);
  border-left:1px solid var(--border);
  box-shadow:var(--shadow-modal);
  backdrop-filter:none;
}
.modal-sheet-header{background:#f5f6f7;border-color:var(--border)}
.confirm-card{border-color:var(--border);border-radius:10px;box-shadow:var(--shadow-modal)}
.toast{border-radius:8px;background:var(--secondary);color:var(--text-on-dark)}
.toast.success{border-color:var(--success)}.toast.error{border-color:var(--danger)}.toast.warning{border-color:var(--warning)}
.mobile-drawer{background:var(--sidebar-bg);border-color:#2d2d2d;box-shadow:var(--shadow-modal);backdrop-filter:none}
.mobile-drawer-header{color:var(--text-on-dark)}
.mobile-drawer-header button{background:var(--sidebar-hover);border-color:#3d3d3d}
.mobile-drawer a{color:var(--sidebar-text);border-radius:8px;background:transparent}
.mobile-drawer a:hover{background:var(--sidebar-hover)}
.mobile-drawer a.active{background:var(--sidebar-active);color:var(--text-on-primary)}
.sidebar,.mobile-drawer{
  scrollbar-width:thin;
  scrollbar-color:#5a5a5a #151515;
}
.sidebar::-webkit-scrollbar,.mobile-drawer::-webkit-scrollbar{width:9px}
.sidebar::-webkit-scrollbar-track,.mobile-drawer::-webkit-scrollbar-track{
  background:#151515;
  border-left:1px solid #242424;
}
.sidebar::-webkit-scrollbar-thumb,.mobile-drawer::-webkit-scrollbar-thumb{
  min-height:44px;
  background:#555;
  border:2px solid #151515;
  border-radius:999px;
}
.sidebar::-webkit-scrollbar-thumb:hover,.mobile-drawer::-webkit-scrollbar-thumb:hover{background:var(--accent)}
.sidebar::-webkit-scrollbar-thumb:active,.mobile-drawer::-webkit-scrollbar-thumb:active{background:var(--primary-dark)}
.sidebar::-webkit-scrollbar-corner,.mobile-drawer::-webkit-scrollbar-corner{background:#151515}
.bottombar{background:var(--surface);border-color:var(--border);backdrop-filter:none}
.bottombar a{color:var(--muted)}
.bottombar a.active{color:var(--primary)}
.bottombar a.active svg{stroke-width:2.5}
footer{background:var(--surface);border-color:var(--border);backdrop-filter:none}
.auth-body{
  background:linear-gradient(135deg,#111 0%,#1d1d1d 68%,#360505 100%);
  min-height:100vh;
}
.auth-card{border-top:4px solid var(--primary);box-shadow:var(--shadow-modal)}
.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:4px}
.auth-brand-mark{width:46px;height:46px;display:grid;place-items:center;border-radius:8px;background:var(--secondary);color:#fff;border:2px solid var(--primary)}
.auth-brand strong{display:block;font-size:1.35rem;line-height:1;color:var(--text)}
.auth-brand small{display:block;margin-top:4px;color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.12em}
.auth-brand-logo{display:block;max-width:210px;max-height:72px;width:auto;height:auto;object-fit:contain}
.brand-text{display:flex;flex-direction:column;line-height:1}
.brand-text strong{font-size:1.35rem;letter-spacing:.08em}
.brand-text small{margin-top:3px;color:var(--sidebar-muted);font-family:"Inter",sans-serif;font-size:.62rem;font-weight:600;letter-spacing:.09em;text-transform:uppercase}
.topbar-brand{display:flex;align-items:center;gap:9px;min-width:0}
.topbar-brand>svg{width:30px;height:30px;color:var(--accent)}
.topbar-brand span{display:flex;flex-direction:column;line-height:1}
.topbar-brand strong{font-family:"Rajdhani",sans-serif;font-size:1.15rem;letter-spacing:.08em}
.topbar-brand small{margin-top:3px;color:#bdbdbd;font-size:.62rem;letter-spacing:.08em;text-transform:uppercase}
.topbar-logo{display:block;max-width:180px;max-height:42px;width:auto;height:auto;object-fit:contain}
.terminal-pill{padding:7px 10px;border:1px solid #3d3d3d;border-radius:7px;background:#1d1d1d;color:#cfcfcf;font-size:.78rem}
.terminal-pill strong{color:#fff}
.status-badge{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid transparent;border-radius:999px;font-size:.74rem;font-weight:700;line-height:1.2;white-space:nowrap}
.status-badge::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.status-success{background:var(--success-bg);border-color:#efcaca;color:var(--success)}
.brand-palette{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.brand-palette span{display:inline-flex;align-items:center;gap:7px;padding:7px 9px;border:1px solid var(--border);border-radius:7px;background:var(--surface);font-size:.78rem;font-weight:700}
.brand-palette i{display:block;width:22px;height:22px;border:1px solid rgba(0,0,0,.16);border-radius:5px}
.status-warning{background:var(--warning-bg);border-color:#efd49e;color:var(--warning)}
.status-danger{background:var(--danger-bg);border-color:#efbcbc;color:var(--danger)}
.status-running{background:var(--surface-selected);border-color:#efcaca;color:var(--primary)}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px;margin:12px 0}
.photo-grid a{display:flex;flex-direction:column;gap:5px;color:inherit;text-decoration:none}
.photo-grid img{width:100%;height:110px;object-fit:cover;border-radius:8px;border:1px solid var(--border)}
.list-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid var(--border);flex-wrap:wrap}
#received-table input,#received-table textarea,#received-table select,#work-table input,#work-table select,#measurement-table input,#measurement-table select{min-width:110px}
.pagination{display:flex;gap:6px;flex-wrap:wrap;margin-top:14px}.pagination .active{background:var(--primary);color:#fff}

@media (min-width:980px){
  .sidebar{
    background:var(--sidebar-bg);
    border-right:1px solid #2d2d2d;
    backdrop-filter:none;
  }
  .sidebar h2{color:var(--text-on-dark);font-size:1.2rem;margin:0 0 6px}
  .sidebar-group-title{color:var(--sidebar-muted)}
  .sidebar a{color:var(--sidebar-text);border-radius:8px}
  .sidebar a i{color:#b8b8b8}
  .sidebar a:hover{background:var(--sidebar-hover);color:#fff}
  .sidebar a.active{background:var(--sidebar-active);color:#fff}
  .sidebar a.active i,.sidebar a:hover i{color:#fff}
}

@media (max-width:979px){
  .mobile-drawer,.mobile-drawer a{background:var(--sidebar-bg)}
  .mobile-drawer a:hover{background:var(--sidebar-hover)}
  .bottombar{min-height:60px}
  .bottombar a{min-height:58px;justify-content:center}
  .topbar{border-radius:8px}
  .topbar-brand small{display:none}
  .terminal-pill{max-width:48%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .card{border-radius:10px}
  .toolbar .btn-inline{background:var(--surface)}
}
