/* public\admin\css\theme.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* --- BRAND COLORS (Figma Integration) --- */
  --color-primary: #0F4DFC;
  --color-primary-light: #DBEAFE;
  --color-text-main: #111827;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-disabled: #D1D5DB;
  --color-bg-white: #FFFFFF;
  --color-bg-canvas: #F4F7FC;
  /* Softer app-like background */
  --color-success: #10B981;
  --color-accent-promo: #F59E0B;

  --font-family-base: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

  /* --- LAYOUT DIMENSIONS (Untouched) --- */
  --sidebar-collapsed: 84px;
  --sidebar-open: 260px;

  /* --- SIDEBAR THEME (#0F4DFC Vibrant Blue) --- */
  --sb-blue-1: #0F4DFC;
  --sb-blue-2: #0A3CDA;
  --sb-blue-3: #0626A6;
  --sb-hover: rgba(255, 255, 255, 0.15);
  --sb-active: rgba(255, 255, 255, 0.25);
  --sb-border: rgba(255, 255, 255, 0.15);
  --sb-line: rgba(255, 255, 255, 0.15);
  --sb-shadow: rgba(15, 77, 252, 0.2);
  --sb-scroll-track: transparent;
  --sb-scroll-thumb-start: rgba(255, 255, 255, 0.4);
  --sb-scroll-thumb-end: rgba(255, 255, 255, 0.2);
  --sb-sub-bg: rgba(0, 0, 0, 0.15);
  --sb-sub-border: rgba(255, 255, 255, 0.08);
  --sb-sub-hover: rgba(255, 255, 255, 0.12);
  --sb-profile-start: #0B3BE0;
  --sb-profile-end: #0626A6;
  --sb-avatar-bg: #FFFFFF;
  --sb-avatar-text: #0F4DFC;
  --text-light: #EAF1FF;

  /* --- ADMIN SHELL --- */
  --admin-bg-page: #F4F7FC;
  --admin-text-strong: #0f172a;
  --admin-text-soft: #D1E0FF;
  --admin-muted: #64748b;
  --admin-border-soft: #E2E8F0;
  --admin-table-border: #E2E8F0;
  --admin-table-head-bg: #f8f8f8;
  --admin-table-head-text: #000000;
  --admin-panel-bg: #ffffff;
  --admin-panel-border: #E2E8F0;

  --admin-navbar-start: #0F4DFC;
  --admin-navbar-end: #0B3BE0;
  --admin-navbar-border: #0626A6;
  --admin-footer-start: #0F4DFC;
  --admin-footer-end: #0626A6;

  --admin-overlay: rgba(15, 23, 42, 0.5);
  --admin-btn-primary: #0F4DFC;
  --admin-btn-primary-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-base);
  color: var(--color-text-main);
  background: var(--color-bg-canvas);
  -webkit-font-smoothing: antialiased;
  /* UX Polish: sharper text */
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid rgba(15, 77, 252, 0.55);
  outline-offset: 2px;
}

body.admin-shell {
  background: var(--admin-bg-page);
  color: var(--admin-text-strong);
  --sidebar-width: var(--sidebar-collapsed);
}

.tenzo-page {
  min-height: 100vh;
}

.tenzo-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 84px 16px 56px;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tenzo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tenzo-navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 74px;
  background: linear-gradient(90deg, var(--admin-navbar-start) 0%, var(--admin-navbar-end) 100%);
  border-bottom: 1px solid var(--admin-navbar-border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 45;
  color: var(--admin-btn-primary-text);
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 12px rgba(15, 77, 252, 0.15);
  /* UX Polish */
}

.tenzo-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tenzo-navbar h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1;
}

.tenzo-navbar p {
  margin: 2px 0 0;
  color: var(--admin-text-soft);
  font-size: 13px;
}

.tenzo-hamburger {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--admin-btn-primary-text);
  cursor: pointer;
  display: none;
  transition: background 0.2s ease;
}

.tenzo-hamburger:active {
  background: rgba(255, 255, 255, 0.2);
}

.tenzo-btn-logout {
  border: 0;
  background: var(--admin-panel-bg);
  color: var(--color-primary);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tenzo-btn-logout:hover {
  background: var(--color-bg-canvas);
}

.tenzo-nav-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tenzo-nav-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--admin-btn-primary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.tenzo-nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.tenzo-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--admin-navbar-start);
}

