/* ==========================================================
 iOS 26 Design System - Glassmorphism & Translucent Surfaces
 Scoped specifically for Invoicing & Accounting Module
 ========================================================== */

:root {
  /* System Colors - Purple / Violet Primary Theme */
  --ios-primary: #7c3aed;
  --ios-primary-hover: #6d28d9;
  --ios-primary-rgb: 124, 58, 237;
  --ios-blue: #7c3aed;
  --ios-blue-rgb: 124, 58, 237;
  --ios-purple: #7c3aed;
  --ios-purple-rgb: 124, 58, 237;
  --ios-green: #22c55e;
  --ios-green-rgb: 34, 197, 94;
  --ios-indigo: #6366f1;
  --ios-indigo-rgb: 99, 102, 241;
  --ios-orange: #f97316;
  --ios-orange-rgb: 249, 115, 22;
  --ios-pink: #ec4899;
  --ios-red: #ef4444;
  --ios-red-rgb: 239, 68, 68;
  --ios-teal: #14b8a6;
  --ios-yellow: #eab308;
  --ios-cyan: #06b6d4;

  /* Frosted Glass Surfaces */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-bg-hover: rgba(255, 255, 255, 0.95);
  --glass-card: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(226, 232, 240, 0.85);
  --glass-border-subtle: rgba(226, 232, 240, 0.6);
  --glass-inner-glow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.9);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-float: 0 12px 36px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);

  /* Typography & Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --transition-smooth: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

/* Scoped Container Resets */
.ios-container {
  font-family: var(--font-family);
  color: #18181b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 10px 0 100px 0;
}

.ios-container * {
  box-sizing: border-box;
}

.ios-container a {
  text-decoration: none !important;
}

/* Glassmorphism Containers */
.ios-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  position: relative;
  transition: var(--transition-smooth);
}

.ios-glass:hover {
  background: var(--glass-bg-hover);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

/* Page Header */
.ios-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.ios-header-left {
  display: flex;
  flex-direction: column;
}

.ios-page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ios-page-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 400;
}

.ios-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* KPI Cards Grid */
.ios-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ios-kpi-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.ios-kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.ios-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}

/*
.ios-kpi-card.kpi--primary::before { background: #007aff; }
.ios-kpi-card.kpi--success::before { background: #34c759; }
.ios-kpi-card.kpi--warning::before { background: #ff9500; }
.ios-kpi-card.kpi--danger::before  { background: #ff3b30; }
*/

.ios-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ios-kpi-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.ios-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi--primary .ios-kpi-icon {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

.kpi--success .ios-kpi-icon {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.kpi--warning .ios-kpi-icon {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.kpi--danger .ios-kpi-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.ios-kpi-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.2;
}

.ios-kpi-subtext {
  font-size: 12px;
  color: #64748b;
}

/* Filter Card */
.ios-filter-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.ios-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 0;
}

.ios-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 180px;
  min-width: 140px;
}

.ios-filter-label {
  font-size: 11px !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0;
}

/* Form Controls */
.ios-container input[type="text"].ios-input,
.ios-container input[type="number"].ios-input,
.ios-container input[type="date"].ios-input,
.ios-container input[type="email"].ios-input,
.ios-container select.ios-select,
.ios-container textarea.ios-textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font-family);
  color: #1e293b;
  margin: 0;
  box-shadow: none;
  transition: var(--transition-smooth);
}

.ios-container select.ios-select {
  padding-right: 28px;
}

.ios-container textarea.ios-textarea {
  height: auto;
  min-height: 60px;
  padding: 8px 12px;
}

