/**
 * eStudio — Apple HIG White Theme Design System
 * Cybersecurity Threat Management Platform
 * Grounded in eSDSv1.md & eSDSv2.md
 * Powered by eShamikh
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Apple Pro Palette */
  --bg: #f5f5f7;
  --canvas: rgba(255, 255, 255, 0.7);
  --surface: rgba(255, 255, 255, 0.85);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --separator: rgba(0, 0, 0, 0.06);

  /* Typography Colors */
  --text-1: #1d1d1f;
  --text-2: #424245;
  --text-3: #6e6e73;
  --text-4: #86868b;

  /* Accents */
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: rgba(0, 113, 227, 0.08);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.1);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.1);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.08);
  --red-glow: rgba(255, 59, 48, 0.35);

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(0,0,0,0.04);
  --sh-sm: 0 2px 8px rgba(0,0,0,0.06);
  --sh-md: 0 8px 30px rgba(0,0,0,0.08);
  --sh-lg: 0 20px 60px -10px rgba(0,0,0,0.12);
  --sh-btn: 0 2px 8px rgba(0,113,227,0.25);
  --sh-btn-red: 0 2px 8px rgba(255,59,48,0.3);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 9999px;

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --canvas: rgba(28, 28, 30, 0.7);
    --surface: rgba(44, 44, 46, 0.85);
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --separator: rgba(255, 255, 255, 0.08);

    --text-1: #f5f5f7;
    --text-2: #ebebf5;
    --text-3: #ebebf599;
    --text-4: #ebebf566;

    --blue-soft: rgba(10, 132, 255, 0.15);
    --green-soft: rgba(48, 209, 88, 0.15);
    --orange-soft: rgba(255, 159, 10, 0.15);
    --red-soft: rgba(255, 69, 58, 0.15);

    --sh-xs: 0 1px 2px rgba(0,0,0,0.4);
    --sh-sm: 0 2px 8px rgba(0,0,0,0.6);
    --sh-md: 0 8px 30px rgba(0,0,0,0.8);
    --sh-lg: 0 20px 60px -10px rgba(0,0,0,0.9);
  }
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Antigravity Mesh Gradient & 3D Space */
  background: radial-gradient(circle at 15% 50%, rgba(0, 113, 227, 0.08), transparent 25%),
              radial-gradient(circle at 85% 30%, rgba(52, 199, 89, 0.08), transparent 25%),
              var(--bg);
  background-attachment: fixed;
  perspective: 1000px;
}

/* ============================================================
   FULLSCREEN LOADER (Min 2s Connection Screen)
   ============================================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}
.loader-lottie { width: 200px; height: 200px; }
.loader-title { font-size: 17px; font-weight: 700; color: var(--text-1); }
.loader-sub { font-size: 13px; color: var(--text-3); }

/* ============================================================
   NETWORK DISCONNECTED (في إنتظار الشبكة)
   ============================================================ */
#offline-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#offline-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.offline-lottie { width: 220px; height: 220px; }
.offline-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-1);
  direction: rtl;
  margin-top: 4px;
}
.offline-desc {
  font-size: 14px;
  color: var(--text-2);
  direction: rtl;
  max-width: 380px;
  margin-top: 6px;
}
.offline-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 6px 16px;
  background: rgba(0,0,0,0.04);
  border-radius: var(--r-full);
  font-size: 12px;
  color: var(--text-3);
}

/* ============================================================
   LOGIN VIEW
   ============================================================ */
.auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--canvas);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 44px 36px 36px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.05);
  transform-style: preserve-3d;
  will-change: transform;
}

.auth-logo {
  width: 48px;
  height: 48px;
  background: var(--text-1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.auth-logo svg { color: #fff; }

.auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

.auth-card .subtitle {
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
  margin: 6px 0 32px;
}

/* Form Elements */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-1);
  background: var(--canvas);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.input::placeholder { color: var(--text-4); }

.btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--sh-btn);
}
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 4px 14px rgba(0,113,227,0.35); }

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: var(--sh-btn-red);
}
.btn-danger:hover { box-shadow: 0 4px 14px rgba(255,59,48,0.45); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(0,0,0,0.03); border-color: var(--border-hover); }

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  width: auto;
}

.demo-accounts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.demo-pill {
  padding: 5px 10px;
  border-radius: var(--r-full);
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.demo-pill:hover {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: rgba(0,113,227,0.25);
}

.auth-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--separator);
  text-align: center;
  font-size: 12px;
  color: var(--text-4);
}

/* ============================================================
   PASSKEY MODAL (Red Fingerprint)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: var(--canvas);
  border-radius: var(--r-xl);
  max-width: 420px;
  width: 100%;
  padding: 40px 32px 32px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.2);
  transform: scale(0.95) translateY(8px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

.fingerprint-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--red-soft);
  border: 2px solid rgba(255,59,48,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  box-shadow: 0 0 24px var(--red-glow);
}
.fingerprint-icon svg { width: 44px; height: 44px; color: var(--red); }

.laser-line {
  position: absolute;
  left: 12%; right: 12%;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: laserScan 2s ease-in-out infinite alternate;
}
@keyframes laserScan {
  0%   { top: 18%; opacity: 0.25; }
  50%  { opacity: 1; }
  100% { top: 82%; opacity: 0.25; }
}

.modal-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}
.modal-card .modal-desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 20px;
}

.passkey-user-badge {
  background: var(--red-soft);
  border: 1px solid rgba(255,59,48,0.2);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 20px;
}

.passkey-status {
  font-size: 12px;
  color: var(--text-4);
  margin-top: 14px;
}

.passkey-error {
  font-size: 13px;
  color: var(--red);
  font-weight: 600;
  margin-top: 12px;
  display: none;
}

/* ============================================================
   SIDEBAR NAVIGATION (Expandable on Hover)
   ============================================================ */
