/* public/styles.css */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* ===== Base (DARK) ===== */
  --bg-body: radial-gradient(circle at top, #020617, #000);
  --bg-elevated: #020617;
  --bg-panel: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 1));

  --border-color: rgba(148, 163, 184, 0.45);
  --border-soft: rgba(148, 163, 184, 0.18);
  --border-subtle: rgba(31, 41, 55, 0.9);

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;
  --text-strong: #f9fafb;

  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --accent-strong: #1d4ed8;

  --danger: #f97373;
  --danger-strong: #ef4444;
  --success: #4ade80;
  --warning: #facc15;

  --shadow-soft: 0 18px 60px rgba(15, 23, 42, 0.45);

  --radius-lg: 18px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --transition-fast: 0.15s ease-out;
  --transition-med: 0.22s ease;

  /* ===== Table tokens (DARK) ===== */
  --table-wrap-bg: rgba(15, 23, 42, 0.9);
  --table-head-bg: rgba(15, 23, 42, 0.96);
  --table-head-grad: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  --table-head-text: var(--text-soft);
  --table-row-odd: rgba(15, 23, 42, 0.9);
  --table-row-even: rgba(15, 23, 42, 0.85);
  --table-row-hover: radial-gradient(circle at left, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.98));
  --table-border: rgba(255, 255, 255, 0.08);
  --table-footer-bg: rgba(15, 23, 42, 0.98);

  /* ===== Inputs (DARK) ===== */
  --input-bg: rgba(15, 23, 42, 0.8);
  --input-bg-soft: rgba(15, 23, 42, 0.65);
  --input-border: var(--border-soft);
  --input-placeholder: var(--text-soft);

  /* ===== Topbar (DARK) ===== */
  --topbar-bg: rgba(2, 6, 23, 0.75);
  --topbar-border: rgba(148, 163, 184, 0.16);
}

/* ===== Light theme overrides (ENTERPRISE) ===== */
body.light-theme {
  --bg-body: #f3f4f6;
  --bg-elevated: #ffffff;
  --bg-panel: #ffffff;

  --border-color: #e5e7eb;
  --border-soft: #e5e7eb;
  --border-subtle: #eef2f7;

  --text-main: #374151;
  --text-muted: #6b7280;
  --text-soft: #94a3b8;
  --text-strong: #111827;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.06);

  --input-bg: #ffffff;
  --input-bg-soft: #ffffff;
  --input-border: #d1d5db;
  --input-placeholder: #94a3b8;

  --topbar-bg: rgba(255, 255, 255, 0.92);
  --topbar-border: #e5e7eb;

  /* Table tokens (LIGHT) */
  --table-wrap-bg: #ffffff;
  --table-head-bg: #f8fafc;
  --table-head-grad: none;
  --table-head-text: #475569;
  --table-row-odd: #ffffff;
  --table-row-even: #f9fafb;
  --table-row-hover: #eff6ff;
  --table-border: #e5e7eb;
  --table-footer-bg: #ffffff;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-body);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   Login
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 26px 26px 22px;
  border-radius: 22px;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  color: var(--text-main);
}

body.light-theme .login-card {
  background: #ffffff;
  border-color: var(--border-color);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.login-logo img {
  height: 38px;
}

.login-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 650;
  text-align: center;
  color: var(--text-strong);
}

.login-subtitle {
  margin: 0 0 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-hint {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--text-soft);
  text-align: center;
}

/* ============================================================
   Form fields
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
}

.field span {
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  border-radius: 9px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-main);
  padding: 7px 9px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.field--soft input,
.field--soft select,
.field--soft textarea {
  background: var(--input-bg-soft);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--input-placeholder);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.form-error {
  min-height: 16px;
  margin: 2px 0 4px;
  font-size: 0.78rem;
  color: var(--danger-strong);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 7px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform 0.05s ease-out,
    box-shadow var(--transition-fast);
}

body.light-theme .btn {
  background: #ffffff;
  border-color: #d1d5db;
  color: var(--text-main);
}

.btn--primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f9fafb;
  border-color: transparent;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.45);
}

.btn--primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--text-muted);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}

body.light-theme .btn--ghost {
  background: #ffffff;
  border-color: #d1d5db;
  color: #4b5563;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.light-theme .btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff6ff;
}

.btn--sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.btn--full {
  width: 100%;
}

.btn--loading {
  opacity: 0.85;
}

.btn--loading::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: rgba(255, 255, 255, 0.1);
  animation: spin 0.8s linear infinite;
}

body.light-theme .btn--loading::after {
  border-color: rgba(17, 24, 39, 0.35);
  border-top-color: rgba(17, 24, 39, 0.08);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast), transform 0.05s ease-out;
}

.icon-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-main);
}

body.light-theme .icon-btn:hover {
  background: rgba(2, 6, 23, 0.06);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn--small {
  font-size: 0.78rem;
}

.icon-btn--danger {
  color: var(--danger);
}

.icon-btn--danger:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.icon-btn--danger {
  color: var(--danger);
}

.icon-btn--danger:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

/* ============================================================
   Layout / Shell
   ============================================================ */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar__logo img {
  height: 34px;
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--text-strong);
}