.ios-container input.ios-input:focus,
.ios-container select.ios-select:focus,
.ios-container textarea.ios-textarea:focus {
  outline: none;
  border-color: var(--ios-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Buttons - Baseline alignment & Refined, Subtle 3D Tactile Styling */
.ios-btn,
button.ios-btn,
a.ios-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  gap: 7px;
  height: 38px !important;
  padding: 0 18px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  font-family: var(--font-family) !important;
  border-radius: var(--radius-full) !important;
  border: 1px solid transparent !important;
  cursor: pointer;
  text-decoration: none !important;
  margin: 0 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Refined 3D Purple (Primary) */
.ios-btn-primary,
.ios-btn-purple {
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%) !important;
  color: #ffffff !important;
  border: 1px solid #5b21b6 !important;
  border-top-color: #a78bfa !important;
  box-shadow: inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.45),
    0 2px 8px -1px rgba(124, 58, 237, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.ios-btn-primary:hover,
.ios-btn-purple:hover {
  background: linear-gradient(180deg, #936bf8 0%, #8453f7 50%, #7535e5 100%) !important;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 14px -1px rgba(124, 58, 237, 0.48),
    0 2px 4px rgba(0, 0, 0, 0.08) !important;
  color: #ffffff !important;
}

.ios-btn-primary:active,
.ios-btn-purple:active {
  background: linear-gradient(180deg, #5b21b6 0%, #6d28d9 100%) !important;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(0.5px);
}

/* Refined 3D Green (Success) */
.ios-btn-success {
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 50%, #16a34a 100%) !important;
  color: #ffffff !important;
  border: 1px solid #15803d !important;
  border-top-color: #86efac !important;
  box-shadow: inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.45),
    0 2px 8px -1px rgba(34, 197, 94, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.ios-btn-success:hover {
  background: linear-gradient(180deg, #5ee491 0%, #2ecc6b 50%, #19b352 100%) !important;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 14px -1px rgba(34, 197, 94, 0.48),
    0 2px 4px rgba(0, 0, 0, 0.08) !important;
  color: #ffffff !important;
}

.ios-btn-success:active {
  background: linear-gradient(180deg, #15803d 0%, #16a34a 100%) !important;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(0.5px);
}

/* Enhanced High-Contrast Gray / White (Secondary) */
.ios-btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  color: #1e293b !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08),
    inset 0 1px 0.5px #ffffff !important;
}

.ios-btn-secondary:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12),
    inset 0 1px 0.5px #ffffff !important;
}

.ios-btn-secondary:active {
  background: #e2e8f0 !important;
  box-shadow: inset 0 1.5px 2px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(0.5px);
}

/* Refined 3D Red (Danger) */
.ios-btn-danger {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 50%, #dc2626 100%) !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c !important;
  border-top-color: #fca5a5 !important;
  box-shadow: inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.45),
    0 2px 8px -1px rgba(239, 68, 68, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.ios-btn-danger:hover {
  background: linear-gradient(180deg, #fb8383 0%, #f35555 50%, #e63232 100%) !important;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 14px -1px rgba(239, 68, 68, 0.48),
    0 2px 4px rgba(0, 0, 0, 0.08) !important;
  color: #ffffff !important;
}

.ios-btn-danger:active {
  background: linear-gradient(180deg, #b91c1c 0%, #dc2626 100%) !important;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(0.5px);
}

.ios-btn-sm,
button.ios-btn-sm,
a.ios-btn-sm {
  height: 31px !important;
  padding: 0 13px !important;
  font-size: 12px !important;
}

/* Status Badges */
.ios-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--paid {
  background: rgba(52, 199, 89, 0.12);
  color: #166534;
  border: 1px solid rgba(52, 199, 89, 0.25);
}

.badge--unpaid {
  background: rgba(255, 149, 0, 0.12);
  color: #9a3412;
  border: 1px solid rgba(255, 149, 0, 0.25);
}

.badge--overdue {
  background: rgba(255, 59, 48, 0.12);
  color: #991b1b;
  border: 1px solid rgba(255, 59, 48, 0.25);
}

.badge--storno {
  background: rgba(100, 116, 139, 0.12);
  color: #334155;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.badge--proforma {
  background: rgba(125, 76, 246, 0.12);
  color: #5b21b6;
  border: 1px solid rgba(125, 76, 246, 0.25);
}

/* Modern Glass Table */
.ios-table-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
}

.ios-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 !important;
  background: transparent;
}

.ios-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.ios-table td {
  padding: 12px 16px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  background: transparent;
  transition: background 0.12s ease;
}

.ios-table tr:last-child td {
  border-bottom: none;
}

.ios-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.9);
}

.ios-table .td-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.ios-table .td-title {
  font-weight: 600;
  color: #0f172a;
}

.ios-table .td-actions {
  text-align: right;
  white-space: nowrap;
}

/* Action Icons inside table */
.ios-action-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: #ffffff !important;
  color: #334155 !important;
  text-decoration: none !important;
  margin-left: 3px;
  border: 1.5px solid #cbd5e1 !important;
  margin-bottom: 0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: var(--transition-smooth);
}

.ios-action-icon:hover {
  background: #f8fafc !important;
  color: #7c3aed !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.ios-action-icon.danger:hover {
  color: #ef4444 !important;
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

/* Form Card Sections */
.ios-card {
  background: #fff;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.ios-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.ios-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.ios-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ios-form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0;
}

/* Customer Selected Summary Pill */
.ios-customer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
}

.ios-customer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ios-customer-name {
  font-weight: 700;
  color: #166534;
  font-size: 13.5px;
}

.ios-customer-meta {
  font-size: 11.5px;
  color: #15803d;
}

/* Accordion Toggle - Clean Slate/Neutral Pill with Margin */
.ios-accordion-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-sm) !important;
  padding: 7px 14px !important;
  margin: 14px 0 6px 0 !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: var(--transition-smooth);
}

