﻿/* ============================================================
   Atlas OS — Design System v2.0
   ============================================================ */

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

*, *::before, *::after { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100vw;
}

.container, .container-fluid, .container.py-4 {
  max-width: 100%;
}

.table-responsive, .table-cards {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */
:root {
  --bg-base: #0D0E11;
  --bg-surface: #16181D;
  --bg-card: #1a1a1a;
  --bg-card-hover: #242424;
  --bg-raised: #2a2a2a;
  --border: #2a2a2a;
  --border-light: #333;
  --text: #f0f0f0;
  --text-secondary: #999;
  --text-muted: #666;
  --accent: #d4a843;
  --accent-dim: rgba(212, 168, 67, 0.08);
  --accent-dim-strong: rgba(212, 168, 67, 0.15);
  --studio-primary: #38BDF8;
  --studio-secondary: #1E293B;
  --success: #22c55e;
  --success-dim: rgba(34, 197, 94, 0.10);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.10);
  --info: #3b82f6;
  --info-dim: rgba(59, 130, 246, 0.10);
  --warning: #d4a843;
  --warning-dim: rgba(212, 168, 67, 0.12);
  --navbar-bg: #0d0d0d;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --transition: 0.15s ease;
}

[data-theme="light"] {
  --bg-base: #f5f5f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f0;
  --bg-raised: #e8e8e8;
  --border: #d4d4d4;
  --border-light: #e0e0e0;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --accent: #8a7a5a;
  --accent-dim: rgba(138, 122, 90, 0.08);
  --accent-dim-strong: rgba(138, 122, 90, 0.15);
  --success: #22c55e;
  --success-dim: rgba(34, 197, 94, 0.08);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.08);
  --info: #3b82f6;
  --info-dim: rgba(59, 130, 246, 0.08);
  --navbar-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* ============================================================
   BASE
   ============================================================ */
body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
}

h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
h4 { font-size: 0.9rem; font-weight: 600; }
h5 { font-size: 0.85rem; font-weight: 600; }

.gold-text { color: var(--accent); font-weight: 700; letter-spacing: 0.02em; }
.text-secondary, .text-muted { color: var(--text-secondary); }

.login-logo {
  max-width: 260px;
  width: 100%;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
}
.serif-subtitle { color: var(--text-muted); font-size: 0.75rem; font-weight: 500; }

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container.py-4 {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  max-width: 1400px;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  background-color: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
  min-height: 52px;
  font-family: var(--font-sans);
}

.navbar .navbar-brand {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}

.brand-text-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  line-height: 1.3;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.75rem 0.85rem;
  transition: color var(--transition);
  letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: transparent;
}

.nav-link i { margin-right: 0.35rem; font-size: 0.9rem; }

.navbar .dropdown-menu {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem;
  margin-top: 0.35rem;
  box-shadow: var(--shadow-md);
}

.navbar .dropdown-item {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.navbar .dropdown-item i { font-size: 0.85rem; width: 1rem; text-align: center; }

.navbar .dropdown-item:hover,
.navbar .dropdown-item.active {
  background-color: var(--bg-card-hover);
  color: var(--accent);
}

.navbar .dropdown-toggle::after { vertical-align: middle; margin-left: 0.3rem; font-size: 0.65rem; }

.navbar-toggler { border: none; }
.navbar-toggler:focus { box-shadow: none; }

.theme-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.theme-btn:hover { color: var(--accent); }

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 200px;
  height: 100%;
  min-height: 38px;
  padding: 0 0.75rem 0 2.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  line-height: normal;
  font-family: var(--font-sans);
  outline: none;
  transition: width 0.2s ease, border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--text-secondary); opacity: 1; }
.search-input:focus {
  width: 280px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

.search-input.search-loading {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9' opacity='0.25'/%3E%3Cpath d='M21 12a9 9 0 0 0-9-9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 14px 14px;
}

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem 0.25rem;
}

.search-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.search-item:hover { background: var(--bg-card-hover); }
.search-item-label { font-weight: 600; font-size: 0.875rem; color: var(--text); }
.search-item-sub { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.1rem; }
.search-empty { text-align: center; padding: 1rem; color: var(--text-secondary); font-size: 0.85rem; }

@media (max-width: 991.98px) {
  .search-wrap { width: 100%; margin: 0.5rem 0; }
  .search-input, .search-input:focus { width: 100%; }
  .search-dropdown { width: 100%; left: 0; }
}

/* ============================================================
   CARDS
   ============================================================ */