.topbar__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.02);
}

body.light-theme .user-chip {
  background: #ffffff;
  border-color: #e5e7eb;
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 16px 54px;
  flex: 1;
}

.panel {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: var(--bg-panel);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}

body.light-theme .panel {
  border-color: var(--border-color);
  box-shadow: var(--shadow-soft);
}

/* ============================================================
   Filters / Sidebar
   ============================================================ */
.panel--filters {
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filters-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-strong);
}

.filters-subtitle {
  margin: -6px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.filters-section {
  padding: 12px 12px 10px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.35);
}

body.light-theme .filters-section {
  background: #ffffff;
  border-color: var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filters-section__title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-soft);
}

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.55);
  padding: 12px 12px 10px;
  position: relative;
  overflow: hidden;
}

body.light-theme .kpi-card {
  background: #ffffff;
  border-color: var(--border-color);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.kpi-card--alocado::before {
  background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.2), transparent 60%);
}

.kpi-card--estoque::before {
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.2), transparent 60%);
}

.kpi-card--manutencao::before {
  background: radial-gradient(circle at top left, rgba(234, 179, 8, 0.2), transparent 60%);
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.kpi-value {
  display: block;
  font-size: 1.4rem;
  margin-top: 3px;
  font-weight: 750;
  color: var(--text-strong);
  position: relative;
  z-index: 1;
}

.kpi-caption {
  font-size: 0.72rem;
  color: var(--text-soft);
  position: relative;
  z-index: 1;
}

/* Chips */
.filter-status-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.4);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 5px 10px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast),
    transform 0.05s ease-out;
}

body.light-theme .chip {
  background: #ffffff;
  border-color: #d1d5db;
  color: #4b5563;
}

.chip:hover {
  border-color: rgba(37, 99, 235, 0.6);
  color: var(--text-main);
  background: rgba(37, 99, 235, 0.1);
}

body.light-theme .chip:hover {
  background: #eff6ff;
}

.chip.is-active,
.chip.chip--active {
  border-color: rgba(37, 99, 235, 0.85);
  color: #eef2ff;
  background: rgba(37, 99, 235, 0.15);
}

body.light-theme .chip.is-active,
body.light-theme .chip.chip--active {
  color: #1e3a8a;
  background: #dbeafe;
}

/* Sidebar buttons (existing) */
.filters-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filters-nav__item {
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.45);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform 0.05s ease-out;
  color: var(--text-main);
  text-align: left;
}

body.light-theme .filters-nav__item {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.filters-nav__item:hover {
  border-color: rgba(37, 99, 235, 0.7);
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

body.light-theme .filters-nav__item:hover {
  background: #f9fafb;
}

.filters-nav__icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
}

/* Optional custom nav-menu (if used) */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast),
    transform 0.05s ease-out;
  font-size: 0.9rem;
}

.nav-item:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--text-main);
}

.nav-item.is-active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent);
  font-weight: 650;
  border-left: 3px solid var(--accent);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.9;
}

.nav-badge--success {
  color: #4ade80;
}
.nav-badge--warning {
  color: #facc15;
}
.nav-badge--danger {
  color: #f87171;
}

/* ============================================================
   Table panel header
   ============================================================ */
.panel--table {
  display: flex;
  flex-direction: column;
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 14px 10px;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

body.light-theme .panel__header {
  border-bottom-color: var(--border-color);
}

.panel__title-group h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-strong);
}

.summary {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.panel__header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.panel__header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel__header-search {
  position: relative;
  min-width: 240px;
}

.search-input {
  width: 100%;
  padding: 6px 28px 6px 28px;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--input-placeholder);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.search-input__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  opacity: 0.7;
  color: var(--text-muted);
}

/* ============================================================
   Table
   ============================================================ */
.table-wrapper {
  position: relative;
  margin-top: 4px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--table-wrap-bg);
  overflow-x: auto;
  overflow-y: hidden;
  transition: all 0.2s ease;
}


body.light-theme .table-wrapper {
  border-color: var(--border-color);
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.table-wrapper thead {
  background: var(--table-head-bg);
}

.table-wrapper thead tr {
  border-bottom: 1px solid var(--border-subtle);
}

.table-wrapper th,
.table-wrapper td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--table-border);
  vertical-align: middle;
}

.table-wrapper th {
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--table-head-text);
  position: sticky;
  top: 0;
  background: var(--table-head-grad);
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.light-theme .table-wrapper th {
  background: var(--table-head-bg);
}

th.is-sorted {
  color: var(--text-strong);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.96));
}

body.light-theme th.is-sorted {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(248, 250, 252, 1));
}

.table-wrapper tbody tr:nth-child(odd) {
  background: var(--table-row-odd);
}

.table-wrapper tbody tr:nth-child(even) {
  background: var(--table-row-even);
}

