/* SubGestor / ISACPLAY GESTOR - Modern Dark Theme CSS */
:root {
  --bg-main: #0c1421;
  --bg-topbar: #101a2d;
  --bg-card: #152238;
  --bg-card-hover: #1a2a45;
  --bg-inner: #0f1828;
  --border-color: #22344d;
  --border-focus: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --accent-cyan: #38bdf8;
  --status-green: #10b981;
  --status-green-bg: rgba(16, 185, 129, 0.12);
  --status-orange: #f59e0b;
  --status-orange-bg: rgba(245, 158, 11, 0.12);
  --status-red: #ef4444;
  --status-red-bg: rgba(239, 68, 68, 0.12);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow-main: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Top Navigation Bar */
.subgestor-navbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.navbar-brand svg {
  width: 24px;
  height: 24px;
  color: var(--accent-cyan);
}
.navbar-brand img {
  height: 38px;
  width: 38px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}
.navbar-brand:hover img {
  transform: scale(1.05);
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-btn:hover, .nav-btn.active {
  background: #1c2c47;
  color: #fff;
}
.nav-btn.danger-nav:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
  padding: 0 10px;
}

/* Page Layout - Tela Toda (Full Width) */
.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 18px 22px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Flash Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}
.alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.alert.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* Top Stats Grid (5 clickable cards) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}
.metric-card.blue::after { background: var(--primary-blue); }
.metric-card.green::after { background: var(--status-green); }
.metric-card.amber::after { background: #f59e0b; }
.metric-card.orange::after { background: var(--status-orange); }
.metric-card.red::after { background: #ef4444; }

a.metric-card {
  text-decoration: none;
  cursor: pointer;
  display: block;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
a.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}


.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.metric-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.metric-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.metric-value {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.metric-value.green-val {
  color: #34d399;
}
.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Toolbar: Search, Filters, Add Button */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 14px;
  flex: 1;
  max-width: 460px;
  height: 42px;
}
.search-box svg {
  color: var(--text-dim);
  margin-right: 10px;
  flex-shrink: 0;
}
.search-input {
  background: none;
  border: none;
  outline: none;
  width: 100%;
  color: #fff;
  font-size: 13px;
}
.search-input::placeholder {
  color: var(--text-dim);
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}
.filter-tab {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-tab.active, .filter-tab:hover {
  background: #253956;
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--primary-blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-blue-hover);
}
.btn-secondary {
  background: #1e2e47;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: #273b5a;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--status-red);
  color: #fff;
}

/* Clients & SubGestor Table Container */
/* Clients & SubGestor Table Container */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-main);
}
.clients-table, .subgestor-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.clients-table th, .subgestor-table th {
  background: #101927;
  padding: 10px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1e2c40;
  white-space: nowrap;
}
.clients-table td, .subgestor-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #182335;
  vertical-align: middle;
  background: #141e2e;
}
.clients-table tbody tr, .subgestor-table tbody tr {
  transition: background 0.15s;
}
.clients-table tbody tr:hover td, .subgestor-table tbody tr:hover td {
  background: #19273c;
}
.clients-table tbody tr:last-child td, .subgestor-table tbody tr:last-child td {
  border-bottom: none;
}

.credenciais-col-cell {
  max-width: 140px;
  white-space: normal !important;
}
.credenciais-trigger-wrapper strong {
  font-size: 11.5px;
  line-height: 1.2;
}
.credenciais-trigger-wrapper small {
  font-size: 10px;
  line-height: 1.2;
}

/* VIP Table Elements matching screenshot */
.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-indicator.ativo {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}
.dot-indicator.vencido {
  background: #f97316;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.8);
}
.dot-indicator.inativo {
  background: #64748b;
}

.plano-badge-vip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #ffffff;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.row-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  flex-wrap: nowrap;
}

.action-pipe-sep {
  display: none;
}

