/* ============================================================
   ECOM ADMIN — Style Sheet
   Light theme: Warm ivory + Deep teal accents
   Dark theme:  Deep charcoal + Electric amber accents
   ============================================================ */

/* ---- LIGHT THEME (default) ---- */
:root {
  --primary: #0d7377;
  --primary-dark: #095e62;
  --primary-light: #e0f4f4;
  --accent: #f4a261;
  --accent-dark: #e07c3a;
  --accent-light: #fff3e8;
  --success: #2d9e6b;
  --warning: #f4a261;
  --danger: #e05252;
  --info: #4183c4;

  --bg: #f5f3ef;
  --sidebar-bg: #0d2b2c;
  --sidebar-text: #c8e6e6;
  --sidebar-hover: rgba(13, 115, 119, 0.25);
  --sidebar-active: #0d7377;
  --topbar-bg: #ffffff;
  --card-bg: #ffffff;
  --card-bg2: #faf9f7;

  --text: #1c2626;
  --text-muted: #5a7070;
  --text-light: #95a8a8;
  --border: #e4dfda;
  --border-light: #ede9e4;

  --shadow-sm:
    0 1px 3px rgba(13, 43, 44, 0.06), 0 1px 2px rgba(13, 43, 44, 0.04);
  --shadow: 0 4px 16px rgba(13, 43, 44, 0.08);
  --shadow-lg: 0 8px 32px rgba(13, 43, 44, 0.12);

  --sidebar-width: 248px;
  --sidebar-collapsed: 72px;
  --topbar-height: 66px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --transition: 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- DARK THEME ---- */
[data-theme="dark"] {
  --primary: #14b8a6;
  --primary-dark: #0f9688;
  --primary-light: rgba(20, 184, 166, 0.14);
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: rgba(245, 158, 11, 0.14);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;

  --bg: #0d1117;
  --sidebar-bg: #0a0f14;
  --sidebar-text: #7ecdc8;
  --sidebar-hover: rgba(20, 184, 166, 0.15);
  --sidebar-active: #14b8a6;
  --topbar-bg: #111820;
  --card-bg: #161d26;
  --card-bg2: #1a2230;

  --text: #e8f4f4;
  --text-muted: #7a9a9a;
  --text-light: #4a6868;
  --border: #1f2e30;
  --border-light: #1a2530;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.w-100 {
  width: 100%;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}
body {
  font-family:
    "Plus Jakarta Sans",
    "DM Sans",
    system-ui,
    -apple-system,
    sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition:
    background var(--transition),
    color var(--transition);
}

a {
  text-decoration: none;
  color: inherit;
}
button {
  cursor: pointer;
  font-family: inherit;
}
input,
select,
textarea {
  font-family: inherit;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
  transition:
    background var(--transition),
    border-color var(--transition);
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: var(--sidebar-width);
  transition: width var(--transition);
  flex-shrink: 0;
}
.main-wrapper.collapsed ~ .topbar .topbar-left,
body.sidebar-collapsed .topbar-left {
  width: var(--sidebar-collapsed);
}

.hamburger {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.hamburger:hover {
  background: var(--primary);
  color: #fff;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
}
.logo-name {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.logo-name span {
  color: var(--primary);
}
.logo-sub {
  font-size: 9.5px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  height: 40px;
  width: 100%;
  max-width: 420px;
  transition: all var(--transition);
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search-box i {
  color: var(--text-light);
  font-size: 12px;
  flex-shrink: 0;
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.search-box input::placeholder {
  color: var(--text-light);
}
.search-kbd {
  font-size: 10px;
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
  position: relative;
}
.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.notif-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--topbar-bg);
}

/* Theme Toggle */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all var(--transition);
}
.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Notifications panel */
.notif-wrap {
  position: relative;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  overflow: hidden;
}
.notif-panel.open {
  display: block;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.ntitle {
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
}
.nmark {
  font-size: 11px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
}
.nmark:hover {
  text-decoration: underline;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover {
  background: var(--card-bg2);
}
.notif-item:last-child {
  border-bottom: none;
}
.ndot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}
.ndot.read {
  background: var(--border);
}
.ntext {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}
.ntime {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
}

/* Profile */
.profile-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.profile-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-info {
  display: flex;
  flex-direction: column;
}
.profile-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.profile-role {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}
.profile-chevron {
  font-size: 10px;
  color: var(--text-light);
  transition: transform var(--transition);
}
.profile-btn.open .profile-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  overflow: hidden;
}
.dropdown-menu.open {
  display: block;
}
.dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.dname {
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
}
.demail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}
.dropdown-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.dropdown-menu a i {
  width: 16px;
  text-align: center;
}
.dropdown-menu a.danger:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 149;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
  display: block;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 150;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition:
    width var(--transition),
    transform var(--transition);
  overflow: hidden; /* collapsed overrides below */
}