.ios-accordion-toggle:hover {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: var(--shadow-sm);
}

.ios-collapsible-panel {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.ios-collapsible-panel.open {
  display: block;
}

/* Dynamic Items Table in Add/Edit */
.ios-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.ios-items-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  padding: 8px 8px;
  border-bottom: 1px solid #e2e8f0;
}

.ios-items-table td {
  padding: 6px 6px;
  vertical-align: middle;
}

.ios-items-table .ios-input,
.ios-items-table .ios-select {
  height: 36px !important;
  font-size: 12.5px;
}

.ios-calc-pill {
  display: inline-block;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1e293b;
  font-size: 12.5px;
  width: 100%;
  text-align: right;
}

/* Total Summary Box in Add/Edit */
.ios-summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ios-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #475569;
}

.ios-summary-row.total {
  border-top: 1px solid #cbd5e1;
  padding-top: 8px;
  margin-top: 2px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

tr:nth-child(even) {
  background: #fff !important;
}

form .item-row td,
form .ios-items-table th {
  border: 0 !important;
}

/* Sticky Bottom Action Bar with Frosted Glass Effect - 3D Pill Design */
.ios-bottom-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1100px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  outline: 1px solid rgba(203, 213, 225, 0.45);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 1.5px rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-full);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
}

.ios-bottom-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13.5px;
  color: #475569;
}

.ios-bottom-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================
   macOS 26 Global Background & Floating Translucent Sidebar
   ========================================================== */
html,
body {
  min-height: 100vh !important;
  background: radial-gradient(1600px circle at 50% 0%, #ffffff 0%, #fafbfc 45%, #f2f5f8 100%) fixed !important;
  background-attachment: fixed !important;
  color: #18181b;
}

body:not(.login-body) {
  background: transparent !important;
}

.wrapper,
.main {
  background: transparent !important;
}

nav.menu {
  position: fixed !important;
  top: 22px !important;
  left: 22px !important;
  bottom: 22px !important;
  width: 250px !important;
  height: calc(100vh - 44px) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.95) !important;
  outline: 1px solid rgba(226, 232, 240, 0.6) !important;
  border-radius: 26px !important;
  box-shadow: 0 16px 40px -4px rgba(15, 23, 42, 0.09),
    0 2px 6px rgba(0, 0, 0, 0.02),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.95) !important;
  padding: 24px 16px 20px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 999 !important;
  box-sizing: border-box !important;
}

