/* ═══════════════════════════════════════════════════════════════════════════
   PRIVASEE® Enterprise Design System v1.0
   "Architectural Slate" — modern international SaaS palette
   Inter typography, 8px grid, soft elevation
   ═══════════════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* ── BRAND PALETTE ─────────────────────────────────── */
  --bg:            #F7F9FC;
  --bg-2:          #EEF2F8;
  --surface:       #FFFFFF;
  --surface-2:     #FAFBFD;

  --ink:           #0F1F3A;   /* primary text + headlines */
  --ink-2:         #475569;   /* secondary text */
  --muted:         #94A3B8;   /* captions + placeholders */
  --line:          #E5E9F0;   /* borders */
  --line-2:        #D7DEEA;   /* stronger dividers */

  --brand:         #2563EB;   /* primary action */
  --brand-2:       #1D4ED8;   /* hover */
  --brand-soft:    #EEF4FF;   /* tint backgrounds */
  --brand-ring:    rgba(37, 99, 235, 0.18);

  --success:       #047857;
  --success-soft:  #ECFDF5;
  --warning:       #B45309;
  --warning-soft:  #FFFBEB;
  --danger:        #B91C1C;
  --danger-soft:   #FEF2F2;
  --info:          #0369A1;
  --info-soft:     #EFF6FF;

  --header-bg:     #0B1628;   /* deep architectural navy */
  --header-bg-2:   #0F1F3A;
  --header-ink:    #E5EAF2;
  --header-muted:  rgba(229, 234, 242, 0.6);

  /* ── TYPE SCALE ────────────────────────────────────── */
  --font-sans:     'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, "SF Mono", Menlo, monospace;

  --t-12: 12px;
  --t-13: 13px;
  --t-14: 14px;
  --t-16: 16px;
  --t-18: 18px;
  --t-22: 22px;
  --t-28: 28px;
  --t-36: 36px;
  --t-48: 48px;
  --t-60: 60px;

  /* ── SPACING (8px base) ────────────────────────────── */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;

  /* ── RADIUS ────────────────────────────────────────── */
  --r-sm:  4px;
  --r:     8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-pill: 999px;

  /* ── ELEVATION (ink-tinted, calm) ──────────────────── */
  --sh-sm:   0 1px 2px rgba(15,31,58,0.06);
  --sh:      0 1px 3px rgba(15,31,58,0.08), 0 1px 2px rgba(15,31,58,0.04);
  --sh-md:   0 4px 12px rgba(15,31,58,0.08), 0 2px 4px rgba(15,31,58,0.04);
  --sh-lg:   0 12px 32px rgba(15,31,58,0.10), 0 4px 8px rgba(15,31,58,0.04);
  --sh-xl:   0 24px 64px rgba(15,31,58,0.14), 0 8px 16px rgba(15,31,58,0.06);

  /* ── MOTION ────────────────────────────────────────── */
  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur:         180ms;
  --dur-slow:    320ms;
}

/* ═══════════════ RESET & BASE ═══════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-14);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: var(--brand); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4, h5 { font-family: var(--font-sans); color: var(--ink); margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: var(--t-36); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: var(--t-28); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: var(--t-22); font-weight: 600; }
h4 { font-size: var(--t-18); font-weight: 600; }
h5 { font-size: var(--t-16); font-weight: 600; }
p  { margin: 0 0 var(--s-3); color: var(--ink-2); }
small { font-size: var(--t-12); color: var(--muted); }
code, pre, kbd { font-family: var(--font-mono); font-size: 92%; }

/* ═══════════════ LAYOUT ═══════════════ */
.ds-shell { min-height: 100vh; display: flex; flex-direction: column; }
.ds-container { max-width: 1400px; margin: 0 auto; padding: 0 var(--s-5); }
.ds-grid { display: grid; gap: var(--s-4); }

/* ═══════════════ TOP NAV ═══════════════ */
.ds-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  color: var(--header-ink);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: saturate(180%) blur(8px);
}
.ds-nav-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 var(--s-5);
  display: flex; align-items: center; gap: var(--s-5); height: 64px;
}
.ds-brand { display: flex; align-items: center; gap: var(--s-3); font-weight: 700; letter-spacing: 0.01em; }
.ds-brand-mark {
  width: 36px; height: 36px; border-radius: var(--r);
  background: linear-gradient(135deg, #1E40AF, #2563EB);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: var(--t-14); letter-spacing: -0.02em;
}
.ds-brand-text { font-size: var(--t-16); }
.ds-brand-sub  { font-size: var(--t-12); color: var(--header-muted); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.ds-nav-links { display: flex; gap: var(--s-1); margin-left: var(--s-5); }
.ds-nav-link {
  padding: 8px 12px; border-radius: var(--r); font-size: var(--t-13); font-weight: 500;
  color: var(--header-muted); transition: all var(--dur) var(--ease);
}
.ds-nav-link:hover { color: var(--header-ink); background: rgba(255,255,255,0.05); }
.ds-nav-link.active { color: var(--header-ink); background: rgba(255,255,255,0.08); }
.ds-nav-spacer { flex: 1; }
.ds-nav-meta { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-13); color: var(--header-muted); }
.ds-nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 4px rgba(52,211,153,0.18); }