/* Sidebar brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.sb-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}
.sb-name {
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}
.sb-name span {
  color: var(--accent);
}
.sb-sub {
  font-size: 9.5px;
  color: rgba(200, 230, 230, 0.5);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 0 20px;
}
.sidebar.collapsed .sidebar-nav {
  overflow: visible;
}
.sidebar.collapsed {
  overflow: visible;
}
.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.nav-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(200, 230, 230, 0.35);
  text-transform: uppercase;
  padding: 10px 18px 5px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border-radius: 10px;
  margin: 1px 8px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  width: calc(100% - 16px);
  text-align: left;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 115, 119, 0.35);
}
.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.nav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition);
}
.nav-chevron {
  font-size: 10px;
  margin-left: auto;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.nav-item.open .nav-chevron {
  transform: rotate(90deg);
}

/* Sub-menu */
.submenu {
  display: none;
  padding: 4px 0;
}
.nav-item.open .submenu {
  display: block;
}
.sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 48px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(200, 230, 230, 0.55);
  border-radius: 8px;
  margin: 1px 8px;
  transition: all var(--transition);
  white-space: nowrap;
}
.sub-link::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(200, 230, 230, 0.3);
  flex-shrink: 0;
  margin-left: -16px;
}
.sub-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sub-link.active {
  color: var(--accent);
}
.sub-link.active::before {
  background: var(--accent);
}

/* Sidebar badge */
.nav-badge {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  background: var(--accent);
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Sidebar mini-label */
.nav-mini-label {
  display: none;
}

/* ================================================================
   COLLAPSED SIDEBAR — Icon + Label style (like screenshot)
   ================================================================ */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  overflow: visible;
}

/* Hide text-only elements */
.sidebar.collapsed .nav-label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
/* Collapsed: visual spacer between groups using a thin rule */
.sidebar.collapsed .nav-item + .nav-label + .nav-item::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 auto 4px;
  border-radius: 1px;
}
.sidebar.collapsed .nav-text {
  display: none;
}
.sidebar.collapsed .nav-chevron {
  display: none;
}
.sidebar.collapsed .nav-badge {
  display: none;
}
.sidebar.collapsed .sb-name,
.sidebar.collapsed .sb-sub {
  display: none;
}
.sidebar.collapsed .su-name,
.sidebar.collapsed .su-role {
  display: none;
}
.sidebar.collapsed .sidebar-user a {
  display: none;
}
.sidebar.collapsed .submenu {
  display: none !important;
}

/* Brand — center the icon */
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 16px 0;
}
.sidebar.collapsed .sb-icon {
  margin: 0;
}

/* Nav item — stack icon + mini label vertically */
.sidebar.collapsed .nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 0;
}
/* Space after the last item before each label group */
.sidebar.collapsed .nav-label + .nav-item {
  margin-top: 2px;
}
.sidebar.collapsed .nav-link {
  width: 48px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px 0 4px;
  margin: 0 auto;
  border-radius: 10px;
  height: auto;
}
.sidebar.collapsed .nav-icon {
  font-size: 17px;
  width: auto;
  height: auto;
  margin: 0;
}

/* Mini label below icon */
.sidebar.collapsed .nav-mini-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(200, 230, 230, 0.5);
  text-align: center;
  padding: 0 2px 4px;
  white-space: nowrap;
  letter-spacing: 0.2px;
  line-height: 1;
  pointer-events: none;
}
.sidebar.collapsed .nav-link.active + .nav-mini-label,
.sidebar.collapsed .nav-item.active .nav-mini-label {
  color: var(--accent);
}

/* Footer */
.sidebar.collapsed .sidebar-footer {
  padding: 10px 0;
  display: flex;
  justify-content: center;
}
.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 6px;
}
.sidebar.collapsed .sidebar-user .su-av {
  margin: 0;
}

/* ── Hover flyout panel — appears to the right ── */
.collapsed-hover-panel {
  display: none;
} /* hidden by default always */

.sidebar.collapsed .nav-item:hover .collapsed-hover-panel {
  display: block;
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  pointer-events: none;
  animation: chpFadeIn 0.15s ease;
}
.sidebar.collapsed .nav-item.has-sub:hover .collapsed-hover-panel {
  pointer-events: auto;
}
@keyframes chpFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Arrow pointing left back to the icon */
.sidebar.collapsed .nav-item:hover .collapsed-hover-panel::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-right-color: var(--sidebar-bg);
}
.sidebar.collapsed .nav-item.has-sub:hover .collapsed-hover-panel::before {
  border-right-color: var(--card-bg);
}

/* Simple label (no sub-links) */
.chp-label {
  background: var(--sidebar-bg);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Flyout card with sub-links — matches screenshot exactly */
.chp-flyout {
  background: var(--sidebar-bg);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 200px;
  overflow: hidden;
}
.chp-flyout-title {
  padding: 12px 16px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(200, 230, 230, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.chp-flyout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(200, 230, 230, 0.75);
  text-decoration: none;
  transition: all 0.15s;
}
.chp-flyout-link::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(200, 230, 230, 0.3);
  flex-shrink: 0;
}
.chp-flyout-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  padding-left: 20px;
}
.chp-flyout-link:hover::before {
  background: var(--accent);
}

