/* ============================================================
   FlowNails - Dashboard (dashboard.css)
   Clean admin aesthetics with alerts, cards, tables
   ============================================================ */
@import url('./variables.css');

/* ── Layout ── */
.dash-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Sidebar ── */
.dash-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--gradient-dark);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: var(--transition-slide);
  overflow-y: auto;
}

.sidebar-header {
  padding: 28px 24px;
  border-bottom: 1px solid hsl(0 0% 100% / 0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-cta);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-logo-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.sidebar-logo-name span { color: var(--primary); }

.sidebar-badge {
  margin-top: 4px;
  font-size: 10px;
  color: hsl(0 0% 100% / 0.45);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: hsl(0 0% 100% / 0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-display);
  padding: 16px 24px 8px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: hsl(0 0% 100% / 0.65);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.sidebar-nav-item:hover {
  color: white;
  background: hsl(0 0% 100% / 0.06);
}

.sidebar-nav-item.active {
  color: white;
  background: hsl(0 0% 100% / 0.1);
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 18px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--danger-dark);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid hsl(0 0% 100% / 0.08);
}

.sidebar-footer p {
  font-size: 11px;
  color: hsl(0 0% 100% / 0.3);
}

.sidebar-footer a { color: var(--primary); text-decoration: none; }
.sidebar-footer a:hover { text-decoration: underline; }

/* ── Main Content ── */
.dash-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Bar ── */
.dash-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-topbar-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.dash-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.hamburger-dash {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border: none;
  background: none;
}

.hamburger-dash span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition-base);
}

/* ── Dash Sections ── */
.dash-section {
  padding: 32px;
  display: none;
  animation: fadeInUp 0.4s ease both;
}

.dash-section.active { display: block; }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.stat-card.rose::after   { background: var(--gradient-cta); }
.stat-card.mint::after   { background: linear-gradient(135deg, var(--secondary-dark), hsl(180, 50%, 55%)); }
.stat-card.lavender::after { background: linear-gradient(135deg, var(--accent-dark), hsl(270, 50%, 58%)); }
.stat-card.gold::after   { background: linear-gradient(135deg, var(--gold), hsl(42, 70%, 55%)); }

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

.stat-card-icon {
  font-size: 28px;
  line-height: 1;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 500;
}

/* ── Alert Banners ── */
.alerts-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.alert-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 20px;
  background: var(--warning);
  border: 1px solid var(--warning-dark);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: hsl(42, 70%, 25%);
  animation: slideInRight 0.4s ease both;
}

.alert-banner.danger {
  background: var(--danger);
  border-color: var(--danger-dark);
  color: hsl(0, 55%, 25%);
}

.alert-banner.success {
  background: var(--success);
  border-color: var(--success-dark);
  color: hsl(145, 45%, 20%);
}

.alert-icon { font-size: 18px; flex-shrink: 0; }
.alert-msg  { flex: 1; }
.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: inherit;
  opacity: 0.6;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
}

.alert-close:hover { opacity: 1; background: hsl(0 0% 0% / 0.1); }

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-heading {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Approvals Queue ── */
.approval-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: var(--transition-base);
  animation: fadeInUp 0.4s ease both;
}

.approval-card:hover { box-shadow: var(--shadow-md); }

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

.approval-info { flex: 1; }

.approval-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.approval-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.approval-amount {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-deep);
  margin-right: var(--space-md);
}

.approval-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ── Table ── */
.dash-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.dash-table th {
  background: var(--bg-alt);
  padding: 14px 20px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
}

.dash-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

.dash-table tr:last-child td { border-bottom: none; }

.dash-table tr:hover td { background: var(--surface-hover); }

.td-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.td-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-deep);
  flex-shrink: 0;
}

.td-bold {
  font-family: var(--font-display);
  font-weight: 700;
}

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

/* ── Status Dropdown in Table ── */
.status-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition-fast);
}

.status-select:focus {
  outline: none;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px hsl(340 65% 72% / 0.2);
}

/* ── Settings Panel ── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
}

.settings-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.settings-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.settings-card .toggle-wrapper {
  margin-bottom: var(--space-lg);
}

.pix-toggle-section {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.pix-toggle-section.open {
  max-height: 500px;
  opacity: 1;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px var(--space-lg);
  color: var(--text-muted);
}

.empty-state-icon { font-size: 52px; margin-bottom: var(--space-md); }
.empty-state-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}
.empty-state-desc { font-size: 14px; line-height: 1.6; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: hsl(340 30% 15% / 0.5);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  width: 36px; height: 36px;
  background: var(--bg-alt);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

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

.modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

/* ── Toast ── */
.dash-toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  background: var(--text);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  transform: translateY(80px);
  opacity: 0;
  transition: var(--transition-slide);
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-toast.show { transform: translateY(0); opacity: 1; }
.dash-toast.success { background: var(--success-dark); }
.dash-toast.error   { background: var(--danger-dark); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .dash-sidebar {
    transform: translateX(-100%);
  }

  .dash-sidebar.open {
    transform: translateX(0);
  }

  .dash-content { margin-left: 0; }

  .hamburger-dash { display: flex; }

  .dash-section { padding: var(--space-md); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .approval-card {
    flex-wrap: wrap;
  }

  .approval-actions { width: 100%; }

  .dash-table-wrapper { overflow-x: auto; }

  .modal { padding: var(--space-lg); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
