/* ==========================================================
   style.css — SaaS Gestão
   Visual: Corporativo/Sóbrio — v2.0
   Copie este arquivo para: public/assets/css/style.css
   ========================================================== */

/* ----------------------------------------------------------
   1. VARIÁVEIS & RESET
   ---------------------------------------------------------- */
:root {
  --color-primary:        #0b3d91;
  --color-primary-dark:   #082d6b;
  --color-primary-light:  #e8eef8;
  --color-accent:         #1a6fc4;

  --color-success:        #1e7e45;
  --color-success-dark:   #166035;
  --color-success-bg:     #d4edda;
  --color-danger:         #b02030;
  --color-danger-dark:    #8b1826;
  --color-danger-bg:      #f8d7da;
  --color-warning:        #856404;
  --color-warning-btn:    #e0a800;
  --color-warning-btn-dark: #c49200;
  --color-warning-bg:     #fff3cd;
  --color-info:           #0c5460;
  --color-info-bg:        #d1ecf1;

  --color-bg:             #f0f2f5;
  --color-surface:        #ffffff;
  --color-surface-alt:    #f8f9fa;
  --color-border:         #dee2e6;
  --color-border-light:   #e9ecef;

  --color-text:           #1a1e2e;
  --color-text-muted:     #6c757d;
  --color-text-light:     #adb5bd;

  --sidebar-width:        260px;
  --topbar-height:        60px;

  --radius-sm:            4px;
  --radius-md:            8px;
  --radius-lg:            12px;

  --shadow-sm:            0 1px 3px rgba(0,0,0,.08);
  --shadow-md:            0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:            0 8px 24px rgba(0,0,0,.12);

  --font-family:          'Poppins', 'Segoe UI', sans-serif;
  --font-size-base:       0.9375rem;   /* 15px */
  --font-size-sm:         0.8125rem;   /* 13px */
  --font-size-xs:         0.75rem;     /* 12px */

  --transition:           0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }

img, svg { display: block; max-width: 100%; }

/* ----------------------------------------------------------
   2. LAYOUT PRINCIPAL
   ---------------------------------------------------------- */
.main-container {
  display: flex;
  min-height: 100vh;
}

