/* ================================================================
   Prisma T — Design System v1.0
   Inspired by Zaha Hadid: parametric forms, fluid geometry,
   angular precision, layered transparency
   4 Themes × 3 Languages
   ================================================================ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&family=Cairo:wght@300;400;500;600;700;900&family=Tajawal:wght@300;400;500;700;900&display=swap');

/* ================================================================
   THEME 1 — OBSIDIAN (داكن ذهبي)
   Deep black + gold accents — luxury precision
   ================================================================ */
[data-theme="obsidian"] {
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #111118;
  --bg-tertiary:   #1a1a24;
  --bg-card:       #14141e;
  --bg-hover:      #1e1e2c;
  --bg-glass:      rgba(20, 20, 30, 0.85);

  --accent-1:      #c9a84c;   /* gold */
  --accent-2:      #e8c96d;   /* light gold */
  --accent-3:      #8b5cf6;   /* purple */
  --accent-danger: #ef4444;
  --accent-success:#10b981;
  --accent-warn:   #f59e0b;
  --accent-info:   #3b82f6;

  --text-primary:  #f0ede6;
  --text-secondary:#a09880;
  --text-muted:    #5a5548;
  --text-inverse:  #0a0a0f;

  --border-1:      rgba(201,168,76,0.15);
  --border-2:      rgba(201,168,76,0.08);
  --border-focus:  rgba(201,168,76,0.6);

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg:     0 24px 64px rgba(0,0,0,0.8);
  --shadow-glow:   0 0 30px rgba(201,168,76,0.15);

  --sidebar-w:     260px;
  --header-h:      64px;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #1a1020 50%, #0a0a0f 100%);
  --gradient-card: linear-gradient(145deg, rgba(201,168,76,0.05) 0%, transparent 60%);
  --gradient-accent: linear-gradient(135deg, #c9a84c, #8b5cf6);
  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ================================================================
   THEME 2 — ARCTIC (فاتح طبي)
   Pure white + clinical blue — sterile precision
   ================================================================ */
[data-theme="arctic"] {
  --bg-primary:    #f8f9fc;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #eef1f8;
  --bg-card:       #ffffff;
  --bg-hover:      #f0f3fa;
  --bg-glass:      rgba(255,255,255,0.92);

  --accent-1:      #1e40af;
  --accent-2:      #3b82f6;
  --accent-3:      #06b6d4;
  --accent-danger: #dc2626;
  --accent-success:#059669;
  --accent-warn:   #d97706;
  --accent-info:   #2563eb;

  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --text-inverse:  #ffffff;

  --border-1:      rgba(30,64,175,0.15);
  --border-2:      rgba(30,64,175,0.07);
  --border-focus:  rgba(30,64,175,0.5);

  --shadow-sm:     0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:     0 16px 48px rgba(0,0,0,0.12);
  --shadow-glow:   0 0 20px rgba(30,64,175,0.12);

  --sidebar-w:     260px;
  --header-h:      64px;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --gradient-hero: linear-gradient(135deg, #f8f9fc 0%, #eef3ff 100%);
  --gradient-card: linear-gradient(145deg, rgba(30,64,175,0.04) 0%, transparent 60%);
  --gradient-accent: linear-gradient(135deg, #1e40af, #06b6d4);
  --noise: none;
}

/* ================================================================
   THEME 3 — PLASMA (داكن طبي أزرق)
   Deep navy + electric cyan — medical futurism
   ================================================================ */
[data-theme="plasma"] {
  --bg-primary:    #050d1a;
  --bg-secondary:  #0a1628;
  --bg-tertiary:   #0f1f38;
  --bg-card:       #0c1930;
  --bg-hover:      #122040;
  --bg-glass:      rgba(10,22,40,0.88);

  --accent-1:      #00d4ff;
  --accent-2:      #38bdf8;
  --accent-3:      #a78bfa;
  --accent-danger: #f87171;
  --accent-success:#34d399;
  --accent-warn:   #fbbf24;
  --accent-info:   #60a5fa;

  --text-primary:  #e2f4ff;
  --text-secondary:#7ab8d4;
  --text-muted:    #3a6080;
  --text-inverse:  #050d1a;

  --border-1:      rgba(0,212,255,0.15);
  --border-2:      rgba(0,212,255,0.06);
  --border-focus:  rgba(0,212,255,0.5);

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.7);
  --shadow-lg:     0 24px 64px rgba(0,0,0,0.85);
  --shadow-glow:   0 0 40px rgba(0,212,255,0.2);

  --sidebar-w:     260px;
  --header-h:      64px;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --gradient-hero: linear-gradient(135deg, #050d1a 0%, #0a1f35 50%, #050d1a 100%);
  --gradient-card: linear-gradient(145deg, rgba(0,212,255,0.06) 0%, transparent 60%);
  --gradient-accent: linear-gradient(135deg, #00d4ff, #a78bfa);
  --noise: none;
}

/* ================================================================
   THEME 4 — CRIMSON (جريء أحمر)
   Near-black + crimson red — bold authority
   ================================================================ */
[data-theme="crimson"] {
  --bg-primary:    #080808;
  --bg-secondary:  #101010;
  --bg-tertiary:   #181818;
  --bg-card:       #0e0e0e;
  --bg-hover:      #1c1c1c;
  --bg-glass:      rgba(14,14,14,0.9);

  --accent-1:      #e11d48;
  --accent-2:      #fb7185;
  --accent-3:      #f97316;
  --accent-danger: #ef4444;
  --accent-success:#22c55e;
  --accent-warn:   #eab308;
  --accent-info:   #38bdf8;

  --text-primary:  #f5f5f5;
  --text-secondary:#888888;
  --text-muted:    #444444;
  --text-inverse:  #080808;

  --border-1:      rgba(225,29,72,0.2);
  --border-2:      rgba(225,29,72,0.08);
  --border-focus:  rgba(225,29,72,0.6);

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.7);
  --shadow-lg:     0 24px 64px rgba(0,0,0,0.9);
  --shadow-glow:   0 0 30px rgba(225,29,72,0.2);

  --sidebar-w:     260px;
  --header-h:      64px;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --gradient-hero: linear-gradient(135deg, #080808 0%, #180810 50%, #080808 100%);
  --gradient-card: linear-gradient(145deg, rgba(225,29,72,0.06) 0%, transparent 60%);
  --gradient-accent: linear-gradient(135deg, #e11d48, #f97316);
  --noise: none;
}

/* ================================================================
   BASE STYLES — تطبق على كل الثيمات
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* ── Typography ───────────────────────────────────────────────── */
[dir="ltr"] body, [dir="ltr"] * {
  font-family: 'Syne', 'Space Mono', monospace;
}
[dir="rtl"] body, [dir="rtl"] * {
  font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-1); }

/* ── Layout Shell ─────────────────────────────────────────────── */
.pt-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
}

.pt-shell.sidebar-collapsed {
  grid-template-columns: 64px 1fr;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.pt-sidebar {
  grid-row: 1 / -1;
  background: var(--bg-secondary);
  border-inline-end: 1px solid var(--border-2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);

  /* Zaha Hadid diagonal accent line */
  background-image:
    linear-gradient(
      160deg,
      transparent 0%,
      transparent 40%,
      rgba(var(--accent-rgb,201,168,76), 0.03) 40%,
      rgba(var(--accent-rgb,201,168,76), 0.03) 100%
    );
}

.pt-logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-2);
  gap: 12px;
  flex-shrink: 0;
}

.pt-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--gradient-accent);
  clip-path: polygon(0 20%, 100% 0%, 100% 80%, 0% 100%);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.pt-logo-mark:hover { transform: skewX(-5deg) scale(1.05); }

.pt-logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  overflow: hidden;
}

.pt-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.pt-nav-group {
  margin-bottom: 8px;
}

.pt-nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 20px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.pt-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  border: none;
  background: none;
  width: 100%;
  text-align: start;
}

