/* Global UI consistency layer - presentation only. Existing page-specific styling remains in control of layout. */
:root {
  --ui-font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  --ui-body-size: 14px;
  --ui-label-size: 12px;
  --ui-control-size: 14px;
  --ui-radius: 10px;
}
html, body, button, input, select, textarea, table, a, label, th, td {
  font-family: var(--ui-font-family) !important;
}
body { font-size: var(--ui-body-size); }
h1, h2, h3, h4, h5, h6 { font-family: var(--ui-font-family) !important; }
button, input[type="submit"], input[type="button"], input[type="reset"],
.btn, [class$="-btn"], [class*="-btn-"] {
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
  font-weight: 800;
  line-height: 1.25;
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
}
label { font-family: var(--ui-font-family) !important; }
.data-table th, table thead th { font-family: var(--ui-font-family) !important; font-size: 12px !important; }
.data-table td, table tbody td { font-family: var(--ui-font-family) !important; font-size: 14px !important; }
a { font-family: var(--ui-font-family) !important; }


/* Manager portal polish: keep the existing Admin styling untouched. */
.manager-shell .filter-toolbar button,
.manager-shell .date-filter-form button,
.manager-shell .phase6-toolbar button,
.manager-shell button[type="submit"],
.manager-shell button[type="button"] {
  border-radius: 10px !important;
  border: 1.5px solid #d9dff0 !important;
  background: #fff !important;
  color: #475569 !important;
  box-shadow: none !important;
}
.manager-shell .filter-toolbar button:hover,
.manager-shell .date-filter-form button:hover,
.manager-shell .phase6-toolbar button:hover,
.manager-shell button[type="submit"]:hover,
.manager-shell button[type="button"]:hover {
  border-color: #8b82f8 !important;
  color: #17685b !important;
  background: #f8f7ff !important;
}
.manager-shell .manager-ui-btn,
.manager-shell .phase6-toolbar a,
.manager-shell .p3v-btn,
.manager-shell .md-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .45rem !important;
  min-height: 40px !important;
  padding: 9px 14px !important;
  border-radius: 10px !important;
  border: 1.5px solid #d9dff0 !important;
  background: #fff !important;
  color: #17685b !important;
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}
.manager-shell .manager-ui-btn:hover,
.manager-shell .phase6-toolbar a:hover,
.manager-shell .p3v-btn:hover,
.manager-shell .md-btn:hover { background: #f8f7ff !important; border-color: #8b82f8 !important; }
.manager-shell .manager-ui-btn-primary,
.manager-shell .phase6-toolbar a.active,
.manager-shell .p3v-btn-primary,
.manager-shell .md-toolbar .md-btn[style*="background:#17685b"] {
  background: #5747ea !important;
  border-color: #5747ea !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(87,71,234,.18) !important;
}
.manager-shell .manager-ui-btn-primary:hover,
.manager-shell .phase6-toolbar a.active:hover,
.manager-shell .p3v-btn-primary:hover { background: #4f3de0 !important; color: #fff !important; }
.manager-shell .manager-ui-btn-danger { background: #fff1f2 !important; border-color: #fecdd3 !important; color: #be123c !important; }
.manager-shell .manager-ui-btn-soft { background: #f8f9ff !important; border-color: #e5e9f4 !important; color: #667a70 !important; }
.manager-shell .manager-ui-action-link { display:inline-flex; align-items:center; gap:.4rem; padding:.55rem .85rem; border-radius:10px; background:#f3f0ff; color:#5647e8 !important; border:1px solid #c7dfd1; font-weight:800; text-decoration:none !important; }
.manager-shell .manager-ui-action-link:hover { background:#ebe7ff; border-color:#a5cbb9; }
.manager-shell .section-card table button,
.manager-shell .data-table button { min-height:36px; padding:8px 12px !important; border-radius:9px !important; font-weight:800 !important; }
.manager-shell .section-card table a.clear-link,
.manager-shell .date-filter-form .clear-link { color:#17685b !important; font-weight:800 !important; text-decoration:none !important; }
.manager-shell .section-card table a.clear-link:hover,
.manager-shell .date-filter-form .clear-link:hover { color:#3f32c8 !important; }

/* Manager filters and reset/export links use one control treatment. */
.manager-shell .date-filter-form .clear-link,
.manager-shell .clear-link,
.manager-shell a[href*="export=1"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .4rem !important;
  min-height: 40px !important;
  padding: 9px 14px !important;
  border-radius: 10px !important;
  border: 1.5px solid #d9dff0 !important;
  background: #fff !important;
  color: #17685b !important;
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}
.manager-shell .date-filter-form .clear-link:hover,
.manager-shell .clear-link:hover,
.manager-shell a[href*="export=1"]:hover {
  background: #f8f7ff !important;
  border-color: #8b82f8 !important;
  color: #3f32c8 !important;
}
.manager-shell .date-filter-form button[type="submit"],
.manager-shell .filter-toolbar button[type="submit"],
.manager-shell .p3v-btn-primary {
  background: #5747ea !important;
  color: #fff !important;
  border-color: #5747ea !important;
  box-shadow: 0 8px 18px rgba(87,71,234,.18) !important;
}
.manager-shell .date-filter-form button[type="submit"]:hover,
.manager-shell .filter-toolbar button[type="submit"]:hover,
.manager-shell .p3v-btn-primary:hover {
  background: #4f3de0 !important;
  color: #fff !important;
}
.manager-shell .phase6-toolbar select,
.manager-shell .date-filter-form select,
.manager-shell .filter-toolbar select {
  min-height: 40px !important;
  padding: 9px 11px !important;
  border: 1.5px solid #d9dff0 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
}

/* ==========================================================
   Shared File Upload + Calendar Control Polish
   Presentation only. Opening Stock Upload stays unchanged.
   ========================================================== */
input[type="date"],
input[type="month"] {
  min-height: 42px !important;
  padding: 9px 42px 9px 13px !important;
  border: 1.5px solid #d9dff0 !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
  color: #1e2a46 !important;
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
  font-weight: 650 !important;
  line-height: 1.25 !important;
  box-shadow: 0 4px 14px rgba(53,67,113,.06) !important;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  color-scheme: light;
}
input[type="date"]:hover,
input[type="month"]:hover {
  border-color: #b9b1f6 !important;
  background: #ffffff !important;
}
input[type="date"]:focus,
input[type="month"]:focus {
  outline: none !important;
  border-color: #6d5ce7 !important;
  box-shadow: 0 0 0 4px rgba(109,92,231,.11), 0 6px 18px rgba(53,67,113,.08) !important;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  opacity: .9;
  cursor: pointer;
  padding: 7px;
  border-radius: 8px;
  filter: saturate(.85);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
  background: #f2efff;
}

/* File upload controls: modern browser-native button, aligned to the right
   on upload toolbars. Opening Stock Upload is deliberately excluded. */
form[enctype="multipart/form-data"]:not(.opening-stock-upload-form) {
  display: flex !important;
  align-items: center !important;
  gap: .7rem !important;
  flex-wrap: wrap !important;
}
form[enctype="multipart/form-data"]:not(.opening-stock-upload-form) input[type="file"] {
  margin-left: auto !important;
  min-width: 250px;
  max-width: 380px;
  min-height: 42px;
  padding: 5px 7px !important;
  border: 1.5px solid #d9dff0 !important;
  border-radius: 12px !important;
  background: #fbfcff !important;
  color: #52617d !important;
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(53,67,113,.05) !important;
}
form[enctype="multipart/form-data"]:not(.opening-stock-upload-form) input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: #eef0ff;
  color: #5647e8;
  font-family: var(--ui-font-family);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
form[enctype="multipart/form-data"]:not(.opening-stock-upload-form) input[type="file"]::file-selector-button:hover {
  background: #e4e1ff;
  transform: translateY(-1px);
}

/* The Data Import screen uses a stacked form; keep the picker visually right. */
form[enctype="multipart/form-data"]:not(.opening-stock-upload-form) label:has(input[type="file"]) {
  display: flex !important;
  align-items: center !important;
  gap: .65rem !important;
  margin-left: auto !important;
  min-width: min(100%, 520px);
}

/* Preserve the existing Opening Stock Upload layout exactly. */
form.opening-stock-upload-form input[type="file"] {
  margin-left: 0 !important;
}

@media (max-width: 820px) {
  form[enctype="multipart/form-data"]:not(.opening-stock-upload-form) input[type="file"] {
    margin-left: 0 !important;
    width: 100%;
    max-width: none;
  }
  form[enctype="multipart/form-data"]:not(.opening-stock-upload-form) label:has(input[type="file"]) {
    margin-left: 0 !important;
    min-width: 100%;
    flex-direction: column;
    align-items: flex-start !important;
  }
}

/* ==========================================================
   UNIFIED APPLICATION UI — ALL ROLES
   Presentation only. Permissions/visibility remain role-driven.
   ========================================================== */
:root {
  --unified-sidebar-top: #102a43;
  --unified-sidebar-mid: #123f50;
  --unified-sidebar-bottom: #25346a;
  --unified-sidebar-text: #eef6ff;
  --unified-sidebar-muted: #b9c8db;
  --unified-sidebar-active: #17685b;
  --unified-sidebar-active-2: #1e7868;
}

/* One sidebar presentation for Admin, Manager, and Staff. */
.app-shell .sidebar,
.admin-shell .sidebar,
.manager-shell .sidebar {
  width: 274px !important;
  padding: 16px 12px 14px !important;
  background:
    radial-gradient(circle at 88% 8%, rgba(30,120,104,.18), transparent 28%),
    radial-gradient(circle at 10% 92%, rgba(45,212,191,.14), transparent 25%),
    linear-gradient(180deg, var(--unified-sidebar-top) 0%, var(--unified-sidebar-mid) 48%, var(--unified-sidebar-bottom) 100%) !important;
  border-right: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 12px 0 34px rgba(16,42,67,.14) !important;
  position: relative;
  overflow: hidden;
}
.app-shell .sidebar::before {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  left: -100px; bottom: 24px;
  border-radius: 50%;
  background: rgba(45,212,191,.09);
  pointer-events: none;
}
.app-shell .sidebar::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  right: -95px; bottom: -70px;
  border-radius: 50%;
  background: rgba(23,104,91,.18);
  pointer-events: none;
}
.app-shell .sidebar > * { position: relative; z-index: 1; }

.app-shell .sidebar-brand {
  padding: 4px 10px 18px !important;
  gap: 11px !important;
  font-size: 1.13rem !important;
  color: #fff !important;
  letter-spacing: -.25px;
}
.app-shell .sidebar-brand .brand-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 13px !important;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.08)) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.10) !important;
}
.app-shell .sidebar-home-btn {
  margin: 0 3px 12px !important;
  min-height: 46px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 13px !important;
  background: rgba(255,255,255,.08) !important;
  color: #f7fbff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06) !important;
}
.app-shell .sidebar-home-btn:hover {
  background: rgba(255,255,255,.13) !important;
  transform: translateY(-1px);
}

.app-shell .sidebar-nav { gap: 5px !important; }
.app-shell .side-link,
.app-shell .side-group summary {
  min-height: 46px !important;
  padding: 10px 11px !important;
  border-radius: 13px !important;
  color: var(--unified-sidebar-muted) !important;
  font-size: .88rem !important;
  font-weight: 750 !important;
  border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.app-shell .side-link:hover,
.app-shell .side-group summary:hover {
  background: rgba(255,255,255,.07) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.07) !important;
  transform: translateX(2px);
}
.app-shell .side-link.active,
.app-shell .side-group summary.active-group {
  background: linear-gradient(135deg, var(--unified-sidebar-active), var(--unified-sidebar-active-2)) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.10) !important;
  box-shadow: 0 10px 24px rgba(23,104,91,.30), inset 0 1px 0 rgba(255,255,255,.14) !important;
}
.app-shell .side-icon {
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255,255,255,.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06) !important;
}
.app-shell .side-link.active .side-icon,
.app-shell .side-group summary.active-group .side-icon {
  background: rgba(255,255,255,.15) !important;
}
.app-shell .chev { color: rgba(238,246,255,.72) !important; }
.app-shell .side-sublist {
  margin: 4px 0 7px !important;
  padding-left: 34px !important;
  border-left: 1px solid rgba(255,255,255,.14) !important;
}
.app-shell .side-sublink {
  display: block;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  color: rgba(230,238,250,.74) !important;
  font-size: .80rem !important;
  font-weight: 650 !important;
}
.app-shell .side-sublink:hover {
  background: rgba(255,255,255,.07) !important;
  color: #fff !important;
}
.app-shell .side-sublink.active {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 #9e93ff;
}

/* One shared action-link/button treatment across every role. */
.manager-ui-action-link,
.ui-action-link,
.gs-open,
.gs-open-btn,
.p2-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .45rem !important;
  min-height: 38px !important;
  padding: 8px 13px !important;
  border-radius: 10px !important;
  border: 1.5px solid #d9dff0 !important;
  background: #fff !important;
  color: #17685b !important;
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  box-shadow: 0 4px 10px rgba(53,67,113,.05) !important;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease !important;
}
.manager-ui-action-link:hover,
.ui-action-link:hover,
.gs-open:hover,
.gs-open-btn:hover,
.p2-link:hover {
  background: #f6f4ff !important;
  border-color: #a49bf7 !important;
  color: #3f32c8 !important;
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(53,67,113,.08) !important;
}
.manager-ui-action-link.primary,
.ui-action-link.primary,
.gs-open-btn {
  background: linear-gradient(135deg,#17685b,#6d5ce7) !important;
  border-color: #17685b !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(23,104,91,.20) !important;
}
.manager-ui-action-link.primary:hover,
.ui-action-link.primary:hover,
.gs-open-btn:hover {
  background: linear-gradient(135deg,#4f3de0,#624fe0) !important;
  color: #fff !important;
}

/* Control-center and management pages should use the same Open treatment. */
.phase6-alert-row > .manager-ui-action-link,
.md-panel a.p2-link,
.md-panel a.md-btn,
.section-card a.p2-link {
  white-space: nowrap;
}

/* Shared filter/export/reset controls, regardless of role. */
.filter-toolbar button,
.date-filter-form button,
.phase6-toolbar button,
.phase6-toolbar a,
.filter-toolbar a,
.date-filter-form a,
.md-toolbar button,
.md-toolbar a {
  font-family: var(--ui-font-family) !important;
  font-size: var(--ui-control-size) !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
}

/* Compact calendar controls should visually match adjacent toolbar buttons. */
.calendar-control,
.ui-calendar-control {
  min-height: 44px !important;
  height: 44px !important;
}
.calendar-control .month-display,
.ui-calendar-control .month-display {
  min-width: 250px !important;
  height: 44px !important;
}
.calendar-control button,
.ui-calendar-control button {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border-radius: 11px !important;
}

@media (max-width: 900px) {
  .app-shell .sidebar { width: 266px !important; }
  .calendar-control .month-display,
  .ui-calendar-control .month-display { min-width: 200px !important; }
}

/* ==========================================================
   UNIVERSAL VISUAL THEME v3
   One presentation system for Admin, Manager and Staff.
   Role/permission behavior is intentionally untouched.
   ========================================================== */
:root {
  --theme-navy-950: #0d1834;
  --theme-navy-900: #112044;
  --theme-navy-850: #162752;
  --theme-navy-800: #1c315d;
  --theme-indigo: #17685b;
  --theme-indigo-2: #7048f6;
  --theme-orange: #f58524;
  --theme-teal: #38b7b2;
  --theme-surface: #ffffff;
  --theme-surface-soft: #f5f7ff;
  --theme-border: #dfe5f3;
  --theme-text: #17213d;
  --theme-muted: #71809b;
  --theme-danger: #d93661;
}

/* Full-height shared shell + redesigned sidebar. */
.app-shell { min-height: 100vh !important; }
.app-shell .sidebar,
.admin-shell .sidebar,
.manager-shell .sidebar {
  width: 292px !important;
  min-width: 292px !important;
  height: 100vh !important;
  min-height: 100vh !important;
  position: sticky !important;
  top: 0 !important;
  align-self: flex-start !important;
  overflow: hidden !important;
  padding: 22px 18px 18px !important;
  background:
    radial-gradient(circle at 78% 10%, rgba(23,104,91,.22), transparent 27%),
    radial-gradient(circle at 12% 72%, rgba(56,183,178,.10), transparent 31%),
    linear-gradient(180deg, var(--theme-navy-900) 0%, var(--theme-navy-850) 54%, #243a70 100%) !important;
  border-right: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 10px 0 34px rgba(13,24,52,.15) !important;
}
.app-shell .sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 24%, transparent 72%, rgba(255,255,255,.03));
}
.app-shell .sidebar::after {
  content: "";
  position: absolute;
  right: -85px;
  bottom: -55px;
  width: 260px;
  height: 190px;
  border-radius: 52% 48% 0 0;
  background: linear-gradient(155deg, rgba(23,104,91,.20), rgba(56,183,178,.08));
  pointer-events: none;
}
.app-shell .sidebar > * { position: relative; z-index: 2; }

.app-shell .sidebar-brand {
  min-height: 86px !important;
  padding: 0 0 16px !important;
  gap: 12px !important;
  align-items: flex-start !important;
  position: relative !important;
}
.app-shell .sidebar-brand .brand-icon {
  width: 62px !important;
  height: 62px !important;
  flex: 0 0 62px !important;
  border-radius: 17px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, rgba(255,255,255,.15), rgba(109,92,231,.22)) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 12px 28px rgba(0,0,0,.12) !important;
  font-size: 28px !important;
}
.app-shell .brand-copy { display:flex; flex-direction:column; gap:7px; padding-top:1px; }
.app-shell .brand-copy strong { color:#fff; font-size:1.1rem; line-height:.98; letter-spacing:-.02em; }
.app-shell .brand-copy small { color:rgba(255,255,255,.58); font-size:.55rem; font-weight:800; letter-spacing:.18em; white-space:nowrap; }
.app-shell .sidebar-collapse {
  margin-left:auto !important;
  width:34px !important;
  height:34px !important;
  min-height:34px !important;
  border:0 !important;
  border-radius:11px !important;
  background:rgba(255,255,255,.08) !important;
  color:#fff !important;
  font-size:1.2rem !important;
  line-height:1 !important;
  padding:0 !important;
  cursor:pointer !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06) !important;
}
.app-shell .sidebar-collapse:hover { background:rgba(255,255,255,.14) !important; }