.main {
  width: calc(100% - 296px) !important;
  margin-left: 296px !important;
  padding: 22px 32px 100px 16px !important;
  float: none !important;
  box-sizing: border-box !important;
}

nav.menu .logo {
  width: 100% !important;
  height: 52px !important;
  background: url('../img/bynd.png') no-repeat center center !important;
  background-size: contain !important;
  margin-bottom: 24px !important;
  flex-shrink: 0 !important;
}

.menu-link {
  width: 100% !important;
  height: 44px !important;
  line-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 16px !important;
  margin-bottom: 7px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  text-decoration: none !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  position: relative !important;
}

.menu-link:before {
  display: none !important;
}

.menu-link svg {
  width: 20px !important;
  height: 20px !important;
  color: #64748b !important;
  margin-right: 12px !important;
  top: 0 !important;
  flex-shrink: 0 !important;
  transition: color 0.18s ease !important;
}

.menu-link:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

.menu-link:hover svg {
  color: #0f172a !important;
}

.menu-link.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid #5b21b6 !important;
  border-top-color: #a78bfa !important;
  box-shadow: inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.45),
    0 3px 12px rgba(124, 58, 237, 0.35) !important;
}

.menu-link.active svg {
  color: #ffffff !important;
}

.menu-link--logout {
  position: static !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  width: 100% !important;
  background: linear-gradient(180deg, #f87171 0%, #ef4444 50%, #dc2626 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid #b91c1c !important;
  border-top-color: #fca5a5 !important;
  box-shadow: inset 0 1px 0.5px 0 rgba(255, 255, 255, 0.45),
    0 3px 10px -1px rgba(239, 68, 68, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.menu-link--logout svg {
  color: #ffffff !important;
}

.menu-link--logout:hover {
  background: linear-gradient(180deg, #fb8383 0%, #f35555 50%, #e63232 100%) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 14px -1px rgba(239, 68, 68, 0.48),
    0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

.menu-link--logout:hover svg {
  color: #ffffff !important;
}

.menu-link--logout:active {
  background: linear-gradient(180deg, #b91c1c 0%, #dc2626 100%) !important;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(0.5px);
}

/* Modal Overlay & Content */
.ios-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.ios-modal-overlay.active {
  display: flex !important;
}

.ios-modal-content {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-float);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.ios-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.ios-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.ios-modal-close {
  background: #f1f5f9;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: #64748b;
  transition: var(--transition-smooth);
}

.ios-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ==========================================================
   CakePHP Flash Messages (macOS 26 Floating Toast Notifications)
   ========================================================== */
.ios-flash,
.message {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 auto 20px auto;
  width: 100%;
  max-width: 800px;
  box-sizing: border-box;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.03),
    inset 0 1px 1px rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.3s ease, margin 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: iosFlashSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes iosFlashSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

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

.ios-flash.hidden,
.message.hidden {
  display: none !important;
}

/* Default / Info flash */
.ios-flash,
.message {
  background: rgba(239, 246, 255, 0.92);
  color: #1e40af;
  border-color: rgba(147, 197, 253, 0.7);
}

.ios-flash .ios-flash-icon,
.message .ios-flash-icon {
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Success flash */
.ios-flash.success,
.message.success {
  background: rgba(240, 253, 244, 0.94);
  color: #166534;
  border-color: rgba(134, 239, 172, 0.7);
}

.ios-flash.success .ios-flash-icon,
.message.success .ios-flash-icon {
  color: #16a34a;
}

/* Error / Danger flash */
.ios-flash.error,
.message.error {
  background: rgba(254, 242, 242, 0.94);
  color: #991b1b;
  border-color: rgba(252, 165, 165, 0.7);
}

.ios-flash.error .ios-flash-icon,
.message.error .ios-flash-icon {
  color: #dc2626;
}

.ios-flash-text {
  flex: 1 1 auto;
  font-weight: 500;
}

.ios-flash-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: currentColor;
  opacity: 0.5;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ios-flash-close:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* ==========================================================
   macOS 26 Glassmorphic Login Screen
   ========================================================== */
.main.login-section {
  margin-left: 0 !important;
  width: 100% !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: radial-gradient(1200px circle at 50% 15%, #ffffff 0%, #edf2f7 50%, #e2e8f0 100%) !important;
  padding: 24px !important;
  box-sizing: border-box !important;
}

.ios-login-wrapper {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  animation: iosLoginFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes iosLoginFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }

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

.ios-login-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 1px 1.5px rgba(255, 255, 255, 1);
  padding: 40px 36px;
  box-sizing: border-box;
}

.ios-login-header {
  text-align: center;
  margin-bottom: 28px;
}

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

.ios-login-logo img {
  max-height: 64px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.05));
}

.ios-login-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.ios-login-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

.ios-login-card .ios-flash,
.ios-login-card .message {
  margin-bottom: 20px;
  font-size: 13px;
  padding: 10px 14px;
}

.ios-input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.ios-field-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
  transition: color 0.2s ease;
}

.ios-input-icon-wrapper .ios-input {
  padding-left: 42px !important;
  width: 100%;
  box-sizing: border-box;
}

.ios-input-icon-wrapper .ios-input:focus+.ios-field-icon,
.ios-input-icon-wrapper:focus-within .ios-field-icon {
  color: var(--ios-blue);
}

.ios-input-lg {
  height: 48px !important;
  font-size: 15px !important;
  border-radius: 14px !important;
}

/* ==========================================================
   macOS 26 Glassmorphic Floating Pagination
   ========================================================== */
.pagination {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 6px 8px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.95) !important;
  outline: 1px solid rgba(226, 232, 240, 0.7) !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.02),
    inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
  margin: 24px auto !important;
  list-style: none !important;
}

.pagination li {
  margin: 0 !important;
  list-style: none !important;
  display: inline-flex !important;
  align-items: center !important;
}

.pagination li a,
.pagination li span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 36px !important;
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: var(--radius-full) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  font-family: var(--font-family) !important;
  color: #475569 !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}

.pagination li:not(.active):not(.disabled) a:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
}

.pagination li.active a,
.pagination li.active span {
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #5b21b6 !important;
  border-top-color: #a78bfa !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.45),
    0 2px 8px rgba(124, 58, 237, 0.35) !important;
}

.pagination li.disabled a,
.pagination li.disabled span,
.pagination li.prev.disabled a,
.pagination li.next.disabled a,
.pagination li.first.disabled a,
.pagination li.last.disabled a {
  color: #94a3b8 !important;
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: transparent !important;
  border-color: transparent !important;
}

/* ==========================================================
   Full Mobile Responsive Design System (macOS 26 & iOS)
   ========================================================== */

/* Legacy element reset */
#mobile-menu {
  display: none !important;
}