/* Active icon highlight */
.sidebar.collapsed .nav-item.active .nav-link {
  background: var(--sidebar-active);
  color: #fff;
}
.sidebar.collapsed .nav-item.active .nav-mini-label {
  color: var(--accent);
}

/* Mobile */

.sidebar.mobile-open {
  transform: translateX(0) !important;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: background var(--transition);
  overflow: hidden;
}
.sidebar-user:hover {
  background: var(--sidebar-hover);
}
.su-av {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.su-name {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.su-role {
  font-size: 10.5px;
  color: rgba(200, 230, 230, 0.45);
  white-space: nowrap;
}

/* ============================================================
   MAIN WRAPPER & CONTENT
   ============================================================ */
.main-wrapper {
  padding-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  transition: padding-left var(--transition);
  min-height: 100vh;
}
.main-wrapper.collapsed {
  padding-left: var(--sidebar-collapsed);
}
@media (max-width: 768px) {
  .main-wrapper {
    padding-left: 0 !important;
  }
}

.main-content {
  padding: 24px;
  max-width: 1600px;
}
@media (max-width: 640px) {
  .main-content {
    padding: 16px;
  }
}

/* ============================================================
   WELCOME / PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header-left {
}
.page-title {
  font-family: "Sora", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 540px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition);
  position: relative;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.sc1::before {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.sc2::before {
  background: linear-gradient(90deg, #2d9e6b, #34d399);
}
.sc3::before {
  background: linear-gradient(90deg, #e05252, #f87171);
}
.sc4::before {
  background: linear-gradient(90deg, var(--accent), #f59e0b);
}
.sc5::before {
  background: linear-gradient(90deg, #4183c4, #60a5fa);
}
.sc6::before {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.sc1 .stat-icon {
  background: var(--primary-light);
  color: var(--primary);
}
.sc2 .stat-icon {
  background: rgba(45, 158, 107, 0.12);
  color: #2d9e6b;
}
.sc3 .stat-icon {
  background: rgba(224, 82, 82, 0.12);
  color: var(--danger);
}
.sc4 .stat-icon {
  background: var(--accent-light);
  color: var(--accent);
}
.sc5 .stat-icon {
  background: rgba(65, 131, 196, 0.12);
  color: var(--info);
}
.sc6 .stat-icon {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

.stat-trend {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
}
.trend-up {
  background: rgba(45, 158, 107, 0.12);
  color: #2d9e6b;
}
.trend-down {
  background: rgba(224, 82, 82, 0.12);
  color: var(--danger);
}

.stat-count {
  font-family: "Sora", sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-top: 8px;
}
.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ============================================================
   DASHBOARD TABS
   ============================================================ */
.dash-tabs-wrap {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.dash-tab i {
  font-size: 12px;
}
.dash-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.dash-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 115, 119, 0.3);
}

.dash-module-panel {
  display: none;
}
.dash-module-panel.active {
  display: block;
}

/* ============================================================
   CARD COMPONENT
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(
    --radius-lg
  ); /* overflow: visible — allow UAM menus to overflow */
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  gap: 12px;
  border-bottom: 1.5px solid var(--border);
}
.card-title {
  font-family: "Sora", sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}
