:root {
  --bg: #0d1117;
  --sidebar: #161b22;
  --card: #1c2128;
  --border: #30363d;
  --primary: #14b8a6;
  --primary-hover: #0d9488;
  --text: #8b949e;
  --text-light: #e6edf3;
  --text-muted: #484f58;
  --success: #3fb950;
  --danger: #f85149;
  --warning: #d29922;
  --info: #58a6ff;
  --sidebar-w: 250px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; direction: rtl; }

a { color: inherit; text-decoration: none; }

/* Layout */
.sidebar {
  position: fixed; top: 0; right: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px; border-bottom: 1px solid var(--border);
}
.logo-star { font-size: 24px; }
.logo-title { font-size: 15px; font-weight: 700; color: var(--text-light); }
.logo-sub { font-size: 11px; color: var(--text-muted); }
nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; color: var(--text);
  transition: all .15s; border-right: 3px solid transparent;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text-light); }
.nav-item.active { background: rgba(20,184,166,.1); color: var(--primary); border-right-color: var(--primary); }
.nav-badge {
  margin-right: auto; background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
}
.nav-badge-danger { background: var(--danger); }
.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { color: var(--text-muted); padding: 4px; }
.logout-btn:hover { color: var(--danger); }

/* Main */
.main-wrap { margin-right: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-light); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.main-content { flex: 1; padding: 24px; max-width: 1100px; width: 100%; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--text-light); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 500;
  border: none; cursor: pointer; transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-light); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.btn-link { font-size: 12px; color: var(--primary); }
.btn-link:hover { text-decoration: underline; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.mt-2 { margin-top: 8px; }

/* Badges */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.badge-success { background: rgba(63,185,80,.15); color: var(--success); }
.badge-danger  { background: rgba(248,81,73,.15); color: var(--danger); }
.badge-warning { background: rgba(210,153,34,.15); color: var(--warning); }
.badge-info    { background: rgba(88,166,255,.15); color: var(--info); }
.badge-primary { background: rgba(20,184,166,.15); color: var(--primary); }
.badge-muted   { background: rgba(139,148,158,.12); color: var(--text); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-light); font-weight: 500; }
.form-control {
  width: 100%; padding: 9px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-light); font-size: 13px; transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-control:disabled { opacity: .5; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; transition: opacity .5s; }
.alert-success { background: rgba(63,185,80,.12); border: 1px solid rgba(63,185,80,.3); color: var(--success); }
.alert-danger  { background: rgba(248,81,73,.12); border: 1px solid rgba(248,81,73,.3); color: var(--danger); }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--text-light); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* List Items */
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  transition: background .1s; cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(255,255,255,.03); }
.list-item-lg { padding: 16px 20px; }
.list-item-main { flex: 1; }
.list-item-title { font-size: 14px; font-weight: 600; color: var(--text-light); }
.list-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.list-item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.amount { font-size: 13px; font-weight: 700; color: var(--primary); }

/* Progress */
.progress { background: rgba(255,255,255,.06); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.progress-mini { width: 60px; height: 4px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.progress-mini-bar { height: 100%; background: var(--primary); border-radius: 2px; }

/* Info Rows */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-muted); }
.info-row strong { color: var(--text-light); }

/* Welcome Banner */
.welcome-banner { background: linear-gradient(135deg,rgba(20,184,166,.15),rgba(20,184,166,.03)); border: 1px solid rgba(20,184,166,.2); border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.welcome-banner h1 { font-size: 20px; color: var(--text-light); }
.welcome-banner p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Page Header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--text-light); }
.page-header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Empty State */
.empty-state { padding: 40px; text-align: center; color: var(--text-muted); }
.empty-state .icon { font-size: 36px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* Text helpers */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }

/* Login */
.login-bg { background: radial-gradient(ellipse at 50% 40%, rgba(20,184,166,.08) 0%, transparent 70%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.logo-star { font-size: 40px; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--text-light); margin-top: 8px; }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-footer { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); }

/* Print */
@media print {
  .sidebar, .topbar { display: none; }
  .main-wrap { margin-right: 0; }
  .main-content { padding: 0; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-wrap { margin-right: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