.tenzo-profile-trigger {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--admin-btn-primary-text);
  padding: 6px 10px 6px 6px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tenzo-profile-trigger:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tenzo-profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-bg-white);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.tenzo-top-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.tenzo-top-profile-name {
  font-size: 12px;
  font-weight: 700;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenzo-top-profile-role {
  font-size: 10px;
  color: var(--admin-text-soft);
  letter-spacing: 0.08em;
}

.tenzo-profile-arrow {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.tenzo-nav-actions.open .tenzo-profile-arrow {
  transform: rotate(180deg);
}

/* UX Polish: Dropdown Fade Animation */
@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tenzo-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  border-radius: 12px;
  border: 1px solid var(--admin-border-soft);
  background: var(--admin-panel-bg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
  padding: 8px;
  display: none;
  z-index: 70;
}

.tenzo-nav-actions.open .tenzo-profile-dropdown {
  display: block;
  animation: dropdownFade 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tenzo-profile-dropdown-head {
  padding: 6px 6px 10px;
  border-bottom: 1px solid var(--admin-border-soft);
  margin-bottom: 6px;
}

.tenzo-profile-dropdown-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text-strong);
}

.tenzo-profile-dropdown-email {
  font-size: 12px;
  color: var(--admin-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenzo-dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 10px;
  color: var(--admin-text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.tenzo-dropdown-item:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tenzo-dropdown-logout-form {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--admin-border-soft);
}

.tenzo-dropdown-logout {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.tenzo-dropdown-logout:hover {
  background: #fee2e2;
}

.tenzo-footer {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  height: 42px;
  background: linear-gradient(180deg, var(--admin-footer-start) 0%, var(--admin-footer-end) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  color: var(--text-light);
  font-size: 13px;
  text-align: center;
  z-index: 45;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 16px;
}

.card {
  background: var(--admin-panel-bg);
  border: 1px solid var(--admin-panel-border);
  border-radius: 12px;
  /* Soft app-like corner */
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  /* UX Polish: Lift effect */
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 77, 252, 0.08);
  border-color: rgba(15, 77, 252, 0.2);
}

.card p {
  margin: 0 0 8px;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 500;
}

.card h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}

.panel {
  background: var(--admin-panel-bg);
  border: 1px solid var(--admin-panel-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.links {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.links a {
  background: linear-gradient(180deg, var(--color-primary) 0%, #0A3CDA 100%);
  color: var(--admin-btn-primary-text);
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(15, 77, 252, 0.2);
  transition: all 0.2s ease;
}

.links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 77, 252, 0.3);
}

.table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--admin-table-border);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--admin-table-border);
  padding: 14px 16px;
  font-size: 14px;
}

/* managing hover effects */
td:hover {
  background: #fbfbfb;
  border-color: #bdccf0;
  border-width: 0.1px;
}

.admin-details-row td {
  background: #f8fbff;
  border-top: 0;
}

.admin-details-cell {
  padding: 10px 14px;
}

/* Zebra stripping inside table
tr:nth-child(even) {
  background: #eee;
} */

th {
  background: var(--admin-table-head-bg);
  color: var(--admin-table-head-text);
  font-weight: 600;
  font-size: 13px;
}

.empty,
.panel-subtitle {
  color: var(--admin-muted);
  font-size: 14px;
}

.panel-subtitle {
  margin: 0 0 10px;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.table-controls-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 420px;
  flex-wrap: wrap;
}

.table-search {
  flex: 1 1 220px;
  min-width: 180px;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

.table-filter {
  flex: 0 1 190px;
  min-width: 150px;
}

.custom-filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  font-size: 14px;
}

.table-limit label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--admin-muted);
}

.table-limit select {
  padding: 7px 10px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 6px;
  background: #fff;
}

.pagination-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-summary {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.35;
}

.pagination-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-page {
  background: #e9ecef;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: #495057;
  font-size: 13px;
  min-width: 34px;
}

.btn-page.active {
  background: #2563eb;
  color: #fff;
  cursor: default;
}

.tenzo-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-open);
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-right: 1px solid var(--sb-border);
  box-shadow: 8px 0 24px var(--sb-shadow);
  background: linear-gradient(180deg, var(--sb-blue-1) 0%, var(--sb-blue-2) 48%, var(--sb-blue-3) 100%);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 60;
}