.app-shell { display: none; min-height: 100vh; }
.app-shell.active { display: flex; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 68px;
  background: var(--canvas);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 10px;
  z-index: 500;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s;
}
.sidebar:hover {
  width: 240px;
  box-shadow: 4px 0 20px rgba(0,0,0,0.06);
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  text-decoration: none;
  color: var(--text-1);
  white-space: nowrap;
}
.sb-logo {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 10px;
  background: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-logo svg { color: #fff; width: 20px; height: 20px; }
.sb-name {
  font-size: 16px; font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar:hover .sb-name { opacity: 1; }

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin-top: 24px;
}

.sb-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.sb-btn:hover { background: rgba(0,0,0,0.04); color: var(--text-1); }
.sb-btn.active { background: var(--blue-soft); color: var(--blue); }

.sb-icon {
  width: 20px; height: 20px; min-width: 20px;
  display: flex; align-items: center; justify-content: center;
}
.sb-label { opacity: 0; transition: opacity 0.2s; }
.sidebar:hover .sb-label { opacity: 1; }

/* Sidebar Bottom */
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.02);
  white-space: nowrap;
}
.sb-avatar {
  width: 34px; height: 34px; min-width: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.sb-user-info { opacity: 0; transition: opacity 0.2s; }
.sidebar:hover .sb-user-info { opacity: 1; }
.sb-user-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
.sb-user-role { font-size: 11px; color: var(--text-4); }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
  margin-left: 68px;
  flex: 1;
  padding: 28px 36px;
  max-width: 1200px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title { font-size: 24px; font-weight: 700; color: var(--text-1); letter-spacing: -0.02em; }
.page-desc { font-size: 14px; color: var(--text-3); margin-top: 2px; }

/* ============================================================
   STAT CARDS ROW
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--canvas);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.stat-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}
.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.stat-value.blue { color: var(--blue); }
.stat-value.green { color: var(--green); }
.stat-value.orange { color: var(--orange); }

/* ============================================================
   THREAT REPORT CARDS
   ============================================================ */
.threat-card {
  background: var(--canvas);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.threat-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  border-color: var(--border-hover);
}

.tc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.tc-domain {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-meta {
  font-size: 12px;
  color: var(--text-4);
  margin-top: 2px;
}

/* Status badges */
.badge {
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-pending { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(255,159,10,0.3); }
.badge-reviewed { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(0,113,227,0.3); }
.badge-fixed { background: var(--green-soft); color: var(--green); border: 1px solid rgba(52,199,89,0.3); }

/* Individual threat items */
.threat-item {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin-top: 8px;
}
.ti-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.sev {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
}
.sev-high { background: rgba(255,59,48,0.12); color: var(--red); }
.sev-medium { background: rgba(255,159,10,0.12); color: var(--orange); }
.sev-info { background: rgba(0,113,227,0.12); color: var(--blue); }

.ti-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.ti-desc { font-size: 13px; color: var(--text-3); line-height: 1.45; }

.tc-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--separator);
  justify-content: flex-end;
}

/* ============================================================
   TABLE
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.data-table thead th {
  padding: 10px 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
  color: var(--text-2);
}
.data-table tbody tr:hover { background: rgba(0,0,0,0.015); }

.role-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  margin-right: 4px;
  margin-bottom: 2px;
}

/* ============================================================
   UPLOAD MODAL (Apple Sheet)
   ============================================================ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sheet-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.sheet {
  background: var(--canvas);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 30px 80px -12px rgba(0,0,0,0.2);
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sheet-backdrop.active .sheet {
  transform: translateY(0) scale(1);
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--separator);
  background: #fafafa;
}
.sheet-title { font-size: 16px; font-weight: 600; color: var(--text-1); }
.sheet-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.05);
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.sheet-close:hover { background: rgba(0,0,0,0.1); color: var(--text-1); }
.sheet-body { padding: 24px; }

textarea.input {
  min-height: 72px;
  padding: 12px 16px;
  resize: vertical;
  height: auto;
}

select.input {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ============================================================
   PROVISION CARD
   ============================================================ */
.provision-card {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--sh-xs);
}
.provision-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}
.provision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

/* Campaign cards */
.campaign-card {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow 0.2s;
}
.campaign-card:hover { box-shadow: var(--sh-sm); }

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--text-3);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-area {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  min-width: 280px;
  max-width: 380px;
  background: var(--canvas);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-1);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   VIEWS (hidden by default)
   ============================================================ */
.view { display: none; }
.view.active { display: block; }

/* ============================================================
   KANBAN BOARD (Orders View)
   ============================================================ */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 24px;
  min-height: 400px;
}
.kanban-column {
  flex: 0 0 280px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kanban-col-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-count {
  background: var(--border);
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
}
.order-card {
  background: var(--canvas);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  cursor: grab;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.order-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.order-card:active {
  cursor: grabbing;
}
.oc-header {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 4px;
}
.oc-service {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.4;
}
.oc-meta {
  font-size: 11px;
  color: var(--text-4);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
.oc-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--separator);
  padding-top: 10px;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .main-content { margin-left: 0; padding: 20px 16px; padding-top: 70px; }
  .sidebar { width: 100%; height: 60px; bottom: auto; flex-direction: row; padding: 0 12px; }
  .sidebar:hover { width: 100%; }
  .sb-nav { flex-direction: row; margin-top: 0; }
  .sb-label, .sb-name, .sb-user-info, .sb-user { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
