/* ==========================================================================
   WorkForce Pro — UI V2 Polish Layer
   1. Corporate Blue (#2563eb) for Active / Primary / Upload / Focus states
      (Red reserved strictly for LC Logo & real Danger/Alert states)
   2. Compact One-Screen Enterprise Density (more rows visible without scroll)
   3. Clean Header & Card Subtitle Noise Removal (Zero DOM IDs removed)
   4. Polished Executive Login Screen (Background LC Logo preserved intact)
   ========================================================================== */

:root {
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-soft: #eff6ff;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --sidebar-w: 226px;
  --header-h: 52px;
  --radius: 8px;
}

/* ── 1. SIDEBAR: Clean Corporate Blue Active + Refined Brand Header ── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #111827 0%, #0b1120 100%);
  box-shadow: 2px 0 14px rgba(0, 0, 0, 0.22);
}

.sidebar-header {
  padding: 13px 14px;
  gap: 10px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.35);
  background: rgba(255, 255, 255, 0.02);
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid rgba(204, 20, 22, 0.55);
}

.brand-text h2 {
  font-size: 0.88rem;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.64rem;
  color: #C9A84C;
  letter-spacing: 0.6px;
}

.sidebar-menu {
  padding: 10px 8px;
}

.menu-title {
  font-size: 0.62rem;
  color: #64748b;
  padding: 10px 12px 4px;
}

.menu-item {
  padding: 8px 12px;
  gap: 10px;
  margin-bottom: 2px;
  font-size: 0.83rem;
  color: #94a3b8;
  border-radius: 8px;
}

.menu-item svg {
  width: 16px;
  height: 16px;
}

.menu-item:hover {
  background: rgba(37, 99, 235, 0.14);
  color: #ffffff;
}

.menu-item.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

.sidebar-footer {
  padding: 11px 14px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
  border: 1.5px solid #C9A84C;
}

.user-role {
  color: #C9A84C;
}

/* Keep main-wrapper & background LC watermark aligned with slim sidebar */
.main-wrapper {
  margin-left: var(--sidebar-w);
}

.page-watermark {
  left: calc(50% + 113px);
}

