/* cloudflare/admin/dist/style.css - Modern Responsive Admin Dashboard Styling */

:root {
  --bg-main: #0f1117;
  --bg-card: #181b24;
  --bg-sidebar: #13151d;
  --border-color: #262a36;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-primary: #fe2c55;
  --accent-primary-hover: #e0264b;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.brand-icon {
  background: var(--accent-primary);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-btn.active {
  background: rgba(254, 44, 85, 0.12);
  color: var(--accent-primary);
  font-weight: 600;
}

.badge {
  margin-left: auto;
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 700;
}

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

.auth-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-indicator-dot.online {
  background: var(--accent-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.topbar-title-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title-section h1 {
  font-size: 20px;
  font-weight: 700;
}

.env-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success);
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.content-container {
  padding: 28px 32px;
  flex: 1;
}

.tab-pane {
  display: none;
}

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

/* Metrics Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.metric-card.success {
  border-left: 4px solid var(--accent-success);
}

.metric-card.warning {
  border-left: 4px solid var(--accent-warning);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

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

.metric-value {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.metric-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Sections & Cards */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mt-4 {
  margin-top: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  font-size: 16px;
  font-weight: 700;
}

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

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

.card-body {
  padding: 20px 24px;
  overflow-x: auto;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

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

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

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

.btn-primary:hover {
  background: var(--accent-primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-success { background: var(--accent-success); color: white; }
.btn-danger { background: var(--accent-danger); color: white; }

.form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 240px;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Status Badges */
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-tag.online, .status-tag.approved, .status-tag.published, .status-tag.applied {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success);
}

.status-tag.offline, .status-tag.draft {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
}

.status-tag.pending, .status-tag.queued {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
}

.status-tag.revoked, .status-tag.failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 520px;
  max-width: 90vw;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}

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

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

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* Progress Bars & Upload UI */
.progress-container {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #1f2937;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.progress-fill.success {
  background: var(--accent-success);
}

.progress-fill.total {
  background: #3b82f6;
}

.modal-box-wide {
  width: 640px !important;
}