.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* ============================================================
   BOTTOM GRID (table + chart side by side)
   ============================================================ */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
}
@media (max-width: 1100px) {
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   TABLE CONTROLS
   ============================================================ */
.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  flex-wrap: wrap;
}
.srch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 0 12px;
  height: 36px;
  flex: 1;
  min-width: 180px;
}
.srch:focus-within {
  border-color: var(--primary);
}
.srch input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.srch input::placeholder {
  color: var(--text-light);
}
.fsel {
  height: 36px;
  padding: 0 30px 0 10px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--card-bg2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a7070' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 9px) center;
}
.fsel:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
[data-theme="dark"] .fsel {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a9a9a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.icon-refresh-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--card-bg2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 13px;
}
.icon-refresh-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.icon-refresh-btn i.spinning {
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.tbl-wrap {
  overflow-x: auto;
}
.tbl-wrap table {
  overflow: visible;
}
.tbl-wrap td {
  overflow: visible;
  position: relative;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead tr {
  border-bottom: 1.5px solid var(--border);
}
.data-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-light);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}
.data-table tbody tr:hover {
  background: var(--card-bg2);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.emp-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.emp-av {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.emp-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.emp-id {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
}

/* Status badges */
.s-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  display: inline-block;
}
.spresent {
  background: rgba(45, 158, 107, 0.12);
  color: #2d9e6b;
}
.sabsent {
  background: rgba(224, 82, 82, 0.12);
  color: var(--danger);
}
.sleave {
  background: rgba(244, 162, 97, 0.15);
  color: var(--accent-dark);
}
.sprocessing {
  background: rgba(65, 131, 196, 0.12);
  color: var(--info);
}
.sshipped {
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary);
}
.sdelivered {
  background: rgba(45, 158, 107, 0.12);
  color: #2d9e6b;
}
.scancelled {
  background: rgba(224, 82, 82, 0.12);
  color: var(--danger);
}
.spending {
  background: rgba(244, 162, 97, 0.15);
  color: var(--accent-dark);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1.5px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.pinfo {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.pbtns {
  display: flex;
  gap: 5px;
}
.pb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}
.pb:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pb.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
   CHART CARD
   ============================================================ */
.chart-card {
}
.csec {
  padding: 16px 18px;
}
.csec + .csec {
  border-top: 1.5px solid var(--border-light);
}
.clabel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.cwrap {
  position: relative;
  height: 140px;
}
.donut-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.dval {
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}
.dlbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}
.li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.ldot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ============================================================
   KPI MINI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 16px 18px;
}
.kpi-card {
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.kpi-icon {
  font-size: 18px;
  opacity: 0.8;
}
.kpi-val {
  font-family: "Sora", sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}
.kpi-lbl {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.8;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.btn i {
  font-size: 12px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(13, 115, 119, 0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(244, 162, 97, 0.3);
}
.btn-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.btn-sm {
  padding: 6px 13px;
  font-size: 12px;
  border-radius: 8px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 9px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 18px 24px;
  border-top: 1.5px solid var(--border);
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  min-width: 240px;
  max-width: 340px;
  font-size: 13px;
  font-weight: 700;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.3s ease;
  color: var(--text);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.toast.success .toast-icon {
  color: #2d9e6b;
}
.toast.error .toast-icon {
  color: var(--danger);
}
.toast.warning .toast-icon {
  color: var(--accent);
}
.toast.info .toast-icon {
  color: var(--info);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open {
  display: flex;
}
.modal {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal-lg {
  max-width: 760px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--card-bg2);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover {
  background: #fee2e2;
  color: var(--danger);
}
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 22px;
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 0;
}
.form-row.full {
  grid-template-columns: 1fr;
}
.form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}
.form-label .req {
  color: var(--danger);
}
.form-input,
.form-select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--card-bg2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.form-input:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
.section-divider {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 8px 0 10px;
  margin-bottom: 4px;
  border-bottom: 1.5px solid var(--border);
  margin-top: 4px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
body.login-page {
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}
.login-wrap {
  display: flex;
  width: 100%;
  min-height: 100vh;
}
.login-left {
  flex: 0 0 58%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0d2b2c 0%, #0d7377 50%, #14a67a 100%);
  display: flex;
  flex-direction: column;
}
.login-bg-circles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
}
.login-bg-circles svg {
  width: 100%;
  height: 100%;
}
.login-wave-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(to top, rgba(13, 43, 44, 0.5), transparent);
}
.login-left-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.login-brand-icon {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
}
.login-brand-title {
  font-family: "Sora", sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  text-align: center;
  letter-spacing: -1px;
  line-height: 1.1;
}
.login-brand-title span {
  color: var(--accent);
}
.login-sep {
  width: 60px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  margin: 10px 0;
}
.login-tagline {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  font-weight: 500;
  max-width: 320px;
  line-height: 1.6;
}
.login-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}
.login-feat {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  font-weight: 600;
}
.login-feat i {
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}
.login-left-footer {
  position: relative;
  z-index: 2;
  padding: 16px 40px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  text-align: center;
}
.login-right {
  flex: 1;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
}
.login-right-logo {
  margin-bottom: 28px;
}
.login-right-logo img {
  border-radius: 12px;
}
.login-form-box {
  width: 100%;
  max-width: 380px;
}
.login-form-heading h2 {
  font-family: "Sora", sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.login-form-heading p {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 28px;
}
.login-field {
  margin-bottom: 18px;
}
.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.login-input-wrap {
  position: relative;
}
.login-input-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--card-bg2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}
.login-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.login-eye-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  display: flex;
  align-items: center;
  padding: 4px;
}
.login-eye-btn:hover {
  color: var(--primary);
}
.login-btn-signin {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--primary), #14a67a);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 6px 20px rgba(13, 115, 119, 0.35);
  margin-top: 8px;
}
.login-btn-signin:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(13, 115, 119, 0.45);
}
.login-btn-signin:disabled {
  opacity: 0.75;
  transform: none;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .login-left {
    display: none;
  }
  .login-right {
    padding: 32px 24px;
  }
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-hero {
  background: linear-gradient(135deg, var(--primary), #14a67a);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.profile-av {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-hero-info {
  color: #fff;
}
.profile-hero-name {
  font-family: "Sora", sans-serif;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 4px;
}
.profile-hero-role {
  font-size: 14px;
  opacity: 0.75;
  font-weight: 600;
}
.profile-hero-badges {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.profile-hero-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}
.profile-section {
  padding: 20px;
}
.profile-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.profile-info-item:last-child {
  border-bottom: none;
}
.pii-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}
.pii-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pii-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

/* ============================================================
   RESPONSIVE — Tablet (max 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .bottom-grid {
    grid-template-columns: 1fr !important;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .topbar-center {
    max-width: 280px;
  }
  .profile-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   RESPONSIVE — Mobile landscape / small tablet (max 768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Topbar */
  .topbar {
    padding: 0 14px;
    gap: 8px;
  }
  .topbar-left {
    width: auto;
    gap: 8px;
  }
  .topbar-center {
    display: none;
  }
  .topbar-right {
    gap: 6px;
  }
  .logo-name,
  .logo-sub {
    display: none;
  }
  .profile-info {
    display: none;
  }
  .profile-chevron {
    display: none;
  }
  .profile-btn {
    padding: 4px;
    border-radius: 10px;
  }

  /* Sidebar */
  .sidebar {
    transform: translateX(-100%);
    width: 260px !important;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Main wrapper */
  .main-wrapper {
    padding-left: 0 !important;
  }
  .main-content {
    padding: 14px;
  }

  /* Page header */
  .page-header {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-header-right {
    width: 100%;
  }
  .page-header-right .btn {
    flex: 1;
    justify-content: center;
  }
  .page-title {
    font-size: 18px;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    margin-bottom: 10px;
  }
  .stat-count {
    font-size: 22px;
  }
  .stat-card {
    padding: 14px;
  }

  /* Dash tabs */
  .dash-tabs-wrap {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .dash-tabs-wrap::-webkit-scrollbar {
    display: none;
  }
  .dash-tab span {
    display: none;
  }
  .dash-tab {
    padding: 9px 13px;
    flex-shrink: 0;
  }

  /* Cards */
  .card-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .table-controls {
    padding: 10px 14px;
    gap: 8px;
  }
  .srch {
    min-width: 0;
  }
  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 12px;
  }
  .pagination {
    padding: 10px 14px;
  }
  .tbl-wrap {
    -webkit-overflow-scrolling: touch;
  }

  /* Bottom grid */
  .bottom-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  /* KPI grid */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 0;
    margin-bottom: 14px;
    gap: 10px;
  }
  .kpi-val {
    font-size: 17px;
  }

  /* Profile */
  .profile-hero {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    gap: 16px;
  }
  .profile-hero > div:last-child {
    margin-left: 0;
  }
  .profile-hero-badges {
    justify-content: center;
  }
  .profile-grid {
    grid-template-columns: 1fr !important;
  }

  /* Form */
  .form-row {
    grid-template-columns: 1fr !important;
  }

  /* Dropdown menus */
  .dropdown-menu {
    right: 0;
    left: auto;
    width: 200px;
  }
  .notif-panel {
    right: -40px;
    width: 290px;
  }
}

/* ============================================================
   RESPONSIVE — Mobile portrait (max 480px)
   ============================================================ */
@media (max-width: 480px) {
  .main-content {
    padding: 10px;
  }
  .topbar {
    padding: 0 10px;
  }

  /* Stats: single column on tiny screens */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .stat-count {
    font-size: 20px;
  }
  .stat-card {
    padding: 12px;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  /* KPI: 2 col */
  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .kpi-card {
    padding: 12px;
  }
  .kpi-val {
    font-size: 15px;
  }

  /* Tabs: scrollable row */
  .dash-tabs-wrap {
    gap: 5px;
  }
  .dash-tab {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Tables: tighter */
  .data-table th {
    font-size: 10px;
    padding: 8px 10px;
  }
  .data-table td {
    font-size: 11.5px;
    padding: 9px 10px;
  }
  .emp-av {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
  .emp-name {
    font-size: 12px;
  }
  .emp-id {
    font-size: 10px;
  }

  /* Buttons */
  .btn {
    padding: 8px 14px;
    font-size: 12px;
  }
  .btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  /* Notif panel */
  .notif-panel {
    width: 260px;
    right: -60px;
  }

  /* Page title */
  .page-title {
    font-size: 16px;
  }
  .page-subtitle {
    font-size: 12px;
  }

  /* Card header */
  .card-title {
    font-size: 13.5px;
  }
  .card-sub {
    font-size: 11px;
  }

  /* Profile hero */
  .profile-hero {
    padding: 16px;
  }
  .profile-av {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }
  .profile-hero-name {
    font-size: 18px;
  }

  /* Login page */
  .login-right {
    padding: 24px 16px;
  }
  .login-form-box {
    max-width: 100%;
  }
  .login-form-heading h2 {
    font-size: 22px;
  }
}

/* ============================================================
   PRODUCTS PAGE — responsive grid
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
}
@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
@media (max-width: 380px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.product-img {
  aspect-ratio: 1/1;
  background: var(--card-bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}
.product-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 115, 119, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity var(--transition);
}
.product-card:hover .product-img-overlay {
  opacity: 1;
}
.prod-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background var(--transition);
  cursor: pointer;
}
.prod-action-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}
.badge-new {
  background: var(--primary);
  color: #fff;
}
.badge-sale {
  background: var(--accent);
  color: #fff;
}
.badge-hot {
  background: var(--danger);
  color: #fff;
}
.badge-out {
  background: #64748b;
  color: #fff;
}

.product-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-category {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.product-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.product-rating {
  display: flex;
  align-items: center;
  gap: 5px;
}
.stars {
  color: #f4a261;
  font-size: 11px;
  letter-spacing: 1px;
}
.rating-count {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
}
.product-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.product-price {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.product-mrp {
  font-size: 11.5px;
  color: var(--text-light);
  text-decoration: line-through;
  font-weight: 500;
}
.product-discount {
  font-size: 11px;
  font-weight: 800;
  color: var(--success);
}
.product-footer {
  padding: 10px 14px;
  border-top: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.product-stock {
  font-size: 11.5px;
  font-weight: 700;
}
.stock-ok {
  color: var(--success);
}
.stock-low {
  color: var(--warning);
}
.stock-out {
  color: var(--danger);
}

/* Add product modal tabs */
.prod-modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.prod-tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  transition: all var(--transition);
  cursor: pointer;
}
.prod-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.prod-tab-panel {
  display: none;
}
.prod-tab-panel.active {
  display: block;
}

/* Filters sidebar */

.filter-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 10px;
}

/* Mobile filter toggle */
@media (max-width: 900px) {
}

/* View toggle (grid / list) */
.view-toggle {
  display: flex;
  gap: 4px;
}
.view-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all var(--transition);
  cursor: pointer;
}
.view-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* List view */
.products-grid.list-view {
  grid-template-columns: 1fr !important;
}
.list-view .product-card {
  flex-direction: row;
}
.list-view .product-img {
  width: 120px;
  flex-shrink: 0;
  aspect-ratio: auto;
  height: 120px;
  border-radius: 0;
}
.list-view .product-body {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.list-view .product-price-row {
  margin-top: 0;
  padding-top: 0;
}
@media (max-width: 540px) {
  .list-view .product-card {
    flex-direction: column;
  }
  .list-view .product-img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/1;
  }
}

/* ============================================================
   SCROLLBAR (global)
   ============================================================ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ============================================================
   UTILITY
   ============================================================ */
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.fw-700 {
  font-weight: 700;
}
.text-primary {
  color: var(--primary);
}
.text-muted {
  color: var(--text-muted);
}
.text-sm {
  font-size: 12px;
}
.text-danger {
  color: var(--danger);
}
.text-success {
  color: var(--success);
}
.rounded {
  border-radius: var(--radius);
}

/* ============================================================
   PRODUCT LIST VIEW (Table Style)
   ============================================================ */
#productsGrid {
  gap: 0;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ============================================================
   SIDEBAR SUB-CATEGORY INDENT STYLES
   ============================================================ */
.sub-link-indent {
  padding-left: 32px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  opacity: 0.9;
}
.sub-link-indent:hover {
  opacity: 1;
}
.sub-cat-icon {
  width: 14px;
  font-size: 10px;
  color: var(--accent);
  opacity: 0.8;
  margin-right: 4px;
}

/* ============================================================
   CATEGORIES PAGE STYLES
   ============================================================ */
.cat-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.cat-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.cat-card-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1.5px solid var(--border-light);
}
.cat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.cat-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.cat-card-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.cat-card-body {
  padding: 12px 16px;
}
.subcat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subcat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--card-bg2);
  border: 1px solid var(--border-light);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  transition: background var(--transition);
}
.subcat-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.subcat-item-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 20px;
}