.table-wrapper tbody tr:hover {
  background: var(--table-row-hover);
}

/* Truncamento + tooltip (JS coloca title) */
.td-truncate {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact view: esconder colunas opcionais/avançadas */
.table--compact th.col-optional,
.table--compact td.col-optional,
.table--compact th.col-advanced,
.table--compact td.col-advanced,
.table--compact th.col-extra,
.table--compact td.col-extra {
  display: none;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-main);
}

body.light-theme .status-badge {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

.status-badge--estoque {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.12);
}
.status-badge--alocado {
  border-color: rgba(249, 115, 22, 0.7);
  background: rgba(249, 115, 22, 0.12);
}
.status-badge--manutencao {
  border-color: rgba(234, 179, 8, 0.75);
  background: rgba(234, 179, 8, 0.12);
}
.status-badge--descartado {
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(239, 68, 68, 0.12);
}

/* Table actions */
.table-actions,
.cell-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast), transform 0.08s ease-out;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.btn-icon:hover {
  transform: translateY(-1px);
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-main);
}

body.light-theme .btn-icon:hover {
  background: rgba(2, 6, 23, 0.06);
}

/* Icon hover colors (optional) */
.act-copy:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}
.act-maint:hover {
  color: #e879f9;
  background: rgba(232, 121, 249, 0.1);
}
.act-stock:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}
.act-edit:hover {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
}
.act-del:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* Empty state */
.empty-state {
  padding: 18px 14px 18px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-soft);
  border-top: 1px dashed rgba(75, 85, 99, 0.7);
  display: none;
}

body.light-theme .empty-state {
  border-top-color: #e5e7eb;
}

.empty-state__icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.empty-state__title {
  margin: 0 0 3px;
  font-size: 0.95rem;
  color: var(--text-main);
}

.empty-state__text {
  margin: 0 0 10px;
}

/* Table footer / pagination */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  background: var(--table-footer-bg);
  font-size: 0.78rem;
}

body.light-theme .table-footer {
  border-top-color: #e5e7eb;
}

.table-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--text-soft);
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-size select {
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-main);
  padding: 3px 8px;
  font-size: 0.78rem;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-indicator {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ============================================================
   Tabela com Larguras Corrigidas (Visual Enterprise)
   ============================================================ */
#notebooksTable {
  width: 100%;
  border-collapse: separate; /* Permite bordas arredondadas e spacing se quiser */
  border-spacing: 0;
}

.table-wrapper #notebooksTable {
  table-layout: fixed; /* OBRIGATÓRIO para respeitar as larguras */
  min-width: 1600px; /* Largura total mínima para caber tudo sem esmagar */
}

#notebooksTable th,
#notebooksTable td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 10px 12px;
  vertical-align: middle;
}

/* --- DEFINIÇÃO DE LARGURAS (Ajustado para nomes completos) --- */

/* 1. Patrimônio */
#notebooksTable th:nth-child(1), #notebooksTable td:nth-child(1) { width: 110px; }

/* 2. Marca */
#notebooksTable th:nth-child(2), #notebooksTable td:nth-child(2) { width: 100px; }

/* 3. Modelo */
#notebooksTable th:nth-child(3), #notebooksTable td:nth-child(3) { width: 140px; }

/* 4. Número de Série (Era S/N) - Precisa de mais espaço */
#notebooksTable th:nth-child(4), #notebooksTable td:nth-child(4) { width: 160px; }

/* 5. Processador */
#notebooksTable th:nth-child(5), #notebooksTable td:nth-child(5) { width: 140px; }

/* 6. Memória */
#notebooksTable th:nth-child(6), #notebooksTable td:nth-child(6) { width: 100px; }

/* 7. Armazenamento (Era Armaz.) */
#notebooksTable th:nth-child(7), #notebooksTable td:nth-child(7) { width: 140px; }

/* 8. Nota Fiscal (Era NF) */
#notebooksTable th:nth-child(8), #notebooksTable td:nth-child(8) { width: 120px; text-align: center; }

/* 9. Valor */
#notebooksTable th:nth-child(9), #notebooksTable td:nth-child(9) { width: 130px; }

/* 10. Garantia */
#notebooksTable th:nth-child(10), #notebooksTable td:nth-child(10) { width: 130px; }

/* 11. Estado */
#notebooksTable th:nth-child(11), #notebooksTable td:nth-child(11) { width: 100px; }

/* 12. Status */
#notebooksTable th:nth-child(12), #notebooksTable td:nth-child(12) { width: 140px; text-align: center; }

/* 13. Responsável */
#notebooksTable th:nth-child(13), #notebooksTable td:nth-child(13) { width: 220px; }

/* 14. Setor */
#notebooksTable th:nth-child(14), #notebooksTable td:nth-child(14) { width: 160px; }

/* 15. Localização */
#notebooksTable th:nth-child(15), #notebooksTable td:nth-child(15) { width: 160px; }