.card,
.card-studio {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  transition: background-color var(--transition), border-color var(--transition);
}

.card:hover,
.card-studio:hover {
  background-color: var(--bg-card-hover);
}

.card-body { padding: 1.5rem; border-radius: var(--radius); }
.card-body.p-0 { padding: 0; }
.card-body.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.card-title {
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* KPI Cards */
.kpi-card .card-body { padding: 1rem 1.25rem; }
.kpi-card .card-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.kpi-card .card-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.kpi-card .dashboard-icon { font-size: 1.4rem; opacity: 0.3; }

.kpi-card-hover {
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.kpi-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.kpi-gold { border-left: 3px solid var(--accent); }
.kpi-blue { border-left: 3px solid var(--info); }
.kpi-green { border-left: 3px solid var(--success); }
.kpi-red { border-left: 3px solid var(--danger); }

/* Alert card */
.alert-card { border-left: 3px solid var(--danger); }

/* Appointment cards */
.appointment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  transition: border-color 0.2s ease, transform var(--transition);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.appointment-card:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.appointment-card .appt-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  background: var(--accent-dim);
  color: var(--accent);
}

.appointment-card .appt-body { flex: 1; min-width: 0; }
.appointment-card .appt-body .appt-client {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.3;
}

.appointment-card .appt-body .appt-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.appointment-card .appt-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
  flex-shrink: 0;
  min-width: 44px;
}

/* Insta card */
.insta-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.insta-card h6 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.insta-card h6 i { margin-right: 0.4rem; }

/* Card header */
.card-header-studio {
  padding: 0.75rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

/* ============================================================
   SECTION HEADERS / TITLES
   ============================================================ */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-title i { font-size: 0.7rem; opacity: 0.7; }

.section-title .badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-dim-strong);
  color: var(--accent);
  border: none;
  min-width: 1.25rem;
  text-align: center;
  line-height: 1.3;
}

.section-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
  margin-bottom: 1.25rem;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  font-weight: 500;
  font-size: 0.7rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.badge-today {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-dim-strong);
  color: var(--accent);
  margin-top: 0.2rem;
  line-height: 1.3;
}

.badge.bg-success { background: var(--success-dim); color: var(--success); }
.badge.bg-danger { background: var(--danger-dim); color: var(--danger); }
.badge.bg-info { background: var(--info-dim); color: var(--info); }
.badge.bg-warning { background: var(--warning-dim); color: var(--warning); }
.badge.bg-secondary { background: var(--bg-card-hover); color: var(--text-secondary); }

.badge-pix, .badge-dinheiro, .badge-cartao, .badge-voucher {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-dim-strong);
  color: var(--accent);
}