.app-shell .sidebar-home-btn {
  margin: 0 0 11px !important;
  min-height: 50px !important;
  padding: 11px 14px !important;
  border: 1px solid rgba(255,255,255,.07) !important;
  border-radius: 15px !important;
  background: rgba(255,255,255,.055) !important;
  color:#fff !important;
  font-size:.9rem !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
}
.app-shell .sidebar-home-btn:hover { background:rgba(255,255,255,.10) !important; }
.app-shell .sidebar-nav { gap: 5px !important; }
.app-shell .side-link,
.app-shell .side-group summary {
  min-height: 50px !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  border: 1px solid transparent !important;
  color: rgba(244,248,255,.80) !important;
  font-size: .89rem !important;
  font-weight: 760 !important;
  transition: .18s ease !important;
}
.app-shell .side-link:hover,
.app-shell .side-group summary:hover {
  background: rgba(255,255,255,.06) !important;
  color:#fff !important;
  border-color:rgba(255,255,255,.06) !important;
  transform:translateX(1px);
}
.app-shell .side-link.active,
.app-shell .side-group summary.active-group {
  background: linear-gradient(135deg, var(--theme-indigo) 0%, var(--theme-indigo-2) 100%) !important;
  border-color: rgba(255,255,255,.14) !important;
  color:#fff !important;
  box-shadow: 0 12px 26px rgba(23,104,91,.28), inset 0 1px 0 rgba(255,255,255,.16) !important;
}
.app-shell .side-icon {
  width: 34px !important; height:34px !important; flex:0 0 34px !important;
  border-radius: 11px !important;
  background: rgba(255,255,255,.075) !important;
  display:inline-flex !important; align-items:center !important; justify-content:center !important;
  font-size:1rem !important;
}
.app-shell .side-link.active .side-icon,
.app-shell .side-group summary.active-group .side-icon { background:rgba(255,255,255,.14) !important; }
.app-shell .chev { color:rgba(255,255,255,.72) !important; font-size:1rem !important; }
.app-shell .side-sublist { margin:4px 0 8px !important; padding-left:40px !important; border-left:1px solid rgba(255,255,255,.14) !important; }
.app-shell .side-sublink { padding:8px 10px !important; border-radius:10px !important; color:rgba(236,242,252,.72) !important; font-size:.80rem !important; font-weight:650 !important; }
.app-shell .side-sublink:hover { background:rgba(255,255,255,.06) !important; color:#fff !important; }
.app-shell .side-sublink.active { background:rgba(255,255,255,.10) !important; color:#fff !important; box-shadow:inset 3px 0 0 #8b7bff !important; }

/* Reference decorative artwork — fills the remaining sidebar height visually. */
.app-shell .sidebar-decoration {
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  height:250px !important;
  pointer-events:none !important;
  overflow:hidden !important;
  z-index:1 !important;
}
.app-shell .sidebar-decoration img {
  position:absolute !important;
  left:50% !important;
  bottom:-18px !important;
  width:230px !important;
  height:345px !important;
  object-fit:cover !important;
  object-position:center !important;
  transform:translateX(-50%) !important;
  border-radius:42% !important;
  opacity:.98 !important;
  box-shadow: 0 -10px 34px rgba(0,0,0,.12) !important;
}
.app-shell .sidebar-decoration::after {
  content:"";
  position:absolute !important;
  left:0; right:0; bottom:0; height:70px;
  background:linear-gradient(180deg, rgba(29,49,92,0), rgba(17,32,68,.64));
}

/* Theme the shared shell and common surfaces without changing layout/behavior. */
.main-column { background: linear-gradient(180deg,#f4f7ff 0%,#f7f9ff 100%) !important; }
.topbar-new { background: rgba(255,255,255,.94) !important; border-bottom-color: var(--theme-border) !important; }
.page-content { max-width: 1500px !important; }
.page-hero { background: linear-gradient(120deg,#f3f1ff,#ffffff 72%,#fff8ef) !important; border-color:#e2e4f4 !important; }
.admin-shell .page-hero { background: linear-gradient(120deg,#f4f1ff,#ffffff 72%,#fff8ef) !important; border-color:#e2e4f4 !important; }
.section-card,
.mini-card,
.stat-card,
.filter-toolbar,
.date-filter-form,
.list-toolbar,
.table-card,
.report-card { border-color:var(--theme-border) !important; box-shadow:0 10px 28px rgba(31,48,86,.06) !important; }
.section-card-header { color:var(--theme-text) !important; }
.data-table thead th,
table thead th { background:#f2f5fb !important; color:#5d6c88 !important; border-bottom-color:#e4e8f2 !important; }
.data-table tbody td,
table tbody td { border-bottom-color:#edf0f5 !important; }
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea { border-color:#dfe5f1 !important; }
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus { border-color:#7667f2 !important; box-shadow:0 0 0 4px rgba(118,103,242,.10) !important; }

/* Keep search inputs in their existing shapes; harmonize only theme/focus. */
.search-box,
.topbar-search { background:#fff !important; border-color:#dfe5f1 !important; }
.search-icon { background:#eeedff !important; }

/* Universal primary/secondary action colors — presentation only. */
button[type="submit"],
button[type="button"].primary,
.att-btn.primary,
.btn-primary,
.manager-ui-action-link.primary,
.ui-action-link.primary,
.gs-open-btn,
.p3v-btn-primary,
.md-btn-primary {
  background:linear-gradient(135deg,var(--theme-indigo),var(--theme-indigo-2)) !important;
  border-color:var(--theme-indigo) !important;
  color:#fff !important;
  box-shadow:0 9px 20px rgba(23,104,91,.20) !important;
}
button[type="submit"]:hover,
button[type="button"].primary:hover,
.att-btn.primary:hover,
.btn-primary:hover,
.manager-ui-action-link.primary:hover,
.ui-action-link.primary:hover,
.gs-open-btn:hover,
.p3v-btn-primary:hover,
.md-btn-primary:hover { background:linear-gradient(135deg,#4e40dd,#6241e6) !important; }

.app-confirm-card { border-color:#dfe5f1 !important; }
.app-confirm-head { background:linear-gradient(135deg,#f2f0ff,#fff7ed) !important; }
.app-confirm-primary { background:linear-gradient(135deg,var(--theme-indigo),var(--theme-indigo-2)) !important; border-color:var(--theme-indigo) !important; }

@media (max-width: 900px) {
  .app-shell .sidebar,
  .admin-shell .sidebar,
  .manager-shell .sidebar { width:292px !important; min-width:292px !important; left:-292px !important; }
  .app-shell.sidebar-open .sidebar { left:0 !important; }
  .app-shell .sidebar-decoration { height:230px !important; }
}

/* Manager sidebar Today at a glance. The dashboard version stays for Admin only. */
.manager-sidebar-glance {
  margin: 12px 2px 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 24px rgba(5,12,35,.12);
}
.manager-sidebar-glance-head > div { display:flex; align-items:center; gap:10px; }
.manager-sidebar-glance-head strong { display:block; color:#fff; font-size:1rem; line-height:1.15; font-weight:850; }
.manager-sidebar-glance-head small { display:block; margin-top:4px; color:rgba(236,242,252,.68); font-size:.72rem; font-weight:700; }
.manager-sidebar-glance-icon {
  width:42px; height:42px; flex:0 0 42px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, rgba(124,92,255,.30), rgba(76,201,240,.18)); color:#fff; font-size:1.15rem;
  border:1px solid rgba(255,255,255,.10);
}
.manager-sidebar-glance-grid { display:grid; grid-template-columns:1fr; gap:9px; margin-top:12px; }
.manager-mini { min-width:0; display:flex; align-items:center; gap:11px; padding:11px 12px; min-height:62px; border-radius:13px; background:rgba(255,255,255,.075); border:1px solid rgba(255,255,255,.09); box-shadow:inset 0 1px 0 rgba(255,255,255,.035); }
.manager-mini > span { width:38px; height:38px; flex:0 0 38px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:1rem; background:rgba(255,255,255,.11); }
.manager-mini small { display:block; color:rgba(236,242,252,.62); font-size:.68rem; line-height:1.05; font-weight:750; }
.manager-mini strong { display:block; margin-top:4px; color:#fff; font-size:1rem; line-height:1.05; font-weight:850; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.manager-mini-sales > span { color:#8de2b7; background:rgba(141,226,183,.12); }
.manager-mini-stock > span { color:#ff8ea5; background:rgba(255,142,165,.12); }
.manager-mini-staff > span { color:#9db7ff; background:rgba(157,183,255,.12); }
.manager-mini-dues > span { color:#ffd98a; background:rgba(255,217,138,.12); }
@media (max-width: 900px) {
  .manager-sidebar-glance { margin-bottom: 10px; }
  .manager-mini { min-height:58px; }
}

/* ==========================================================
   UNIVERSAL APPLICATION THEME + ACCESSIBLE UI BASELINE
   Presentation-only. Shared by Admin, Manager and Staff.
   ========================================================== */
:root {
  --primary: #17685b !important;
  --primary-dark: #4939d8 !important;
  --primary-light: #eeecff !important;
  --admin: #17685b !important;
  --admin-light: #eeecff !important;
  --success: #17a673 !important;
  --success-bg: #e8fbf3 !important;
  --danger: #d9435e !important;
  --danger-bg: #fff0f3 !important;
  --warn: #d48616 !important;
  --warn-bg: #fff5e8 !important;
  --text: #223e36 !important;
  --text-muted: #66738f !important;
  --border: #dfe5f2 !important;
  --bg: #f4f7ff !important;
  --card: #ffffff !important;
  --ui-primary: #17685b !important;
  --ui-primary-2: #7a68ff !important;
  --ui-primary-soft: #eeecff !important;
  --ui-navy: #223e36 !important;
  --ui-muted: #66738f !important;
  --ui-border: #dfe5f2 !important;
  --ui-bg: #f4f7ff !important;
  --ui-card: #ffffff !important;
}

html, body { font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif !important; }
body {
  background:
    radial-gradient(circle at 90% 0%, rgba(23,104,91,.055), transparent 23%),
    linear-gradient(180deg,#f8f9ff 0%,#f2f6ff 100%) !important;
  color: #223e36 !important;
  font-size: 15px !important;
}

/* Shared application frame */
.app-shell { min-height:100vh !important; background:transparent !important; }
.sidebar {
  width: 274px !important;
  min-height: 100vh !important;
  padding: 18px 14px !important;
  background:
    radial-gradient(circle at 15% 88%, rgba(23,104,91,.28), transparent 25%),
    radial-gradient(circle at 90% 10%, rgba(123,104,255,.18), transparent 23%),
    linear-gradient(180deg,#101a3a 0%,#15234b 48%,#1c2a58 100%) !important;
  border-right:1px solid rgba(255,255,255,.10) !important;
  box-shadow: 10px 0 28px rgba(20,32,67,.12) !important;
}
.admin-shell .sidebar,
.manager-shell .sidebar { background:
    radial-gradient(circle at 15% 88%, rgba(23,104,91,.28), transparent 25%),
    radial-gradient(circle at 90% 10%, rgba(123,104,255,.18), transparent 23%),
    linear-gradient(180deg,#101a3a 0%,#15234b 48%,#1c2a58 100%) !important; }
.sidebar-brand { color:#fff !important; padding:8px 10px 20px !important; }
.sidebar-brand .brand-icon { background:linear-gradient(135deg,#745eff,#17685b) !important; border:0 !important; box-shadow:0 8px 18px rgba(23,104,91,.28) !important; }
.sidebar-brand .brand-copy small { color:rgba(255,255,255,.58) !important; letter-spacing:.10em !important; }
.sidebar-home-btn {
  color:#eef1ff !important; background:rgba(255,255,255,.075) !important;
  border:1px solid rgba(255,255,255,.10) !important; border-radius:13px !important;
}
.sidebar-home-btn:hover { background:rgba(255,255,255,.12) !important; }
.side-link, .side-group summary {
  min-height:46px !important; border-radius:13px !important; color:#e9edff !important;
  font-size:14px !important; font-weight:750 !important; padding:10px 12px !important;
  transition:background .16s ease, transform .16s ease, color .16s ease !important;
}
.side-link:hover, .side-group summary:hover { background:rgba(255,255,255,.075) !important; color:#fff !important; transform:translateX(2px); }
.side-link.active, .side-group summary.active-group {
  background:linear-gradient(135deg,#6a54f7,#5643e8) !important; color:#fff !important;
  box-shadow:0 10px 22px rgba(23,104,91,.26) !important;
}
.side-sublink { color:#cbd2ee !important; border-radius:10px !important; font-size:13px !important; }
.side-sublink:hover, .side-sublink.active { color:#fff !important; background:rgba(23,104,91,.30) !important; }
.side-icon { filter:saturate(.95); }
.topbar-new { background:rgba(255,255,255,.88) !important; border-bottom:1px solid #e6eaf3 !important; backdrop-filter:blur(10px) !important; }
.user-chip { border:1px solid #dfe5f2 !important; background:#fff !important; border-radius:14px !important; }

/* Page typography: no eye-straining micro text */
.page-content, .page-content p, .page-content li, .page-content td, .page-content th,
.page-content label, .page-content span, .page-content input, .page-content select,
.page-content textarea, .page-content button, .page-content a { font-family:Inter,"Segoe UI",Arial,sans-serif !important; }
.page-content p, .page-content li { font-size:15px !important; line-height:1.5 !important; }
.page-content table td { font-size:14px !important; }
.page-content table th { font-size:12.5px !important; }
.page-content label { font-size:13px !important; font-weight:700 !important; }

/* Universal action control language */
.page-content button,
.page-content input[type="submit"],
.page-content input[type="button"],
.page-content input[type="reset"],
.page-content .btn,
.page-content [class*="-btn"],
.page-content [class^="btn"] {
  min-height:40px !important;
  padding:9px 15px !important;
  border-radius:11px !important;
  border:1.5px solid #d7deee !important;
  background:#fff !important;
  color:#31405f !important;
  font-size:14px !important;
  font-weight:800 !important;
  line-height:1.2 !important;
  text-decoration:none !important;
  box-shadow:0 3px 10px rgba(31,45,84,.045) !important;
}
.page-content button:hover,
.page-content input[type="submit"]:hover,
.page-content input[type="button"]:hover,
.page-content input[type="reset"]:hover,
.page-content .btn:hover,
.page-content [class*="-btn"]:hover,
.page-content [class^="btn"]:hover {
  border-color:#a89fff !important; color:#4f40dc !important; background:#faf9ff !important;
}
/* Common primary/danger variants retain meaning */
.page-content .primary, .page-content .btn-primary, .page-content .app-btn-primary,
.page-content .primary-btn, .page-content .att-btn-solid-purple, .page-content .p2-btn-primary,
.page-content .p3c-btn-primary, .page-content .md-btn-primary, .page-content .gs-btn-primary,
.page-content .dsr-ui-btn-primary {
  background:linear-gradient(135deg,#6a55f4,#5744e9) !important; border-color:#17685b !important; color:#fff !important;
  box-shadow:0 8px 18px rgba(23,104,91,.20) !important;
}
.page-content .danger, .page-content .btn-danger, .page-content .att-btn-outline-red,
.page-content .p2-btn-danger, .page-content .manager-ui-btn-danger, .page-content .dsr-ui-btn-danger {
  background:#fff2f4 !important; border-color:#fecdd6 !important; color:#c93652 !important;
}
.page-content a[href*="export"], .page-content a[href*="tab="].action,
.page-content .clear-link, .page-content .ui-action-link, .page-content .gs-open,
.page-content .gs-open-btn, .page-content .p2-link, .page-content .manager-ui-action-link {
  display:inline-flex !important; align-items:center !important; justify-content:center !important; gap:.4rem !important;
  min-height:40px !important; padding:9px 15px !important; border-radius:11px !important;
  border:1.5px solid #d7deee !important; background:#fff !important; color:#5546df !important;
  font-size:14px !important; font-weight:800 !important; text-decoration:none !important;
  box-shadow:0 3px 10px rgba(31,45,84,.045) !important;
}
.page-content a[href*="export"]:hover, .page-content .clear-link:hover, .page-content .ui-action-link:hover,
.page-content .gs-open:hover, .page-content .gs-open-btn:hover, .page-content .p2-link:hover,
.page-content .manager-ui-action-link:hover { background:#faf9ff !important; border-color:#a89fff !important; }

/* Form controls */
.page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.page-content select, .page-content textarea {
  min-height:42px !important; border:1.5px solid #d9e1ef !important; border-radius:11px !important;
  background:#fff !important; color:#223e36 !important; font-size:14px !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7) !important;
}
.page-content input:focus, .page-content select:focus, .page-content textarea:focus {
  outline:none !important; border-color:#8577ee !important;
  box-shadow:0 0 0 4px rgba(23,104,91,.10) !important;
}

/* Unified native date/month presentation: the selected value is always readable */
.page-content input[type="date"], .page-content input[type="month"] {
  color:#223e36 !important; font-weight:750 !important; min-height:42px !important;
  background:#fff !important; border:1.5px solid #d7deee !important; border-radius:11px !important;
}
.page-content input[type="date"]::-webkit-calendar-picker-indicator,
.page-content input[type="month"]::-webkit-calendar-picker-indicator { opacity:.85 !important; cursor:pointer !important; }
.app-calendar-control { width:320px !important; min-height:46px !important; }
.app-calendar-control .app-calendar-nav { width:42px !important; height:46px !important; border-radius:11px !important; }
.app-calendar-display { height:46px !important; border-radius:11px !important; padding:0 14px !important; background:#fff !important; }
.app-calendar-label { font-size:15px !important; font-weight:850 !important; color:#223e36 !important; }
.app-calendar-icon { color:#17685b !important; }

/* DSR readability: override older compact/test overrides */
.dsr-test-ui-v2 .dsr-kpi-label { font-size:13px !important; }
.dsr-test-ui-v2 .dsr-kpi-value { font-size:26px !important; }
.dsr-test-ui-v2 .dsr-section-title { font-size:17px !important; }
.dsr-test-ui-v2 .dsr-section-desc { font-size:13px !important; }
.dsr-test-ui-v2 .dsr-field-label { font-size:13px !important; }
.dsr-test-ui-v2 .dsr-field-input-row input { min-height:40px !important; font-size:14px !important; }
.dsr-test-ui-v2 .mini-card-table, .dsr-test-ui-v2 .mini-card-table td { font-size:14px !important; }
.dsr-test-ui-v2 .mini-card-table th { font-size:12.5px !important; }
.dsr-test-ui-v2 .tally-line { font-size:14px !important; padding:9px 7px !important; }
.dsr-test-ui-v2 .tally-line.total { font-size:15px !important; }
.dsr-test-ui-v2 .eod-tile .label { font-size:12px !important; }
.dsr-test-ui-v2 .eod-tile .value { font-size:17px !important; }
.dsr-test-ui-v2 .dsr-modal-form label { font-size:13px !important; }
.dsr-test-ui-v2 .dsr-modal-form input, .dsr-test-ui-v2 .dsr-modal-form select { font-size:14px !important; }
.dsr-test-ui-v2 .dsr-ui-btn { font-size:14px !important; }

/* Cards / sections */
.page-content .section-card, .page-content .section, .page-content .card,
.page-content .panel, .page-content .mini-card, .page-content .tally-card,
.page-content .metric, .page-content .dashboard-card {
  border-color:#dfe5f2 !important; box-shadow:0 10px 28px rgba(31,45,84,.055) !important;
}

/* Responsive sidebar */
@media (max-width: 900px) {
  .sidebar { width:248px !important; }
}
.manager-sidebar-glance {
  margin: 4px 2px 14px !important; padding: 14px !important;
  border:1px solid rgba(255,255,255,.12) !important; border-radius:16px !important;
  background:linear-gradient(145deg,rgba(255,255,255,.10),rgba(255,255,255,.05)) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 10px 24px rgba(0,0,0,.12) !important;
}
.manager-sidebar-glance-head { margin-bottom:10px !important; }
.manager-sidebar-glance-head strong { color:#fff !important; font-size:15px !important; }
.manager-sidebar-glance-head small { color:rgba(255,255,255,.58) !important; font-size:11px !important; }
.manager-sidebar-glance-grid { grid-template-columns:1fr !important; gap:9px !important; }
.manager-mini { min-height:70px !important; padding:10px 12px !important; border-radius:13px !important; background:rgba(255,255,255,.08) !important; border:1px solid rgba(255,255,255,.08) !important; }
.manager-mini small { color:#bfc9ea !important; font-size:11px !important; }
.manager-mini strong { color:#fff !important; font-size:19px !important; }

/* Make action links in management pages obvious without affecting sidebar/breadcrumbs. */
.management-page a, .data-integrity-page a, .audit-page a, .notification-page a { text-decoration:none !important; }


/* Consistent secondary Cancel Edit action and readable date selectors */
.page-content a.app-cancel-edit, a.app-cancel-edit {
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 padding:10px 18px!important;min-height:42px!important;border:1.5px solid #cbd5e1!important;
 border-radius:11px!important;background:#fff!important;color:#34465f!important;
 font-weight:750!important;text-decoration:none!important;line-height:1.25!important;
 margin-left:10px!important;vertical-align:middle!important;cursor:pointer!important;
 box-shadow:0 2px 6px rgba(20,35,70,.05)!important;
}
a.app-cancel-edit:hover{background:#f4f6fb!important;border-color:#9caaca!important;color:#1e3452!important}
.page-content input[type="date"]:not(.app-calendar-native),.page-content input[type="month"]:not(.app-calendar-native){
 min-width:180px!important;width:auto;max-width:100%;padding:9px 12px!important;
 font-size:14px!important;color:#1e2a46!important;
}
.page-content .app-calendar-control{width:clamp(185px,20vw,320px)!important;min-width:185px!important;max-width:100%!important;flex-shrink:0!important}
.page-content .app-calendar-control[data-calendar-type="month"]{width:220px!important}
.page-content .app-calendar-display{min-width:0!important;overflow:visible!important}
.page-content .app-calendar-label{white-space:nowrap!important;text-overflow:clip!important;overflow:hidden!important;font-size:14px!important}
@media(max-width:650px){.page-content .app-calendar-control{width:100%!important;min-width:185px!important}}