/* 16. Ações (Última coluna - Larga para caber botões + checkbox) */
#notebooksTable th:nth-child(16), #notebooksTable td:nth-child(16) { 
  width: 200px; 
  text-align: center; 
  overflow: visible; /* Para tooltips não cortarem */
}

/* Estilo dos ícones do menu lateral para ficarem uniformes */
.nav-icon, .filters-nav__icon {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ============================================================
   Modal
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
}

body.light-theme .modal__backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.modal__content {
  position: relative;
  width: min(860px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

body.light-theme .modal__content {
  background: #ffffff;
  border-color: var(--border-color);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.18);
}

.modal__content--wide {
  width: min(1020px, 100%);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

body.light-theme .modal__header {
  border-bottom-color: var(--border-color);
}

.modal__header h2 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text-strong);
}

.modal__body {
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal__body--split {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

@media (max-width: 980px) {
  .modal__body--split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .modal__body--split {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

body.light-theme .modal__footer {
  border-top-color: var(--border-color);
}

/* Advanced block inside notebook modal */
.advanced-block {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.35);
  overflow: hidden;
}

body.light-theme .advanced-block {
  background: #ffffff;
  border-color: var(--border-color);
}

.advanced-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
}

.advanced-toggle__icon {
  color: var(--text-muted);
}

.advanced-content {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: block;
}

body.light-theme .advanced-content {
  border-top-color: var(--border-color);
}

.advanced-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 0;
}

.advanced-status__label {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.warranty-badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.6);
}

body.light-theme .warranty-badge {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

.warranty-badge--unknown {
  opacity: 0.9;
}

/* Users modal table (if exists) */
.users-list h3,
.users-form h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--text-strong);
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.users-search {
  position: relative;
  min-width: 220px;
  flex: 1 1 260px;
}

.users-search .search-input {
  width: 100%;
}

.users-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.users-pagination__actions {
  display: flex;
  gap: 6px;
}

.users-table-wrapper {
  max-height: 360px;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.35);
}

body.light-theme .users-table-wrapper {
  background: #ffffff;
  border-color: var(--border-color);
}

.table-wrapper--sub {
  margin-top: 0;
  border-radius: 14px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.users-table th,
.users-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

body.light-theme .users-table th,
body.light-theme .users-table td {
  border-bottom-color: #e5e7eb;
}

.users-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* ============================================================
   Toasts
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  max-width: 360px;
}

.toast {
  border-radius: 16px;
  padding: 12px 12px 10px;
  background: rgba(2, 6, 23, 0.92);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.8);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

body.light-theme .toast {
  background: rgba(255, 255, 255, 0.98);
  border-color: #e5e7eb;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
}

.toast__icon {
  font-size: 1.05rem;
  margin-top: 1px;
}

.toast__body {
  flex: 1;
}

.toast__title {
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text-strong);
}

.toast__text {
  margin: 0;
  color: var(--text-main);
}

.toast--success {
  border-color: rgba(34, 197, 94, 0.9);
}
.toast--error {
  border-color: rgba(239, 68, 68, 0.9);
}
.toast--info {
  border-color: rgba(59, 130, 246, 0.9);
}

/* ============================================================
   Footer
   ============================================================ */
.app-footer {
  margin-top: auto;
  padding: 8px 18px 14px;
  font-size: 0.78rem;
  color: var(--text-soft);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(0, 0, 0, 0.98));
}

body.light-theme .app-footer {
  background: #ffffff;
  border-top-color: #e5e7eb;
}

/* ============================================================
   Theme toggle button (if you have #themeToggleBtn)
   ============================================================ */
#themeToggleBtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fbbf24;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

#themeToggleBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.08) rotate(10deg);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.28);
  border-color: #fbbf24;
}

body.light-theme #themeToggleBtn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #4f46e5;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

