/*
  AL-MULK BRILink — Mobile-first UI/UX Design System
  Scope: visual foundation only. Menu, routes, controller, model, and database logic remain unchanged.
*/
:root {
  color-scheme: light;
  --radius-xs: .5rem;
  --radius-sm: .75rem;
  --radius-md: 1rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;

  /* 60% dominant: neutral canvas */
  --background: #f6faf8;
  --foreground: #11221c;
  --foreground-strong: #061812;
  --text-muted: #5b7168;

  /* 30% secondary: surfaces */
  --card: #ffffff;
  --card-foreground: #11221c;
  --secondary: #edf7f2;
  --secondary-foreground: #11221c;
  --muted: #eef6f1;
  --muted-foreground: #5b7168;
  --border: #dbe8e2;
  --input: #f9fcfa;
  --sidebar: #ffffff;
  --sidebar-accent: #eef6f1;

  /* 10% accent/action */
  --primary: #0f9f6e;
  --primary-strong: #087a54;
  --primary-foreground: #ffffff;
  --accent: #2563eb;
  --accent-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --success: #059669;
  --success-foreground: #ffffff;
  --warning: #d97706;
  --warning-foreground: #78350f;
  --info: #0284c7;
  --gold: #d99b16;
  --gold-foreground: #5c3b00;
  --ring: #0f9f6e;

  --gradient-brand: linear-gradient(135deg, #0f9f6e 0%, #087a54 52%, #2563eb 100%);
  --gradient-gold: linear-gradient(135deg, #f2c94c 0%, #d99b16 100%);
  --shadow-sm: 0 2px 10px rgba(12, 48, 34, .06);
  --shadow-md: 0 14px 45px rgba(12, 48, 34, .10);
  --shadow-lg: 0 26px 80px rgba(12, 48, 34, .16);
  --shadow-elegant: 0 14px 42px -16px rgba(15, 159, 110, .55);
  --shadow-glow: 0 0 60px -12px rgba(15, 159, 110, .48);

  --readable-mobile: 50ch;
  --readable-desktop: 66ch;
}

html.dark {
  color-scheme: dark;
  --background: #07130f;
  --foreground: #eefaf4;
  --foreground-strong: #ffffff;
  --text-muted: #b9c9c1;
  --card: #12211b;
  --card-foreground: #eefaf4;
  --secondary: #172b23;
  --secondary-foreground: #eefaf4;
  --muted: #172b23;
  --muted-foreground: #b9c9c1;
  --border: #28483a;
  --input: #0f1e19;
  --sidebar: #0f1e19;
  --sidebar-accent: #172b23;
  --primary: #34d399;
  --primary-strong: #10b981;
  --accent: #60a5fa;
  --destructive: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --warning-foreground: #fde68a;
  --info: #38bdf8;
  --gold: #facc15;
  --gold-foreground: #fef3c7;
  --ring: #34d399;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .20);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, .30);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(15, 159, 110, .13), transparent 34rem),
    radial-gradient(circle at 80% 10%, rgba(37, 99, 235, .10), transparent 28rem),
    var(--background);
  color: var(--foreground);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* Tailwind-friendly color utilities and legacy class compatibility */
.gradient-brand { background-image: var(--gradient-brand) !important; }
.gradient-gold  { background-image: var(--gradient-gold) !important; }
.shadow-elegant { box-shadow: var(--shadow-elegant) !important; }
.shadow-glow    { box-shadow: var(--shadow-glow) !important; }
.text-gradient-brand { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

.bg-background { background-color: var(--background) !important; }
.bg-card { background-color: var(--card) !important; color: var(--card-foreground); }
.bg-primary { background-color: var(--primary) !important; }
.bg-accent { background-color: var(--accent) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-destructive { background-color: var(--destructive) !important; }
.bg-muted { background-color: var(--muted) !important; }
.bg-sidebar { background-color: var(--sidebar) !important; }

.text-background { color: var(--background) !important; }
.text-foreground { color: var(--foreground) !important; }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-warning-foreground { color: var(--warning-foreground) !important; }
.text-destructive { color: var(--destructive) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary-foreground { color: var(--primary-foreground) !important; }
.text-gold { color: var(--gold) !important; }
.text-gold-foreground { color: var(--gold-foreground) !important; }

.border-default { border-color: var(--border) !important; }
.ring-primary { --tw-ring-color: color-mix(in srgb, var(--primary) 38%, transparent) !important; }

/* Design system classes for new/updated markup */
.ds-app { min-height: 100dvh; }
.ds-readable { max-width: var(--readable-mobile); }
.ds-display { font-size: 2rem; line-height: 1.25; font-weight: 900; letter-spacing: -.035em; }
.ds-heading { font-size: 1.5rem; line-height: 1.25; font-weight: 900; letter-spacing: -.025em; }
.ds-subheading { font-size: 1.25rem; line-height: 1.35; font-weight: 800; letter-spacing: -.015em; }
.ds-body { font-size: 1rem; line-height: 1.5; }
.ds-caption { font-size: .75rem; line-height: 1.35; font-weight: 700; }
.ds-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.ds-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-2xl); box-shadow: var(--shadow-md); }
.ds-surface { background: var(--secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); }
.ds-banner { box-shadow: var(--shadow-sm); }
.ds-topbar { box-shadow: 0 1px 0 rgba(12, 48, 34, .03); }
.ds-bottom-bar { box-shadow: var(--shadow-lg); }
.ds-btn { min-height: 44px; border-radius: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1rem; font-weight: 900; font-size: .875rem; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; -webkit-tap-highlight-color: transparent; }
.ds-btn:active { transform: translateY(1px) scale(.99); }
.ds-btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 12px 26px rgba(15, 159, 110, .22); }
.ds-btn-primary:hover { background: var(--primary-strong); }
.ds-btn-secondary { background: var(--card); color: var(--foreground); border: 1px solid var(--border); }
.ds-btn-secondary:hover { background: var(--muted); }
.ds-btn-tertiary { background: transparent; color: var(--primary); }
.ds-icon-btn { min-width: 44px; width: 44px; height: 44px; border-radius: 1rem; display: inline-grid; place-items: center; background: var(--card); border: 1px solid var(--border); color: var(--foreground); }
.ds-input, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea {
  min-height: 44px;
  border-radius: 1rem;
  border-color: var(--border) !important;
  background-color: var(--input) !important;
  color: var(--foreground) !important;
}
.ds-input:focus, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus, select:focus, textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent) !important;
  outline: none !important;
  background-color: var(--card) !important;
}
input[aria-invalid="true"], .ds-input-error {
  border-color: var(--destructive) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--destructive) 12%, transparent) !important;
}
input:disabled, select:disabled, textarea:disabled { opacity: .58; cursor: not-allowed; background: var(--muted) !important; }
.ds-error { margin-top: .5rem; display: flex; align-items: flex-start; gap: .45rem; color: var(--destructive); font-size: .75rem; line-height: 1.45; font-weight: 800; }
.ds-badge { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .35rem .65rem; font-size: .72rem; line-height: 1; font-weight: 900; border: 1px solid transparent; }
.ds-badge-primary { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.ds-badge-info { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.ds-badge-warning { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.ds-badge-danger { background: color-mix(in srgb, var(--destructive) 12%, transparent); color: var(--destructive); }

/* Base anatomy polish across existing PHP views */
.app-main > div:first-child h1,
.app-main .page-title,
.app-main h1 {
  letter-spacing: -.025em;
  color: var(--foreground-strong);
}
.app-main p,
.app-main .text-sm { line-height: 1.5; }
.app-main p:not(.max-w-none) { max-width: var(--readable-mobile); }
.app-main .rounded-2xl.border,
.app-main .rounded-\[2rem\].border,
.app-main .rounded-3xl.border {
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 24%, var(--border)); }

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a[role="button"], .ds-btn { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 3px;
}

/* Sidebar */
.app-sidebar { will-change: transform; }
.app-sidebar.open { transform: translateX(0) !important; }
.sidebar-link { min-height: 44px; }
@media (min-width: 1024px) {
  .app-shell.sidebar-collapsed .app-sidebar { width: 5.75rem !important; }
  .app-shell.sidebar-collapsed .sidebar-brand-text,
  .app-shell.sidebar-collapsed .sidebar-section-title,
  .app-shell.sidebar-collapsed .sidebar-label { display: none !important; }
  .app-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: .75rem; padding-right: .75rem; }
  .app-shell.sidebar-collapsed .sidebar-link { justify-content: center; padding-left: .65rem !important; padding-right: .65rem !important; }
  .app-shell.sidebar-collapsed .sidebar-icon { width: 2.75rem; height: 2.75rem; }
  .app-shell.sidebar-collapsed .app-sidebar nav { padding-left: .55rem; padding-right: .55rem; }
}

/* Bottom navigation */
.bottom-nav { bottom: calc(.5rem + env(safe-area-inset-bottom)); }
.bottom-nav-panel { backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%); }
.bottom-nav-item { min-height: 4.75rem; }
.bottom-nav-item:active { transform: translateY(1px) scale(.98); }
.bottom-nav-pill { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease; }
.bottom-nav-pill-regular { width: 2.45rem; height: 2.45rem; border-radius: .95rem; background: var(--muted); color: var(--foreground); }
.bottom-nav-pill-center { width: 3.5rem; height: 3.5rem; border-radius: 9999px; background: var(--gradient-brand); color: var(--primary-foreground); box-shadow: var(--shadow-elegant); }
.bottom-nav-pill.is-active.bottom-nav-pill-regular { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-elegant); }
.bottom-nav-pill.is-active.bottom-nav-pill-center { transform: translateY(-1px) scale(1.02); box-shadow: var(--shadow-glow); }
.bottom-nav-center { margin-top: -1.15rem; }