/* Área de conteúdo principal */
.content {
  flex: 1;
  min-width: 0;
  padding: 2rem;
  max-height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

.container {
  max-width: 100%;
  margin: 0 auto;
  background: var(--color-surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ----------------------------------------------------------
   3. TOPBAR
   ---------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Botões da topbar — tom-sobre-tom (herda --color-primary do tenant) */
.topbar .btn-secondary {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}
.topbar .btn-secondary:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.topbar .btn-secondary:hover i,
.topbar .btn-secondary:hover svg { opacity: 1; }

/* ----------------------------------------------------------
   4. SIDEBAR
   ---------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #c5d8f8;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  transition: width 0.28s ease;
  overflow: hidden;
}

/* --- Sidebar Collapsed (desktop icon-rail) --- */
.sidebar.collapsed { width: 64px; }

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 1.25rem 0;
}
.sidebar.collapsed .sidebar-logo > span { display: none; }

.sidebar.collapsed .sidebar-section-label { display: none; }

.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding: 0.75rem 0;
  font-size: 0;
  border-left: 3px solid transparent;
}
.sidebar.collapsed .sidebar-nav a:hover  { border-left-color: #4d8ce8; }
.sidebar.collapsed .sidebar-nav a.active { border-left-color: #4d8ce8; }
.sidebar.collapsed .sidebar-nav svg      { width: 20px; height: 20px; opacity: 1; }

.sidebar.collapsed .sidebar-dropdown-toggle {
  justify-content: center;
  padding: 0.75rem 0;
  font-size: 0;
  border-left: 3px solid transparent;
}
.sidebar.collapsed .sidebar-dropdown-toggle:hover { border-left-color: #4d8ce8; }
.sidebar.collapsed .sidebar-dropdown-toggle .chevron { display: none; }
.sidebar.collapsed .sidebar-dropdown-toggle span   { display: none; }
.sidebar.collapsed .sidebar-dropdown-menu          { display: none !important; }
.sidebar.collapsed .sidebar-footer                 { display: none; }

/* --- Sidebar Overlay (mobile backdrop) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 799;
  backdrop-filter: blur(1px);
}

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0,20,70,.35);
  background: rgba(0,20,70,.25);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #e8f1fc;
}

.sidebar-logo svg, .sidebar-logo img { width: 28px; height: 28px; }

.sidebar-section-label {
  padding: .75rem 1.25rem .25rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b9fd4;
}

.sidebar-nav { flex: 1; padding: .5rem 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: #a8c8ef;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.sidebar-nav a:hover {
  background: rgba(0,20,70,.3);
  color: #d6eaff;
  border-left-color: #4d8ce8;
}

.sidebar-nav a.active {
  background: rgba(0,20,70,.45);
  color: #e8f1fc;
  border-left-color: #4d8ce8;
  font-weight: 600;
}

.sidebar-nav svg { width: 18px; height: 18px; opacity: .8; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(0,20,70,.35);
  background: rgba(0,20,70,.2);
  font-size: var(--font-size-xs);
  color: #6b9fd4;
}

/* ----------------------------------------------------------
   5. CARDS
   ---------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  background: var(--color-surface-alt);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
  font-size: .925rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body { padding: 1.5rem; }

.card-footer {
  background: var(--color-surface-alt);
  padding: .875rem 1.5rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Cards de estatística (dashboard) */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon svg { width: 22px; height: 22px; color: var(--color-primary); }

.stat-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-card-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: .1rem;
}

/* ----------------------------------------------------------
   6. TABELAS
   ---------------------------------------------------------- */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

thead th {
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .875rem 1rem;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

tbody td {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background-color: var(--color-primary-light); }

.table-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.table-actions form { margin: 0; }

/* ----------------------------------------------------------
   7. BOTÕES
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: .5rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
              box-shadow var(--transition), transform var(--transition);
  user-select: none;
}

.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
  box-shadow: 0 2px 8px rgba(11,61,145,.25);
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-outline-primary:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.btn-success {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}
.btn-success:hover {
  background: var(--color-success-dark);
  border-color: var(--color-success-dark);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,126,69,.25);
}

.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--color-danger-dark);
  border-color: var(--color-danger-dark);
  color: #fff;
  box-shadow: 0 2px 8px rgba(176,32,48,.25);
}

.btn-warning {
  background: var(--color-warning-btn);
  border-color: var(--color-warning-btn);
  color: #1a1e2e;
}
.btn-warning:hover {
  background: var(--color-warning-btn-dark);
  border-color: var(--color-warning-btn-dark);
  color: #1a1e2e;
  box-shadow: 0 2px 8px rgba(224,168,0,.25);
}

.btn-secondary {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
.btn-secondary:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.btn-sm {
  padding: .3rem .75rem;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: .75rem 2rem;
  font-size: 1rem;
}

/* Botão sem classe (fallback) */
button {
  padding: .5rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  transition: background var(--transition);
}
button:hover { background: var(--color-primary-dark); }

/* ----------------------------------------------------------
   8. FORMULÁRIOS
   ---------------------------------------------------------- */
.form-group { margin-bottom: 1.125rem; }

label {
  display: block;
  margin-bottom: .375rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

label .required { color: var(--color-danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: .5625rem .875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11,61,145,.12);
}

input::placeholder, textarea::placeholder { color: var(--color-text-light); }

textarea { min-height: 100px; resize: vertical; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .875rem center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-hint {
  margin-top: .25rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

/* ----------------------------------------------------------
   9. ALERTAS / FEEDBACK
   ---------------------------------------------------------- */
.feedback, .alert {
  padding: .875rem 1.125rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  border: 1px solid transparent;
}

/* Toasts (Notificações Flutuantes) */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.feedback.toast {
  pointer-events: auto;
  margin-bottom: 0;
  min-width: 300px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease forwards;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.feedback.success, .alert-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-color: #b8dfc6;
}

.feedback.error, .alert-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: #f1aeb5;
}

.feedback.warning, .alert-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border-color: #ffe69c;
}

.feedback.info, .alert-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border-color: #9eeaf9;
}

/* ----------------------------------------------------------
   10. BADGES & STATUS
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-primary   { background: var(--color-primary-light); color: var(--color-primary); }
.badge-success   { background: var(--color-success-bg);    color: var(--color-success); }
.badge-danger    { background: var(--color-danger-bg);     color: var(--color-danger); }
.badge-warning   { background: var(--color-warning-bg);    color: var(--color-warning); }
.badge-secondary { background: var(--color-border-light);  color: var(--color-text-muted); }

/* ----------------------------------------------------------
   11. PÁGINA DE LOGIN
   ---------------------------------------------------------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  padding: 1rem;
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}

.login-card .logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-card .logo img { margin: 0 auto; height: 52px; }

.login-card h2 {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .25rem;
}

.login-card p.subtitle {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
}

/* ----------------------------------------------------------
   12. TÍTULOS DE PÁGINA
   ---------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-light);
}

.page-header h1 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
}

.page-header p {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: .2rem;
}

.page-header-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ----------------------------------------------------------
   13. MODAIS
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-box {
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .2s ease;
}

.modal-box .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

.modal {
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface-alt);
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--color-text-muted);
  font-size: 1.25rem;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover { background: none; color: var(--color-danger); }

.modal-body  { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface-alt);
  border-radius: 0 0 10px 10px;
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   14. PAGINAÇÃO
   ---------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  gap: .375rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 .5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.pagination a:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pagination .active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

/* ----------------------------------------------------------
   15. UTILITÁRIOS
   ---------------------------------------------------------- */
.text-muted   { color: var(--color-text-muted) !important; }
.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger  { color: var(--color-danger) !important; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-sm      { font-size: var(--font-size-sm); }
.text-xs      { font-size: var(--font-size-xs); }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }

.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1         { gap: .5rem; }
.gap-2         { gap: 1rem; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.w-100 { width: 100%; }

.divider {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: 1.5rem 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: .4; }
.empty-state p { font-size: var(--font-size-sm); }

/* ----------------------------------------------------------
   16. RESPONSIVIDADE
   ---------------------------------------------------------- */
@media (max-width: 992px) {
  .sidebar:not(.collapsed) { width: 220px; }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    z-index: 1002 !important;
    width: var(--sidebar-width) !important;
    transition: left 0.28s ease;
  }
  .sidebar.open {
    left: 0 !important;
    width: var(--sidebar-width) !important;
  }
  .sidebar.open .sidebar-logo > span,
  .sidebar.open .sidebar-section-label,
  .sidebar.open .sidebar-nav a span,
  .sidebar.open .sidebar-dropdown-toggle span,
  .sidebar.open .sidebar-footer {
    display: block !important;
  }
  .sidebar.open .sidebar-dropdown-toggle .chevron {
    display: block !important;
  }
  .sidebar-overlay.show { display: block; z-index: 1001 !important; }

  .content { padding: 1.25rem; max-height: unset; }

  .container { padding: 1.25rem; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .875rem;
  }

  .form-row { grid-template-columns: 1fr; }

  table { font-size: var(--font-size-xs); }
  thead th, tbody td { padding: .625rem .75rem; }

  /* Convert tables to cards on mobile */
  .table-responsive.table-cards,
  .table-wrapper.table-cards {
    border: 0;
    margin-top: 10px;
    box-shadow: none;
    background: transparent;
  }
  
  .table-responsive.table-cards table,
  .table-wrapper.table-cards table,
  .table-responsive.table-cards thead,
  .table-wrapper.table-cards thead,
  .table-responsive.table-cards tbody,
  .table-wrapper.table-cards tbody,
  .table-responsive.table-cards th,
  .table-wrapper.table-cards th,
  .table-responsive.table-cards td,
  .table-wrapper.table-cards td,
  .table-responsive.table-cards tr,
  .table-wrapper.table-cards tr {
    display: block;
  }
  
  /* Hide desktop table header */
  .table-responsive.table-cards thead tr,
  .table-wrapper.table-cards thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .table-responsive.table-cards tr,
  .table-wrapper.table-cards tr {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    margin-bottom: 16px;
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
  }
  
  .table-responsive.table-cards tr:hover td,
  .table-wrapper.table-cards tr:hover td {
    background-color: transparent;
  }
  
  .table-responsive.table-cards td,
  .table-wrapper.table-cards td {
    border: none;
    border-bottom: 1px dashed var(--color-border-light);
    position: relative;
    padding: 8px 0 8px 40%;
    text-align: left !important;
    font-size: 13px;
    white-space: normal !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    min-height: 36px;
  }
  
  .table-responsive.table-cards td:last-child,
  .table-wrapper.table-cards td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  /* Add column headers dynamically via CSS attribute matching */
  .table-responsive.table-cards td[data-label]::before,
  .table-wrapper.table-cards td[data-label]::before {
    position: absolute;
    top: 8px;
    left: 0;
    width: 35%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: 700;
    color: var(--color-text-muted);
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  /* Hide label on elements that shouldn't have one */
  .table-responsive.table-cards td:not([data-label])::before,
  .table-wrapper.table-cards td:not([data-label])::before,
  .table-responsive.table-cards td[data-label=""]::before,
  .table-wrapper.table-cards td[data-label=""]::before {
    display: none !important;
  }
  
  .table-responsive.table-cards td:not([data-label]),
  .table-wrapper.table-cards td:not([data-label]),
  .table-responsive.table-cards td[data-label=""],
  .table-wrapper.table-cards td[data-label=""] {
    padding-left: 0 !important;
  }
  
  /* Table Action column adjustments on mobile */
  .td-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
    width: 100% !important;
    padding-top: 12px !important;
    margin-top: 4px;
    border-top: 1px solid var(--color-border-light);
  }
  
  .td-actions a,
  .td-actions button,
  .td-actions div {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    min-width: calc(50% - 4px);
  }
}

@media (max-width: 480px) {
  .btn { font-size: var(--font-size-xs); padding: .45rem 1rem; }
  .modal, .modal-box { max-width: 100%; border-radius: 10px; }
}

/* O estilo do Chat de Suporte foi movido para chat/assets/chat.css */

/* ── Filtros Retráteis Globais ── */
.collapsible-filters-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0 0 0;
  font-weight: 600;
}
.collapsible-filters-trigger:hover {
  text-decoration: underline;
}
.collapsible-filters-content {
  display: none;
  width: 100%;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 0.5rem;
}
.collapsible-filters-content.open {
  display: flex !important;
}

/* ── Responsividade Geral da Topbar ── */
@media (max-width: 768px) {
  .hidden-mobile {
    display: none !important;
  }
  .visible-mobile {
    display: inline-block !important;
  }
  .topbar-app-name {
    display: none !important;
  }
  /* Oculta todos os botões/links de ação na topbar exceto a foto/perfil do usuário */
  .topbar-actions > :not(.topbar-profile-container) {
    display: none !important;
  }
}
@media (min-width: 769px) {
  .visible-mobile {
    display: none !important;
  }
}


/* Navegação fixa para celulares */
.mobile-bottom-nav { display: none; }
@media (max-width: 768px) {
    .mobile-bottom-nav { position: fixed; z-index: 1100; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; display: flex; align-items: stretch; justify-content: space-around; min-height: 64px; padding: 5px 6px; background: var(--color-surface, #fff); border: 1px solid var(--color-border-light, #e2e8f0); border-radius: 18px; box-shadow: 0 12px 35px rgba(15,23,42,.22); }
    .mobile-bottom-nav__item { position: relative; display: flex; flex: 1 1 0; min-width: 0; max-width: 92px; min-height: 52px; padding: 5px 2px 3px; align-items: center; justify-content: center; flex-direction: column; gap: 2px; color: var(--color-text-muted,#64748b); background: transparent; border: 0; border-radius: 10px; font: inherit; font-size: 10px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .mobile-bottom-nav__item svg { width: 21px; height: 21px; stroke-width: 2; }
    .mobile-bottom-nav__item.is-active { color: var(--color-primary,#0b3d91); background: var(--color-primary-light,#eff6ff); }
    .mobile-bottom-nav__item.is-active::before { position: absolute; top: -5px; width: 28px; height: 3px; content: ''; background: currentColor; border-radius: 0 0 4px 4px; }
    body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media print { .mobile-bottom-nav { display: none !important; } }