body.light-theme #themeToggleBtn:hover {
  border-color: #4f46e5;
  background: #f5f3ff;
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel--filters {
    order: -1;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .layout {
    padding: 12px 12px 50px;
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .panel__header-right {
    width: 100%;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .panel__header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .panel__header-search {
    min-width: 100%;
  }
}

@media (max-width: 720px) {
  .table-wrapper thead {
    display: none;
  }

  .table-wrapper table,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper td {
    display: block;
    width: 100%;
  }

  .table-wrapper tbody tr {
    margin: 8px 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    overflow: hidden;
  }

  body.light-theme .table-wrapper tbody tr {
    border-color: #e5e7eb;
  }

  .table-wrapper td {
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  body.light-theme .table-wrapper td {
    border-bottom-color: #e5e7eb;
  }

  .table-wrapper td::before {
    content: attr(data-label);
    font-weight: 650;
    color: var(--text-soft);
    flex: 0 0 45%;
    text-align: left;
  }

  .table-actions,
  .cell-actions {
    justify-content: flex-end;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* ==========================================================================
   BADGES & STATUS (ATUALIZAÇÃO VISUAL)
   Cole isso no final do arquivo styles.css para garantir a prioridade
   ========================================================================== */

/* --- 1. BADGES DE GARANTIA --- */
.badge-warranty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 6px; /* Levemente quadrado (estilo Intune) */
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 90px;
}

/* Com Garantia (Verde) */
.badge-warranty--active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Garantia Expirada (Vermelho) */
.badge-warranty--expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- 2. STATUS DO NOTEBOOK (REDEFINIÇÃO DE CORES) --- */
/* Força as cores específicas que você pediu */

.status-badge {
  /* Mantém o layout base, muda só as cores */
  border-radius: 6px; /* Padronizando com a garantia */
  text-transform: capitalize;
}

/* Estoque = Verde */
.status-badge.status-estoque {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

/* Alocado = Amarelo/Laranja (Igual menu lateral) */
.status-badge.status-alocado {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.3);
}

/* Manutenção = Cinza (Neutro) */
.status-badge.status-manutencao, 
.status-badge.status-defeito {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

/* Descartado = Vermelho */
.status-badge.status-descartado {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* --- AJUSTES PARA TEMA CLARO (LIGHT MODE) --- */
/* Precisamos escurecer o texto para ficar legível no fundo branco */

body.light-theme .badge-warranty--active {
  background: #dcfce7; color: #15803d; border-color: #bbf7d0;
}
body.light-theme .badge-warranty--expired {
  background: #fee2e2; color: #b91c1c; border-color: #fecaca;
}

body.light-theme .status-badge.status-estoque {
  background: #dcfce7; color: #15803d; border-color: #bbf7d0;
}
body.light-theme .status-badge.status-alocado {
  background: #fef9c3; color: #a16207; border-color: #fde047;
}
body.light-theme .status-badge.status-manutencao {
  background: #f1f5f9; color: #475569; border-color: #e2e8f0;
}
body.light-theme .status-badge.status-descartado {
  background: #fee2e2; color: #b91c1c; border-color: #fecaca;
}

/* ==========================================================================
   FASE 3: FUNCIONALIDADES AVANÇADAS (Dropdown, Sort, Bulk, Compact)
   Cole isso no final do arquivo para garantir que funcione
   ========================================================================== */

/* --- 1. MENU DROPDOWN (CSV) --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 180px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: none; /* Escondido por padrão */
  flex-direction: column;
  padding: 6px;
  z-index: 100;
}

/* Mostra quando tem a classe .is-open */
.dropdown.is-open .dropdown-menu {
  display: flex;
  animation: slideDown 0.15s ease-out;
}

.dropdown-item {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
}

.dropdown-item:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--accent);
}

/* Ajuste para Tema Claro */
body.light-theme .dropdown-menu {
  background: #ffffff;
  border-color: #d1d5db;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
body.light-theme .dropdown-item:hover {
  background: #f3f4f6;
}

/* Animação suave */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 2. ORDENAÇÃO (Setinhas na Tabela) --- */
th.sortable {
  cursor: pointer;
  user-select: none; /* Evita selecionar o texto ao clicar */
  position: relative;
  padding-right: 20px !important; /* Espaço para a setinha */
  transition: background 0.2s;
}

th.sortable:hover {
  background-color: rgba(255, 255, 255, 0.05); /* Hover sutil */
}

body.light-theme th.sortable:hover {
  background-color: #f1f5f9;
}

/* Ícone da setinha */
.sort-icon::after {
  content: "↕"; /* Seta neutra */
  position: absolute;
  right: 8px;
  opacity: 0.3;
  font-size: 0.75rem;
}

/* Quando ordenado ASC (Crescente) */
th.asc .sort-icon::after {
  content: "▲";
  opacity: 1;
  color: var(--accent);
}

/* Quando ordenado DESC (Decrescente) */
th.desc .sort-icon::after {
  content: "▼";
  opacity: 1;
  color: var(--accent);
}

/* --- 3. CHECKBOXES E SELEÇÃO DE LINHA --- */
input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent); /* Cor azul do sistema */
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* Linha selecionada (Destaque) */
tr.row-selected td {
  background-color: rgba(37, 99, 235, 0.1) !important;
}

body.light-theme tr.row-selected td {
  background-color: #eff6ff !important; /* Azul bem clarinho no light mode */
}

/* --- 4. VISÃO COMPACTA (Esconder colunas extras) --- */
/* O pulo do gato: quando a tabela tem a classe .table--compact, as colunas .col-extra somem */
.table--compact .col-extra {
  display: none !important;
}

/* --- 5. BOTÃO DE AÇÃO EM MASSA (Danger) --- */
#bulkDeleteBtn {
  margin-right: 10px;
  font-weight: 600;
  transition: all 0.2s;
}
#bulkDeleteBtn.hidden {
  display: none !important;
}

/* --- CÉLULA DE AÇÕES E CHECKBOX --- */
.cell-actions {
  display: flex !important; /* Força flexbox na célula */
  align-items: center;
  justify-content: center;
  gap: 12px; /* Espaço entre os ícones e o checkbox */
  height: 100%;
}

.actions-group {
  display: flex;
  gap: 4px;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, 0.3); /* Linha divisória sutil */
}

