/* ============================================================
   AC TECNOLOGIA DIGITAL - Sistema de Gestão
   Design System: Dark + Blue + Green | Fonte: Poppins
   ============================================================ */

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

:root {
  --bg-body:       #07070F;
  --bg-sidebar:    #0C0C1A;
  --bg-card:       #101020;
  --bg-card2:      #13132A;
  --bg-input:      #0A0A1A;
  --bg-hover:      #141430;
  --border:        #1C1C38;
  --border-light:  #232340;
  --text-primary:  #E8E8F5;
  --text-sec:      #7880A0;
  --text-muted:    #484870;
  --blue:          #4F8AF7;
  --blue-dark:     #2563EB;
  --blue-dim:      rgba(79,138,247,0.12);
  --green:         #22D98E;
  --green-dark:    #10B981;
  --green-dim:     rgba(34,217,142,0.12);
  --red:           #F75F5F;
  --red-dim:       rgba(247,95,95,0.12);
  --yellow:        #F5A623;
  --yellow-dim:    rgba(245,166,35,0.12);
  --purple:        #A78BFA;
  --gradient:      linear-gradient(135deg, #2563EB 0%, #10B981 100%);
  --gradient-card: linear-gradient(135deg, rgba(37,99,235,0.15) 0%, rgba(16,185,129,0.08) 100%);
  --sidebar-w:     260px;
  --header-h:      68px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.3);
  --transition:    0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--green); }

img { max-width: 100%; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── LOGIN PAGE ─── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(37,99,235,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(16,185,129,0.1) 0%, transparent 60%),
              var(--bg-body);
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow), 0 0 80px rgba(37,99,235,0.08);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .brand-icon {
  width: 56px; height: 56px;
  background: var(--gradient);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4);
}

.login-logo h1 {
  font-size: 16px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}

.login-logo p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.login-tab {
  flex: 1;
  padding: 9px;
  text-align: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  font-family: 'Poppins', sans-serif;
}

.login-tab.active {
  background: var(--bg-card2);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.login-form h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-form p.subtitle {
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 24px;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,138,247,0.12);
}

.form-control::placeholder { color: var(--text-muted); }

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .form-control { padding-left: 42px; }

/* Ícone decorativo do lado esquerdo — apenas o primeiro i direto */
.input-icon-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

/* Botão de mostrar/ocultar senha — lado direito */
.pw-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  padding: 4px 6px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color var(--transition);
  z-index: 1;
}
.pw-toggle-btn:hover { color: var(--text-sec); }
.pw-toggle-btn i { position: static; transform: none; font-size: 15px; pointer-events: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37,99,235,0.45);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-card2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(247,95,95,0.2);
}

.btn-danger:hover { background: var(--red); color: #fff; }

.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(34,217,142,0.2);
}

.btn-success:hover { background: var(--green); color: #000; }

.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 15px 32px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--text-sec);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(247,95,95,0.2); }
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,217,142,0.2); }
.alert-warning { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(245,166,35,0.2); }
.alert-info { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(79,138,247,0.2); }

/* ─── LAYOUT (Admin & Client) ─── */
.layout { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
}

.sidebar-logo .logo-text {
  line-height: 1.2;
}

.sidebar-logo .logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.sidebar-logo .logo-text small {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.nav-section {
  padding: 0 12px;
  margin-bottom: 4px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--gradient-card);
  color: var(--blue);
  border: 1px solid rgba(79,138,247,0.15);
}

.nav-item.active i { color: var(--blue); }

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-item:hover i { color: var(--text-primary); }

.nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
}

