/* super-admin.css - Styles dashboard super admin */

body.super-admin {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gradient-green);
  color: #333;
  min-height: 100vh;
  padding: 14px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  -webkit-user-select: auto;
  user-select: auto;
  caret-color: auto;
  cursor: auto;
}

.container {
  width: min(1280px, 100%);
  margin: 0 auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 30px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.1rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid #e0e0e0;
  flex-wrap: wrap;
  gap: 14px;
}

.header-actions {
  display: flex;
  gap: 0.3rem;
}

h1 {
  color: #2a5298;
  font-size: 1.7rem;
}

/* Buttons */
.btn {
  padding: 0.4rem 0.6rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-primary {
  background: #2a5298;
  color: white;
}

.btn-primary:hover {
  background: #1e3c72;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #d5edff;
}

.form-field {
  display: block;
  margin: 0.3rem 0;
}

.input-wide {
  width: 100%;
  max-width: 600px;
}

.input-medium {
  width: 100%;
  max-width: 400px;
}

.mt-15 {
  margin-top: 0.6rem;
}

.warning-text {
  color: #d9534f;
  font-weight: bold;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 0.4rem;
  padding: 1rem;
  width: min(520px, 92vw);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.modal h3 {
  margin-bottom: 0.4rem;
  color: #2a5298;
}

.modal p {
  margin-bottom: 0.3rem;
  color: #333;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #2a5298;
  transition: width 0.2s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #444;
}

.hidden {
  display: none;
}

/* Tabs Navigation */
.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.92rem;
  color: #6c757d;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #2a5298;
}

.tab-btn.active {
  color: #2a5298;
  border-bottom-color: #2a5298;
  font-weight: bold;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h2 {
  margin-bottom: 0.6rem;
  color: #2a5298;
  font-size: 1.35rem;
}

.tab-content h3 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  color: #333;
  font-size: 1.08rem;
}

.tab-content h4 {
  margin-top: 0.6rem;
  margin-bottom: 0.3rem;
  font-size: 0.96rem;
}

/* Stats Grid (4 cards) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--gradient-green);
  color: white;
  padding: 0.5rem;
  border-radius: 0.5rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.stat-card h3 {
  font-size: 2.1rem;
  margin-bottom: 0.2rem;
  color: white;
}

.stat-card p {
  font-size: 0.92rem;
  opacity: 0.9;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.data-table thead {
  background: #2a5298;
  color: white;
}

.data-table th,
.data-table td {
  padding: 0.2rem 0.3rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

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

/* Performance Grid */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.perf-card {
  background: #e3f1ff;
  padding: 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid #d7dee8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.perf-card h4 {
  font-size: 0.88rem;
  color: #6c757d;
  margin-bottom: 0.2rem;
}

.perf-card p {
  font-size: 1.3rem;
  font-weight: bold;
  color: #2a5298;
  margin-bottom: 0.1rem;
}

.perf-card small {
  color: #6c757d;
  font-size: 0.78rem;
}

.analytics-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.live-status {
  font-weight: 600;
  font-size: 0.94rem;
  color: #2a5298;
}

.live-generated {
  font-size: 0.82rem;
  color: #6c757d;
}

.live-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.alert-chip-neutral {
  background: #f1f3f5;
  color: #6c757d;
  border-color: #dfe3e8;
}

.alert-chip-ok {
  background: #ecfdf3;
  color: #146c43;
  border-color: #b7ebcd;
}

.alert-chip-warn {
  background: #fff8e1;
  color: #8a6d1f;
  border-color: #f1dd9b;
}

.alert-chip-critical {
  background: #fdeaea;
  color: #8b1f2d;
  border-color: #f1b2bc;
}

/* Export Button */
#exportCsvBtn {
  margin-top: 12px;
}

/* Security Tab - Filter Controls */
.filter-controls {
  margin-bottom: 0.5rem;
  padding: 0.3rem;
  background: #f8f9fa;
  border-radius: 0.5rem;
}

.filter-controls label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.filter-controls input[type="checkbox"] {
  width: 0.8rem;
  height: 0.8rem;
  cursor: pointer;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.4rem;
  border-radius: 0.4rem;
  font-size: 0.78rem;
  font-weight: bold;
}

.badge-resolved {
  background: #d4edda;
  color: #155724;
}

.badge-pending {
  background: #fff3cd;
  color: #856404;
}

.badge-critical {
  background: #f8d7da;
  color: #721c24;
}

.badge-error {
  background: #f8d7da;
  color: #721c24;
}

.badge-warn {
  background: #fff3cd;
  color: #856404;
}

.status-resolved {
  color: #28a745;
  font-weight: bold;
}

.status-pending {
  color: #ffc107;
  font-weight: bold;
}

/* Small buttons */
.btn-small {
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  background: #2a5298;
  color: white;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-small:hover {
  background: #1e3c72;
}

.btn-small.btn-danger {
  background: #dc3545;
  margin-left: 0.4rem;
}

.btn-small.btn-danger:hover {
  background: #c82333;
}

.btn-sm.btn-danger {
  background: #dc3545;
  margin-left: 0.4rem;
}

.btn-sm.btn-danger:hover {
  background: #c82333;
}

/* Responsive */
@media (max-width: 768px) {
  body.super-admin {
    padding: 0.4rem;
  }

  .container {
    padding: 0.8rem;
  }

  h1 {
    font-size: 1.45rem;
  }

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

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

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .tab-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.88rem;
  }
}