/* Ajuste para modo claro */
body.light-theme .checkbox-wrapper {
  border-left-color: #e2e8f0;
}

/* Aumentar um pouco a área de clique do checkbox */
input.row-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
/* --- CHECKBOX CUSTOMIZADO (BOTÃO) --- */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  padding-left: 10px;
  margin-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.1); /* Divisória sutil */
}

body.light-theme .checkbox-wrapper {
  border-left-color: #e2e8f0;
}

/* O botão desmarcado parece os outros ícones (cinza) */
.btn-check {
  font-size: 1.3rem; /* Um pouco maior para facilitar o clique */
}

/* Quando marcado (is-active), fica azul brilhante */
.btn-check.is-active {
  color: var(--accent) !important;
  background: rgba(37, 99, 235, 0.15);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.3);
}

/* Animaçãozinha ao clicar */
.btn-check:active {
  transform: scale(0.9);
}

/* ============================================================
   CHECKBOX ANIMADO (ESTILO NEON)
   ============================================================ */

.btn-check {
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efeito elástico */
  border: 1px solid transparent;
  border-radius: 6px;
}

/* Estado Marcado (ATIVO) */
.btn-check.is-active {
  transform: scale(1.15); /* Aumenta um pouquinho */
}

/* Cores no Dark Mode */
.btn-check.is-active {
  color: #22d3ee !important; /* Ciano Neon */
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.3); /* Brilho */
}

.btn-check.is-active i {
  font-weight: 800; /* Deixa o ícone de check mais gordinho */
}

/* Cores no Light Mode */
body.light-theme .btn-check.is-active {
  color: #2563eb !important; /* Azul Royal */
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
}

/* ============================================================
   Reduced motion
   ============================================================ */


@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ===== Resumo por empresas (cards) ===== */
.company-grid {
  display: grid;
  grid-template-columns: 1fr; /* <- 1 coluna por padrão (sidebar) */
  gap: 8px;
  margin-top: 10px;
}

/* Só vira 2 colunas quando tiver espaço mesmo */
@media (min-width: 520px) {
  .company-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.company-card {
  position: relative;
  width: 100%;
  text-align: left;
  cursor: pointer;

  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.62);

  padding: 10px 12px;
  overflow: hidden;

  transition: background var(--transition-fast),
    border-color var(--transition-fast),
    transform 0.05s ease-out;
}

.company-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.company-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(15, 23, 42, 0.70);
  transform: translateY(-1px);
}

.company-card:active {
  transform: translateY(0);
}

.company-card:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

.company-card.is-active {
  border-color: rgba(37, 99, 235, 0.80);
  background: rgba(37, 99, 235, 0.12);
}

.company-card.is-active::before {
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.24), transparent 60%);
}

/* Top: reserva espaço REAL pro badge (evita sobreposição) */
.company-card__top {
  position: relative;
  z-index: 1;
  padding-right: 86px; /* >= largura máxima do badge */
  min-height: 26px;    /* garante alinhamento vertical consistente */
  display: flex;
  align-items: center;
}

.company-card__name {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;

  white-space: normal;     /* <- permite quebrar linha */
  overflow: visible;
  text-overflow: unset;
}

.company-card__count {
  position: absolute;
  z-index: 2;

  right: 0;
  top: 50%;
  transform: translateY(-50%);

  min-width: 44px;
  padding: 2px 10px;
  border-radius: 999px;

  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;

  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #e5e7eb;
}

/* Se você remover o hint no HTML, pode deletar esse bloco */
.company-card__hint {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--text-soft);
  line-height: 1.2;
}

.company-card.is-active .company-card__name {
  color: rgba(191, 219, 254, 0.95);
}

.company-card.is-active .company-card__hint {
  color: rgba(203, 213, 225, 0.95);
}

/* Light theme */
body.light-theme .company-card {
  background: #ffffff;
  border-color: var(--border-color);
}
body.light-theme .company-card::before {
  opacity: 0.7;
}
body.light-theme .company-card:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.35);
}
body.light-theme .company-card__count {
  color: #111827;
}
body.light-theme .company-card__name {
  color: #6b7280;
}
body.light-theme .company-card__hint {
  color: #6b7280;
}

/* Botão Dashboard (topbar) */
.dash-btn{
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;

  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: inherit;
  cursor: pointer;

  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.dash-btn i{
  font-size: 18px;
  line-height: 1;
  opacity: .95;
}

.dash-btn span{
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .2px;
  opacity: .95;
}

.dash-btn:hover{
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.60);
  border-color: rgba(148, 163, 184, 0.30);
}

.dash-btn:active{
  transform: translateY(0px);
}

/* opcional: no mobile, fica só o ícone */
@media (max-width: 520px){
  .dash-btn span{ display:none; }
  .dash-btn{ padding: 0 12px; }
}