.badge-voucher {
  background: rgba(212,168,67,0.2);
  color: #d4a843;
  border: 1px solid rgba(212,168,67,0.4);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.inb-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

/* Badge operacional */
.badge-atendimento {
  background: var(--accent-dim-strong);
  color: var(--accent);
  font-weight: 500;
  font-size: 0.7rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all var(--transition);
  line-height: 1.4;
  box-shadow: none;
}

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

.btn-primary {
  background: var(--studio-primary);
  border: 1px solid var(--studio-primary);
  color: var(--bg-base);
}

.btn-primary:hover {
  opacity: 0.85;
  border-color: var(--studio-primary);
  color: var(--bg-base);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-dim-strong);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline-light {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline-light:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
  color: var(--text);
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-outline-warning {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline-warning:hover {
  background: var(--accent-dim-strong);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline-success {
  background: transparent;
  border: 1px solid var(--success);
  color: var(--success);
}

.btn-outline-success:hover {
  background: var(--success-dim);
  border-color: var(--success);
  color: var(--success);
}

.btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
  color: var(--text);
}

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.75rem; border-radius: var(--radius-xs); }
.btn-lg { padding: 0.6rem 1.2rem; font-size: 0.9rem; }

.btn-outline-gold {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn-outline-gold:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ============================================================
   WHITE-LABEL (Atlas OS) — tokens injetados por tenant via base.html
   ============================================================ */

/* Botões de ação principal */
.btn-primary { background-color: var(--studio-primary); }

/* Item ativo na sidebar */
.sidebar-item.active { border-left: 3px solid var(--studio-primary); color: var(--studio-primary); }

/* Badges de status */
.badge-accent { background-color: var(--studio-primary); }

/* Sombra neon nos cards */
.card-metric { box-shadow: 0 0 12px color-mix(in srgb, var(--studio-primary) 30%, transparent); }

/* ============================================================
   LIST ITEMS
   ============================================================ */
.list-item-row {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  gap: 0.75rem;
}

.list-item-row + .list-item-row { border-top: 1px solid var(--border); }
.list-item-row:last-child { border-bottom: none; }
.next-atendimento { background: rgba(212, 175, 55, 0.06); border-radius: 6px; margin:0 -0.5rem; padding:0.75rem 0.5rem; }
.next-atendimento + .list-item-row { border-top-color: transparent; }

.list-item-row .list-item-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
}

.list-item-row .list-item-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ============================================================
   INBOX
   ============================================================ */
.inbox-wrap { display:flex; gap:0; height:calc(100vh - 140px); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.inbox-sidebar { width:340px; min-width:340px; border-right:1px solid var(--border); display:flex; flex-direction:column; background:var(--bg-card); }
.inbox-sidebar-header { padding:0.85rem 1rem; border-bottom:1px solid var(--border); font-size:0.8rem; font-weight:600; color:var(--accent); }
.inbox-lista { flex:1; overflow-y:auto; }

.inb-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.inb-item:hover { background: var(--bg-card-hover); }
.inb-item:last-child { border-bottom: none; }

.inb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim-strong);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.inb-body { flex: 1; min-width: 0; }
.inb-name { font-weight: 600; color: var(--text); font-size: 0.85rem; }
.inb-preview { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inb-meta { text-align: right; flex-shrink: 0; }
.inb-time { font-size: 0.7rem; color: var(--text-muted); }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 2rem;
  opacity: 0.2;
  display: block;
  margin-bottom: 0.5rem;
}

.empty-state p { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.5rem; }

.empty-block {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.empty-block i { font-size: 1rem; color: var(--success); }

/* ============================================================
   FORMS
   ============================================================ */
input:not([type="checkbox"]):not([type="radio"]):not(.search-input),
select,
textarea,
.form-control,
.form-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  transition: border-color var(--transition);
}

input:not([type="checkbox"]):not([type="radio"]):not(.search-input):focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: none;
  background-color: var(--bg-card);
  color: var(--text);
}

input:not(.search-input)::placeholder, .form-control::placeholder { color: var(--text-muted); }

select option, .form-select option { background-color: var(--bg-card); color: var(--text); }

.form-check-input {
  background-color: var(--bg-card);
  border-color: var(--border);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.input-group-text {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius);
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: transparent;
  color: var(--text);
  border-color: var(--border);
}

.table th {
  border-color: var(--border);
  color: var(--text-secondary);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  background: transparent;
  padding: 0.75rem 0.5rem;
}

.table td {
  border-color: var(--border);
  color: var(--text);
  font-size: 0.85rem;
  vertical-align: middle;
  background: transparent;
  padding: 0.65rem 0.5rem;
}

.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background-color: var(--bg-card-hover); }

