/* ==========================================================================
   ELECTRO LIVE TECH ADMIN & STAFF MANAGEMENT SYSTEM — ELEGANT SLATE THEME
   ========================================================================== */

:root {
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: #2563eb;
  --sidebar-active-text: #ffffff;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-accent: #0284c7;
  
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.08);
  --success-border: rgba(22, 163, 74, 0.2);
  
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --warning-border: rgba(217, 119, 6, 0.2);
  
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --danger-border: rgba(220, 38, 38, 0.2);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 30px -10px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base Layout */
#admin-app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Navigation */
.admin-sidebar {
  width: 270px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

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

.admin-brand img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin: 16px 8px 6px 8px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease-in-out;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--sidebar-text);
  stroke-width: 1.75;
  fill: none;
  transition: stroke 0.15s ease-in-out;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: #f8fafc;
}

.nav-item:hover svg {
  stroke: #f8fafc;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-item.active svg {
  stroke: #ffffff;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-main);
}

.admin-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 18px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.admin-topbar h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.admin-topbar p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-content-area {
  padding: 32px 36px;
  flex: 1;
  overflow-y: auto;
}

/* Metrics Grid & Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

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

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

.metric-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-subtle);
  color: var(--brand-primary);
}

.metric-icon-box svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.metric-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Responsive Screen-Fit Table Containers */
.admin-content-area {
  padding: 20px 24px;
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
}

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: auto;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.80rem;
}

.admin-table th {
  background: #f8fafc;
  padding: 9px 10px;
  color: #475569;
  font-weight: 700;
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1.5px solid var(--border-light);
  white-space: nowrap;
}

.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
  font-size: 0.80rem;
}

.admin-table th.actions-col, .admin-table td.actions-cell {
  text-align: right;
  white-space: nowrap;
  padding-right: 12px;
}

.action-btns-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

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

.admin-table tr:hover td {
  background: #f1f5f9;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-new {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge-confirmed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-in-progress {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-cancelled {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

/* Buttons */
.btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
  outline: none;
}

.btn-admin svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.btn-admin-primary {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-admin-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-admin-secondary {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-admin-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-admin-danger {
  background: #ffffff;
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn-admin-danger:hover {
  background: var(--danger-bg);
}

.btn-icon-only {
  padding: 8px;
  border-radius: 6px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
}

.btn-icon-only:hover {
  background: var(--border-subtle);
  color: var(--text-main);
}

/* Modals */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeIn 0.15s ease-out;
}

.admin-modal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tab Navigation */
.editor-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.editor-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.editor-tab:hover {
  color: var(--brand-accent);
}

.editor-tab.active {
  color: var(--brand-accent);
  border-bottom-color: var(--brand-accent);
}

/* Form Inputs & Controls */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Sidebar Smooth Transition & Drawer Layout */
.admin-sidebar {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin-left 0.3s ease, opacity 0.2s ease;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.hidden {
  display: none !important;
  opacity: 0;
}

@media (max-width: 868px) {
  #admin-app {
    position: relative;
    overflow-x: hidden;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 1100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(0);
    overflow-y: auto;
  }

  .admin-sidebar.collapsed {
    transform: translateX(-100%) !important;
    display: flex !important;
  }

  .admin-topbar {
    padding: 14px 18px;
  }

  .admin-content-area {
    padding: 18px;
  }
}

@media (min-width: 869px) {
  .admin-sidebar.collapsed {
    display: none !important;
  }
}

/* ==========================================================================
   INTERACTIVE VISUAL FOOTER SIMULATOR & LIVE EDITOR STYLES
   ========================================================================== */
.footer-simulator-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  padding: 24px;
}

.footer-simulator-canvas {
  border-radius: 12px;
  padding: 32px 24px 20px 24px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.footer-sim-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .footer-sim-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .footer-sim-grid {
    grid-template-columns: 1fr;
  }
}

.footer-sim-col {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 16px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.footer-sim-col:hover {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.04);
}

.footer-sim-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.footer-sim-heading-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

.footer-sim-link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-sim-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.83rem;
  transition: all 0.15s ease;
}

.footer-sim-link-item:hover {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.3);
}

.footer-sim-link-text {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.footer-sim-link-url {
  font-size: 0.72rem;
  opacity: 0.7;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.footer-sim-action-group {
  display: flex;
  gap: 4px;
  align-items: center;
}

.footer-sim-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  transition: background 0.15s ease;
  line-height: 1;
}

.footer-sim-icon-btn:hover {
  background: rgba(2, 132, 199, 0.2);
}

.footer-sim-icon-btn-danger:hover {
  background: rgba(220, 38, 38, 0.2);
}

.footer-sim-btn-add {
  margin-top: 10px;
  width: 100%;
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  border: 1px dashed #0284c7;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.footer-sim-btn-add:hover {
  background: #0284c7;
  color: #ffffff;
}

.footer-sim-bottom-bar {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}

.admin-view-content h2 svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.seo-header-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.seo-health-large-badge {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 22px;
  border-radius: 12px;
}

.seo-health-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: #22c55e;
  line-height: 1;
}

.seo-subnav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.seo-subnav-btn {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.seo-subnav-btn:hover {
  color: var(--brand-primary);
  background: var(--border-subtle);
}

.seo-subnav-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background: #ffffff;
}

.seo-grid-editor {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

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

.seo-serp-preview {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  font-family: Arial, sans-serif;
}

.seo-serp-title {
  color: #1a0dab;
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 2px;
  cursor: pointer;
  word-break: break-word;
}

.seo-serp-title:hover {
  text-decoration: underline;
}

.seo-serp-url {
  color: #202124;
  font-size: 0.82rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.seo-serp-desc {
  color: #4d5156;
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
}

.seo-score-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.seo-score-bar-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.seo-score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.bg-score-green { background: #22c55e; }
.bg-score-yellow { background: #eab308; }
.bg-score-orange { background: #f97316; }
.bg-score-red { background: #ef4444; }

.seo-issue-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-primary);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.seo-issue-critical { border-left-color: #ef4444; background: #fef2f2; }
.seo-issue-warning { border-left-color: #f97316; background: #fff7ed; }
.seo-issue-info { border-left-color: #3b82f6; background: #eff6ff; }