/* ===== Login (upgrade visual) ===== */
.login-screen{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(900px 500px at 60% 40%, rgba(47, 107, 255, .22), transparent 60%),
              radial-gradient(700px 420px at 30% 65%, rgba(124, 58, 237, .18), transparent 60%),
              linear-gradient(180deg, rgba(2, 6, 23, .94), rgba(2, 6, 23, 1));
}

.login-screen::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.login-card{
  position: relative;
  width: min(420px, 92vw);
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .62);
  box-shadow: 0 16px 50px rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
}

.login-logo{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  background: rgba(47, 107, 255, .14);
  border: 1px solid rgba(47, 107, 255, .25);
  color: var(--accent, #2f6bff);
  box-shadow: 0 0 0 6px rgba(47,107,255,.06);
}
.login-logo i{ font-size: 18px; }

.login-title{
  margin: 6px 0 0;
  text-align: center;
  font-weight: 800;
  letter-spacing: .2px;
}
.login-subtitle{
  margin: 6px 0 14px;
  text-align: center;
  color: rgba(226, 232, 240, .70);
  font-size: .92rem;
}

.login-form{ display: grid; gap: 10px; }

.login-field{ display: grid; gap: 6px; }
.login-label{
  font-size: .78rem;
  color: rgba(226, 232, 240, .78);
}

.input-wrap{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(2, 6, 23, .35);
  transition: border-color .15s ease, box-shadow .15s ease, transform .06s ease;
}

.input-wrap:focus-within{
  border-color: rgba(47, 107, 255, .55);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, .12);
}

.input-icon{
  width: 18px;
  text-align: center;
  color: rgba(226, 232, 240, .65);
}

.input-wrap input{
  flex: 1;
  background: transparent;
  border: 0 !important;
  outline: none !important;
  color: rgba(226,232,240,.95);
  font-size: .95rem;
  min-width: 0;
}

.input-action{
  border: 0;
  background: transparent;
  color: rgba(226,232,240,.65);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 10px;
}
.input-action:hover{
  background: rgba(148, 163, 184, .10);
  color: rgba(226,232,240,.92);
}

.login-options{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 0;
  color: rgba(226,232,240,.70);
  font-size: .82rem;
}

.check{
  display:flex;
  align-items:center;
  gap: 8px;
  user-select:none;
}
.check input{
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #2f6bff);
}

.login-help{ opacity: .8; }

.form-error{
  min-height: 18px;
  margin: 0;
  color: rgba(248, 113, 113, .95);
  font-size: .84rem;
}

.btn--full{ width: 100%; }

.btn--primary{
  transition: transform .06s ease, filter .12s ease;
}
.btn--primary:hover{ filter: brightness(1.08); }
.btn--primary:active{ transform: translateY(1px); }

.btn--loading{
  position: relative;
  cursor: not-allowed;
}
.btn--loading::after{
  content:"";
  display:inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.95);
  animation: btnspin .9s linear infinite;
  vertical-align: -2px;
}
@keyframes btnspin{ to{ transform: rotate(360deg); } }

.login-footer{
  margin-top: 10px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  color: rgba(226,232,240,.55);
  font-size: .78rem;
}
.login-version{
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.28);
}

/* ===== Brand (igual dashboard) ===== */
.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .2px;
  color: rgba(226,232,240,.95);
}

.brand i{
  color: #8b5cf6;          /* roxinho */
  font-size: 18px;
}

.brand--topbar{
  font-size: 1.1rem;
}

.brand--login{
  justify-content: center;
  width: 100%;
  margin: 2px 0 10px;
  font-size: 1.45rem;
}

.brand__logo{
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 6px;
}

.brand--login .brand__logo{
  width: 26px;
  height: 26px;
}
/* ===========================
   PASSO 5 — POLIMENTO VISUAL
   (Index + Inventário)
   =========================== */

/* 1) Tokens de marca */
:root{
  --brand-purple: #8b5cf6;   /* roxo do “Estoque Pro” */
  --ponce-blue:   #2563eb;   /* Poncetech */
  --unitech-green:#22c55e;   /* Unitech */
  --focus-ring: 0 0 0 3px rgba(139,92,246,.22);
}

/* 2) Brand (logo + texto) consistente */
.brand,
.topbar__logo{
  gap: 10px;
}

.brand__logo,
.topbar__logo img,
.login-logo{
  width: 26px;
  height: 26px;
  border-radius: 10px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(139, 92, 246, .22));
}

.brand--login .brand__logo,
.brand--login img{
  width: 44px;
  height: 44px;
  border-radius: 16px;
}

.brand span{
  font-weight: 900;
  letter-spacing: .2px;
}

/* se no seu topo tiver <h1> no logo */
.topbar__logo h1{
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: .2px;
}
@media(max-width: 720px){
  .topbar__logo h1{ font-size: 1.1rem; }
}

/* 3) Clique na logo para “hard reload” (se você usar data-reload="1") */
.brand[data-reload="1"],
.topbar__logo[data-reload="1"],
.brand--login[data-reload="1"]{
  cursor: pointer;
  user-select: none;
}
.brand[data-reload="1"]:active,
.topbar__logo[data-reload="1"]:active{
  transform: translateY(1px);
}