/* ═══════════════ HERO (PREMIUM) ═══════════════ */
.ds-hero {
  position: relative; overflow: hidden;
  background: var(--header-bg);
  color: var(--header-ink);
  padding: var(--s-8) 0 var(--s-9);
}
.ds-hero::before {
  /* subtle architectural grid lines (very faint) */
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
.ds-hero::after {
  /* premium glow */
  content: ""; position: absolute; top: -40%; left: 50%; transform: translateX(-50%);
  width: 1200px; height: 1200px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(37, 99, 235, 0.20), transparent 55%);
  pointer-events: none;
}
.ds-hero-inner { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 0 var(--s-5); }

.ds-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 6px 12px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: var(--t-12); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(229,234,242,0.85);
}
.ds-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: #34D399; box-shadow: 0 0 8px rgba(52,211,153,0.5); animation: dsPulse 2s ease-in-out infinite; }
@keyframes dsPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.ds-hero h1 {
  color: #fff; font-size: clamp(var(--t-36), 5vw, var(--t-60));
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
  margin: var(--s-4) 0 var(--s-4); max-width: 900px;
}
.ds-hero h1 .accent {
  background: linear-gradient(135deg, #60A5FA 0%, #2563EB 60%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ds-hero-sub {
  font-size: var(--t-18); color: rgba(229,234,242,0.7); max-width: 700px;
  margin: 0 0 var(--s-7); line-height: 1.6;
}

.ds-hero-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-3); margin-top: var(--s-6);
}
.ds-kpi {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md); padding: var(--s-4);
  backdrop-filter: blur(8px);
  transition: all var(--dur) var(--ease);
}
.ds-kpi:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); transform: translateY(-1px); }
.ds-kpi-label { font-size: var(--t-12); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(229,234,242,0.55); margin-bottom: var(--s-2); }
.ds-kpi-value { font-size: var(--t-28); font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ds-kpi-unit  { font-size: var(--t-13); font-weight: 500; color: rgba(229,234,242,0.55); margin-left: 4px; }
.ds-kpi-meta  { font-size: var(--t-12); color: rgba(229,234,242,0.5); margin-top: 6px; }
.ds-kpi-trend { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-12); font-weight: 600; }
.ds-kpi-trend.up    { color: #6EE7B7; }
.ds-kpi-trend.down  { color: #FCA5A5; }
.ds-kpi-trend.flat  { color: rgba(229,234,242,0.6); }

/* ═══════════════ SECTIONS ═══════════════ */
.ds-section { padding: var(--s-8) 0; }
.ds-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); flex-wrap: wrap; }
.ds-section-title { display: block; font-size: var(--t-28); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.ds-section-sub { font-size: var(--t-14); color: var(--ink-2); margin-top: 4px; max-width: 600px; }
.ds-section-meta { font-size: var(--t-12); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ═══════════════ CARDS ═══════════════ */
.ds-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-5);
  transition: all var(--dur) var(--ease);
}
.ds-card.elevated { box-shadow: var(--sh); }
.ds-card.hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-lg);
  border-color: var(--line-2);
}

/* App tile grid */
.ds-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-4);
}
.ds-tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-5);
  text-decoration: none;
  color: var(--ink);
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.ds-tile::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.ds-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-lg);
  border-color: rgba(37, 99, 235, 0.25);
}
.ds-tile:hover::before { opacity: 1; }
.ds-tile-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-3);
}
.ds-tile-icon {
  width: 40px; height: 40px; border-radius: var(--r);
  background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.ds-tile-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: var(--r-sm);
  background: var(--bg-2); color: var(--ink-2);
}
.ds-tile-badge.new   { background: var(--success-soft); color: var(--success); }
.ds-tile-badge.live  { background: rgba(37, 99, 235, 0.10); color: var(--brand); }
.ds-tile-badge.beta  { background: var(--warning-soft); color: var(--warning); }
.ds-tile-badge.legacy { background: var(--bg-2); color: var(--muted); }
.ds-tile h3 { font-size: var(--t-18); font-weight: 600; margin-bottom: var(--s-2); color: var(--ink); }
.ds-tile p  { font-size: var(--t-13); color: var(--ink-2); margin: 0 0 var(--s-4); line-height: 1.5; }
.ds-tile-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--s-3); border-top: 1px solid var(--line);
}
.ds-tile-stat { font-size: var(--t-12); color: var(--muted); }
.ds-tile-stat b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ds-tile-cta {
  font-size: var(--t-13); font-weight: 600; color: var(--brand);
  display: inline-flex; align-items: center; gap: 4px;
}
.ds-tile-cta .arr { transition: transform var(--dur) var(--ease); }
.ds-tile:hover .ds-tile-cta .arr { transform: translateX(3px); }

