:root {
  color-scheme: light;
}

.ui-modern {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.12);
  --primary: #2563eb;
  --primary2: #0ea5e9;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --app-font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--app-font-family);
}

.ui-modern,
.ui-modern .tw-font-sans,
.ui-modern input,
.ui-modern select,
.ui-modern textarea,
.ui-modern button {
  font-family: var(--app-font-family);
}

.ui-modern .side-bar {
  background: var(--panel);
  border-inline-end: 1px solid var(--border);
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.05);
}

.ui-modern .side-bar a {
  color: inherit;
}

.ui-modern .sidebar-brand-mark {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1e3a8a, #0ea5e9);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.5px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.25);
}

.ui-modern .sidebar-brand-glow {
  position: absolute;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 60%);
  inset: -20%;
}

.ui-modern .sidebar-brand-text {
  position: relative;
  z-index: 1;
}

.ui-modern .sidebar-menu {
  font-size: 0.95rem;
}

.ui-modern .sidebar-link {
  border-radius: 0.9rem;
  position: relative;
  color: var(--text);
  transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.ui-modern .sidebar-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.12));
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: -1;
}

.ui-modern .sidebar-link:hover::after,
.ui-modern .sidebar-link:focus::after,
.ui-modern .sidebar-link.active::after {
  opacity: 1;
  transform: scale(1);
}

.ui-modern .sidebar-link.active {
  color: #1d4ed8;
  background-color: rgba(37, 99, 235, 0.12);
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.12);
}

.ui-modern .sidebar-nav-icon {
  --sidebar-icon-size: 2.55rem;
  width: var(--sidebar-icon-size);
  height: var(--sidebar-icon-size);
  border-radius: 0.85rem;
  background: linear-gradient(145deg, #eff6ff, #e0f2fe);
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12), 0 8px 18px rgba(15, 23, 42, 0.08);
}

.ui-modern .sidebar-nav-icon i,
.ui-modern .sidebar-nav-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.ui-modern .sidebar-nav-icon i {
  font-size: 1.1rem;
  line-height: 1;
  color: currentColor;
}

.ui-modern .sidebar-nav-icon svg {
  display: block;
  color: currentColor;
}

.ui-modern .sidebar-nav-icon svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
}

.ui-modern .sidebar-nav-icon svg [fill]:not([fill="none"]) {
  fill: currentColor;
}

.ui-modern .sidebar-accordion summary::-webkit-details-marker {
  display: none;
}

.ui-modern .sidebar-accordion summary {
  cursor: pointer;
}

.ui-modern .sidebar-accordion[open] > summary .sidebar-link {
  background-color: rgba(37, 99, 235, 0.12);
}

.ui-modern .sidebar-sublink {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding-block: 0.55rem;
  padding-inline: 0.75rem;
  border-radius: 0.8rem;
  font-weight: 600;
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ui-modern .sidebar-sublink:hover,
.ui-modern .sidebar-sublink:focus {
  background-color: rgba(148, 163, 184, 0.15);
  color: #1d4ed8;
}

.ui-modern .sidebar-child-bullet {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 0.35rem;
  background: linear-gradient(135deg, #1d4ed8, #22d3ee);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
  flex-shrink: 0;
}

.ui-modern .dashboard-hero {
  position: relative;
  background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.18), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(16, 185, 129, 0.16), transparent 25%),
    linear-gradient(135deg, #1e3a8a, #0f172a);
  border-radius: 1.3rem;
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

.ui-modern .dashboard-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.2), transparent 50%);
  pointer-events: none;
}

.ui-modern .dashboard-hero .tw-text-white\/80 {
  color: rgba(248, 250, 252, 0.85);
}

.ui-modern .quick-action {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1rem;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.18s ease, background 0.2s ease;
}

.ui-modern .quick-action:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.14));
  transform: translateY(-3px);
}

.ui-modern .quick-action__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15), 0 10px 24px rgba(15, 23, 42, 0.16);
}

.ui-modern .quick-action__icon svg,
.ui-modern .quick-action__icon i {
  width: 1.35rem;
  height: 1.35rem;
  color: currentColor;
}

.ui-modern .quick-action__icon i {
  font-size: 1.35rem;
  line-height: 1;
}

.ui-modern .quick-action__icon svg {
  display: block;
}

.ui-modern .quick-action__icon svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
}

.ui-modern .quick-action__icon svg [fill]:not([fill="none"]) {
  fill: currentColor;
}

.ui-modern .dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.ui-modern .stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(155deg, #ffffff, #f8fafc);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  min-height: 9rem;
}

.ui-modern .stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.08), transparent 35%);
  pointer-events: none;
}

.ui-modern .stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.ui-modern .stat-card__icon {
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06), 0 10px 22px rgba(15, 23, 42, 0.08);
}

.ui-modern .stat-card__icon svg,
.ui-modern .stat-card__icon i {
  width: 1.4rem;
  height: 1.4rem;
  color: currentColor;
}

.ui-modern .stat-card__icon i {
  font-size: 1.4rem;
  line-height: 1;
}

.ui-modern .stat-card__icon svg {
  display: block;
}

.ui-modern .stat-card__icon svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
}

.ui-modern .stat-card__icon svg [fill]:not([fill="none"]) {
  fill: currentColor;
}

.ui-modern .date-filter-btn {
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.ui-modern .small-view-button,
.ui-modern .side-bar-collapse,
.ui-modern #btnCalculator,
.ui-modern #view_todays_profit,
.ui-modern .tw-dw-dropdown summary {
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}

.ui-modern .small-view-button svg,
.ui-modern .side-bar-collapse svg,
.ui-modern #btnCalculator svg,
.ui-modern #view_todays_profit svg,
.ui-modern .tw-dw-dropdown summary svg {
  color: currentColor;
  width: 1.2rem;
  height: 1.2rem;
}

.ui-modern .tw-dw-dropdown summary i {
  color: currentColor;
}

.ui-modern .sidebar-nav-icon,
.ui-modern .stat-card__icon,
.ui-modern .quick-action__icon {
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .ui-modern .sidebar-nav-icon {
    --sidebar-icon-size: 2.35rem;
    border-radius: 0.8rem;
  }

  .ui-modern .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (min-width: 1280px) {
  .ui-modern .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }
}
