:root {
  --bg-body: #f5f7fb;
  --bg-soft: #eef4ff;
  --bg-dark-soft: #0d1320;

  --primary: #007aff;
  --primary-2: #2997ff;
  --primary-3: #5ac8fa;

  --success: #34c759;
  --warning: #ff9f0a;
  --danger: #ff3b30;

  --text-main: #111827;
  --text-sec: #6b7280;
  --text-light: #9ca3af;

  --card-bg: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);

  --line: rgba(17, 24, 39, 0.08);
  --line-strong: rgba(17, 24, 39, 0.14);

  --shadow-xs: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --container: 1240px;

  --sidebar-width: 280px;
  --header-height: 74px;
}

[data-theme="dark"] {
  --bg-body: #05070b;
  --bg-soft: #0b1020;
  --bg-dark-soft: #0a0f1d;

  --primary: #2997ff;
  --primary-2: #4db2ff;
  --primary-3: #76c7ff;

  --text-main: #f5f7fb;
  --text-sec: #9aa4b2;
  --text-light: #738093;

  --card-bg: rgba(15, 18, 28, 0.86);
  --card-solid: #10141f;
  --glass-bg: rgba(15, 18, 28, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 18px 45px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.42);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Cairo", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top right, rgba(41, 151, 255, 0.12), transparent 24%),
    radial-gradient(circle at bottom left, rgba(90, 200, 250, 0.1), transparent 22%),
    linear-gradient(180deg, var(--bg-soft), var(--bg-body));
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--transition);
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
}

input,
textarea,
select {
  outline: none;
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: rgba(0, 122, 255, 0.18);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.45);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 122, 255, 0.6);
}

.container {
  width: min(94%, var(--container));
  margin-inline: auto;
}

.page-shell {
  min-height: 100vh;
  padding: 28px 0;
}

.page-section {
  margin-bottom: 22px;
}

.hidden {
  display: none !important;
}

.text-muted {
  color: var(--text-sec);
}

.text-primary {
  color: var(--primary);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.card-surface {
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.section-subtitle {
  color: var(--text-sec);
  line-height: 1.9;
  font-size: 0.96rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-header-content h1 {
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 8px;
}

.page-header-content p {
  color: var(--text-sec);
  line-height: 1.9;
  font-size: 0.96rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .app-topbar {
  background: rgba(5, 7, 11, 0.72);
}

.topbar-inner {
  width: min(94%, var(--container));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--card-solid);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--line);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-size: 1rem;
  font-weight: 900;
  white-space: nowrap;
}

.brand-text span {
  font-size: 0.82rem;
  color: var(--text-sec);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
}

.status-badge.success {
  color: var(--success);
  border-color: rgba(52, 199, 89, 0.18);
  background: rgba(52, 199, 89, 0.08);
}

.status-badge.warning {
  color: var(--warning);
  border-color: rgba(255, 159, 10, 0.18);
  background: rgba(255, 159, 10, 0.08);
}

.status-badge.danger {
  color: var(--danger);
  border-color: rgba(255, 59, 48, 0.18);
  background: rgba(255, 59, 48, 0.08);
}

.status-badge.primary {
  color: var(--primary);
  border-color: rgba(0, 122, 255, 0.18);
  background: rgba(0, 122, 255, 0.08);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stack-12 > * + * {
  margin-top: 12px;
}

.stack-16 > * + * {
  margin-top: 16px;
}

.stack-20 > * + * {
  margin-top: 20px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}
