@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  /* متغیرهای رنگی اختصاصی کاردیولوژی */
  --bg-main: #fff5f7;
  --bg-card: #ffffff;
  --primary: #800e2e;
  --primary-light: #a31c42;
  --primary-soft: #fce8ed;
  --accent-pink: #f72585;
  --text-dark: #2b1810;
  --text-muted: #8c7a6b;
  --border-color: #f7d6de;
  --shadow-sm: 0 4px 15px rgba(128, 14, 46, 0.05);
  --shadow-hover: 0 8px 25px rgba(128, 14, 46, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-dark);
  direction: rtl;
  min-height: 100vh;
}

/* ساختار کلی چیدمان صفحه */
.layout {
  display: flex;
  min-height: 100vh;
}

/* سایدبار مدیریت و ناوبری */
.sidebar {
  width: 260px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary);
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-color);
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: var(--primary-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-copy b {
  display: block;
  font-size: 16px;
  color: var(--primary);
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 11px;
}

.side-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

/* تاپ بار بالای داشبورد */
.topbar {
  padding: 16px 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eyebrow {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.top-title strong {
  color: var(--primary);
  font-size: 18px;
}

.user-badge {
  background: var(--primary-soft);
  border: 1px solid var(--border-color);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(247, 37, 133, 0.3);
}

.logout-btn {
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--primary) !important;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: var(--primary);
  color: #fff !important;
}

.content {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* بنر خوش‌آمدگویی و تاریخ */
.welcome {
  background: linear-gradient(135deg, #ffffff 0%, #fff0f3 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.welcome-kicker {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-pink);
  border-radius: 50%;
}

.welcome h1 {
  color: var(--primary);
  font-size: 22px;
  margin-bottom: 4px;
}

.welcome p {
  color: var(--text-muted);
  font-size: 13px;
}

.date-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.date-box span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.date-box b {
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
}

/* کارت‌های آماری سیستم */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.stat-icon-svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  background: var(--primary-soft);
  border-radius: 10px;
  color: var(--primary);
}

.stat-card strong {
  display: block;
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 6px;
}

.stat-card small {
  color: var(--text-muted);
  font-size: 12px;
}

/* چیدمان دوتایی پایین صفحه */
.lower-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-head h2 {
  font-size: 16px;
  color: var(--primary);
}

.panel-head p {
  font-size: 12px;
  color: var(--text-muted);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap th {
  text-align: right;
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.table-wrap td {
  padding: 14px 12px;
  font-size: 13px;
  border-bottom: 1px solid #fcf0f3;
}

.quick-action {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  text-decoration: none;
}

.quick-action:hover {
  background: var(--primary-soft);
  border-color: var(--primary-light);
  transform: translateX(-4px);
}

.quick-icon-svg {
  width: 32px;
  height: 32px;
  padding: 6px;
  background: var(--primary-soft);
  border-radius: 8px;
  color: var(--primary);
}

.quick-action b {
  display: block;
  font-size: 13px;
  color: var(--primary);
}

.quick-action small {
  font-size: 11px;
  color: var(--text-muted);
}

.footer {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
}

/* بنر راهنمای نصب PWA در iOS */
.ios-install-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: 20px;
  max-width: 420px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(128, 14, 46, 0.15);
  z-index: 9999;
  display: none;
  animation: slideUp 0.4s ease-out forwards;
}

@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ios-install-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ios-install-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ios-install-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
}

.ios-install-steps {
  font-size: 12px;
  color: var(--text-dark);
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ios-install-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ios-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
}

.ios-dismiss-btn {
  margin-top: 12px;
  width: 100%;
  padding: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 900px) {
  .lower-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