.action-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(0);
}
.action-link-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
  box-shadow: 0 5px 8px -1px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.action-link-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.action-link-btn.wa-link {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  color: #fff !important;
  border-color: #22c55e;
}
.action-link-btn.dados-link {
  background: linear-gradient(180deg, #4f46e5 0%, #3730a3 100%);
  color: #fff !important;
  border-color: #818cf8;
}
.action-link-btn.renew-link {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  color: #fff !important;
  border-color: #38bdf8;
}
.action-link-btn.edit-link {
  background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
  color: #fff !important;
  border-color: #fbbf24;
}
.action-link-btn.delete-link {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  color: #fff !important;
  border-color: #f87171;
  padding: 5px 8px;
}

.action-link-btn.dados-link { color: #a78bfa; }
.action-link-btn.dados-link:hover { background: rgba(167, 139, 250, 0.15); color: #c4b5fd; }

.action-link-btn.copy-link { color: #94a3b8; }
.action-link-btn.copy-link:hover { background: rgba(148, 163, 184, 0.12); color: #fff; }

/* View Client Modal Styles */
.view-info-box {
  background: #0d1522;
  border: 1px solid #1c2e47;
  border-radius: 8px;
  padding: 10px 12px;
}
.view-info-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  display: block;
}
.ponto-view-card {
  background: #0b1320;
  border: 1px solid #1c2e47;
  border-radius: 10px;
  padding: 14px;
}
.ponto-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #162438;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

/* Tabs Row & Pills (SubGestor Module Nav) */
.tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px;
}
.tab-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}
.tab-pill:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.15);
}
.tab-pill.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