/* ── 2. SLIM CLEAN HEADER & SUBTITLE CLEANUP ── */
.header {
  height: var(--header-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.header::before {
  height: 2px;
  background: linear-gradient(90deg, #2563eb 0%, #C9A84C 65%, #CC1416 100%);
}

.header-title h1 {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* Remove redundant long header subtitle across all modules */
#viewHeaderSubtitle {
  display: none !important;
}

/* Remove duplicate red company pill in header (LC logo is already in sidebar) */
.header-brand-pill {
  display: none !important;
}

.header-date-badge {
  padding: 4px 11px;
  font-size: 0.76rem;
}

.notif-bell-btn,
.mobile-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.notif-bell-btn:hover,
.mobile-menu-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

/* ── 3. CORPORATE BLUE BUTTONS, UPLOADS, TABS & FOCUS RINGS ── */
.btn {
  padding: 6px 12px;
  font-size: 0.81rem;
  gap: 6px;
  border-radius: 7px;
}

.btn-sm {
  padding: 4px 9px;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* Upload zones (Documents / Receipts / Photos) -> Clean Corporate Blue */
.doc-upload-zone {
  border: 2px dashed #93c5fd;
  background: #f8fbff;
  padding: 14px;
  border-radius: 9px;
}

.doc-upload-zone:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

/* Tabs, Pills & Preset Filters -> Clean Corporate Blue */
.att-subtabs,
.inc-tabs-bar {
  margin-bottom: 10px;
  padding-bottom: 7px;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.att-subtab-btn,
.inc-tab-btn {
  padding: 6px 13px;
  font-size: 0.8rem;
  border-radius: 7px;
  gap: 6px;
}

.att-subtab-btn.active,
.inc-tab-btn.active,
.dash-adv-tab.active,
.fd-preset-btn.active,
.prof-sec-tab.active,
.date-mode-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.24);
}

.doc-filter-bar {
  gap: 6px;
  margin-bottom: 10px;
}

.doc-filter-pill {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.doc-filter-pill.active {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
}

.doc-filter-pill.active .doc-pill-cnt {
  background: #2563eb;
  color: #ffffff;
}

.doc-emp-avatar {
  width: 30px;
  height: 30px;
  font-size: 0.74rem;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
}

.doc-ext-tag {
  background: #dbeafe;
  color: #1e40af;
}

/* Active Summary Cards -> Soft Blue instead of Red */
.doc-summary-card.active-card,
.adv-summary-card.active-card,
.inc-summary-card.active-card {
  border-color: #2563eb;
  background: #f8fbff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
}

/* Input & Date Focus Rings -> Corporate Blue */
.form-control {
  padding: 6px 10px;
  font-size: 0.81rem;
  border-radius: 7px;
}

.form-control:focus,
.date-range-field:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.date-range-field {
  height: 32px;
  border-radius: 7px;
}

.date-range-field input[type="date"] {
  height: 28px;
  font-size: 0.8rem;
}

/* Employee Search Picker Hover -> Blue */
.esp-item:hover,
.esp-item.highlighted {
  background: #eff6ff;
  color: #1d4ed8;
}

/* Advances Sheet Current Month Highlight -> Blue */
.adv-sheet-table .adv-month-hl {
  background: #2563eb !important;
}

.adv-month-hl-cell {
  outline: 2px solid rgba(37, 99, 235, 0.35);
}

/* Banners -> Clean Subtle Blue/Slate instead of Pink */
.inc-banner {
  padding: 8px 13px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  border: 1px solid #bfdbfe;
  background: linear-gradient(90deg, #eff6ff, #f8fafc);
}

.sav-liability-banner {
  padding: 7px 12px;
  margin-bottom: 10px;
  font-size: 0.78rem;
}

/* Modals & History Items -> Blue Top Accent instead of Heavy Red */
.modal-box {
  border-top: 3px solid #2563eb;
}

.doc-history-item {
  border-left: 3px solid #2563eb;
  padding: 10px 12px;
}

/* ── 4. COMPACT ONE-SCREEN ENTERPRISE DENSITY ── */
.content-body {
  padding: 12px 18px;
}

.stats-row,
.inc-summary-grid,
.doc-summary-grid,
.adv-summary-grid {
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  padding: 10px 13px;
  gap: 10px;
  border-radius: 10px;
  border-left: 1px solid var(--border);
}

.stat-card:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  border-left-color: #2563eb;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.08);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-details .label {
  font-size: 0.71rem;
  font-weight: 600;
  line-height: 1.2;
}

.stat-details .value {
  font-size: 1.22rem;
  line-height: 1.2;
  margin-top: 2px;
}

.stat-details .sub {
  font-size: 0.68rem;
  margin-top: 2px;
  line-height: 1.2;
}

/* Clean up static redundant filler sub-lines inside KPI cards (preserve dynamic IDs!) */
.stat-details .sub:not([id]) {
  display: none !important;
}

.action-bar {
  margin-bottom: 10px;
  gap: 8px;
}

.filter-group {
  gap: 6px;
}

.card {
  margin-bottom: 12px;
  border-radius: 10px;
}

.card-header {
  padding: 10px 15px;
  border-left: none;
  gap: 8px;
}

.card-header h3 {
  font-size: 0.92rem;
}

.card-body {
  padding: 12px 15px;
}

/* Compact, Crisp Tables -> ~10-12 rows fit on 1 laptop screen */
.data-table {
  font-size: 0.81rem;
}

.data-table th {
  padding: 8px 11px;
  font-size: 0.68rem;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 7px 11px;
  line-height: 1.35;
}

.data-table tbody tr:hover {
  background: #f1f5f9;
}

.badge {
  padding: 2px 8px;
  font-size: 0.68rem;
}

/* Compact Attendance Circles */
.att-circle-btn {
  width: 28px;
  height: 28px;
  font-size: 0.74rem;
}

.att-circle-group {
  gap: 5px;
}

/* Compact Finance Dashboard sections */
.fd-section-title {
  margin: 12px 0 8px;
  font-size: 0.76rem;
}

.fd-two-col {
  gap: 12px;
  margin-bottom: 12px;
}

/* ── 5. POLISHED EXECUTIVE LOGIN PAGE (Preserves Background LC Logo!) ── */
.login-wrap {
  background: linear-gradient(135deg, #0b1120 0%, #111827 52%, #172554 100%);
  padding: 18px;
}

.login-wrap::before {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, transparent 70%);
}

.login-wrap::after {
  background: radial-gradient(circle, rgba(201, 168, 76, 0.14) 0%, transparent 70%);
}

/* Keep the exact background LC watermark visible & crisp */
.login-bg-logo {
  opacity: 0.055;
}

.login-card {
  max-width: 420px;
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.login-card-top-bar {
  height: 4px;
  background: linear-gradient(90deg, #CC1416 0%, #C9A84C 50%, #2563eb 100%);
}

.login-card-body {
  padding: 28px 30px 24px;
}

.login-logo-area {
  margin-bottom: 18px;
}

.login-company-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.35px;
  margin-top: 8px;
}

.login-company-sub {
  font-size: 0.74rem;
  color: #64748b;
  font-style: normal;
  margin-top: 3px;
}

.login-gold-line {
  margin: 11px 0 10px;
}

.login-system-title {
  font-size: 0.68rem;
  color: #64748b;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.login-heading {
  font-size: 1.2rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.login-subheading {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 16px;
}

.login-input-group {
  margin-bottom: 12px;
}

.login-input-label {
  font-size: 0.76rem;
  color: #334155;
  margin-bottom: 4px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input {
  padding: 10px 13px;
  font-size: 0.88rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
}

.login-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.login-eye-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.login-eye-btn:hover {
  color: #2563eb;
  background: #eff6ff;
}

.login-btn {
  padding: 11px 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 10px;
  font-size: 0.92rem;
  margin-top: 6px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.login-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.login-footer {
  margin-top: 16px;
  padding-top: 12px;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.5;
}

/* ── Mobile / Tablet / iOS / Android & Windows Executive Polish Layer (v3) ── */
.sidebar-close-btn:hover {
  background: rgba(37, 99, 235, 0.35);
}

.notif-item.unread {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
}

.pe-preset-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Windows Desktop & High-DPI Refinements */
.header-profile-btn:focus-visible,
.notif-bell-btn:focus-visible,
.mobile-menu-btn:focus-visible,
.btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.data-table th {
  position: relative;
}

.data-table td .btn-sm {
  padding: 3px 8px;
  font-size: 0.73rem;
}

#view-dashboard .stat-details .value {
  font-size: 1.12rem;
}

/* Windows 1280×720 / 1366×768 Laptop Height Fit: keep all 14 sidebar items visible without scroll */
@media (min-width: 1025px) and (max-height: 780px) {
  .sidebar-header {
    padding: 10px 14px;
  }
  .sidebar-menu {
    padding: 6px 8px;
  }
  .menu-title {
    padding: 7px 12px 3px;
    font-size: 0.6rem;
  }
  .menu-item {
    padding: 6.5px 11px;
    margin-bottom: 1px;
    font-size: 0.81rem;
  }
  .sidebar-footer {
    padding: 9px 14px;
  }
}

/* Disable sticky hover border highlight on touch-only mobile devices */
@media (hover: none) {
  .stat-card:hover {
    transform: none;
    border-color: var(--border);
    border-left-color: var(--border);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
  }
  .stat-card.active-card:hover {
    border-color: #2563eb;
    border-left-color: #2563eb;
  }
}

@media (max-width: 1240px) {
  .content-body {
    padding: 12px 16px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: min(285px, 84vw);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sidebar-header {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 13px;
  }
  .main-wrapper {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
  .page-watermark {
    left: 50%;
    width: 300px;
    max-width: 75vw;
  }
}

/* ── 6. AUTHORIZED USER / ADMIN PROFILE AVATAR SYSTEM ── */
.user-avatar {
  overflow: hidden;
  padding: 0;
}

.user-avatar img,
.admin-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}

.admin-avatar-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #ffffff;
  font-weight: 700;
  user-select: none;
  border: 1.5px solid rgba(37, 99, 235, 0.25);
}

.header-profile-wrap {
  position: relative;
  flex-shrink: 0;
}

.header-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.header-profile-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.header-profile-name {
  font-size: 0.78rem;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 230px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  z-index: 1250;
  overflow: hidden;
}

.header-profile-dropdown.show {
  display: block;
}

.hp-drop-head {
  padding: 11px 13px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hp-drop-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 13px;
  font-size: 0.81rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: background 0.14s ease, color 0.14s ease;
}

.hp-drop-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.hp-drop-item.danger {
  color: #dc2626;
  border-top: 1px solid #f1f5f9;
}

.hp-drop-item.danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.my-profile-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.my-profile-preview {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2.5px solid #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.16);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ── 7. MOBILE VIP iOS & ANDROID LAYER (<= 768px) ──
   Explicitly supersedes UI-V2 desktop compact density so touch targets,
   iOS 16px anti-zoom, safe areas, Profile Chip, Profit & Equity, and Bottom Nav
   all deliver a true native executive app feel on iPhone & Android! */
@media (max-width: 768px) {
  .header {
    height: auto;
    min-height: 56px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.06);
  }

  .header-title h1 {
    font-size: 1rem;
    letter-spacing: -0.015em;
  }

  .notif-bell-btn,
  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .header-profile-name {
    display: none;
  }

  .header-profile-btn {
    padding: 3px 6px 3px 4px;
    gap: 4px;
    min-height: 38px;
    border-radius: 999px;
  }

  .header-profile-dropdown {
    position: fixed;
    top: calc(60px + env(safe-area-inset-top, 0px));
    right: 10px;
    left: auto;
    width: min(244px, calc(100vw - 20px));
  }

  .hp-drop-item {
    padding: 11px 14px;
    font-size: 0.85rem;
  }

  /* Preserve bottom clearance for VIP Mobile Bottom Navigation Bar + iPhone Home Indicator */
  .content-body {
    padding: 12px 12px calc(86px + env(safe-area-inset-bottom, 0px));
  }

  /* UI-V2 Corporate Blue + Gold Mobile Bottom Nav Theme (Solid 60fps Surface) */
  .mobile-bottom-nav {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
  }

  .mob-nav-item.active {
    color: #2563eb;
    background: #eff6ff;
    font-weight: 700;
  }

  .mob-nav-item.active::before {
    background: linear-gradient(90deg, #2563eb, #C9A84C);
  }

  /* Touch-Friendly Buttons, Tabs & Filter Controls */
  .btn {
    padding: 8px 13px;
    font-size: 0.83rem;
    min-height: 36px;
    border-radius: 8px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 0.77rem;
    min-height: 32px;
    border-radius: 7px;
  }

  .att-subtab-btn,
  .inc-tab-btn,
  .adv-subtab-btn {
    padding: 8px 13px;
    font-size: 0.81rem;
    border-radius: 8px;
  }

  /* Strict iOS Safari 16px anti-zoom on all inputs/selects/textareas */
  .form-control,
  select.form-control,
  textarea.form-control,
  .login-input {
    font-size: 16px;
    padding: 9px 11px;
    min-height: 40px;
    border-radius: 8px;
  }

  input[type="file"].form-control {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    flex: 1 1 0;
    overflow: hidden;
    font-size: 14px;
    padding: 7px 9px;
  }

  .date-range-field {
    height: 40px;
    border-radius: 8px;
  }

  .date-range-field input[type="date"] {
    height: 36px;
    font-size: 14px;
    padding: 4px 2px !important;
  }

  /* Executive 2-Column KPI Cards with crisp Corporate Blue touch elevation */
  .stat-card {
    padding: 11px 12px;
    gap: 7px;
    border-radius: 11px;
    border-left: 3px solid #e2e8f0;
  }

  .stat-card:hover {
    transform: none;
  }

  .stat-card.active-card {
    border-left-color: #2563eb;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .stat-details .label {
    font-size: 0.7rem;
  }

  .stat-details .value {
    font-size: 1.04rem;
  }

  .stat-details .sub {
    font-size: 0.68rem;
  }

  .card {
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .card-header {
    padding: 11px 13px;
  }

  .card-header h3 {
    font-size: 0.93rem;
  }

  .card-body {
    padding: 12px 13px;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th {
    padding: 8px 10px;
    font-size: 0.67rem;
  }

  .data-table td {
    padding: 9px 10px;
  }

  /* Touch-friendly Attendance Circles */
  .att-circle-btn {
    width: 32px;
    height: 32px;
    font-size: 0.78rem;
  }

  .att-circle-group {
    gap: 6px;
  }

  /* ── Profit & Partners Equity (Module 6G) Mobile VIP Fit — Zero Cut-Off ── */
  #view-profit-equity .inc-tabs-bar > div[style*="display:flex"] .date-mode-toggle,
  #view-profit-equity .inc-tabs-bar > div[style*="display: flex"] .date-mode-toggle {
    flex: 1 1 100%;
    width: 100%;
    display: flex;
  }

  #view-profit-equity .inc-tabs-bar > div[style*="display:flex"] .date-mode-btn,
  #view-profit-equity .inc-tabs-bar > div[style*="display: flex"] .date-mode-btn {
    flex: 1 1 50%;
    padding: 7px 10px;
    font-size: 0.78rem;
    text-align: center;
  }

  #view-profit-equity .inc-tabs-bar > div[style*="display:flex"] > .btn,
  #view-profit-equity .inc-tabs-bar > div[style*="display: flex"] > .btn {
    flex: 1 1 calc(50% - 4px) !important;
  }

  #peKpiProfitBadge .badge {
    font-size: 0.62rem;
    padding: 2px 7px;
    white-space: nowrap;
  }

  .pe-preset-action-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .pe-preset-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
  }

  .pe-preset-pills {
    width: 100%;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0;
  }
  .pe-preset-pills::-webkit-scrollbar {
    display: none;
  }

  .pe-close-presets {
    padding: 8px 10px !important;
  }

  #pe-panel-closing .filter-group > button.btn-primary {
    width: 100%;
  }

  /* Crisp single-line Dashboard sub-tabs on 360px Android & 390px iPhone */
  #view-dashboard .inc-tabs-bar .inc-tab-btn {
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  #view-dashboard .inc-tabs-bar > .btn {
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  /* Keep Dashboard 4-column tables crisp & all 4 columns visible on 360px Android + readable directory names */
  #view-dashboard .data-table th,
  #view-dashboard .data-table td {
    padding: 8px 7px;
    font-size: 0.77rem;
  }
  #view-employees .data-table td:nth-child(2) {
    min-width: 175px;
  }

  #peBadDebtPickerWrap {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  #peBadDebtReason {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  #peCloseLabel,
  #peCloseNotes {
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  #peCloseBasis {
    flex: 1 1 calc(50% - 4px) !important;
    width: auto !important;
  }

  #peCloseReserve {
    width: 68px !important;
    font-size: 16px;
  }

  #peCapTableAlert {
    width: 100%;
    min-width: 0;
    font-size: 0.79rem !important;
  }

  /* ── Settings My Profile & Photo Card Mobile VIP Fit ── */
  .my-profile-row {
    gap: 14px;
  }

  .my-profile-row > div[style*="min-width"] {
    min-width: 0 !important;
    flex: 1 1 180px !important;
  }

  .my-profile-preview {
    width: 64px;
    height: 64px;
    font-size: 1.3rem;
  }

  /* ── Employee 9-Section Profile Modal Mobile VIP Fit ── */
  .prof-modal-top {
    border-radius: 16px 16px 0 0 !important;
  }

  .prof-modal-close {
    width: 38px !important;
    height: 38px !important;
    top: 10px !important;
    right: 10px !important;
  }

  /* ── Executive Login Screen iOS & Android Safe-Area Fit ── */
  .login-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .login-card {
    border-radius: 18px;
  }

  .login-card-body {
    padding: 24px 20px 20px;
  }

  .login-eye-btn {
    width: 38px;
    height: 38px;
    right: 4px;
  }

  .login-btn {
    min-height: 44px;
    font-size: 0.94rem;
  }
}

@media (max-width: 600px) {
  .header-date-badge {
    display: none;
  }
}

@media (max-width: 440px) {
  .header {
    padding-left: 10px;
    padding-right: 10px;
    gap: 6px;
  }

  .header-right {
    gap: 6px;
  }

  .header-title h1 {
    font-size: 0.94rem;
  }

  .header-profile-btn svg {
    display: none;
  }

  .header-profile-btn {
    padding: 3px;
    width: 38px;
    height: 38px;
    justify-content: center;
  }

  .my-profile-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .content-body {
    padding: 10px 10px calc(86px + env(safe-area-inset-bottom, 0px));
  }
}