.tenzo-sidebar-overlay {
  display: none;
}

.tenzo-brand {
  padding: 18px 14px 12px;
  border-bottom: 1px solid var(--sb-line);
}

.tenzo-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-bg-white);
  white-space: nowrap;
}

.tenzo-role {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-light);
  white-space: nowrap;
}

.tenzo-logo .pin-btn {
  margin-left: auto;
}

.pin-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--sb-line);
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s ease;
}

.pin-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.pin-btn.active {
  background: rgba(255, 255, 255, 0.28);
}

.sb-scroll-wrap {
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 16px;
}

.tenzo-nav {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  scrollbar-gutter: stable;
}

.tenzo-nav::-webkit-scrollbar {
  width: 8px;
}

.tenzo-nav::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.tenzo-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tenzo-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.sb-bottom-shadow {
  pointer-events: none;
  background: linear-gradient(180deg, rgba(16, 47, 159, 0) 0%, rgba(8, 24, 74, 0.15) 100%);
}

.sb-group {
  border-radius: 12px;
}

.sb-parent {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text-light);
  text-decoration: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.sb-link:hover {
  background: var(--sb-hover);
}

.sb-link.active {
  background: var(--sb-active);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.sb-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: background 0.2s ease;
}

.sb-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sb-toggle i {
  transition: transform 0.2s ease;
}

.sb-toggle.open i {
  transform: rotate(180deg);
}

.sb-submenu {
  display: none;
  margin: 4px 2px 4px 8px;
  border-radius: 10px;
  background: var(--sb-sub-bg);
  border: 1px solid var(--sb-sub-border);
  overflow: hidden;
}

.sb-group.is-open>.sb-submenu {
  display: block;
  animation: dropdownFade 0.2s ease forwards;
  /* Smooth open */
}

.sb-sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 16px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
  /* UX Polish */
}

.sb-sub-link:hover {
  color: var(--color-bg-white);
  background: var(--sb-sub-hover);
  padding-left: 20px;
  /* UX Polish: Indent on hover */
}

.sb-sub-link.active {
  color: var(--color-bg-white);
  background: var(--sb-active);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.sb-sub-link i {
  width: 14px;
  text-align: center;
}

/* !!! UNTOUCHED CUSTOM ICON STYLING !!! */
.sb-sub-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
  display: inline-block;
  flex: 0 0 20px;
  vertical-align: middle;
  margin-left: -3px;
  filter: brightness(0) invert(1) drop-shadow(0 0 1px rgba(0, 0, 0, 0.25));
  opacity: 0.95;
}

.tenzo-sidebar-profile {
  min-height: 86px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--sb-line);
  background: linear-gradient(180deg, var(--sb-profile-start) 0%, var(--sb-profile-end) 100%);
}

.tenzo-avatar-wrap {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  position: relative;
}

.tenzo-avatar,
.tenzo-avatar-fallback {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.66);
  box-shadow: 0 6px 14px rgba(2, 14, 52, 0.42);
}

.tenzo-avatar {
  object-fit: cover;
  background: var(--sb-avatar-bg);
}

.tenzo-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sb-avatar-text);
  font-size: 17px;
  font-weight: 700;
  background: var(--sb-avatar-bg);
}

.tenzo-profile-info {
  min-width: 0;
  color: var(--text-light);
}

.tenzo-profile-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenzo-profile-role {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-light);
}