/* Quick menu and sheets */
.quick-menu-strip { scrollbar-width: none; }
.quick-menu-strip::-webkit-scrollbar { display: none; }
.menu-sheet-scroll { -webkit-overflow-scrolling: touch; }
.menu-sheet-card { animation: sheetIn .18s ease both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Toasts */
.toast { animation: toastIn .2s ease both; }
.toast-close { transition: background-color .16s ease, color .16s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Table and data density rules */
.scrollbar-thin { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
table { border-collapse: separate; border-spacing: 0; }
th { font-weight: 900; }
td, th { vertical-align: middle; }
@media (max-width: 767px) {
  .app-shell .overflow-x-auto { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .app-shell table { min-width: max-content; }
  .app-shell th, .app-shell td { white-space: nowrap; }
}

/* Login glassmorphism */
.glass {
  background: color-mix(in srgb, var(--card) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--card) 80%, var(--border));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* PWA/mobile hardening */
.app-main { min-height: calc(100dvh - 4.35rem); }
@media (max-width: 1023px) {
  .app-main { padding-bottom: max(8rem, calc(env(safe-area-inset-bottom) + 7.75rem)) !important; }
  .app-shell .text-3xl { font-size: 1.65rem; line-height: 1.12; }
  .app-shell .text-2xl { font-size: 1.32rem; line-height: 1.18; }
  .app-shell .text-xl { font-size: 1.08rem; line-height: 1.25; }
  .app-shell .grid[class*="grid-cols-"] { gap: .85rem; }
  .app-shell .p-6 { padding: 1.05rem !important; }
  .app-shell .p-5 { padding: 1rem !important; }
  .app-shell .px-5 { padding-left: 1rem !important; padding-right: 1rem !important; }
  .app-shell .py-5 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .app-shell dialog { width: calc(100vw - 1rem) !important; max-width: calc(100vw - 1rem) !important; margin: auto; }
}
@media (min-width: 1024px) { .ds-readable, .app-main p:not(.max-w-none) { max-width: var(--readable-desktop); } }
@media (max-width: 640px) {
  body { background: var(--background); }
  .app-shell .rounded-2xl { border-radius: 1.15rem; }
  .app-shell .rounded-xl { border-radius: .9rem; }
  .app-shell .grid.grid-cols-2:not(.keep-grid) { gap: .75rem; }
}
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav-panel { padding-bottom: env(safe-area-inset-bottom); }
}

/* Utility states */
.pulse-dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--success);
  box-shadow: 0 0 0 0 rgba(5, 150, 105, .70);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .70); }
  70% { box-shadow: 0 0 0 12px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}
