:root {
  --bg: #f4f7fb;
  --bg-2: #eef3ff;
  --panel: rgba(255,255,255,.94);
  --panel-soft: #fff7f1;
  --panel-ink: #111827;
  --ink: #132238;
  --muted: #6f7d95;
  --line: #e4eaf4;
  --orange: #ff6a00;
  --orange-2: #ff8b2a;
  --orange-soft: #fff0e6;
  --green: #12b76a;
  --green-soft: #dcfae6;
  --blue: #2f80ed;
  --blue-soft: #e8f1ff;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --shadow: 0 20px 45px rgba(16, 24, 40, .10);
  --shadow-strong: 0 24px 65px rgba(16, 24, 40, .14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,0)),
    radial-gradient(circle at top right, rgba(255,154,87,.16), transparent 34rem),
    radial-gradient(circle at top left, rgba(47,128,237,.10), transparent 32rem),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--ink);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
::selection { background: rgba(255,106,0,.16); color: var(--ink); }

.shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px);
  border-left: 1px solid rgba(228,234,244,.85);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.7);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 900; font-size: 26px; color: var(--orange);
  letter-spacing: 0;
}
.login-brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.login-brand {
  align-items: center;
}
.sidebar-brand {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(228,234,244,.8);
}
.sidebar-brand.compact { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  flex: none;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .16);
  object-fit: contain;
}
.brand-logo.small {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(16, 24, 40, .10);
}
.brand-mark {
  width: 50px; height: 50px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--orange), var(--orange-2));
  color: #fff; box-shadow: 0 14px 32px rgba(255,106,0,.24);
}
.nav { margin-top: 34px; display: grid; gap: 10px; }
.nav button {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 16px; border-radius: 16px;
  background: transparent; color: #7f8da7; font-weight: 800;
  transition: transform .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
.nav button:hover { transform: translateX(-2px); background: rgba(255,255,255,.72); color: var(--ink); }
.nav button.active {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  box-shadow: 0 12px 26px rgba(255,106,0,.24);
}
.main { padding: 30px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 22px;
  padding: 2px 2px 10px;
}
.title h1 { margin: 0; font-size: 30px; }
.title p { margin: 6px 0 0; color: var(--muted); font-weight: 700; line-height: 1.6; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  background: rgba(255,255,255,.82); border: 1px solid rgba(228,234,244,.95); color: var(--muted); font-weight: 800;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}
.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid rgba(228,234,244,.9);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-strong); border-color: rgba(255,106,0,.12); }
.card h2 { margin: 0 0 14px; }
.stat { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.stat-icon {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #fff3ea, #fff7f1);
  color: var(--orange);
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,106,0,.06);
}
.stat b { display: block; font-size: 30px; margin-bottom: 4px; letter-spacing: 0; }
.stat span { color: var(--muted); font-weight: 800; }
.section { display: none; }
.section.active { display: block; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin: 22px 0 14px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff; font-weight: 900;
  box-shadow: 0 14px 28px rgba(255,106,0,.18);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(255,106,0,.22); }
.btn.secondary { background: linear-gradient(180deg, #f4f7fc, #eef2f8); color: var(--ink); box-shadow: none; border: 1px solid rgba(228,234,244,.95); }
.btn.green { background: linear-gradient(135deg, #14c27a, var(--green)); }
.btn.red { background: linear-gradient(135deg, #feecec, var(--red-soft)); color: var(--red); box-shadow: none; }
.input {
  width: 100%; border: 1px solid rgba(226,232,240,.95); border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfcfe); color: var(--ink);
  padding: 13px 14px; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255,106,0,.10); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(228,234,244,.9);
  background: rgba(255,255,255,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 14px 16px; border-bottom: 1px solid rgba(228,234,244,.85); text-align: right; white-space: nowrap; }
th { color: #60708a; background: linear-gradient(180deg, #fbfcfe, #f6f8fc); font-size: 13px; }
td { font-weight: 700; }
.status { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.status.active, .status.online { color: #067647; background: #dcfae6; }
.status.disabled, .status.offline { color: #b42318; background: #fee4e2; }
.status.expired { color: #b54708; background: #fef0c7; }
.status.queued { color: #7c3aed; background: #ede9fe; }
.status.sent { color: #067647; background: #dcfae6; }
.status.failed { color: #b42318; background: #fee4e2; }
.actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(30px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 170px;
  padding-top: 12px;
}
.bar {
  min-height: 38px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(255,106,0,.18);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.detail-tile {
  background: linear-gradient(180deg, #fbfcfe, #f8fafc);
  border: 1px solid rgba(228,234,244,.9);
  border-radius: 18px;
  padding: 14px;
}
.detail-tile span { color: var(--muted); font-size: 13px; font-weight: 800; }
.detail-tile b { display: block; margin-top: 6px; font-size: 20px; }
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal {
  position: fixed; inset: 0; background: rgba(18,32,51,.38);
  display: none; align-items: center; justify-content: center; padding: 18px; z-index: 50;
  backdrop-filter: blur(8px);
}
.modal.open { display: flex; }
.modal-box {
  width: min(760px, 100%); max-height: 90vh; overflow: auto;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94));
  border-radius: 26px; padding: 24px; box-shadow: var(--shadow-strong);
  border: 1px solid rgba(255,255,255,.7);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 0; }
.close { width: 42px; height: 42px; border-radius: 50%; background: #f1f5f9; font-size: 22px; color: var(--ink); }
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.login-card { width: min(460px, 100%); }
.login-card h1 { margin-top: 18px; }
.login-card .login-brand .brand { font-size: 24px; }
.login-card .login-brand .muted { font-size: 13px; line-height: 1.45; }
.hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #172033 56%, #ff6a00 140%);
  color: #fff; border: 0;
  box-shadow: 0 22px 52px rgba(15,23,42,.18);
}
.hero-card p { color: rgba(255,255,255,.78); }
.customer-layout { max-width: 1120px; margin: 0 auto; padding: 24px; }
.customer-hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; align-items: stretch; }
.usage-ring {
  min-height: 220px; border-radius: 26px;
  background: linear-gradient(145deg, #fff, #fff7f1);
  display: grid; place-items: center; text-align: center;
  border: 1px solid rgba(228,234,244,.92);
  box-shadow: var(--shadow);
}
.usage-ring b { font-size: 44px; color: var(--orange); }
.muted { color: var(--muted); }
.toast {
  position: fixed; bottom: 18px; left: 18px;
  background: #111827; color: #fff; padding: 12px 16px; border-radius: 14px;
  box-shadow: var(--shadow); display: none; z-index: 90;
}
.toast.show { display: block; }

.sidebar .brand span:last-child,
.topbar .title h1,
.card h2,
.detail-tile b,
.stat b,
.hero-card h1,
.customer-layout .brand span:last-child {
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; border-left: 0; border-bottom: 1px solid var(--line); }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .customer-hero { grid-template-columns: 1fr; }
  .detail-grid, .split { grid-template-columns: 1fr; }
  .mini-chart { grid-template-columns: repeat(7, minmax(30px, 1fr)); }
  .main { padding: 18px; }
}

@media (max-width: 600px) {
  .title h1 { font-size: 24px; }
  .brand { font-size: 22px; }
  .card { padding: 18px; border-radius: 22px; }
  .btn { width: auto; }
  .toolbar { align-items: stretch; }
  .brand-logo { width: 58px; height: 58px; border-radius: 18px; }
.brand-logo.small { width: 42px; height: 42px; border-radius: 14px; }
}
