/* ====== Base ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
}

.app-body {
  font-family: 'Tajawal', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1d4ed8 0, #020617 40%, #000 100%);
  color: #e5e7eb;
  min-height: 100vh;
}

/* ====== Layout ====== */
.main-wrapper {
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.98);
  border-inline-end: 1px solid rgba(148, 163, 184, 0.35);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  color: #e5e7eb;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
}

.logo-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-sub {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Sidebar Menu */
.sidebar-menu {
  margin-top: 20px;
}

.sidebar-item + .sidebar-item {
  margin-top: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 0.75rem;
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.18s ease-in-out;
}

.sidebar-link .icon {
  width: 24px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-item.active .sidebar-link,
.sidebar-link:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.16));
  color: #e5e7eb;
}

.sidebar-item.active .sidebar-link {
  border: 1px solid rgba(59, 130, 246, 0.6);
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
  padding-top: 16px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.sidebar-user-name {
  max-width: 200px;
}

/* Content */
.content-wrapper {
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.24), transparent 50%),
              radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.22), transparent 60%),
              #020617;
}

/* Topbar */
.topbar {
  padding: 16px 24px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  background: linear-gradient(to left, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.8));
  position: sticky;
  top: 0;
  z-index: 5;
}

.page-title-text {
  color: #f9fafb;
}

.content-inner {
  padding: 20px 24px 32px;
}

/* Alerts */
.custom-alert {
  border-radius: 0.9rem;
  border: none;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.6);
}

/* ====== Cards & Stats ====== */
.card {
  border-radius: 1.1rem;
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), transparent 55%),
              rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(31, 41, 55, 0.9);
  color: #e5e7eb;
}

.card-header {
  border-bottom-color: rgba(55, 65, 81, 0.7);
  background: transparent;
}

.stat-card {
  border: none;
  position: relative;
  overflow: hidden;
  color: #f9fafb;
  padding: 16px 18px;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset-inline-end: -20px;
  bottom: -20px;
  width: 90px;
  height: 90px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.25);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: #e5e7eb;
  opacity: 0.85;
}

.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 800;
}

/* Colors للكروت */
.stat-card.total-customers {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}
.stat-card.active-subs {
  background: linear-gradient(135deg, #22c55e, #15803d);
}
.stat-card.soon-renew {
  background: linear-gradient(135deg, #f97316, #ea580c);
}
.stat-card.need-renew {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

/* ====== Tables ====== */
.table {
  color: #e5e7eb;
  margin-bottom: 0;
}

.table thead {
  background: rgba(15, 23, 42, 0.9);
}

.table thead th {
  border-bottom-color: rgba(55, 65, 81, 0.9);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: #9ca3af;
}

.table tbody tr {
  transition: background 0.12s ease-in-out, transform 0.06s ease-in-out;
}

.table tbody tr:hover {
  background: rgba(15, 23, 42, 0.9);
  transform: translateY(-1px);
}

.table tbody td {
  border-bottom-color: rgba(31, 41, 55, 0.7);
  font-size: 0.85rem;
}

/* ====== Forms & Buttons ====== */
.form-control,
.form-select,
textarea {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  border-radius: 0.7rem;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
  background: rgba(15, 23, 42, 0.98);
  color: #f9fafb;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-outline-danger {
  border-radius: 0.75rem;
}

/* Modal */
.modal-content {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 1.1rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
}

/* ====== Login Page ====== */
.login-body {
  background: radial-gradient(circle at top, #1d4ed8 0, #020617 50%, #000 100%);
  min-height: 100vh;
}

.login-wrapper {
  min-height: 100vh;
}

.login-card {
  max-width: 420px;
  width: 100%;
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

.login-card .form-control {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
}

/* Badges */
.badge.bg-primary-subtle {
  background-color: rgba(37, 99, 235, 0.12) !important;
}