.cat-card-footer {
  padding: 10px 16px;
  border-top: 1.5px solid var(--border-light);
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ============================================================
   ENHANCED STYLES — New modules + UX improvements
   ============================================================ */
/* ============================================================
   GLOBAL CUSTOM SELECT ARROW — applies to all <select> elements
   ============================================================ */
select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%235a7070' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 9px) center !important;
  background-size: 11px !important;
  padding-right: 28px !important;
  cursor: pointer;
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%237a9a9a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success {
  background: rgba(45, 158, 107, 0.12);
  color: #2d9e6b;
}
.badge-warning {
  background: rgba(244, 162, 97, 0.15);
  color: #d97706;
}
.badge-danger {
  background: rgba(224, 82, 82, 0.12);
  color: #e05252;
}
.badge-info {
  background: rgba(65, 131, 196, 0.12);
  color: #4183c4;
}

/* Table action buttons */
.tbl-act-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card-bg2);
  color: var(--text-muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.tbl-act-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.tbl-act-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(224, 82, 82, 0.1);
}

/* Order Drawer */
#orderDrawer {
  scrollbar-width: thin;
}
#orderDrawer::-webkit-scrollbar {
  width: 4px;
}
#orderDrawer::-webkit-scrollbar-track {
  background: transparent;
}
#orderDrawer::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* Settings nav active */
#settingsTabs button {
  transition: all 0.2s ease;
}
#settingsTabs button:hover {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
}

