/* ============================================================
   Cold Zone HVAC — Design System
   Brand: #007BBB · بنكي احترافي · RTL-first
   ============================================================ */

:root {
  /* ─── Brand Colors ─── */
  --cz-primary:        #007BBB;
  --cz-primary-dark:   #005a8a;
  --cz-primary-light:  #4a9fd1;
  --cz-primary-50:     #e6f3fa;
  --cz-primary-100:    #cce7f5;

  --cz-black:          #000000;
  --cz-gray:           #6D6E71;
  --cz-gray-light:     #9CA3AF;
  --cz-gray-lighter:   #E5E7EB;
  --cz-gray-bg:        #F9FAFB;
  --cz-white:          #FFFFFF;

  /* ─── Semantic Colors ─── */
  --cz-success:        #16A34A;
  --cz-success-bg:     #DCFCE7;
  --cz-warning:        #D97706;
  --cz-warning-bg:     #FEF3C7;
  --cz-danger:         #DC2626;
  --cz-danger-bg:      #FEE2E2;
  --cz-info:           #0EA5E9;
  --cz-info-bg:        #DBEAFE;

  /* ─── Spacing Scale (4px base) ─── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ─── Border Radius (Banking = Sharp) ─── */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  /* ─── Shadows ─── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);

  /* ─── Typography ─── */
  --font-sans: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;

  /* ─── Layout ─── */
  --topbar-h: 64px;
  --sidebar-w: 260px;
  --container-max: 1200px;

  /* ─── Transitions ─── */
  --t-fast: .15s ease;
  --t-base: .2s ease;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--cz-black);
  background: var(--cz-gray-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--cz-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.3; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p { margin: 0; }

/* ============================================================
   Topbar (Banking Header)
   ============================================================ */
.cz-topbar {
  height: var(--topbar-h);
  background: var(--cz-white);
  border-bottom: 1px solid var(--cz-gray-lighter);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 50;
}
.cz-topbar__brand {
  display: flex; align-items: center; gap: var(--space-3);
  font-weight: 700; color: var(--cz-primary); font-size: var(--text-md);
}
.cz-topbar__brand img { height: 36px; width: auto; }
.cz-topbar__nav {
  margin-inline-start: auto;
  display: flex; align-items: center; gap: var(--space-2);
}
.cz-topbar__link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  color: var(--cz-gray);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: var(--t-fast);
}
.cz-topbar__link:hover { background: var(--cz-gray-bg); color: var(--cz-black); text-decoration: none; }

/* ============================================================
   Container
   ============================================================ */
.cz-container { max-width: var(--container-max); margin: 0 auto; padding: var(--space-6); }
.cz-container--narrow { max-width: 720px; }
.cz-container--wide { max-width: 1400px; }

/* ============================================================
   Card
   ============================================================ */
.cz-card {
  background: var(--cz-white);
  border: 1px solid var(--cz-gray-lighter);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}
.cz-card--flat { box-shadow: none; }
.cz-card--shadow { box-shadow: var(--shadow-sm); border: 0; }
.cz-card__title {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--cz-gray-lighter);
}

/* ============================================================
   Buttons
   ============================================================ */
.cz-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--t-fast);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.cz-btn--primary {
  background: var(--cz-primary); color: var(--cz-white);
}
.cz-btn--primary:hover { background: var(--cz-primary-dark); text-decoration: none; }
.cz-btn--secondary {
  background: var(--cz-white); color: var(--cz-primary);
  border-color: var(--cz-primary);
}
.cz-btn--secondary:hover { background: var(--cz-primary-50); text-decoration: none; }
.cz-btn--ghost {
  background: transparent; color: var(--cz-gray);
  border-color: var(--cz-gray-lighter);
}
.cz-btn--ghost:hover { background: var(--cz-gray-bg); text-decoration: none; }
.cz-btn--success { background: var(--cz-success); color: var(--cz-white); }
.cz-btn--danger  { background: var(--cz-danger);  color: var(--cz-white); }
.cz-btn--lg { padding: 14px var(--space-6); font-size: var(--text-base); }
.cz-btn--sm { padding: 6px var(--space-3); font-size: var(--text-xs); }
.cz-btn--block { width: 100%; }
.cz-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   Forms
   ============================================================ */
.cz-field { margin-bottom: var(--space-4); }
.cz-label {
  display: block; font-size: var(--text-sm); font-weight: 600;
  color: var(--cz-gray); margin-bottom: var(--space-2);
}
.cz-input, .cz-select, .cz-textarea {
  width: 100%;
  padding: 10px var(--space-3);
  font-family: inherit;
  font-size: var(--text-base);
  border: 1px solid var(--cz-gray-lighter);
  border-radius: var(--radius);
  background: var(--cz-white);
  transition: var(--t-fast);
}
.cz-input:focus, .cz-select:focus, .cz-textarea:focus {
  outline: 0;
  border-color: var(--cz-primary);
  box-shadow: 0 0 0 3px rgba(0,123,187,.15);
}
.cz-textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   Badges
   ============================================================ */
