/* ── FIADOS PDV E VENDAS - WEB MANAGEMENT DASHBOARD STYLES ── */
:root {
  --primary-color: #739E4C;
  --primary-dark: #5B813A;
  --primary-light: #F0FDF4;
  --primary-border: #BBF7D0;
  
  --accent-yellow: #EDBC17;
  --accent-blue: #276CAD;
  --accent-red: #EF4444;
  --accent-red-light: #FEF2F2;
  --accent-green: #10B981;
  --accent-green-light: #ECFDF5;
  
  --sidebar-bg: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-border: #1E293B;
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;
  
  --bg-main: #F8FAFC;
  --card-bg: #FFFFFF;
  --border-color: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ── LOADING SCREEN ── */
#app-loading {
  position: fixed;
  inset: 0;
  background-color: #0F172A;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  gap: 16px;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── LOGIN PAGE ── */
#login-page {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 10000;
}

.login-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-header {
  text-align: center;
}

.brand-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius-md);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(115, 158, 76, 0.3);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background-color: #F8FAFC;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(115, 158, 76, 0.15);
}

.btn {
  padding: 12px 20px;
  height: 46px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(115, 158, 76, 0.3);
}

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

.btn-outline:hover {
  background-color: #F1F5F9;
}

.btn-google {
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #1E293B;
  font-weight: 600;
}

.btn-google:hover {
  background-color: #F8FAFC;
  border-color: #94A3B8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.login-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 4px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #E2E8F0;
}

.login-divider span {
  padding: 0 12px;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ── FILTER CHIPS & VIEW SWITCHER ── */
.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  background: #F1F5F9;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.filter-chip:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.view-btn {
  padding: 7px 12px;
  background: white;
  color: var(--text-muted);
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:hover {
  color: var(--primary-color);
  background: #F8FAFC;
}

.view-btn.active {
  background: var(--primary-color);
  color: white;
}

/* ── CLIENT CARDS GRID ── */
.clients-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.client-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
}

.client-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.client-card-avatar {
  width: 48px;
  height: 48px;
  background: #F1F5F9;
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

.client-card-info {
  flex: 1;
  overflow: hidden;
}

.client-card-info h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-card-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.client-card-body {
  background: #F8FAFC;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #F1F5F9;
}

.client-card-body span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.client-card-body h3 {
  font-size: 17px;
  font-weight: 800;
}

.client-card-actions {
  display: flex;
  gap: 8px;
}

/* ── PREMIUM GATE (BLOCK SCREEN) ── */
#premium-gate {
  position: fixed;
  inset: 0;
  background: #0F172A;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 10000;
}

.gate-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 520px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.gate-badge {
  width: 64px;
  height: 64px;
  background: #FEF3C7;
  color: #D97706;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
}

.gate-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.gate-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.gate-features {
  width: 100%;
  text-align: left;
  background: #F8FAFC;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gate-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
}

.gate-feature-item i {
  color: var(--primary-color);
}

/* ── MAIN DASHBOARD LAYOUT ── */
#app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 260px;
  height: 100%;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

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

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
}

.sidebar-brand-text h1 {
  font-size: 15px;
  font-weight: 700;
  color: white;
}

.sidebar-brand-text p {
  font-size: 11px;
  color: #64748B;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 1px;
  padding: 12px 10px 4px 10px;;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: white;
}

.nav-item.active {
  background-color: var(--primary-color);
  color: white;
  font-weight: 700;
}

.nav-badge {
  margin-left: auto;
  background-color: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
  background-color: #090D16;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
}

.user-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.user-info p {
  font-size: 11px;
  color: #4ADE80;
}

/* ── MAIN CONTENT ── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.topbar {
  height: 70px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #F1F5F9;
  font-size: 13px;
}

.search-input:focus {
  outline: none;
  background-color: #FFFFFF;
  border-color: var(--primary-color);
}

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

.live-badge {
  background-color: #DCFCE7;
  color: #15803D;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
}

.content-body {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ── DASHBOARD TAB VIEWS ── */
.tab-view {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.tab-view.active {
  display: flex;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.page-title p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── KPI CARDS ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-info span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.8px;
}

.kpi-info h3 {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-main);
  margin: 6px 0 2px 0;
}

.kpi-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
}

.kpi-red { background: #FEF2F2; color: #EF4444; }
.kpi-blue { background: #EFF6FF; color: #3B82F6; }
.kpi-amber { background: #FFFBEB; color: #F59E0B; }
.kpi-green { background: #ECFDF5; color: #10B981; }

/* ── DATA TABLES ── */
.table-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.table-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #F8FAFC;
  padding: 14px 24px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px 24px;
  font-size: 13px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-main);
}

.data-table tr:hover {
  background: #F8FAFC;
}

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
}

.badge-red { background: #FEE2E2; color: #DC2626; }
.badge-green { background: #DCFCE7; color: #15803D; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 20000;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
}

/* ── TOAST MESSAGES ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #0F172A;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