.pt-nav-item::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--accent-1);
  opacity: 0;
  transform: scaleY(0);
  transition: all 0.2s ease;
  clip-path: polygon(0 10%, 100% 0%, 100% 100%, 0% 90%);
}

.pt-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.pt-nav-item.active {
  color: var(--accent-1);
  background: linear-gradient(90deg, rgba(var(--accent-rgb,201,168,76),0.08) 0%, transparent 100%);
}

.pt-nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.pt-nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.pt-nav-badge {
  margin-inline-start: auto;
  background: var(--accent-1);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ── Header ───────────────────────────────────────────────────── */
.pt-header {
  grid-column: 2;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;

  /* Diagonal accent */
  background-image: linear-gradient(
    170deg,
    transparent 0%, transparent 60%,
    rgba(var(--accent-rgb,201,168,76),0.02) 60%
  );
}

.pt-header-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.pt-header-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-header-spacer { flex: 1; }

.pt-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Main Content ─────────────────────────────────────────────── */
.pt-main {
  grid-column: 2;
  background: var(--bg-primary);
  min-height: calc(100vh - var(--header-h));
  padding: 24px;
  overflow-y: auto;
}

/* ── Cards ────────────────────────────────────────────────────── */
.pt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  background-image: var(--gradient-card);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pt-card::after {
  content: '';
  position: absolute;
  top: -1px;
  inset-inline-start: 20px;
  width: 40px;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pt-card:hover {
  border-color: var(--border-1);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-1px);
}

.pt-card:hover::after { opacity: 1; }

.pt-card-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pt-stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.pt-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.pt-stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pt-stat-trend.up { color: var(--accent-success); }
.pt-stat-trend.down { color: var(--accent-danger); }

/* ── Buttons ──────────────────────────────────────────────────── */
.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.pt-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pt-btn:hover::before { opacity: 1; }

.pt-btn-primary {
  background: var(--gradient-accent);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.pt-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.pt-btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-1);
}

