/* ==========================================================================
   FLEXAPAY FOUNDER ADMIN & KPI DASHBOARD STYLES
   ========================================================================== */

/* PIN Lock Screen Overlay */
.auth-lock-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-darkest);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.lock-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(245, 176, 65, 0.12);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  margin: 0 auto 1.5rem;
}

.pin-input-group {
  margin: 1.5rem 0;
}

.pin-input {
  letter-spacing: 0.35em;
  text-align: center;
  font-size: 1.4rem;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Dashboard Shell Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: 260px;
  background: var(--bg-dark);
  border-right: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

@media (max-width: 992px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .dashboard-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
}

.sidebar-header {
  padding: 0 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.admin-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-primary);
  background: rgba(245, 176, 65, 0.15);
  border: 1px solid var(--border-gold);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sidebar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.sidebar-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-white);
}

.sidebar-btn.active {
  background: rgba(245, 176, 65, 0.12);
  color: var(--gold-light);
  border-left: 3px solid var(--gold-primary);
}

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

/* Dashboard Main Content Area */
.dashboard-main {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
  max-width: 100%;
}

@media (max-width: 768px) {
  .dashboard-main {
    padding: 1.5rem 1rem;
  }
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

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

/* Tab Views */
.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeInStep 0.25s ease-out;
}

/* KPI Progress Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gold-gradient);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kpi-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.kpi-current {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-white);
}

.kpi-target {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.kpi-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-top: 0.4rem;
  color: var(--text-secondary);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.chart-card-header h3 {
  font-size: 1.1rem;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Data Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.table-search {
  max-width: 320px;
}

.table-responsive {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.data-table tbody tr:hover {
  background: var(--bg-surface-elevated);
}

/* POPIA Compliance Audit Box */
.compliance-audit-card {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.audit-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.audit-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #c0ebd7;
}

.audit-item svg {
  color: var(--emerald-success);
  flex-shrink: 0;
  margin-top: 2px;
}