[x-cloak] { display: none !important; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Explicit opacity utility fallbacks for dynamic PHP/JS class names */
.bg-card\/85 { background-color: color-mix(in srgb, var(--card) 85%, transparent) !important; }
.bg-card\/88 { background-color: color-mix(in srgb, var(--card) 88%, transparent) !important; }
.bg-card\/95 { background-color: color-mix(in srgb, var(--card) 95%, transparent) !important; }
.bg-muted\/20 { background-color: color-mix(in srgb, var(--muted) 20%, transparent) !important; }
.bg-muted\/30 { background-color: color-mix(in srgb, var(--muted) 30%, transparent) !important; }
.bg-muted\/40 { background-color: color-mix(in srgb, var(--muted) 40%, transparent) !important; }
.bg-muted\/50 { background-color: color-mix(in srgb, var(--muted) 50%, transparent) !important; }
.bg-muted\/60 { background-color: color-mix(in srgb, var(--muted) 60%, transparent) !important; }
.bg-muted\/70 { background-color: color-mix(in srgb, var(--muted) 70%, transparent) !important; }
.bg-primary\/5 { background-color: color-mix(in srgb, var(--primary) 5%, transparent) !important; }
.bg-primary\/10 { background-color: color-mix(in srgb, var(--primary) 10%, transparent) !important; }
.bg-accent\/10 { background-color: color-mix(in srgb, var(--accent) 10%, transparent) !important; }
.bg-success\/10 { background-color: color-mix(in srgb, var(--success) 10%, transparent) !important; }
.bg-warning\/10 { background-color: color-mix(in srgb, var(--warning) 12%, transparent) !important; }
.bg-destructive\/10 { background-color: color-mix(in srgb, var(--destructive) 10%, transparent) !important; }
.bg-gold\/10 { background-color: color-mix(in srgb, var(--gold) 12%, transparent) !important; }
.bg-info\/10 { background-color: color-mix(in srgb, var(--info) 10%, transparent) !important; }
.border-primary\/30 { border-color: color-mix(in srgb, var(--primary) 30%, transparent) !important; }
.border-success\/30 { border-color: color-mix(in srgb, var(--success) 30%, transparent) !important; }
.border-warning\/30 { border-color: color-mix(in srgb, var(--warning) 30%, transparent) !important; }
.border-destructive\/30 { border-color: color-mix(in srgb, var(--destructive) 30%, transparent) !important; }
.ring-primary\/20 { --tw-ring-color: color-mix(in srgb, var(--primary) 20%, transparent) !important; }
.text-primary\/80 { color: color-mix(in srgb, var(--primary) 80%, transparent) !important; }


/* V2 UI fixes: theme manager, auth default light, responsive sidebar, and mobile filter UX */
@media (min-width: 1024px) {
  .app-shell.sidebar-collapsed .app-grid-shell { grid-template-columns: 5.75rem minmax(0, 1fr) !important; }
  .app-shell.sidebar-collapsed .app-main { max-width: min(1440px, calc(100vw - 5.75rem)); }
  .app-shell:not(.sidebar-collapsed) .app-main { max-width: min(1440px, calc(100vw - 18rem)); }
  .app-sidebar { overflow: hidden; }
  .app-shell.sidebar-collapsed .app-sidebar { width: 5.75rem !important; }
}
.sidebar-link { min-width: 0; overflow: hidden; }
.sidebar-label { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-icon { flex: 0 0 auto; }
.quick-menu-card { min-width: 0; overflow: hidden; }
.quick-menu-card-title, .quick-menu-card-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.quick-menu-card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
@media (max-width: 640px) {
  .quick-menu-card { min-height: 4.5rem !important; padding: .85rem !important; }
  .quick-menu-card-desc { display: none; }
  .quick-menu-card-title { font-size: .78rem; line-height: 1.2; }
  .quick-menu-card .sidebar-icon, .quick-menu-card-icon { width: 2.55rem; height: 2.55rem; border-radius: .95rem; }
}
.auth-shell-light, .auth-shell-light * { color-scheme: light; }
.auth-shell-light input, .auth-shell-light select, .auth-shell-light textarea {
  background-color: #ffffff !important;
  color: #11221c !important;
  border-color: color-mix(in srgb, var(--primary) 18%, #dbe8e2) !important;
}
.auth-shell-light input::placeholder { color: #789087 !important; }
.auth-shell-light .auth-panel { background: color-mix(in srgb, #ffffff 88%, var(--background)); color: #11221c; }
.auth-shell-light .auth-side { background-image: var(--gradient-brand); }
.theme-color-field { display: block; }
.theme-swatch { width: 2.75rem; height: 2.75rem; flex: 0 0 auto; border-radius: 1rem; background: var(--swatch); border: 1px solid var(--border); box-shadow: inset 0 0 0 3px rgba(255,255,255,.45), var(--shadow-sm); }
.theme-color-input { width: 3.25rem; min-width: 3.25rem; height: 2.75rem; padding: .2rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--card); cursor: pointer; }
.theme-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.theme-color-input::-webkit-color-swatch { border: 0; border-radius: .75rem; }
.mobile-filter-trigger { display: none; }
.filter-dialog { width: min(32rem, calc(100vw - 1rem)); border: 0; padding: 0; background: transparent; color: var(--foreground); }
.filter-dialog::backdrop { background: rgba(7, 19, 15, .52); backdrop-filter: blur(4px); }
.filter-dialog-card { max-height: min(86dvh, 44rem); overflow: auto; animation: sheetIn .18s ease both; }
@media (max-width: 767px) {
  form.ds-filter-form { display: none !important; }
  .mobile-filter-trigger { display: inline-grid; }
  .filter-dialog form { display: grid !important; grid-template-columns: 1fr !important; gap: .75rem !important; width: 100% !important; max-width: none !important; border: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; }
  .filter-dialog form > * { width: 100% !important; }
  .filter-dialog form button[type="submit"], .filter-dialog form button:not([type]) { min-height: 44px; border-radius: 1rem; }
}

/* V3 mobile app anatomy: dashboard home, detail app-bar, preset themes, overflow hardening */
.app-grid-shell, .app-grid-shell > * { min-width: 0; }
.app-main { min-width: 0; overflow-x: clip; }
.ds-topbar { min-width: 0; }
.quick-menu-card, .dashboard-mobile-menu-item, .mobile-quick-action { min-width: 0; overflow: hidden; }
.quick-menu-card-title, .quick-menu-card-desc, .dashboard-mobile-menu-item span, .mobile-quick-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-menu-card-title { white-space: nowrap; }
.quick-menu-card-desc { word-break: break-word; }
.theme-preset-card { min-width: 0; }
.theme-preset-card:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent); }
@media (min-width: 1024px) {
  .app-shell.sidebar-collapsed .app-grid-shell { grid-template-columns: 5.75rem minmax(0, 1fr) !important; }
  .app-shell .app-main { width: 100%; max-width: 1440px !important; }
  .app-shell.sidebar-collapsed .sidebar-footer .sidebar-link { justify-content: center; }
  .app-shell.sidebar-collapsed .sidebar-footer .sidebar-label { display: none !important; }
}
@media (max-width: 1023px) {
  .is-dashboard-page .dashboard-main {
    padding-top: max(.85rem, env(safe-area-inset-top)) !important;
  }
  .is-detail-page .detail-main {
    padding-top: 1rem !important;
  }
  .mobile-dashboard-home { margin-top: .15rem; }
  .mobile-home-profile { position: relative; overflow: hidden; }
  .mobile-home-profile::before {
    content: '';
    position: absolute;
    inset: -55% -18% auto auto;
    width: 10rem;
    height: 10rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    pointer-events: none;
  }
  .mobile-home-profile > * { position: relative; }
  .dashboard-mobile-menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .dashboard-mobile-menu-item, .mobile-quick-action { min-height: 5.65rem; }
  .dashboard-mobile-menu-item span:last-child, .mobile-quick-action span:last-child { max-width: 100%; white-space: nowrap; }
  .dashboard-filter-wrap { justify-content: flex-end !important; min-height: 2.75rem; }
  .dashboard-filter-wrap .mobile-filter-trigger { margin-left: auto; margin-bottom: 0; }
  .dashboard-kpi-card { min-height: 6.75rem; }
  .dashboard-kpi-card .text-xl { font-size: 1.05rem !important; }
  .toast-host { top: .75rem !important; }
}
@media (max-width: 380px) {
  .dashboard-mobile-menu-item, .mobile-quick-action { padding: .5rem !important; }
  .dashboard-mobile-menu-item span:first-child, .mobile-quick-action span:first-child { width: 2.45rem; height: 2.45rem; border-radius: .9rem; }
  .dashboard-mobile-menu-item span:last-child, .mobile-quick-action span:last-child { font-size: 9px; }
}