.pt-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-2);
}

.pt-btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-1);
  background: var(--bg-hover);
}

.pt-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.pt-btn-sm { padding: 6px 14px; font-size: 12px; }
.pt-btn-lg { padding: 14px 28px; font-size: 15px; }

/* ── Forms ────────────────────────────────────────────────────── */
.pt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pt-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.pt-label.required::after {
  content: ' *';
  color: var(--accent-danger);
}

.pt-input, .pt-select, .pt-textarea {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s ease;
  width: 100%;
  outline: none;
  font-family: inherit;
}

.pt-input:hover, .pt-select:hover {
  border-color: var(--border-1);
}

.pt-input:focus, .pt-select:focus, .pt-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb,201,168,76), 0.1);
  background: var(--bg-card);
}

.pt-input::placeholder { color: var(--text-muted); }

.pt-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.pt-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.pt-input-group .pt-input {
  padding-inline-start: 40px;
}

.pt-input-icon {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

/* ── Tables ───────────────────────────────────────────────────── */
.pt-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-2);
}

.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pt-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 16px;
  text-align: start;
  border-bottom: 1px solid var(--border-2);
  white-space: nowrap;
}

.pt-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-2);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.pt-table tbody tr {
  transition: background 0.15s ease;
  cursor: pointer;
}

.pt-table tbody tr:hover { background: var(--bg-hover); }

/* ── Badges / Status ──────────────────────────────────────────── */
.pt-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.pt-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.pt-badge-success { background: rgba(16,185,129,0.12); color: var(--accent-success); }
.pt-badge-danger  { background: rgba(239,68,68,0.12);  color: var(--accent-danger);  }
.pt-badge-warn    { background: rgba(245,158,11,0.12); color: var(--accent-warn);    }
.pt-badge-info    { background: rgba(59,130,246,0.12); color: var(--accent-info);    }
.pt-badge-muted   { background: rgba(148,163,184,0.1); color: var(--text-secondary); }
.pt-badge-accent  { background: rgba(var(--accent-rgb,201,168,76),0.12); color: var(--accent-1); }

/* ── Modal ────────────────────────────────────────────────────── */
.pt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pt-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
  backdrop-filter: blur(6px);
}

.pt-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  background-image: var(--gradient-card);

  /* Zaha Hadid top accent */
  border-top: 2px solid transparent;
  border-image: var(--gradient-accent) 1;
}

.pt-modal-overlay.open .pt-modal {
  transform: scale(1) translateY(0);
}

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

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

.pt-modal-body { padding: 20px 24px; }
.pt-modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Grid layouts ─────────────────────────────────────────────── */
.pt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pt-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.pt-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.pt-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }

@media (max-width: 1024px) {
  .pt-grid-4 { grid-template-columns: 1fr 1fr; }
  .pt-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .pt-grid-2, .pt-grid-3, .pt-grid-4 { grid-template-columns: 1fr; }
  .pt-shell { grid-template-columns: 1fr; }
  .pt-sidebar { display: none; }
  .pt-header, .pt-main { grid-column: 1; }
}

/* ── Toast Notifications ─────────────────────────────────────── */
.pt-toasts {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.pt-toast {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  max-width: 320px;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  border-inline-start: 3px solid var(--accent-1);
}

.pt-toast.show { transform: translateX(0); }

/* ── Divider ──────────────────────────────────────────────────── */
.pt-divider {
  height: 1px;
  background: var(--border-2);
  margin: 16px 0;
}

.pt-divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pt-divider-text::before, .pt-divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-2);
}