/* Desktop Defaults for Mobile Elements */
.ios-mobile-header {
  display: none;
}

.ios-nav-backdrop {
  display: none;
}

.menu-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 24px;
}

.menu-header-row .logo {
  width: 100%;
  height: 52px;
  background: url('../img/bynd.png') no-repeat center center;
  background-size: contain;
  margin-bottom: 0 !important;
  flex-shrink: 0;
}

.ios-menu-close-btn {
  display: none;
}

.menu-links-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* Responsive Breakpoint: Tablets & Mobile (<= 992px) */
@media (max-width: 992px) {
  /* Top Mobile Glass Bar */
  .ios-mobile-header {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    padding: 0 16px !important;
    align-items: center !important;
    justify-content: space-between !important;
    z-index: 9990 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
    box-sizing: border-box !important;
  }

  .ios-mobile-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
  }

  .ios-mobile-toggle {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: var(--radius-sm) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #1e293b !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    transition: var(--transition-smooth) !important;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .ios-mobile-toggle:hover,
  .ios-mobile-toggle:active {
    background: #f8fafc !important;
    color: var(--ios-primary) !important;
    border-color: #94a3b8 !important;
  }

  /* Slide-in Mobile Drawer Navigation */
  nav.menu {
    position: fixed !important;
    top: 12px !important;
    left: -320px !important;
    bottom: 12px !important;
    width: 280px !important;
    max-width: calc(100vw - 36px) !important;
    height: calc(100vh - 24px) !important;
    z-index: 10000 !important;
    border-radius: 24px !important;
    padding: 20px 16px 18px 16px !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25) !important;
    transition: left 0.32s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.32s ease !important;
    display: flex !important;
  }

  nav.menu.active {
    left: 12px !important;
  }

  .menu-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7) !important;
  }

  .menu-header-row .logo {
    width: 140px !important;
    height: 40px !important;
  }

  .ios-menu-close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: var(--radius-full) !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #475569 !important;
    cursor: pointer !important;
    font-size: 16px !important;
    transition: var(--transition-smooth) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  }

  .ios-menu-close-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
  }

  /* Translucent Dark Backdrop */
  .ios-nav-backdrop {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9995;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }

  .ios-nav-backdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.ios-menu-open {
    overflow: hidden !important;
  }

  /* Main content container adjustments */
  .main {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 76px 16px 80px 16px !important;
  }

  .ios-container {
    padding: 0 0 60px 0 !important;
  }

  /* Header & Action buttons */
  .ios-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }

  .ios-header-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .ios-header-actions .ios-btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }
}