.sidebar-user .avatar {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-user .logout-btn {
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-user .logout-btn:hover { color: var(--red); }

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

/* ─── TOPBAR ─── */
.topbar {
  height: var(--header-h);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title h2 { font-size: 18px; font-weight: 700; }
.topbar-title p { font-size: 12px; color: var(--text-sec); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.topbar-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  border: 1px solid var(--border);
  text-decoration: none;
}

.topbar-btn:hover { color: var(--text-primary); border-color: var(--border-light); }

.mobile-toggle { display: none; }

/* ─── PAGE CONTENT ─── */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ─── STATS CARDS ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.06;
}

.stat-card.blue::before { background: var(--blue); }
.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card.yellow::before { background: var(--yellow); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.stat-card.blue .stat-icon { background: var(--blue-dim); color: var(--blue); }
.stat-card.green .stat-icon { background: var(--green-dim); color: var(--green); }
.stat-card.red .stat-icon { background: var(--red-dim); color: var(--red); }
.stat-card.yellow .stat-icon { background: var(--yellow-dim); color: var(--yellow); }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-value.text-green { background: none; -webkit-text-fill-color: var(--green); }
.stat-value.text-red { background: none; -webkit-text-fill-color: var(--red); }
.stat-value.text-yellow { background: none; -webkit-text-fill-color: var(--yellow); }
.stat-value.text-blue { background: none; -webkit-text-fill-color: var(--blue); }

.stat-label { font-size: 12px; color: var(--text-sec); font-weight: 500; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i { color: var(--blue); }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-card2); border-radius: 0 0 var(--radius) var(--radius); }

/* ─── GRID ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.grid-cols-chart { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
}

table tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: var(--bg-hover); }

.table-avatar {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.badge-success { background: var(--green-dim); color: var(--green); }
.badge-danger  { background: var(--red-dim);   color: var(--red); }
.badge-warning { background: var(--yellow-dim); color: var(--yellow); }
.badge-info    { background: var(--blue-dim);   color: var(--blue); }
.badge-muted   { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* ─── FORMS ─── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237880A0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

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

.form-help { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ─── SEARCH/FILTER BAR ─── */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-wrap input { padding-left: 42px; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
  box-shadow: var(--shadow), 0 0 60px rgba(37,99,235,0.1);
}

.modal-overlay.show .modal { transform: translateY(0); }

.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px; line-height: 1; transition: var(--transition); }
.modal-close:hover { color: var(--red); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── TOAST ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 300px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
}

.toast-success { background: var(--bg-card2); border-left: 3px solid var(--green); }
.toast-error   { background: var(--bg-card2); border-left: 3px solid var(--red); }
.toast-warning { background: var(--bg-card2); border-left: 3px solid var(--yellow); }
.toast-info    { background: var(--bg-card2); border-left: 3px solid var(--blue); }

.toast i { font-size: 18px; }
.toast-success i { color: var(--green); }
.toast-error i   { color: var(--red); }
.toast-warning i { color: var(--yellow); }
.toast-info i    { color: var(--blue); }

.toast-close { margin-left: auto; cursor: pointer; color: var(--text-muted); font-size: 16px; }

/* ─── STATUS INDICATORS ─── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.online    { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.status-dot.offline   { background: var(--red); }
.status-dot.degraded  { background: var(--yellow); }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 8px var(--green); }
  50%      { box-shadow: 0 0 16px var(--green); }
}

/* ─── SERVICE STATUS WIDGET ─── */
.service-list { display: flex; flex-direction: column; gap: 10px; }

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.service-item .svc-info { display: flex; flex-direction: column; gap: 2px; }
.service-item .svc-name { font-size: 13px; font-weight: 600; }
.service-item .svc-desc { font-size: 11px; color: var(--text-muted); }

/* ─── QUICK ACTIONS ─── */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.action-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}

.action-card:hover { border-color: var(--blue); background: var(--blue-dim); color: var(--blue); }
.action-card i { font-size: 22px; margin-bottom: 8px; display: block; color: var(--blue); }
.action-card span { font-size: 12px; font-weight: 600; display: block; }

