/* ═══════════════════════════════════════════
   MAPNA Dashboard — base.css
   فونت: Vazirmatn | جهت: RTL
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --card:      #1c2230;
  --card2:     #212840;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.13);
  --text:      #e6eaf4;
  --text2:     #8892aa;
  --text3:     #4a5268;
  --blue:      #3b82f6;
  --blue-dim:  rgba(59,130,246,0.12);
  --green:     #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --red:       #ef4444;
  --red-dim:   rgba(239,68,68,0.12);
  --amber:     #f59e0b;
  --amber-dim: rgba(245,158,11,0.12);
  --purple:    #8b5cf6;
  --teal:      #14b8a6;
  --nav-w:     230px;
  --top-h:     58px;
  --radius:    10px;
  --radius-lg: 14px;
  --font:      'Vazirmatn', system-ui, sans-serif;
  --shadow:    0 4px 24px rgba(0,0,0,0.35);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  letter-spacing: 0.4px; flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(59,130,246,0.4);
}

.logo-text { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }
.logo-sub  { font-size: 10px; color: var(--text3); margin-top: 1px; }

/* Nav sections */
.nav-section { padding: 8px 0; }
.nav-label {
  font-size: 10px; font-weight: 600; color: var(--text3);
  padding: 8px 18px 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 18px;
  cursor: pointer;
  border-right: 3px solid transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 400;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}

.nav-item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.nav-item.active {
  background: var(--blue-dim);
  color: var(--blue);
  border-right-color: var(--blue);
  font-weight: 500;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 14px;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
}

.sidebar-footer strong {
  display: block;
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0; right: var(--nav-w); left: 0;
  height: var(--top-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.topbar-left {}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-meta  { font-size: 11px; color: var(--text3); margin-top: 1px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px; font-weight: 500;
  border: 1px solid;
}
.status-badge.open {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(34,197,94,0.3);
}
.status-badge.closed {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; } 50% { opacity:0.4; }
}

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text2);
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--card2); color: var(--text); }
.icon-btn svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ── MAIN CONTENT ── */
.main {
  margin-right: var(--nav-w);
  padding-top: var(--top-h);
  min-height: 100vh;
}

.page {
  display: none;
  padding: 22px;
  animation: pageIn 0.2s ease;
}
.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 14px;
  z-index: 300;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.hamburger:hover { background: var(--card2); }
.hamburger svg {
  width: 18px; height: 18px;
  stroke: var(--text2); fill: none;
  stroke-width: 2; stroke-linecap: round;
  display: block;
}

.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.overlay.show { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-right: 0; }
  .topbar { right: 0; padding-right: 60px; }
  .hamburger { display: flex; }
}
@media (max-width: 520px) {
  .page { padding: 14px; }
  .topbar { padding: 0 14px 0 54px; }
}