/* Responsive Breakpoint: Phones (<= 768px) */
@media (max-width: 768px) {
  /* KPI Cards Grid */
  .ios-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
  }

  .ios-kpi-card {
    padding: 14px 12px !important;
    border-radius: var(--radius-sm) !important;
  }

  .ios-kpi-value {
    font-size: 19px !important;
  }

  .ios-kpi-title {
    font-size: 11px !important;
  }

  /* Filter Form */
  .ios-filter-card {
    padding: 14px !important;
    border-radius: var(--radius-sm) !important;
  }

  .ios-filter-form {
    gap: 10px !important;
  }

  .ios-filter-group {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }

  .ios-filter-form div[style*="display: flex"] {
    width: 100% !important;
  }

  .ios-filter-form button,
  .ios-filter-form a {
    flex: 1 !important;
    justify-content: center !important;
  }

  /* Smooth Table Scrolling */
  .ios-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 16px !important;
  }

  .ios-table {
    min-width: 680px !important;
  }

  /* Bottom Floating Bar */
  .ios-bottom-bar {
    left: 12px !important;
    right: 12px !important;
    width: calc(100% - 24px) !important;
    transform: none !important;
    bottom: 12px !important;
    padding: 12px 16px !important;
    flex-direction: column !important;
    gap: 10px !important;
    border-radius: 20px !important;
  }

  .ios-bottom-bar-left,
  .ios-bottom-bar-right {
    width: 100% !important;
    justify-content: center !important;
  }

  .ios-bottom-bar-right .ios-btn {
    flex: 1 !important;
    justify-content: center !important;
  }

  /* Modals */
  .ios-modal-content {
    padding: 20px 16px !important;
    border-radius: 20px !important;
    max-height: 90vh !important;
  }

  .ios-form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Toast Messages */
  .ios-flash,
  .message {
    padding: 12px 14px !important;
    font-size: 13px !important;
    border-radius: 14px !important;
  }

  /* Pagination */
  .pagination {
    padding: 4px 6px !important;
    gap: 2px !important;
  }

  .pagination li a,
  .pagination li span {
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 12.5px !important;
  }
}

/* Responsive Breakpoint: Small Mobile (<= 480px) */
@media (max-width: 480px) {
  .ios-page-title {
    font-size: 21px !important;
  }

  .ios-kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .ios-login-card {
    padding: 30px 20px !important;
    border-radius: 22px !important;
  }

  .ios-login-title {
    font-size: 20px !important;
  }
}