/* ── Loading skeleton ─────────────────────────────────────────── */
.pt-skeleton {
  background: linear-gradient(90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Utility ──────────────────────────────────────────────────── */
.pt-flex { display: flex; align-items: center; }
.pt-flex-between { display: flex; align-items: center; justify-content: space-between; }
.pt-gap-1 { gap: 4px; }
.pt-gap-2 { gap: 8px; }
.pt-gap-3 { gap: 12px; }
.pt-gap-4 { gap: 16px; }
.pt-mt-1 { margin-top: 8px; }
.pt-mt-2 { margin-top: 16px; }
.pt-mt-3 { margin-top: 24px; }
.pt-mb-1 { margin-bottom: 8px; }
.pt-mb-2 { margin-bottom: 16px; }
.pt-mb-3 { margin-bottom: 24px; }
.pt-text-sm { font-size: 12px; }
.pt-text-muted { color: var(--text-muted); }
.pt-text-accent { color: var(--accent-1); }
.pt-text-success { color: var(--accent-success); }
.pt-text-danger { color: var(--accent-danger); }
.pt-bold { font-weight: 700; }
.pt-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Zaha Hadid geometric decorations ────────────────────────── */
.pt-geo-accent {
  position: relative;
}

.pt-geo-accent::before {
  content: '';
  position: absolute;
  top: 0; inset-inline-end: 0;
  width: 40%;
  height: 3px;
  background: var(--gradient-accent);
  clip-path: polygon(10% 0%, 100% 0%, 100% 100%, 0% 100%);
}

/* Animated accent line */
@keyframes accent-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.pt-page-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-2);
  position: relative;
}

.pt-page-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  inset-inline-start: 0;
  width: 80px;
  height: 2px;
  background: var(--gradient-accent);
  clip-path: polygon(0 0, 100% 0, 90% 100%, 0 100%);
}

.pt-page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.pt-page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================================
   THEME 5 — PRISMA CLEAR (فاتح احترافي)
   Light clinical theme + gold accent — unified "Royal" identity
   ================================================================ */
[data-theme="prisma-clear"] {
  /* Background layers */
  --bg-app:        #F4F5FA;
  --bg-primary:    #F4F5FA;
  --bg-surface:    #FFFFFF;
  --bg-secondary:  #FFFFFF;
  --bg-subtle:     #F0F2F8;
  --bg-tertiary:   #F0F2F8;
  --bg-card:       #FFFFFF;
  --bg-hover:      #F0F2F8;
  --bg-glass:      rgba(255,255,255,0.95);

  /* Sidebar and topbar — light chrome, consistent with surfaces */
  --sidebar-bg:    var(--bg-surface);
  --topbar-bg:     var(--bg-surface);

  /* Gold accent system */
  --accent:        #c9a84c;
  --accent-strong: #b8973f;
  --accent-soft:   rgba(201,168,76,0.12);
  --accent-subtle: rgba(201,168,76,0.12);
  --accent-1:      #c9a84c;
  --accent-2:      #8b5cf6;    /* purple, rare secondary */
  --accent-3:      #8b5cf6;
  --accent2:       #8b5cf6;

  /* Semantic colors (clinical — never change) */
  --ok:            #059669;
  --warn:          #D97706;
  --danger:        #DC2626;
  --info:          #2563EB;
  --accent-success:#059669;
  --accent-warn:   #D97706;
  --accent-danger: #DC2626;
  --accent-info:   #2563EB;

  /* Text hierarchy */
  --text-1:        #1A1D35;
  --text-2:        #4A5180;
  --text-3:        #8892B0;
  --text-primary:  #1A1D35;
  --text-secondary:#4A5180;
  --text-muted:    #8892B0;
  --text-inverse:  #FFFFFF;

  /* Borders */
  --border:        #E2E5F0;
  --border-1:      #E2E5F0;
  --border-2:      #E2E5F0;
  --border-strong: #C5C9E0;
  --border-focus:  rgba(201,168,76,0.6);

  /* Shadows and glow */
  --sh-sm:         0 1px 3px rgba(0,0,0,0.06);
  --sh-md:         0 4px 16px rgba(0,0,0,0.08);
  --glow:          0 0 0 3px rgba(201,168,76,0.25);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:     0 12px 24px rgba(0,0,0,0.10);
  --shadow-glow:   0 0 20px rgba(201,168,76,0.18);

  /* Radii */
  --r-sm:          6px;
  --r-md:          10px;
  --r-lg:          16px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     20px;

  /* Layout dimensions */
  --sidebar-w:     260px;
  --header-h:      64px;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #F4F5FA 0%, #FFFFFF 100%);
  --gradient-card: linear-gradient(145deg, rgba(201,168,76,0.05) 0%, transparent 60%);
  --gradient-accent: linear-gradient(135deg, #c9a84c, #8b5cf6);

  /* Fonts (as per brief) */
  --font-arabic:   'Tajawal', 'Cairo', -apple-system, sans-serif;
  --font-english:  'Syne', -apple-system, sans-serif;
  --font-mono:     'Space Mono', monospace;
  --font-display:  'Syne';
}