.tenzo-profile-email {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-label {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease;
}

/* --- SIDEBAR TOGGLE LOGIC (DESKTOP) --- */
body:not(.sidebar-pinned) .tenzo-sidebar {
  width: var(--sidebar-collapsed);
}

body:not(.sidebar-pinned) .tenzo-sidebar .nav-label,
body:not(.sidebar-pinned) .tenzo-sidebar .sb-toggle {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body:not(.sidebar-pinned) .tenzo-sidebar:not(:hover) .sb-submenu {
  display: none !important;
}

body:not(.sidebar-pinned) .tenzo-sidebar:not(:hover) .tenzo-profile-info {
  display: none;
}

body:not(.sidebar-pinned) .tenzo-sidebar:not(:hover) .tenzo-sidebar-profile {
  justify-content: flex-start;
  padding: 10px 12px;
}

body:not(.sidebar-pinned) .tenzo-sidebar:not(:hover) .tenzo-avatar-wrap {
  margin: 0;
}

body:not(.sidebar-pinned) .tenzo-sidebar:hover {
  width: var(--sidebar-open);
}

body:not(.sidebar-pinned) .tenzo-sidebar:hover .nav-label,
body:not(.sidebar-pinned) .tenzo-sidebar:hover .sb-toggle {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body:not(.sidebar-pinned) .tenzo-sidebar:hover .tenzo-profile-info {
  display: block;
}

body:not(.sidebar-pinned) .tenzo-sidebar:hover~.tenzo-main {
  margin-left: var(--sidebar-open);
}

body:not(.sidebar-pinned) .tenzo-sidebar:hover~.tenzo-main .tenzo-navbar,
body:not(.sidebar-pinned) .tenzo-sidebar:hover~.tenzo-main .tenzo-footer {
  left: var(--sidebar-open);
}

body.sidebar-pinned {
  --sidebar-width: var(--sidebar-open);
}

body.sidebar-pinned .tenzo-sidebar {
  width: var(--sidebar-open);
}

body.sidebar-pinned .nav-label,
body.sidebar-pinned .sb-toggle {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1200px) {
  .cards {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .links {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-open: 260px;
  }

  /* 1. COMPLETELY HIDE PIN ON MOBILE */
  .pin-btn {
    display: none !important;
  }

  .tenzo-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 2. FORCE SIDEBAR TO BE HIDDEN DRAWER ON MOBILE (Ignore Pinned State) */
  .tenzo-sidebar,
  body.sidebar-pinned .tenzo-sidebar {
    width: var(--sidebar-open) !important;
    transform: translateX(-100%) !important;
  }

  body.sidebar-open .tenzo-sidebar,
  body.sidebar-open.sidebar-pinned .tenzo-sidebar {
    transform: translateX(0) !important;
  }

  .tenzo-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--admin-overlay);
    z-index: 55;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
  }

  body.sidebar-open .tenzo-sidebar-overlay {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  /* 3. RESET MAIN CONTENT AREA (Ignore Pinned State) */
  .tenzo-main,
  body.sidebar-pinned .tenzo-main {
    margin-left: 0 !important;
    padding-top: 92px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .tenzo-navbar,
  body.sidebar-pinned .tenzo-navbar,
  .tenzo-footer,
  body.sidebar-pinned .tenzo-footer {
    left: 0 !important;
  }

  .tenzo-top-profile-meta {
    display: none;
  }

  .tenzo-nav-left {
    min-width: 0;
    gap: 8px;
  }

  .tenzo-navbar {
    height: auto;
    min-height: 74px;
    padding: 8px 10px;
  }

  .tenzo-navbar h1 {
    font-size: clamp(26px, 6vw, 34px);
    line-height: 1;
    margin: 0;
    max-width: 62vw;
    white-space: normal;
    word-break: break-word;
  }

  .tenzo-navbar p {
    font-size: 12px;
    line-height: 1.2;
    margin-top: 2px;
    max-width: 62vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel {
    padding: 12px;
  }

  .table-controls {
    gap: 10px;
    align-items: stretch;
  }

  .table-controls-left {
    flex-basis: 100%;
    gap: 8px;
  }

  .table-search,
  .table-filter {
    flex: 1 1 calc(50% - 8px);
    min-width: 130px;
  }

  .table-limit {
    width: 100%;
  }

  .table-limit label {
    justify-content: flex-end;
    width: 100%;
  }

  .pagination-wrap {
    align-items: flex-start;
  }

  .pagination-summary {
    width: 100%;
    font-size: 13px;
  }

  .pagination-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .btn-page {
    padding: 6px 10px;
    font-size: 12px;
  }

  .nav-label,
  .sb-toggle {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .tenzo-sidebar-profile {
    min-height: 72px;
    justify-content: flex-start;
    /* Fix centering on mobile */
  }

  .tenzo-profile-info {
    display: block;
    /* Show names in sidebar profile on mobile */
  }

  .tenzo-avatar-wrap,
  .tenzo-avatar,
  .tenzo-avatar-fallback {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }
}

@media (max-width: 560px) {
  .table-search,
  .table-filter {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .table-limit label {
    justify-content: space-between;
  }

  .tenzo-navbar h1 {
    font-size: clamp(22px, 7.5vw, 30px);
    max-width: 58vw;
  }

  .tenzo-navbar p {
    max-width: 58vw;
  }
}