/* Client Name & Dot Column */
.client-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.active { background: var(--status-green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.status-dot.expired { background: var(--status-orange); box-shadow: 0 0 8px rgba(245, 158, 11, 0.6); }
.status-dot.inactive { background: var(--text-dim); }

.client-name-info strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.client-name-info small {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Expiration Column */
.expiration-cell strong {
  display: block;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}
.expiration-cell small {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}
.expiration-cell small.text-expired { color: #f87171; }
.expiration-cell small.text-warning { color: #fbbf24; }
.expiration-cell small.text-active { color: #34d399; }
.expiration-cell small.text-muted { color: var(--text-dim); }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-success { background: var(--status-green-bg); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-danger { background: var(--status-red-bg); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-warning { background: var(--status-orange-bg); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-muted { background: rgba(148,163,184,0.1); color: var(--text-muted); border: 1px solid rgba(148,163,184,0.2); }

/* Actions Column (WhatsApp, Renovar, Editar, Excluir) */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.action-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.action-link.whatsapp { color: #34d399; }
.action-link.whatsapp:hover { background: rgba(16,185,129,0.12); }
.action-link.renovar { color: #38bdf8; }
.action-link.renovar:hover { background: rgba(56,189,248,0.12); }
.action-link.editar { color: #fbbf24; }
.action-link.editar:hover { background: rgba(251,191,36,0.12); }
.action-link.copiar { color: #94a3b8; }
.action-link.copiar:hover { background: rgba(148,163,184,0.12); color: #fff; }
.action-link.excluir { color: #f87171; }
.action-link.excluir:hover { background: rgba(239,68,68,0.12); }

/* ========================================================= */
/* MODAL: "Adicionar / Editar Cliente" (Exact match to photo) */
/* ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 16, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 100;
  overflow-y: auto;
}
.modal-overlay.show {
  display: grid;
}
.modal-dialog {
  background: #172338;
  border: 1px solid #273a54;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
  margin: auto;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #23344d;
}
.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
  display: grid;
  gap: 18px;
}

#clientModal .modal-dialog {
  width: 97vw;
  max-width: 1540px;
  height: auto;
  max-height: calc(100vh - 16px);
}

.client-modal-grid {
  display: grid;
  grid-template-columns: 1.02fr 1.18fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .client-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* Top 2 Inputs */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: grid;
  gap: 6px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.form-control {
  width: 100%;
  background: var(--bg-inner);
  border: 1px solid #253750;
  color: #fff;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.form-control::placeholder {
  color: var(--text-dim);
}
.mac-input {
  text-transform: uppercase;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Card: Credenciais / Pontos */
.section-box {
  background: #121c2e;
  border: 1px solid #22344b;
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 14px;
}
.section-box-header {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ponto Container */
.ponto-card {
  background: #172439;
  border: 1px solid #2a3e5c;
  border-radius: var(--radius-md);
  padding: 14px;
  display: grid;
  gap: 12px;
}
.ponto-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ponto-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}
.ponto-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ponto-pill {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: #101c2e;
  border: 1px solid #2a3c56;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.ponto-pill.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #fff;
}
.ponto-delete-btn {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  padding: 4px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
}
.ponto-delete-btn:hover {
  color: #ef4444;
}

.add-ponto-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
}
.add-ponto-btn:hover {
  text-decoration: underline;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: #141f32;
  border-top: 1px solid #23344d;
}

/* Login Page Styling */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #152945 0%, #0c1421 65%);
}
.login-shell { width: min(420px, 100%); }
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand h1 { margin: 12px 0 6px; font-size: 22px; font-weight: 800; }
.login-brand p { color: var(--text-muted); font-size: 13px; }
.login-logo { max-width: 140px; max-height: 80px; object-fit: contain; }

/* Responsive adjustments: Celular (Smartphones), Tablet e Desktop */
@media (max-width: 1200px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (max-width: 960px) {
  .client-modal-grid { grid-template-columns: 1fr; gap: 14px; }
  #clientModal .modal-dialog { width: 96vw; margin: 8px auto; border-radius: 12px; }
  #clientModal .modal-body { padding: 14px 12px; max-height: calc(92vh - 125px); }
  #pontosContainer { max-height: none !important; overflow-y: visible !important; }
}

@media (max-width: 900px) {
  .dash-view-bar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .dash-view-left {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 10px !important;
  }
  .dash-view-left .search-box {
    max-width: 100% !important;
    width: 100% !important;
  }
  .dash-view-left .filter-tabs {
    width: 100% !important;
    padding: 4px;
    justify-content: flex-start;
  }
  .dash-view-right {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }
  .dash-sort-select {
    flex: 1 !important;
    height: 40px !important;
  }
  .dash-add-btn {
    flex: 1 !important;
    height: 40px !important;
    justify-content: center !important;
  }
}

@media (max-width: 800px) {
  .app-container { padding: 16px 12px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 12px 14px; }
  .metric-value { font-size: 22px; }
  .clients-table th:nth-child(2),
  .clients-table td:nth-child(2) { display: table-cell; }
}

@media (max-width: 600px) {
  .app-container { padding: 10px 8px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .metrics-grid .metric-card:last-child { grid-column: span 2; }
  .metric-card { padding: 10px 12px; border-radius: 10px; }
  .metric-title { font-size: 11px; }
  .metric-value { font-size: 19px; }
  .metric-sub { font-size: 10px; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; gap: 10px; }
  .subgestor-navbar { padding: 6px 12px; height: auto; min-height: 54px; flex-wrap: wrap; }
  .navbar-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; width: 100%; }
  .nav-btn { padding: 6px 10px; font-size: 12px; }
  .user-badge { display: none; }
  .table-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
  .clients-table th, .clients-table td { padding: 10px 10px; font-size: 12px; }
  .dash-view-bar { padding: 10px !important; }
  .action-link-btn { min-height: 32px; padding: 6px 8px; font-size: 12px; }
  .modal-dialog { width: 96vw !important; margin: 8px auto !important; }
  .form-control { font-size: 15px; }
}

@media (max-width: 380px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metrics-grid .metric-card:last-child { grid-column: span 1; }
  .dash-view-right { flex-direction: column; }
  .dash-view-right select, .dash-view-right button { width: 100%; }
}

/* ========================================================== */
/* GERENCIADOR DE CADASTROS: MODERN ENTERPRISE STYLES        */
/* ========================================================== */

/* Top Catalog Stats Grid */
.catalog-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.catalog-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s, border-color 0.15s;
}
.catalog-stat-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
}
.catalog-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.catalog-stat-info {
  display: flex;
  flex-direction: column;
}
.catalog-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.catalog-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

/* Pricing Cards Grid for Planos & Pacotes */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.plan-card:hover {
  border-color: #3b82f6;
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.18);
}
.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.plan-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.plan-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  background: #1e3a8a;
  color: #93c5fd;
  border: 1px solid #2563eb;
}
.plan-badge.green {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #059669;
}
.plan-price-wrap {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(34, 52, 77, 0.6);
}
.plan-price-val {
  font-size: 28px;
  font-weight: 800;
  color: #34d399;
  letter-spacing: -0.5px;
}
.plan-price-val span {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}
.plan-equiv {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
}
.plan-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: grid;
  gap: 10px;
}
.plan-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.plan-feature-item svg {
  color: #10b981;
  flex-shrink: 0;
}
.plan-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(34, 52, 77, 0.6);
}

/* Item Card Grid (Players, Aparelhos, Servidores) */
.catalog-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.catalog-item-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s ease;
}
.catalog-item-box:hover {
  border-color: #3b82f6;
  background: #142236;
}
.catalog-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.catalog-item-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.catalog-item-title {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-item-sub {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Copy button chip with feedback */
.copy-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0d1829;
  border: 1px solid #223754;
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-chip-btn:hover {
  background: #162945;
  border-color: #38bdf8;
  color: #fff;
}
.copy-chip-btn.copied {
  background: #064e3b;
  border-color: #10b981;
  color: #6ee7b7;
}

/* Protocol & Port Badges */
.proto-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.proto-badge.https { background: #064e3b; color: #34d399; }
.proto-badge.http { background: #1e3a8a; color: #60a5fa; }
.port-badge {
  font-size: 11px;
  font-family: monospace;
  background: #0a1320;
  color: #f59e0b;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #334155;
}

/* Search bar inside catalog tabs */
.catalog-search-bar {
  display: flex;
  align-items: center;
  background: #0f1929;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 38px;
  max-width: 320px;
  flex: 1;
}
.catalog-search-bar input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  width: 100%;
}
.catalog-search-bar input::placeholder {
  color: var(--text-dim);
}

@media (max-width: 1100px) {
  .catalog-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .catalog-stats { grid-template-columns: repeat(2, 1fr); }
  .plans-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .catalog-stats { grid-template-columns: 1fr; }
}

/* ========================================================== */
/* CREDENCIAIS HOVER POPOVER (IDÊNTICO AO MODELO DO CLIENTE)   */
/* ========================================================== */
.credenciais-trigger-wrapper {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: opacity 0.15s;
}
.credenciais-trigger-wrapper:hover strong {
  color: #38bdf8 !important;
}

#credHoverPopover {
  position: fixed;
  z-index: 99999;
  width: 320px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  background: #0d1524;
  border: 1px solid #1e3352;
  border-radius: 10px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(56, 189, 248, 0.15);
  padding: 12px 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(4px);
  font-family: inherit;
}
#credHoverPopover.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.cred-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #1a2c47;
}
.cred-popover-title {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.cred-popover-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.15s;
}
.cred-popover-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.cred-popover-card {
  background: #121c2e;
  border: 1px solid #1c2e47;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cred-popover-card:last-child {
  margin-bottom: 0;
}

.cred-ponto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}
.cred-ponto-title {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
}
.cred-ponto-player {
  color: #fbbf24;
  font-weight: 800;
}
.cred-ponto-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cred-ponto-badge.mac {
  background: #1e3a8a;
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.cred-ponto-badge.user {
  background: #064e3b;
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.cred-ponto-badge.cel {
  background: #4c1d95;
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.cred-line {
  font-size: 11.5px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.35;
}
.cred-line-label {
  color: #94a3b8;
  font-weight: 500;
  margin-right: 6px;
}
.cred-line-val {
  color: #fff;
  font-weight: 600;
  word-break: break-all;
}
.cred-line-val.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  letter-spacing: 0.4px;
}
.cred-copy-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin-left: 6px;
}
.cred-copy-btn:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}
.cred-copy-btn.copied {
  color: #34d399;
}

/* ========================================================== */
/* MODO CARDS MOBILE (RESPONSIVO PARA CELULARES <= 768px)     */
/* Conforme foto de referência media_1789961014050.jpg         */
/* ========================================================== */
.clients-mobile-cards {
  display: none;
}

@media (max-width: 768px) {
  .clients-desktop-table {
    display: none !important;
  }
  .clients-mobile-cards {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
  }
  .table-card.dash-table-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .table-card.dash-table-box > div:first-child {
    background: #111a28 !important;
    border: 1px solid #1f3045 !important;
    border-radius: 12px;
  }
/* ========================================================== */
/* DESTAQUE EM VERMELHO PARA CLIENTES VENCIDOS (DESKTOP & MOBILE) */
/* ========================================================== */
tr.row-vencido {
  background: rgba(239, 68, 68, 0.05);
}
tr.row-vencido:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}
tr.row-vencido td:first-child {
  border-left: 3.5px solid #ef4444;
}

.status-badge-highlight {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.status-badge-highlight.vencido {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}
.status-badge-highlight.ativo {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.status-badge-highlight.inativo {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.client-mobile-card {
  background: #141f2d;
  border: 1px solid #1f3045;
  border-radius: 14px;
  padding: 16px 16px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.client-mobile-card.vencido {
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.09) 0%, #141f2d 65px) !important;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.15) !important;
}
.client-mobile-card.vencido .mobile-card-badge-status {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

.mobile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-card-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mobile-card-dot.ativo {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}
.mobile-card-dot.vencido {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}
.mobile-card-dot.inativo {
  background: #64748b;
}

.mobile-card-name {
  color: #fff;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: color 0.15s;
  text-transform: uppercase;
}
.mobile-card-name:hover {
  color: #38bdf8;
}

.mobile-card-badge-screens {
  background: #1e3a8a;
  color: #60a5fa;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.mobile-card-badge-status {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: capitalize;
}
.mobile-card-badge-status.status-ativo {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.mobile-card-badge-status.status-vencido {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.mobile-card-badge-status.status-inativo {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.mobile-card-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: flex-start;
  gap: 12px;
}

.mobile-card-col {
  display: flex;
  flex-direction: column;
}

.mobile-card-col.text-right {
  text-align: right;
  align-items: flex-end;
}

.mobile-card-col-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.mobile-card-date {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.25;
}

.mobile-card-subtext {
  font-size: 12px;
  margin-top: 3px;
  font-weight: 500;
}

.mobile-card-val-amount {
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.25;
}

.mobile-card-player-strip {
  background: #0d1522;
  border: 1px solid #1a293d;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.strip-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.strip-ponto-num {
  color: #64748b;
  font-weight: 700;
  font-size: 12.5px;
}

.strip-player-name {
  color: #fbbf24;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}

.strip-server-name {
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.mobile-card-actions-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #1f3045;
  margin: 6px -16px 0 -16px;
  background: rgba(0, 0, 0, 0.12);
}

.mobile-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 2px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-right: 1px solid #1f3045;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mobile-action-btn:active {
  transform: scale(0.96);
}

.mobile-action-btn.btn-wa {
  color: #22c55e;
}
.mobile-action-btn.btn-wa:hover,
.mobile-action-btn.btn-wa:active {
  background: rgba(34, 197, 94, 0.15);
}
.mobile-action-btn.btn-wa.disabled {
  color: #475569;
  cursor: not-allowed;
}

.mobile-action-btn.btn-renew {
  color: #38bdf8;
}
.mobile-action-btn.btn-renew:hover,
.mobile-action-btn.btn-renew:active {
  background: rgba(56, 189, 248, 0.15);
}

.mobile-action-btn.btn-edit {
  color: #eab308;
}
.mobile-action-btn.btn-edit:hover,
.mobile-action-btn.btn-edit:active {
  background: rgba(234, 179, 8, 0.15);
}

.mobile-action-btn.btn-del {
  color: #ef4444;
  border-right: none !important;
}
.mobile-action-btn.btn-del:hover,
.mobile-action-btn.btn-del:active {
  background: rgba(239, 68, 68, 0.15);
}

/* ========================================================
   3D THEME ELEVATION & DEPTH SYSTEM (GESTOR VIP)
   ======================================================== */
.card-3d, .table-card {
  background: linear-gradient(180deg, #111e33 0%, #0c1626 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.metric-card {
  background: linear-gradient(180deg, #111e33 0%, #0d1726 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease !important;
}

a.metric-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 18px 36px -8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
}

.btn-primary {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #0369a1 0%, #075985 100%) !important;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(0, 0, 0, 0.2) !important;
}

.form-control, input[type="text"], input[type="password"], select, textarea {
  background-color: #070e1b !important;
  border: 1px solid #1a2a44 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
  color: #f8fafc !important;
  border-radius: 8px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.form-control:focus, input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.25) !important;
  outline: none !important;
}