/* Toggle switch polish */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Restock stock bar */
.stock-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stock-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.stock-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Staff Activity Dot */
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  margin-right: 4px;
}

/* Inventory alert banner */
.alert-banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.alert-banner-warning {
  background: linear-gradient(135deg, #fff3cd, #ffeeba);
  border: 1.5px solid #ffd107;
}

/* Customer avatar */
.cust-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Form group improved */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group .form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.form-group .req {
  color: var(--danger);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card-bg2);
  color: var(--text);
  font-size: 13px;
  transition: all var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a7070' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 10px) center;
  background-size: 12px;
}
[data-theme="dark"] select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a9a9a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Page fade-in */
.main-content {
  animation: fadeUp 0.3s ease;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive for new pages */
@media (max-width: 900px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Sidebar footer link */
.sidebar-footer a:hover {
  opacity: 1 !important;
}

/* Print-friendly */
@media print {
  .sidebar,
  .topbar,
  .page-header-right {
    display: none;
  }
  .main-content {
    margin: 0;
    padding: 0;
  }
}

/* ============================================================
   THREE-DOT / UAM CONTEXT MENU
   ============================================================ */
.uam-wrap {
  position: relative;
  display: inline-block;
}
.uam-trigger {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card-bg2);
  color: var(--text-muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.uam-trigger:hover,
.uam-trigger.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Menu uses fixed positioning — set via JS to escape any overflow:hidden parent */
.uam-menu {
  position: fixed;
  min-width: 180px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 99999;
  padding: 6px;
  display: none;
  animation: uamFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.uam-menu.open {
  display: block;
}
@keyframes uamFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.uam-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}
.uam-item i {
  width: 15px;
  text-align: center;
  font-size: 12px;
  flex-shrink: 0;
  opacity: 0.75;
}
.uam-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.uam-item:hover i {
  opacity: 1;
}
.uam-item.uam-danger {
  color: var(--danger);
}
.uam-item.uam-danger:hover {
  background: rgba(224, 82, 82, 0.1);
  color: var(--danger);
}
.uam-item.uam-warning:hover {
  background: rgba(244, 162, 97, 0.1);
  color: var(--warning);
}
.uam-divider {
  height: 1px;
  background: var(--border-light, var(--border));
  margin: 4px 2px;
}

/* ================================================================
   FULLY RESPONSIVE — All breakpoints
   ================================================================ */

/* ── Shared responsive helpers ── */
.hide-mobile {
  display: initial !important;
}
.show-mobile {
  display: none !important;
}

/* ================================================================
   TABLET  ≤ 1100px
   ================================================================ */
@media (max-width: 1100px) {
  .stats-grid[style*="repeat(5"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .gateway-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .reviews-top-grid {
    grid-template-columns: 1fr !important;
  }
  .txn-top-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ================================================================
   SMALL TABLET / LARGE PHONE  ≤ 900px
   ================================================================ */
@media (max-width: 900px) {
  /* Layout */
  .main-wrapper {
    margin-left: 0 !important;
  }
  .sidebar {
    left: -var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 300;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-overlay.active {
    display: block !important;
  }
  .topbar-left {
    width: auto !important;
  }

  /* Page header stacks */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header-right {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-header-right .btn {
    flex: 1;
    justify-content: center;
    min-width: 120px;
  }

  /* Stats grid collapses to 2 cols */
  .stats-grid,
  .stats-grid[style*="repeat(4"],
  .stats-grid[style*="repeat(5"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .gateway-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Tables: horizontal scroll */
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tbl-wrap table {
    min-width: 700px;
  }

  /* Card padding reduce */
  .card {
    border-radius: var(--radius);
  }

  /* Hide less-important columns on tablets */
  .tbl-hide-sm {
    display: none !important;
  }

  /* Review layout */
  .review-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .review-comment-col {
    border-left: none !important;
    border-top: 1px solid var(--border) !important;
    padding-left: 0 !important;
    padding-top: 12px !important;
  }

  /* Dashboard grids */
  .dash-mid-grid {
    grid-template-columns: 1fr !important;
  }
  .dash-bot-grid {
    grid-template-columns: 1fr !important;
  }

  /* Products layout */
  .products-layout-wrap {
    grid-template-columns: 1fr !important;
  }

  /* Sidebar from sidebar.php nav */
  .sidebar {
    width: var(--sidebar-width) !important;
  }
  .sidebar.collapsed {
    width: var(--sidebar-width) !important;
  }
  .sidebar.collapsed .nav-text,
  .sidebar.collapsed .nav-chevron,
  .sidebar.collapsed .nav-badge {
    opacity: 1 !important;
    width: auto !important;
    display: inline !important;
  }
  .sidebar.collapsed .nav-label {
    opacity: 1 !important;
    height: auto !important;
    padding: inherit !important;
    overflow: visible !important;
  }
  .sidebar.collapsed .nav-link {
    width: 100% !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 10px 14px !important;
  }
  .sidebar.collapsed .nav-mini-label {
    display: none !important;
  }
  .sidebar.collapsed .collapsed-hover-panel {
    display: none !important;
  }
  .sidebar.collapsed .sb-name,
  .sidebar.collapsed .sb-sub,
  .sidebar.collapsed .su-name,
  .sidebar.collapsed .su-role {
    display: block !important;
    opacity: 1 !important;
    width: auto !important;
  }
  .sidebar.collapsed .sidebar-brand {
    justify-content: flex-start !important;
    padding: inherit !important;
  }
  .sidebar.collapsed .sidebar-footer {
    padding: inherit !important;
  }
  .sidebar.collapsed .sidebar-user {
    justify-content: flex-start !important;
  }
  .sidebar.collapsed .sidebar-user a {
    display: inline !important;
  }
}

/* ================================================================
   PHONE  ≤ 640px
   ================================================================ */
@media (max-width: 640px) {
  :root {
    --topbar-height: 56px;
  }

  /* Main content padding */
  .main-content {
    padding: 16px 12px;
  }
  .page-header {
    padding: 0;
    margin-bottom: 16px;
  }
  .page-title {
    font-size: 20px !important;
  }

  /* Stats: 2 col on phone */
  .stats-grid,
  .stats-grid[style*="repeat(4"],
  .stats-grid[style*="repeat(5"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .stat-card {
    padding: 14px !important;
  }
  .stat-count {
    font-size: 22px !important;
  }

  /* Cards */
  .card {
    border-radius: 12px;
  }

  /* Gateway grid: 1 col */
  .gateway-grid {
    grid-template-columns: 1fr !important;
  }

  /* Toolbar wraps */
  .srch {
    min-width: 100% !important;
  }

  /* Topbar compact */
  .topbar {
    padding: 0 12px !important;
    gap: 8px !important;
  }
  .search-box {
    display: none !important;
  }
  .topbar-right .topbar-action:not(:last-child):not(:nth-last-child(2)) {
    display: none !important;
  }

  /* Modals full-screen on phone */
  .modal-backdrop .modal {
    max-width: 100% !important;
    width: 100vw !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
  }
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  /* Drawers full-width */
  #orderDrawer,
  #payDrawer,
  #returnDrawer {
    width: 100vw !important;
  }

  /* Buttons in header: icon-only */
  .page-header-right .btn-sm .btn-label {
    display: none;
  }

  /* Table min-width less aggressive */
  .tbl-wrap table {
    min-width: 580px;
  }

  /* Brands/banners grid: 1 col */
  #brandsGrid {
    grid-template-columns: 1fr !important;
  }
  #bannersGrid {
    grid-template-columns: 1fr !important;
  }

  /* Order drawer */
  .order-detail-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hide secondary topbar actions */
  .hide-mobile {
    display: none !important;
  }
  .show-mobile {
    display: initial !important;
  }

  /* Pagination compact */
  #payPagination
    button:not(:first-child):not(:last-child):not(:nth-child(2)):not(
      :nth-last-child(2)
    ) {
    display: none;
  }
}

/* ================================================================
   VERY SMALL PHONE  ≤ 375px
   ================================================================ */
@media (max-width: 375px) {
  .stats-grid,
  .stats-grid[style*="repeat(4"],
  .stats-grid[style*="repeat(5"] {
    grid-template-columns: 1fr !important;
  }
  .stat-card {
    padding: 12px !important;
  }
  .main-content {
    padding: 12px 8px;
  }
}

/* ── Review row layout (desktop) ── */
.review-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.review-product-col {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 200px;
  flex-shrink: 0;
}
.review-comment-col {
  flex: 1;
  border-left: 1px solid var(--border);
  padding-left: 16px;
  min-width: 0;
}
.review-meta-col {
  width: 130px;
  flex-shrink: 0;
  text-align: right;
}
.review-actions-col {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* ── Page-level grid classes used in new pages ── */
.reviews-top-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}
.txn-top-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* ================================================================
   FLATPICKR CUSTOM THEME — matches admin panel colors
   ================================================================ */
.flatpickr-calendar {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  background: var(--card-bg) !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
}
.flatpickr-month {
  background: var(--card-bg) !important;
  color: var(--text) !important;
}
.flatpickr-weekday {
  background: var(--card-bg) !important;
  color: var(--text-muted) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
}
.flatpickr-months .flatpickr-month {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.flatpickr-day {
  color: var(--text) !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}
.flatpickr-day:hover {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border-color: transparent !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.flatpickr-day.inRange {
  background: var(--primary-light) !important;
  border-color: transparent !important;
  color: var(--primary) !important;
  box-shadow: none !important;
}
.flatpickr-day.today {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
.flatpickr-day.today:hover {
  background: var(--primary) !important;
  color: #fff !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: var(--text-light) !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: var(--card-bg) !important;
  color: var(--text) !important;
}
.numInputWrapper span.arrowUp:after {
  border-bottom-color: var(--text-muted) !important;
}
.numInputWrapper span.arrowDown:after {
  border-top-color: var(--text-muted) !important;
}
.flatpickr-prev-month svg,
.flatpickr-next-month svg {
  fill: var(--text-muted) !important;
}
.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
  fill: var(--primary) !important;
}
.flatpickr-input.fp-date {
  cursor: pointer;
  caret-color: transparent;
}
.flatpickr-input.fp-date:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
[data-theme="dark"] .flatpickr-calendar {
  background: #1a2424 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .flatpickr-day {
  color: rgba(200, 230, 230, 0.85) !important;
}
[data-theme="dark"] .flatpickr-month,
[data-theme="dark"] .flatpickr-weekday {
  background: #1a2424 !important;
  color: rgba(200, 230, 230, 0.5) !important;
}