.cz-badge {
  display: inline-flex; align-items: center;
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  background: var(--cz-gray-bg);
  color: var(--cz-gray);
}
.cz-badge--primary { background: var(--cz-primary-50); color: var(--cz-primary-dark); }
.cz-badge--success { background: var(--cz-success-bg); color: #14532d; }
.cz-badge--warning { background: var(--cz-warning-bg); color: #78350f; }
.cz-badge--danger  { background: var(--cz-danger-bg);  color: #7f1d1d; }
.cz-badge--info    { background: var(--cz-info-bg);    color: #1e3a8a; }

/* ============================================================
   Tables
   ============================================================ */
.cz-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.cz-table th, .cz-table td {
  padding: var(--space-3) var(--space-4);
  text-align: start;
  border-bottom: 1px solid var(--cz-gray-lighter);
}
.cz-table th {
  background: var(--cz-gray-bg);
  font-weight: 600;
  color: var(--cz-gray);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.cz-table tr:hover { background: var(--cz-primary-50); }

/* ============================================================
   Status Timeline
   ============================================================ */
.cz-timeline {
  display: flex; justify-content: space-between;
  margin: var(--space-6) 0; position: relative;
}
.cz-timeline::before {
  content: ''; position: absolute; top: 18px;
  inset-inline: 18px; height: 2px;
  background: var(--cz-gray-lighter); z-index: 0;
}
.cz-timeline__step { position: relative; text-align: center; flex: 1; z-index: 1; }
.cz-timeline__dot {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--cz-white); border: 2px solid var(--cz-gray-lighter);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; font-size: var(--text-sm); font-weight: 700;
  color: var(--cz-gray-light);
}
.cz-timeline__step--done .cz-timeline__dot {
  background: var(--cz-success); border-color: var(--cz-success);
  color: var(--cz-white);
}
.cz-timeline__step--active .cz-timeline__dot {
  background: var(--cz-primary); border-color: var(--cz-primary);
  color: var(--cz-white);
  box-shadow: 0 0 0 4px rgba(0,123,187,.2);
}
.cz-timeline__label {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--cz-gray);
  font-weight: 600;
}
.cz-timeline__step--done .cz-timeline__label,
.cz-timeline__step--active .cz-timeline__label { color: var(--cz-black); }

/* ============================================================
   Stats Cards
   ============================================================ */
.cz-stat {
  background: var(--cz-white);
  border: 1px solid var(--cz-gray-lighter);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
}
.cz-stat__value { font-size: var(--text-2xl); font-weight: 700; color: var(--cz-primary); }
.cz-stat__label { font-size: var(--text-xs); color: var(--cz-gray); margin-top: var(--space-1); }

/* ============================================================
   Hero Section
   ============================================================ */
.cz-hero {
  background: linear-gradient(135deg, var(--cz-primary) 0%, var(--cz-primary-dark) 100%);
  color: var(--cz-white);
  padding: var(--space-10) var(--space-6);
  text-align: center;
}
.cz-hero__logo { height: 90px; margin-bottom: var(--space-4); }
.cz-hero__title { font-size: var(--text-3xl); margin-bottom: var(--space-2); }
.cz-hero__subtitle { opacity: .9; font-size: var(--text-md); }

/* ============================================================
   Utilities
   ============================================================ */
.cz-text-center { text-align: center; }
.cz-text-muted  { color: var(--cz-gray); }
.cz-text-primary { color: var(--cz-primary); }
.cz-text-success { color: var(--cz-success); }
.cz-text-danger  { color: var(--cz-danger); }

.cz-mt-1 { margin-top: var(--space-1); }
.cz-mt-2 { margin-top: var(--space-2); }
.cz-mt-3 { margin-top: var(--space-3); }
.cz-mt-4 { margin-top: var(--space-4); }
.cz-mt-6 { margin-top: var(--space-6); }

.cz-mb-1 { margin-bottom: var(--space-1); }
.cz-mb-2 { margin-bottom: var(--space-2); }
.cz-mb-3 { margin-bottom: var(--space-3); }
.cz-mb-4 { margin-bottom: var(--space-4); }
.cz-mb-6 { margin-bottom: var(--space-6); }

.cz-grid { display: grid; gap: var(--space-4); }
.cz-grid--2 { grid-template-columns: repeat(2, 1fr); }
.cz-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cz-grid--4 { grid-template-columns: repeat(4, 1fr); }
.cz-grid--auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
@media (max-width: 640px) {
  .cz-grid--2, .cz-grid--3, .cz-grid--4 { grid-template-columns: 1fr; }
}

.cz-flex { display: flex; gap: var(--space-3); }
.cz-flex--between { justify-content: space-between; align-items: center; }
.cz-flex--center  { justify-content: center; align-items: center; }
.cz-flex--col     { flex-direction: column; }

/* ============================================================
   Print
   ============================================================ */
@media print {
  .cz-topbar, .cz-no-print { display: none !important; }
  body { background: var(--cz-white); }
  .cz-card { border: 1px solid var(--cz-gray-lighter); box-shadow: none; }
}
