* { box-sizing: border-box; }

:root {
  --page: #fafafa;
  /* --sidebar: rgba(0, 110, 196, .20); */
  --sidebar: rgba(0, 196, 16, 0.212);
  /* --primary: #006ec4; */
  --primary: #008900;
  --ink: #16151c;
  --muted: #a2a1a8;
  --line: rgba(162, 161, 168, .20);
  --card: #fff;
  --table-head: #f3f2f3;
  --table-text: #111827;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: Lexend, sans-serif;
  font-weight: 300;
}

button, input { font: inherit; }
button { cursor: pointer; border: 0; }

.login-screen {
  min-height: 100vh;
  padding: 30px;
  display: flex;
  align-items: stretch;
  gap: 50px;
  background: #fff;
}
.login-visual {
  width: min(56.6vw, 815px);
  min-height: calc(100vh - 60px);
  overflow: hidden;
  border-radius: 30px;
  background: #dbeaf3;
}
.login-visual img { width: 100%; height: 100%; display: block; object-fit: cover; }
.login-content {
  width: 445px;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
}
.login-brand { width: 180px; height: 73px; display: flex; align-items: center; gap: 22px; }
.login-brand .brand-mark { transform: scale(1.25) skewY(-28deg) rotate(3deg); transform-origin: left center; }
.login-brand .brand-name { font-size: 20px; }
.login-form { width: 445px; }
.login-heading { margin-bottom: 30px; }
.login-heading h1 { margin: 0 0 5px; color: #16151c; font-size: 30px; line-height: 40px; font-weight: 600; }
.login-heading p { margin: 0; color: #a2a1a8; font-size: 16px; line-height: 24px; }
.login-fields { display: flex; flex-direction: column; gap: 20px; }
.login-input {
  height: 56px;
  padding: 7px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid rgba(162,161,168,.35);
  border-radius: 10px;
  background: #fff;
}
.login-input.focused, .login-input:focus-within { border-color: var(--primary); }
.login-input span { color: #a2a1a8; font-size: 11px; line-height: 16px; }
.login-input.focused span, .login-input:focus-within span { color: var(--primary); }
.login-input input { width: 100%; height: 24px; padding: 0; outline: 0; border: 0; color: #16151c; background: transparent; font-size: 16px; line-height: 24px; }
.password-toggle { position: absolute; right: 14px; bottom: 14px; color: #a2a1a8; background: transparent; font-size: 16px; line-height: 24px; }
.login-options { display: flex; justify-content: space-between; align-items: center; }
.remember-option { display: flex; align-items: center; gap: 10px; padding-right: 16px; color: #16151c; font-size: 16px; line-height: 24px; cursor: pointer; }
.remember-option input { position: absolute; opacity: 0; pointer-events: none; }
.custom-checkbox { width: 24px; height: 24px; display: grid; place-items: center; background: #f2f5f8; border-radius: 4px; }
.remember-option input:checked + .custom-checkbox { background: var(--primary); }
.remember-option input:checked + .custom-checkbox::after { content: "✓"; color: white; font-size: 15px; font-weight: 600; }
.forgot-button { padding: 0; color: var(--primary); background: transparent; font-size: 14px; line-height: 22px; }
.login-button { width: 100%; height: 56px; color: #fff; background: var(--primary); border-radius: 10px; font-size: 16px; line-height: 24px; transition: background .2s ease, transform .2s ease; }
.login-button:hover { background: var(--primary); transform: translateY(-1px); }
.dashboard-view { display: flex; }
.dashboard-view.hidden, .login-screen.hidden { display: none; }

.app-shell {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  gap: 20px;
  background:
    radial-gradient(circle at 80% 25%, rgba(0, 110, 196, .025), transparent 35%),
    var(--page);
}

.sidebar {
  width: 280px;
  height: calc(100vh - 40px);
  padding: 30px;
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-radius: 10px;
  position: sticky;
  top: 20px;
}
.sidebar-close, .sidebar-overlay, .mobile-menu-button { display: none; }

.brand { height: 50px; display: flex; align-items: center; gap: 15px; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -.5px; }
.brand-mark { width: 31px; height: 37px; position: relative; transform: skewY(-28deg) rotate(3deg); }
.brand-mark span { position: absolute; width: 9px; border-radius: 2px; background: var(--primary); }
.brand-mark span:nth-child(1) { left: 1px; top: 5px; height: 27px; }
.brand-mark span:nth-child(2) { left: 11px; top: 0; height: 35px; opacity: .8; }
.brand-mark span:nth-child(3) { left: 21px; top: 9px; height: 22px; opacity: .6; }

.nav-list { margin-top: 30px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; }
.nav-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 220px;
  height: 50px;
  padding: 0 19px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  text-align: left;
  font-size: 16px;
  font-weight: 300;
  background: transparent;
  border-radius: 0 10px 10px 0;
  position: relative;
  transition: background .2s ease, color .2s ease;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
a.nav-item { width: 220px; }
.nav-item:hover { background: rgba(0, 110, 196, .06); }
.nav-item.active { background: rgba(0, 110, 196, .05); color: var(--primary); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); border-radius: 0 10px 10px 0; }
.nav-icon { width: 24px; font-size: 23px; line-height: 1; text-align: center; font-family: Arial, sans-serif; }
.nav-toggle { justify-content: flex-start; }
.nav-arrow { margin-left: auto; font-size: 14px; transition: transform .25s ease; }
.nav-group.open > .nav-toggle .nav-arrow { transform: rotate(180deg); }
.nav-group.open > .nav-toggle { color: var(--primary); }
.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, opacity .25s ease;
  opacity: 0;
}
.nav-group.open > .nav-submenu { max-height: 350px; opacity: 1; }
.nav-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 19px 10px 59px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 300;
  border-radius: 0 10px 10px 0;
  transition: background .15s ease, color .15s ease;
}
.nav-subitem i { font-size: 16px; opacity: .7; }
.nav-subitem:hover { background: rgba(0, 110, 196, .06); color: var(--primary); }
.nav-subitem.active { color: var(--primary); font-weight: 500; background: rgba(0, 110, 196, .05); }

.theme-switch { margin-top: auto; height: 50px; width: 220px; padding: 0 3px; display: flex; align-items: center; background: rgba(162,161,168,.05); border-radius: 10px; }
.theme-option { height: 44px; flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--ink); background: transparent; border-radius: 8px; font-size: 15px; }
.theme-option.selected { color: white; background: var(--primary); }
.theme-icon { font-family: Arial, sans-serif; font-size: 22px; line-height: 1; }

.main-content { flex: 1; min-width: 0; padding: 0 10px 30px 0; }
.topbar { min-height: 112px; display: flex; justify-content: space-between; align-items: flex-start; padding: 15px 0 0 10px; }
.topbar-intro { display: flex; align-items: flex-start; gap: 12px; width: 100%; }
.greeting h1 { margin: 0; font-size: 20px; line-height: 30px; font-weight: 600; }
.greeting p { margin: 0; color: var(--muted); font-size: 14px; line-height: 22px; }
.live-clock { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; background: rgba(0,110,196,.06); border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--primary); }
.live-clock i { font-size: 14px; }
.live-clock span { font-family: 'Manrope', monospace; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.header-actions { position: relative; display: flex; align-items: center; gap: 20px; padding-top: 16px; }
.search-box { width: 261px; height: 50px; padding: 0 16px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(162,161,168,.1); border-radius: 10px; background: transparent; }
.search-symbol { color: var(--ink); opacity: .55; font-family: Arial, sans-serif; font-size: 27px; line-height: 1; transform: rotate(-15deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; font-weight: 300; }
.search-box input::placeholder { color: rgba(22,21,28,.45); }
.icon-button { width: 50px; height: 50px; position: relative; display: grid; place-items: center; color: var(--ink); background: rgba(162,161,168,.1); border-radius: 10px; font-size: 22px; }
.notification-button { margin-left: auto; }
.notification-button::after { content: ''; position: absolute; width: 7px; height: 7px; top: 11px; right: 12px; border: 2px solid #fafafa; background: var(--primary); border-radius: 50%; }
.profile-button { width: 184px; height: 50px; padding: 4px; display: flex; align-items: center; gap: 9px; background: transparent; border: 1px solid rgba(162,161,168,.2); border-radius: 8px; text-align: left; }
.profile-button img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: #d6e4ed; }
.profile-button span { min-width: 0; display: flex; flex-direction: column; }
.profile-button strong { font-size: 15px; font-weight: 600; line-height: 22px; white-space: nowrap; }
.profile-button small { color: var(--muted); font-size: 11px; line-height: 17px; white-space: nowrap; }
.profile-button b { margin-left: auto; margin-right: 6px; font-size: 20px; font-weight: 300; }
.profile-menu { position: absolute; z-index: 10; top: 72px; right: 0; width: 184px; padding: 7px; display: none; background: white; border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(40,48,63,.12); border-radius: 10px; }
.profile-menu.open { display: block; }
.profile-menu button { width: 100%; padding: 10px; color: var(--ink); background: transparent; text-align: left; border-radius: 6px; font-size: 13px; }
.profile-menu button:hover { background: #f3f6f9; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 50px 20px; }
.panel { min-width: 0; height: 433px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.panel-heading { height: 62px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid rgba(162,161,168,.2); }
.panel-heading h2 { margin: -1px 0 0; font-size: 20px; line-height: 30px; font-weight: 600; }
.view-all { padding: 10px 0; color: var(--primary); background: transparent; font-size: 16px; font-weight: 300; }
.data-table-wrap { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: Manrope, sans-serif; color: var(--table-text); font-size: 12px; }
.data-table th { height: 56px; padding: 16px; color: #687588; background: var(--table-head); border-right: 1px solid rgba(162,161,168,.15); font-weight: 700; letter-spacing: .2px; text-align: left; }
.data-table th:nth-child(1) { width: 24%; }
.data-table th:nth-child(2) { width: 24%; }
.data-table th:nth-child(3) { width: 29%; }
.data-table th:nth-child(4) { width: 18%; }
.data-table td { height: 64px; padding: 10px 16px; border-bottom: 1px solid #f1f2f4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-table td:nth-child(2) { padding: 4px 16px; text-align: center; }
.sort { float: right; color: #687588; font-size: 14px; }
.product-thumb { width: 46px; height: 46px; margin: 0 auto; overflow: hidden; position: relative; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.product-thumb::before, .product-thumb::after { content: ""; position: absolute; border-radius: 4px; }
.product-thumb::before { width: 28px; height: 38px; left: 9px; top: 4px; transform: rotate(10deg); background: rgba(255,255,255,.7); box-shadow: 7px 8px 0 rgba(0,0,0,.08); }
.product-thumb::after { width: 30px; height: 5px; left: 8px; top: 12px; transform: rotate(10deg); background: rgba(255,255,255,.8); }
.product-thumb.orange { background: linear-gradient(135deg,#e59b5e,#fad6a4); }
.product-thumb.blue { background: linear-gradient(135deg,#6f9db0,#d4e5e8); }
.product-thumb.green { background: linear-gradient(135deg,#7c9a81,#d1e2cb); }
.product-thumb.purple { background: linear-gradient(135deg,#927b9b,#dcd1df); }
.empty-state { display: none; padding: 45px 10px; color: var(--muted); text-align: center; font-size: 13px; }

.summary-card { min-height: 163px; padding: 20px 16px; background: var(--card); border-radius: 8px; overflow: hidden; }
.summary-card h2 { margin: 0; color: #383e49; font-family: Inter, sans-serif; font-size: 20px; line-height: 30px; font-weight: 500; }
.summary-split { height: 96px; display: grid; grid-template-columns: 1fr 1fr; align-items: start; position: relative; }
.summary-split::after { content: ""; width: 1px; height: 91px; position: absolute; top: 6px; left: 50%; background: #dfe2e7; }
.metric { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 13px; text-align: center; }
.metric-icon { width: 30px; height: 30px; margin-bottom: 2px; display: grid; place-items: center; border-radius: 4px; font-family: Arial, sans-serif; font-size: 18px; color: #495465; }
.metric-icon.peach { background: #ffeedb; }
.metric-icon.lavender { background: #eceaff; }
.metric-icon.cyan { background: #e5f7fd; }
.metric-icon.periwinkle { background: #e7e5ff; }
.metric strong { color: #5d6679; font-family: Inter, sans-serif; font-size: 16px; line-height: 24px; font-weight: 600; }
.metric span { color: #444; font-family: Inter, sans-serif; font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.wide-summary { padding-left: 33px; padding-right: 33px; }
.toast { position: fixed; z-index: 9999; right: 24px; bottom: 24px; padding: 12px 16px; color: white; background: #28303f; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 13px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Notification Panel ─────────────────────────────────────── */
.notif-overlay { position: fixed; inset: 0; z-index: 998; background: rgba(0,0,0,.35); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; }
.notif-overlay.visible { opacity: 1; visibility: visible; }

.notif-panel { position: fixed; top: 0; right: -420px; z-index: 999; width: 400px; max-width: 100vw; height: 100vh; display: flex; flex-direction: column; background: var(--page); box-shadow: -8px 0 40px rgba(0,0,0,.15); transition: right .35s cubic-bezier(.4,0,.2,1); }
.notif-panel.open { right: 0; }

.notif-header { padding: 20px 24px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.notif-header h2 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.notif-header h2 i { color: var(--primary); }
.notif-close { width: 36px; height: 36px; display: grid; place-items: center; background: rgba(162,161,168,.1); border-radius: 8px; font-size: 22px; color: var(--ink); transition: background .2s; }
.notif-close:hover { background: rgba(162,161,168,.25); }

.notif-tabs { padding: 0 24px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.notif-tab { flex: 1; padding: 12px 0; background: none; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.notif-tab:hover { color: var(--ink); }
.notif-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.notif-tab-content { display: none; flex: 1; overflow-y: auto; }
.notif-tab-content.active { display: flex; flex-direction: column; }

/* Notification items */
.notif-list { flex: 1; padding: 8px 16px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 14px 12px; border-radius: 10px; transition: background .2s; cursor: pointer; }
.notif-item:hover { background: rgba(162,161,168,.08); }
.notif-item.unread { background: rgba(0,110,196,.06); }
.notif-item.unread:hover { background: rgba(0,110,196,.1); }

.notif-item-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 10px; font-size: 18px; }
.notif-item-icon.info    { background: #dbeafe; color: #3b82f6; }
.notif-item-icon.success { background: #d1fae5; color: #10b981; }
.notif-item-icon.warning { background: #fef3c7; color: #f59e0b; }
.notif-item-icon.danger  { background: #fee2e2; color: #ef4444; }
.notif-item-icon.shalat  { background: #e0e7ff; color: #6366f1; }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-body strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.4; }
.notif-item-body p { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.notif-item-body small { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; color: var(--muted); }

.notif-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 20px; color: var(--muted); }
.notif-empty i { font-size: 40px; opacity: .4; }
.notif-empty p { font-size: 14px; }

/* Prayer times */
.shalat-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--muted); }
.shalat-spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.shalat-retry { margin-top: 8px; padding: 8px 20px; background: var(--primary); color: #fff; border-radius: 8px; font-size: 13px; font-weight: 500; }

.shalat-meta { padding: 16px 24px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.shalat-location, .shalat-date { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.shalat-location i, .shalat-date i { color: var(--primary); font-size: 14px; }

.shalat-list { flex: 1; padding: 12px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.shalat-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); transition: all .25s; }
.shalat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.shalat-card.past { opacity: .5; }
.shalat-card.next { border-color: var(--primary); background: rgba(0,110,196,.04); box-shadow: 0 4px 20px rgba(0,110,196,.1); }

.shalat-card-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 10px; font-size: 20px; }
.shalat-card-info { flex: 1; }
.shalat-card-info strong { display: block; font-size: 14px; font-weight: 600; }
.shalat-card-info span { font-size: 13px; color: var(--muted); font-weight: 400; }

.shalat-card-status { display: flex; align-items: center; }
.shalat-done { color: #10b981; font-size: 18px; }
.shalat-upcoming { padding: 4px 10px; font-size: 11px; font-weight: 600; color: var(--primary); background: rgba(0,110,196,.1); border-radius: 20px; animation: pulseUpcoming 2s ease-in-out infinite; }
@keyframes pulseUpcoming { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

.shalat-alert { margin: 12px 16px; padding: 16px; display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border-radius: 14px; animation: slideInUp .4s ease; }
.shalat-alert-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; background: rgba(255,255,255,.2); border-radius: 12px; font-size: 22px; }
.shalat-alert-body strong { display: block; font-size: 14px; font-weight: 600; }
.shalat-alert-body span { font-size: 13px; opacity: .85; }
@keyframes slideInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Notification badge */
.notif-badge { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; border: 2px solid var(--page); line-height: 1; }

/* Bell pulse animation */
@keyframes bellPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.notif-pulse { animation: bellPulse .6s ease-in-out 3; }

body.dark {
  --page: #151a22;
  /* --sidebar: rgba(0, 110, 196, .2); */
  --sidebar: rgba(7, 196, 0, 0.2);
  --ink: #edf3f7;
  --muted: #a4b0bc;
  --line: rgba(255,255,255,.12);
  --card: #202834;
  --table-head: #2d3745;
  --table-text: #eaf0f5;
}
body.dark .summary-card h2, body.dark .metric span { color: #d8e0e8; }
body.dark .data-table td { border-color: rgba(255,255,255,.08); }
body.dark .search-box input::placeholder, body.dark .search-symbol { color: #cbd5e0; }
body.dark .profile-menu { background: #202834; }
body.dark .profile-menu button { color: #edf3f7; }
body.dark .profile-menu button:hover { background: #2d3745; }
body.dark .product-thumb::before { background: rgba(255,255,255,.35); }
body.dark .login-screen { background: #151a22; }
body.dark .login-heading h1 { color: #edf3f7; }
body.dark .login-input { border-color: rgba(255,255,255,.14); background: #202834; }
body.dark .login-input:focus-within, body.dark .login-input.focused { border-color: #70c0f5; }
body.dark .login-input input, body.dark .remember-option { color: #edf3f7; }
body.dark .login-input.focused span, body.dark .login-input:focus-within span { color: #70c0f5; }
body.dark .custom-checkbox { background: #2d3745; }
body.dark .notif-item.unread { background: rgba(0,110,196,.1); }
body.dark .notif-item-icon.info    { background: rgba(59,130,246,.15); }
body.dark .notif-item-icon.success { background: rgba(16,185,129,.15); }
body.dark .notif-item-icon.warning { background: rgba(245,158,11,.15); }
body.dark .notif-item-icon.danger  { background: rgba(239,68,68,.15); }
body.dark .notif-item-icon.shalat  { background: rgba(99,102,241,.15); }
body.dark .shalat-card.next { background: rgba(0,110,196,.08); }
body.dark .notif-badge { border-color: var(--page); }

/* DataTables Global Adjustments */
table.dataTable { border-color: var(--line) !important; }
table.dataTable th, table.dataTable td { border-bottom-color: var(--line) !important; }

/* Light Mode Datatables overrides (counteract OS dark mode media queries) */
body:not(.dark) .dt-search input, body:not(.dark) .dt-length select {
  background-color: #fff !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
body:not(.dark) .dt-search label, body:not(.dark) .dt-length label, body:not(.dark) .dt-info, body:not(.dark) .dt-paging button {
  color: var(--ink) !important;
}

/* Dark Mode Datatables overrides */
body.dark .dt-search input, body.dark .dt-length select {
  background-color: var(--card) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
body.dark .dt-search label, body.dark .dt-length label, body.dark .dt-info, body.dark .dt-paging button {
  color: var(--muted) !important;
}
body.dark .dt-paging button.current {
  background-color: rgba(0, 110, 196, 0.2) !important;
  color: #fff !important;
  border-color: transparent !important;
}

@media (max-width: 1200px) {
  .sidebar { width: 230px; flex-basis: 230px; padding-left: 20px; padding-right: 10px; }
  .nav-item, .theme-switch { width: 200px; }
  .nav-subitem { padding-left: 49px; }
  .header-actions { gap: 10px; }
  .search-box { width: 210px; }
  .profile-button { width: 170px; }
  .metric span { font-size: 11px; }
  .login-screen { gap: 35px; }
  .login-content { width: 390px; }
  .login-form { width: 100%; }
}

@media (max-width: 900px) {
  .login-screen { padding: 20px; gap: 30px; }
  .login-visual { width: 45%; min-height: calc(100vh - 40px); }
  .login-content { width: 55%; min-height: calc(100vh - 40px); }
  .login-form { width: 100%; }
  .app-shell { padding: 12px; gap: 12px; }
  .sidebar { width: 70px; flex-basis: 70px; padding: 18px 10px; align-items: center; }
  .brand { justify-content: center; }
  .brand-name, .nav-item span:last-child, .theme-option, .nav-arrow { display: none; }
  .nav-menu { align-items: center; }
  .nav-list { width: 100%; align-items: center; margin-top: 25px; }
  .nav-item { width: 50px; justify-content: center; padding: 0; border-radius: 10px; }
  .nav-item.active::before { left: -1px; border-radius: 8px; }
  .nav-submenu { display: none; }
  .nav-group.open > .nav-submenu { display: none; }
  .theme-switch { width: 50px; height: 100px; padding: 3px; flex-direction: column; }
  .theme-option { width: 44px; height: 44px; }
  .theme-option.selected { display: grid; }
  .main-content { padding-right: 0; }
  .topbar { flex-direction: column; gap: 18px; }
  .header-actions { width: 100%; padding-top: 0; }
  .search-box { flex: 1; width: auto; }
}

@media (max-width: 650px) {
  .login-screen {
    min-height: 100dvh;
    padding: 24px 18px 30px;
    display: block;
    background: linear-gradient(180deg, #fafdff 0%, #fff 100%);
  }
  .login-visual { display: none; }
  .login-content { width: 100%; min-height: 0; display: block; }
  .login-brand { width: 100%; height: 55px; gap: 16px; justify-content: center; }
  .login-brand .brand-mark { transform: scale(.95) skewY(-28deg) rotate(3deg); }
  .login-brand .brand-name { font-size: 18px; }
  .login-form { width: 100%; margin-top: 54px; }
  .login-heading h1 { font-size: 28px; }
  .login-options { gap: 10px; }
  .remember-option { font-size: 14px; }
  .forgot-button { font-size: 13px; white-space: nowrap; }
  body.dark .login-screen { background: #151a22; }
  .app-shell { display: block; padding: 0; }
  body.sidebar-is-open { overflow: hidden; }
  .sidebar {
    width: min(86vw, 320px);
    min-height: 100dvh;
    height: 100dvh;
    padding: 14px;
    display: flex;
    position: fixed;
    z-index: 30;
    top: 0;
    left: 0;
    align-items: stretch;
    flex-direction: column;
    background: #e7f3fc;
    border-radius: 0 20px 20px 0;
    box-shadow: 14px 0 36px rgba(22, 21, 28, .16);
    transform: translateX(-105%);
    transition: transform .25s ease;
  }
  body.dark .sidebar {
    background: #202834;
    border-right: 1px solid rgba(255,255,255,.08);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close {
    width: 36px;
    height: 36px;
    margin-left: auto;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: rgba(255,255,255,.82);
    box-shadow: 0 2px 8px rgba(31, 78, 121, .08);
    border-radius: 10px;
    font-family: Arial, sans-serif;
    font-size: 26px;
    line-height: 1;
  }
  body.dark .sidebar-close {
    color: #edf3f7;
    background: #2d3745;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
  }
  body.dark .nav-item:hover {
    background: rgba(77, 169, 234, .12);
  }
  body.dark .nav-item.active {
    color: #70c0f5;
    background: rgba(77, 169, 234, .14);
  }
  body.dark .theme-switch {
    background: #18212c;
  }
  .sidebar-overlay {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    background: rgba(15, 23, 42, .52);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .brand {
    height: 42px;
    justify-content: flex-start;
  }
  .brand-mark { transform: scale(.86) skewY(-28deg) rotate(3deg); transform-origin: left center; }
  .brand-name { display: inline; font-size: 14px; }
  .nav-item span:last-child { display: inline; }
  .nav-arrow { display: inline-block; }
  .nav-submenu { display: block; }
  .nav-group.open > .nav-submenu { display: block; }
  .nav-list {
    width: 100%;
    margin: 28px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .nav-item {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    justify-content: flex-start;
    gap: 9px;
    border-radius: 10px;
    font-size: 13px;
  }
  .nav-item.active::before {
    left: 0;
    border-radius: 10px 0 0 10px;
  }
  .nav-icon { width: 20px; font-size: 18px; flex: 0 0 20px; }
  .nav-subitem { padding-left: 42px; font-size: 13px; padding-top: 8px; padding-bottom: 8px; border-radius: 10px; }
  .theme-switch {
    width: 100%;
    height: 44px;
    margin-top: auto;
    padding: 3px;
    display: flex;
    flex-direction: row;
  }
  .theme-option {
    width: auto;
    height: 38px;
    display: flex;
    font-size: 13px;
  }
  .theme-option.selected { display: flex; }
  .main-content { padding: 12px; }
  .topbar { min-height: 0; padding: 8px 0 20px; }
  .topbar-intro { align-items: center; }
  .mobile-menu-button {
    width: 42px;
    height: 42px;
    padding: 10px 9px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 0 0 42px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 11px;
  }
  .mobile-menu-button span {
    width: 100%;
    height: 2px;
    display: block;
    background: var(--primary);
    border-radius: 2px;
  }
  .header-actions { gap: 7px; }
  .search-box { min-width: 0; }
  .profile-button { width: 50px; padding: 4px; }
  .profile-button span, .profile-button b { display: none; }
  .profile-button img { width: 40px; }
  .profile-menu { top: 55px; }
  .dashboard-grid { display: flex; flex-direction: column; gap: 18px; }
  .panel { height: auto; min-height: 410px; padding: 14px 10px; }
  .data-table { font-size: 11px; }
  .data-table th, .data-table td { padding-left: 8px; padding-right: 8px; }
  .data-table th:nth-child(1) { width: 29%; }
  .data-table th:nth-child(2) { width: 22%; }
  .data-table th:nth-child(3) { width: 31%; }
  .data-table th:nth-child(4) { width: 18%; }
  .product-thumb { width: 38px; height: 38px; }
  .summary-card { min-height: 155px; }
  .wide-summary { padding-left: 16px; padding-right: 16px; }
}