/* 4) Foco padrão mais “enterprise” */
:where(button, [role="button"], a, input, select, textarea):focus-visible{
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: rgba(139,92,246,.55);
}

/* 5) Botões primários mais vivos (sem “chegar” demais) */
.btn--primary,
.topbar__actions .btn.btn--primary{
  background: linear-gradient(135deg, rgba(37,99,235,1), rgba(139,92,246,1));
  box-shadow: 0 16px 36px rgba(37,99,235,.22), inset 0 1px 0 rgba(255,255,255,.10);
}
.btn--primary:hover,
.topbar__actions .btn.btn--primary:hover{
  transform: translateY(-1px);
}

/* 6) Resumo por empresas: UNITECH = verde / PONCETECH = azul */
.company-card[data-company="UNITECH"]::before{
  background: radial-gradient(circle at top left, rgba(34,197,94,0.16), transparent 55%);
}
.company-card[data-company="UNITECH"]:hover{
  border-color: rgba(34,197,94,0.45);
}
.company-card[data-company="UNITECH"].is-active{
  border-color: rgba(34,197,94,0.85);
  background: rgba(34,197,94,0.12);
}
.company-card[data-company="UNITECH"] .company-card__count{
  background: rgba(34,197,94,0.16);
  border-color: rgba(34,197,94,0.35);
}

/* (PONCE/PONCETECH fica no azul que já está no seu CSS, mas deixo compatível) */
.company-card[data-company="PONCE"] .company-card__count,
.company-card[data-company="PONCETECH"] .company-card__count{
  background: rgba(37,99,235,0.14);
  border-color: rgba(37,99,235,0.32);
}

/* 7) Tabela: fixa 1ª coluna (Patrimônio) e última (Ações) no desktop */
@media (min-width: 721px){
  /* garante scroll horizontal quando precisar */
  .table-wrapper{ overflow: auto; }

  /* header fixo: fixa também as bordas */
  .table-wrapper thead th:first-child{
    position: sticky;
    left: 0;
    z-index: 8;
  }
  .table-wrapper thead th:last-child{
    position: sticky;
    right: 0;
    z-index: 8;
  }

  /* zebra correta nas colunas fixas */
  .table-wrapper tbody tr:nth-child(odd) td:first-child,
  .table-wrapper tbody tr:nth-child(odd) td:last-child{
    background: rgba(15, 23, 42, 0.90);
  }
  .table-wrapper tbody tr:nth-child(even) td:first-child,
  .table-wrapper tbody tr:nth-child(even) td:last-child{
    background: rgba(15, 23, 42, 0.85);
  }

  .table-wrapper tbody td:first-child{
    position: sticky;
    left: 0;
    z-index: 3;
    font-weight: 900;
    color: #fff;
    box-shadow: 14px 0 26px rgba(0,0,0,.22);
  }
  .table-wrapper tbody td:last-child{
    position: sticky;
    right: 0;
    z-index: 3;
    box-shadow: -14px 0 26px rgba(0,0,0,.28);
  }

  /* hover coerente nas colunas fixas */
  .table-wrapper tbody tr:hover td:first-child,
  .table-wrapper tbody tr:hover td:last-child{
    background: radial-gradient(circle at left, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.98));
  }
}

/* 8) Modal/Form: foco e “peso” visual melhor */
.modal__content{
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color: rgba(139,92,246,.55);
  box-shadow: var(--focus-ring);
}

/* ===== Step 1 (UX): Loading + Empty state actions + Danger button ===== */

.table-wrapper{ position: relative; }

.table-loading{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  background: rgba(2,6,23,.35);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  z-index: 5;
  color: #e2e8f0;
  font-weight: 800;
  letter-spacing: .2px;
}
.table-loading.is-hidden{ display:none; }
.table-loading__spinner{
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(148,163,184,.35);
  border-top-color: rgba(99,102,241,.95);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.table-loading.is-hidden{ display:none; }

.table-loading__box{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.75);
  color:#e2e8f0;
  font-weight:900;
  letter-spacing:.2px;
}

.empty-state__actions{
  margin-top: 10px;
  display:flex;
  justify-content:center;
}

.btn--danger{
  background: rgba(244,63,94,.95);
  border: 1px solid rgba(244,63,94,.55);
  color:#fff;
  box-shadow: 0 18px 38px rgba(244,63,94,.18);
}
.btn--danger:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.btn--danger:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
  filter:none;
}

/* ===== util ===== */
.u-hidden { display: none !important; }

/* ===== index.html: remove inline styles ===== */
.icon-plus { font-size: 1.05em; }

.btn--danger{
  background-color: var(--danger);
  color: #fff;
  border: none;
}
.btn--danger:hover{
  filter: brightness(1.05);
}

.th-actions{
  text-align: center;
  width: 180px;
}

.warranty-status{
  font-size: 0.85rem;
  font-weight: 700;
}

.form-actions{
  margin-top: 10px;
  display: flex;
  gap: 10px;
}