/* ═══════════════ BUTTONS ═══════════════ */
.ds-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r); border: 1px solid transparent;
  font-family: var(--font-sans); font-size: var(--t-13); font-weight: 600;
  cursor: pointer; transition: all var(--dur) var(--ease);
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.ds-btn:hover { background: var(--bg-2); border-color: var(--line-2); }
.ds-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.ds-btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.ds-btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.ds-btn.success { background: var(--success); color: #fff; border-color: var(--success); }
.ds-btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.ds-btn.ghost:hover { background: var(--bg-2); color: var(--ink); }
.ds-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ds-btn.sm { padding: 6px 10px; font-size: var(--t-12); }
.ds-btn.lg { padding: 12px 20px; font-size: var(--t-14); }

/* ═══════════════ TABLES ═══════════════ */
.ds-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-13); }
.ds-table th, .ds-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.ds-table th { font-size: var(--t-12); font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; background: var(--surface-2); }
.ds-table tbody tr { transition: background var(--dur) var(--ease); }
.ds-table tbody tr:hover { background: var(--bg-2); }
.ds-table td { color: var(--ink); font-variant-numeric: tabular-nums; }
.ds-table .r { text-align: right; }
.ds-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }

/* ═══════════════ FORMS ═══════════════ */
.ds-field { margin-bottom: var(--s-4); }
.ds-label { display: block; font-size: var(--t-13); font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.ds-input, .ds-select, .ds-textarea {
  width: 100%; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--font-sans); font-size: var(--t-14); color: var(--ink);
  transition: all var(--dur) var(--ease);
}
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.ds-input::placeholder { color: var(--muted); }
.ds-help { font-size: var(--t-12); color: var(--muted); margin-top: 4px; }

/* ═══════════════ BADGES ═══════════════ */
.ds-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-pill);
  font-size: var(--t-12); font-weight: 600;
}
.ds-badge.success { background: var(--success-soft); color: var(--success); }
.ds-badge.warning { background: var(--warning-soft); color: var(--warning); }
.ds-badge.danger  { background: var(--danger-soft); color: var(--danger); }
.ds-badge.info    { background: var(--info-soft); color: var(--info); }
.ds-badge.neutral { background: var(--bg-2); color: var(--ink-2); }

/* ═══════════════ EMPTY / LOADING ═══════════════ */
.ds-empty {
  text-align: center; padding: var(--s-8) var(--s-5);
  color: var(--muted);
}
.ds-empty-icon { font-size: 36px; opacity: 0.4; margin-bottom: var(--s-3); }
.ds-empty-title { font-size: var(--t-16); font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.ds-loading-bar {
  height: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent);
  background-size: 200% 100%; animation: dsLoad 1.4s ease-in-out infinite;
}
@keyframes dsLoad { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }
.ds-skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg) 50%, var(--bg-2) 75%);
  background-size: 200% 100%; animation: dsShimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm); display: block;
}
@keyframes dsShimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* ═══════════════ MODAL ═══════════════ */
.ds-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 31, 58, 0.45);
  backdrop-filter: blur(4px); z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
}
.ds-modal {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  max-width: 640px; width: 100%; max-height: calc(100vh - 80px); overflow-y: auto;
  animation: dsModalIn var(--dur-slow) var(--ease);
}
@keyframes dsModalIn { from{ opacity: 0; transform: translateY(20px) scale(0.97);} to{ opacity: 1; transform: translateY(0) scale(1);} }
.ds-modal-head {
  padding: var(--s-5); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.ds-modal-title { font-size: var(--t-18); font-weight: 600; color: var(--ink); }
.ds-modal-body { padding: var(--s-5); }
.ds-modal-foot { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: var(--s-2); }

/* ═══════════════ FOOTER ═══════════════ */
.ds-footer {
  margin-top: auto; padding: var(--s-6) 0 var(--s-7);
  background: var(--surface); border-top: 1px solid var(--line);
  color: var(--muted); font-size: var(--t-13);
}
.ds-footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); }
.ds-footer a { color: var(--ink-2); }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 1024px) {
  .ds-nav-links { display: none; }
  .ds-hero { padding: var(--s-7) 0 var(--s-7); }
}
@media (max-width: 640px) {
  :root { --t-36: 28px; --t-28: 22px; }
  .ds-container, .ds-hero-inner, .ds-nav-inner { padding: 0 var(--s-4); }
  .ds-section { padding: var(--s-6) 0; }
  .ds-hero { padding: var(--s-6) 0; }
  .ds-tile-grid { grid-template-columns: 1fr; }
  .ds-hero-kpis { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════ RTL (Arabic) ═══════════════ */
[dir="rtl"] .ds-tile-cta .arr { transform: scaleX(-1); }
[dir="rtl"] .ds-tile:hover .ds-tile-cta .arr { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .ds-nav-links { margin-left: 0; margin-right: var(--s-5); }