/* ─── PIX PAYMENT ─── */
.pix-container { text-align: center; }
.pix-container img { max-width: 200px; border: 8px solid #fff; border-radius: 12px; }

.copy-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copy-field input {
  flex: 1;
  font-size: 11px;
  word-break: break-all;
}

/* ─── INVOICE CARD ─── */
.invoice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.invoice-card:hover { border-color: var(--border-light); }
.invoice-card .inv-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.invoice-card .inv-icon.pending { background: var(--yellow-dim); color: var(--yellow); }
.invoice-card .inv-icon.paid    { background: var(--green-dim);  color: var(--green); }
.invoice-card .inv-icon.overdue { background: var(--red-dim);    color: var(--red); }

.invoice-card .inv-info { flex: 1; }
.invoice-card .inv-num  { font-size: 13px; font-weight: 700; }
.invoice-card .inv-desc { font-size: 12px; color: var(--text-sec); }
.invoice-card .inv-date { font-size: 11px; color: var(--text-muted); }
.invoice-card .inv-amount { font-size: 18px; font-weight: 800; }
.invoice-card .inv-amount.paid { color: var(--green); }
.invoice-card .inv-amount.pending { color: var(--yellow); }
.invoice-card .inv-amount.overdue { color: var(--red); }

/* ─── SUPPORT STATUS BANNER ─── */
.support-banner {
  background: var(--gradient-card);
  border: 1px solid rgba(79,138,247,0.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.support-info { display: flex; align-items: center; gap: 14px; }
.support-info i { font-size: 28px; color: var(--blue); }
.support-info h3 { font-size: 15px; font-weight: 700; }
.support-info p { font-size: 12px; color: var(--text-sec); }

/* ─── CHART CONTAINER ─── */
.chart-container { position: relative; height: 280px; }

/* ─── DIVIDER ─── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-sec); }
.empty-state p { font-size: 13px; }

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pagination a, .pagination span {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-sec);
  transition: var(--transition);
}

.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ─── ANIMATIONS ─── */
@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease; }

/* ─── SIDEBAR OVERLAY (controlado por JS via classList) ─── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
  z-index: 99;
}
#sidebar-overlay.show { display: block; }

/* ─── GRID HELPERS para stats com colunas fixas ─── */
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stats-5 { grid-template-columns: repeat(5, 1fr); }

/* ─── RESPONSIVE 1200px ─── */
@media (max-width: 1200px) {
  .stats-5 { grid-template-columns: repeat(3, 1fr); }
  .stats-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ─── RESPONSIVE 1024px ─── */
@media (max-width: 1024px) {
  .grid-cols-chart { grid-template-columns: 1fr; }
  .grid-3          { grid-template-columns: 1fr 1fr; }
  .stats-4         { grid-template-columns: repeat(2, 1fr); }
  .stats-5         { grid-template-columns: repeat(3, 1fr); }
}

/* ─── RESPONSIVE 768px (tablets e celulares) ─── */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 40px rgba(0,0,0,0.6);
  }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: flex !important; }

  /* Topbar */
  .topbar { padding: 0 14px; height: 60px; gap: 8px; }
  .topbar-title h2 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }
  .topbar-title h2 i { display: none; }
  /* Esconde botão de configurações — fica no sidebar */
  .topbar-hide-mobile { display: none !important; }

  /* Page content */
  .page-content { padding: 12px; }

  /* Grids */
  .stats-grid,
  .stats-4,
  .stats-5 { grid-template-columns: 1fr 1fr; }

  .grid-2,
  .grid-3,
  .grid-cols-chart { grid-template-columns: 1fr; }

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

  .quick-actions { grid-template-columns: 1fr 1fr; }

  /* Cards */
  .card-header {
    padding: 12px 16px;
    gap: 8px;
  }
  .card-body   { padding: 14px; }
  .card-footer { padding: 12px 14px; }

  /* Tabelas: scroll horizontal limpo */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }
  table th,
  table td { padding: 10px 12px; font-size: 12px; white-space: nowrap; }

  /* Ocultar colunas secundárias em telas menores */
  .col-hide-md { display: none; }

  /* Filter bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .search-wrap { min-width: unset; width: 100%; }
  .filter-bar .btn { font-size: 12px; padding: 7px 12px; }

  /* Flex-between: empilha em mobile */
  .flex-between {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .flex-between > * { width: 100%; }
  .flex-between .btn,
  .flex-between a.btn { text-align: center; justify-content: center; }

  /* Div de botões de filtro de status */
  .status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Modais: sheet inferior em mobile */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100% !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
  }

  /* Support banner */
  .support-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .support-info { flex-direction: column; gap: 10px; }

  /* Invoice card */
  .invoice-card { flex-wrap: wrap; gap: 10px; }
  .invoice-card .inv-amount { font-size: 20px; }

  /* Service rows em settings */
  .service-row {
    grid-template-columns: 1fr 1fr !important;
    row-gap: 8px;
  }
  .service-row input[name^="svc_name"] { grid-column: 1 / -1; }
  .service-row input[name^="svc_desc"] { grid-column: 1 / -1; }

  /* Period selector em financial */
  .period-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .period-bar form { flex-wrap: wrap; }
  .period-bar .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Login */
  .login-box { padding: 28px 20px; }
  .setup-box { padding: 28px 20px; }

  /* PIX copy field */
  .copy-field { flex-direction: column; }
  .copy-field .btn { width: 100%; justify-content: center; }

  /* Pix QR code */
  .pix-container img { max-width: 180px; }

  /* Stat cards */
  .stat-value { font-size: 22px; }
}

/* ─── RESPONSIVE 480px (celulares pequenos) ─── */
@media (max-width: 480px) {
  .stats-grid,
  .stats-4,
  .stats-5 { grid-template-columns: 1fr; }

  .quick-actions { grid-template-columns: 1fr 1fr; }

  .topbar-title h2 { max-width: 150px; font-size: 13px; }

  .page-content { padding: 10px; }

  table th,
  table td { padding: 8px 10px; font-size: 11px; }

  .login-box  { padding: 24px 16px; border-radius: var(--radius); }
  .setup-box  { padding: 24px 16px; }

  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }
  .modal-footer .btn { width: 100%; justify-content: center; }

  .stat-value { font-size: 20px; }
  .stat-icon  { width: 38px; height: 38px; font-size: 16px; }

  /* Card header empilha em telas minúsculas */
  .card-header { flex-direction: column; align-items: flex-start; }
  .card-header > :last-child { align-self: flex-end; }
}

/* ─── SETUP PAGE ─── */
.setup-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  padding: 20px;
}

.setup-box {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

/* ─── UTILS ─── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-green { color: var(--green) !important; }
.text-red   { color: var(--red)   !important; }
.text-blue  { color: var(--blue)  !important; }
.text-muted { color: var(--text-muted) !important; }
.font-bold  { font-weight: 700; }
.font-mono  { font-family: 'Courier New', monospace; font-size: 12px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