.table tfoot td {
  border-top: 1px solid var(--border);
  font-weight: 600;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-content {
  background-color: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid var(--border); padding: 1rem 1.5rem; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
}

/* ============================================================
   TOASTS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
  font-size: 0.85rem;
  line-height: 1.4;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  animation: toastIn 0.3s ease-out forwards;
}

.toast.toast-out { animation: toastOut 0.25s ease-in forwards; }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-body { flex: 1; min-width: 0; }
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.15rem;
  font-size: 0.85rem;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.toast-close:hover { opacity: 1; }
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-danger { border-left: 3px solid var(--danger); }
.toast.toast-danger .toast-icon { color: var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--accent); }
.toast.toast-warning .toast-icon { color: var(--accent); }
.toast.toast-info { border-left: 3px solid var(--info); }
.toast.toast-info .toast-icon { color: var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(1rem); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(1rem); }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-studio {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 1.25rem 0;
  margin-top: 2rem;
}

/* ============================================================
   DROPDOWN / LIST GROUP
   ============================================================ */
.list-group-item {
  background-color: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
  transition: background var(--transition);
}

.list-group-item:hover { background-color: var(--bg-card-hover); }

.dropdown-menu {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dropdown-item { color: var(--text); font-size: 0.85rem; }
.dropdown-item:hover { background-color: var(--bg-card-hover); color: var(--text); }
.dropdown-divider { border-color: var(--border); }

/* ============================================================
   PAGINATION
   ============================================================ */
.page-link {
  background-color: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

.page-link:hover { background-color: var(--bg-card-hover); color: var(--accent); }
.page-item.active .page-link { background-color: var(--accent); border-color: var(--accent); color: #0a0a0a; }

/* ============================================================
   TABS
   ============================================================ */
.nav-tabs { border-bottom-color: var(--border); }
.nav-tabs .nav-link {
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 0;
}

.nav-tabs .nav-link:hover { color: var(--accent); }
.nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  background: transparent;
}

/* ============================================================
   STATUS COLORS
   ============================================================ */
.status-disponivel { color: var(--success); }
.status-poucas { color: var(--accent); }
.status-repor { color: var(--danger); }
.status-atencao { color: var(--accent); }
.status-ok { color: var(--success); }

/* ============================================================
   BACKGROUND UTILITIES
   ============================================================ */
.bg-gold-dim { background-color: var(--accent-dim); }
.bg-danger-dim { background-color: var(--danger-dim); }
.bg-success-dim { background-color: var(--success-dim); }
.bg-info-dim { background-color: var(--info-dim); }
.bg-gray-dim { background-color: var(--bg-card); }

/* ============================================================
   PICKER
   ============================================================ */
.picker-item {
  background-color: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
  transition: background var(--transition);
}

.picker-item:hover { background-color: var(--bg-card-hover); }
.picker-item strong { color: var(--text); }

/* ============================================================
   QUOTE CARD
   ============================================================ */
.quote-card {
  background: linear-gradient(135deg, #f0e8d8 0%, #faf5ea 100%);
}

[data-theme="dark"] .quote-card {
  background: linear-gradient(135deg, #1a1410 0%, #221a14 100%);
}

/* ============================================================
   RESPONSIVIDADE MOBILE
   ============================================================ */
@media (max-width: 576px) {
  .container.py-4 { padding-left: 1rem; padding-right: 1rem; }
  .card-body { padding: 1rem; }
  .table { font-size: 0.75rem; }
  .table th, .table td { padding: 0.4rem 0.35rem; }
  .kpi-card .card-body { padding: 0.85rem; }
  .kpi-card .card-value { font-size: 1.2rem; }
  .search-wrap { max-width: 100%; margin: 0.5rem 0; }

  .inbox-wrap { flex-direction: column; height: auto; }
  .inbox-sidebar { width: 100%; min-width: 100%; max-height: none; display: flex; flex-direction: column; }
  .inbox-detail { min-height: 70vh; flex: 1; }

  .inbox-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
  }
}

@media (min-width: 768px) {
  .inbox-mobile-back {
    display: none;
  }
}

@media (min-width: 577px) {
  .inbox-mobile-back {
    display: none;
  }
}

@media (max-width: 375px) {
  .container.py-4 { padding-left: 0.75rem; padding-right: 0.75rem; }
  .card-body { padding: 0.85rem; }
  .table th, .table td { padding: 0.35rem 0.25rem; font-size: 0.7rem; }
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.1rem; }
  .btn { font-size: 0.75rem; padding: 0.4rem 0.75rem; }
  .kpi-card .card-value { font-size: 1.1rem; }
  .nav-link { font-size: 0.75rem; padding: 0.5rem 0.6rem; }
  .toast { min-width: unset; max-width: calc(100vw - 2rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.min-width-0 { min-width: 0; }

[data-theme="light"] .btn-close { filter: none; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ============================================================
   ACCESSIBILITY — FOCUS, DISABLED, LOADING
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:focus-visible, .nav-link:focus-visible, .dropdown-item:focus-visible,
.form-control:focus-visible, .form-select:focus-visible,
input:not(.search-input):focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:disabled, .btn:disabled, input:disabled, select:disabled, textarea:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ============================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background: var(--navbar-bg);
  border-top: 1px solid var(--border);
  padding: 0.25rem 0 env(safe-area-inset-bottom, 0.25rem);
}

.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.25rem 0.3rem;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  gap: 0.15rem;
  border: none;
  background: none;
  cursor: pointer;
}

.mobile-nav-item i {
  font-size: 1.25rem;
  line-height: 1;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--accent);
}

.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2.5px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

.mobile-nav-item {
  position: relative;
}

.mobile-nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(180%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

/* ============================================================
   MOBILE OFFCANVAS MENU
   ============================================================ */
.offcanvas-studio {
  background-color: var(--bg-base);
  color: var(--text);
}

.offcanvas-studio .offcanvas-header {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
}

.offcanvas-studio .offcanvas-body {
  padding: 0.5rem 0;
}

.offcanvas-studio .nav-link {
  padding: 0.7rem 1.25rem;
  font-size: 0.85rem;
}

.offcanvas-studio .dropdown-divider {
  border-color: var(--border);
  margin: 0.25rem 1rem;
}

.offcanvas-studio .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="light"] .offcanvas-studio .btn-close {
  filter: none;
}

/* ============================================================
   DASHBOARD — ACTION-ORIENTED LAYOUT
   ============================================================ */
.dash-greeting {
  margin-bottom: 1.5rem;
}

.dash-greeting h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.dash-greeting .dash-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.dash-greeting .dash-role {
  color: var(--accent);
  font-weight: 600;
}

/* Primary action highlight */
.dash-hero {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.dash-hero-stat {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.dash-hero-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.dash-hero-detail {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}

.dash-hero-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Compact stat row */
.dash-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dash-stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
}

.dash-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.dash-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Compact alert / reminder */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  transition: border-color var(--transition);
}

.alert-item:hover {
  border-color: var(--accent);
}

.alert-item-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.alert-item-body {
  flex: 1;
  min-width: 0;
}

.alert-item-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
}

.alert-item-context {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.alert-item-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.alert-item .btn {
  white-space: nowrap;
}

/* Alert item: priority colors */
.alert-priority-high { border-left: 3px solid var(--danger); }
.alert-priority-medium { border-left: 3px solid var(--accent); }
.alert-priority-low { border-left: 3px solid var(--info); }

/* ============================================================
   DASHBOARD — HOJE TAB STREAMLINED
   ============================================================ */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.section-card-body {
  padding: 0.75rem 1.25rem;
}

.section-card-header .badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: var(--accent-dim-strong);
  color: var(--accent);
  border-radius: 999px;
}

/* Inline list compact */
.inline-list-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.inline-list-item:last-child {
  border-bottom: none;
}

.inline-list-item .btn {
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE — ENHANCED BREAKPOINTS
   ============================================================ */
@media (max-width: 991.98px) {
  .navbar .navbar-collapse {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding-bottom: 1rem;
  }

  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  body {
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav {
    display: flex;
  }

  .dash-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .dash-hero-actions {
    margin-left: 0;
    width: 100%;
  }

  .dash-hero-actions .btn {
    flex: 1;
  }

  .dash-stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .dash-greeting h1 {
    font-size: 1.1rem;
  }

  .container.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .nav-tabs .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }

  .modal-body {
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
  }
}

@media (max-width: 374.98px) {
  .dash-stat-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .dash-stat-item {
    padding: 0.6rem 0.75rem;
  }

  .dash-stat-value {
    font-size: 1.2rem;
  }

  .dash-hero-stat {
    font-size: 1.75rem;
  }

  .alert-item {
    padding: 0.6rem 0.75rem;
  }

  .mobile-nav-item {
    font-size: 0.55rem;
    padding: 0.3rem 0.15rem 0.25rem;
  }

  .mobile-nav-item i {
    font-size: 1.1rem;
  }

  .list-item-row { flex-wrap: wrap; gap: 0.4rem; }
  .list-item-row .text-center.flex-shrink-0 { min-width: 40px; }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  .dash-stat-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   MOBILE TABLE-TO-CARDS (operational screens)
   ============================================================ */
@media (max-width: 767.98px) {
  .table-cards thead { display: none; }

  .table-cards tbody,
  .table-cards tr,
  .table-cards td {
    display: block;
  }

  .table-cards tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
  }

  .table-cards td {
    border: none;
    padding: 0.2rem 0;
    text-align: left;
  }

  .table-cards td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
  }

  .table-cards .td-actions {
    text-align: right;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .table-cards .td-actions::before { display: none; }
}

/* ═════════════════════════════════════════════════════════
   MOBILE INLINE LIST — compact two-line rows
   ═════════════════════════════════════════════════════════ */
.inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.inline-row:last-child { border-bottom: none; }

.inline-row-main {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.85rem;
}

.inline-row-sub {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.inline-row-meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
}

/* ═════════════════════════════════════════════════════════
   OPERATIONAL FORM IMPROVEMENTS
   ═════════════════════════════════════════════════════════ */
.form-section {
  margin-bottom: 1.25rem;
}

.form-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-action-primary {
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .btn-action-primary {
    width: 100%;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-body form .row > div {
    margin-bottom: 0.75rem;
  }
}

/* ═════════════════════════════════════════════════════════
   OPERATIONAL STAT CARD
   ═════════════════════════════════════════════════════════ */
.op-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.op-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.op-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
