/* ==========================================================================
   AFFILIATE & ADS PERFORMANCE DASHBOARD - GLASSMORPHISM STYLESHEET
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-glow: rgba(56, 189, 248, 0.3);
  
  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --accent-purple: #818cf8;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(129, 140, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.6);
}

/* Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.logo-text h1 span {
  background: linear-gradient(90deg, var(--primary), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent-emerald);
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: rgba(56, 189, 248, 0.1);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  cursor: pointer;
}
.btn-sm.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Layout */
.main-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Store Tabs Navigation Bar */
.store-tabs-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-glow);
  border-radius: 16px;
  padding: 10px 16px;
  overflow-x: auto;
}

.store-tabs-list {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  overflow-x: auto;
}

.store-config-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.store-config-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  padding: 14px 18px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.store-config-card:hover {
  border-color: var(--primary);
  border-left: 4px solid #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15);
}

.store-card-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.store-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-input-group label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .icon-left {
  position: absolute;
  left: 12px;
  color: #64748b;
  font-size: 13px;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-with-icon input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 9px 12px 9px 34px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.input-with-icon input:focus {
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.btn-remove-store {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fb7185;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
}

.btn-remove-store:hover {
  background: #f43f5e;
  border-color: #f43f5e;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.4);
}

.btn-add-store-dashed {
  width: 100%;
  padding: 12px;
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.04);
  color: #38bdf8;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-add-store-dashed:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
}

.store-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.store-tab:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--primary);
  color: #fff;
}

.store-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.store-tab-settings {
  margin-left: auto;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--glass-border);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-glow);
  box-shadow: var(--shadow-glow);
}

.spend-card::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.commission-card::before { background: linear-gradient(90deg, #38bdf8, #818cf8); }
.profit-card::before { background: linear-gradient(90deg, #10b981, #34d399); }
.koc-card::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.kpi-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.spend-card .kpi-icon { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
.commission-card .kpi-icon { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.profit-card .kpi-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.koc-card .kpi-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.kpi-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.kpi-subtext {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-danger { background: rgba(244, 63, 94, 0.2); color: #fb7185; }

.clickable-status {
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.clickable-status:hover {
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Charts Section */
.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

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

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.chart-header h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* Filter Control Bar */
.control-bar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.search-box, .select-box, .date-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text-muted);
  transition: var(--transition);
}

.search-box:focus-within, .select-box:focus-within, .date-picker-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  width: 220px;
}

.select-box select, .date-picker-group input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
}

.select-box select option {
  background: #0f172a;
  color: #fff;
}

.date-picker-group span {
  font-size: 12px;
  color: var(--text-dim);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Overall Summary Bar (Ô Báo Cáo Phía Trên) */
.overall-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-glow);
  border-radius: 16px;
  padding: 16px 20px;
}

.summary-widget {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
}

.summary-widget:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.widget-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.widget-val {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.highlight-spend { border-color: rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.08); }
.highlight-profit { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); }
.highlight-roi { border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.08); }

.val-positive { color: #34d399 !important; }
.val-negative { color: #fb7185 !important; }

/* Dropzone */
.dropzone-container {
  display: none;
  margin-top: -8px;
}

.dropzone-container.active {
  display: block;
}

.dropzone {
  background: rgba(15, 23, 42, 0.9);
  border: 2px dashed var(--primary);
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.dropzone.dragover {
  background: rgba(56, 189, 248, 0.1);
  border-color: #fff;
}

.dropzone-icon {
  font-size: 42px;
  color: var(--primary);
}

.dropzone h3 {
  font-size: 16px;
  font-weight: 600;
}

.dropzone p {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 460px;
}

/* Matrix Table Section */
.table-section {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.table-title h2 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: inline-block;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.green { background-color: var(--accent-emerald); }
.legend-dot.red { background-color: var(--accent-rose); }

/* Table Wrapper & Matrix Table */
.matrix-table-wrapper {
  overflow-x: auto;
  max-height: 600px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  position: relative;
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  white-space: nowrap;
}

.matrix-table th, .matrix-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-table th {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 20;
}

.matrix-table tbody tr:hover td {
  background-color: rgba(56, 189, 248, 0.05);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--glass-border-glow);
  border-radius: 18px;
  width: 100%;
  max-width: 580px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.sync-logs {
  background: #020617;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px;
  font-family: monospace;
  font-size: 11px;
  color: #38bdf8;
  height: 100px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* User Profile Header Widget */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px 14px;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-email-label {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
}

.role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.role-badge.user {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.btn-logout {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #f43f5e;
  color: #fff;
}

/* Login Overlay Modal */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.login-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-card-header {
  text-align: center;
}

.login-card-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.login-card-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.auth-btn-group {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.auth-btn-group button {
  flex: 1;
  padding: 12px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 10px;
}

/* MOBILE & TABLET RESPONSIVE MEDIA QUERIES */
@media (max-width: 900px) {
  .top-header {
    position: relative;
    top: auto;
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .header-actions {
    justify-content: space-between;
  }

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

  .control-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box input {
    width: 100%;
  }

  .select-box select, .date-picker-group {
    width: 100%;
    justify-content: space-between;
  }

  .action-group {
    width: 100%;
    justify-content: space-between;
  }

  .action-group button {
    flex: 1;
  }
}

@media (max-width: 600px) {
  .main-container {
    padding: 14px;
    gap: 16px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .user-profile-widget {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .user-info-text {
    align-items: flex-start;
  }

  .modal-card {
    padding: 16px;
    border-radius: 14px;
  }

  .matrix-table th, .matrix-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
}
