/* ==========================================================
   مصنع تو-A (Factory 2-A) - Modern Industrial POS & Invoicing
   ========================================================== */

:root {
  /* Color Palette: Industrial Steel, Deep Obsidian Slate & Radiant Gold/Amber */
  --bg-dark: #0f141c;
  --bg-surface: #171f2c;
  --bg-card: #1c2637;
  --bg-card-hover: #232f45;
  --bg-light-sheet: #ffffff;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #f59e0b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dark: #1e293b;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.25);
  
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.25);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.15);
  
  --font-main: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  --sidebar-collapsed-width: 74px;
  --sidebar-expanded-width: 280px;
  --sidebar-width: var(--sidebar-collapsed-width);
  --header-height: 70px;
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ================= LAYOUT ================= */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #131b27 0%, #0d1219 100%);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

.brand-header {
  padding: 18px 16px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.brand-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.logo-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: #000;
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-info {
  flex: 1;
  min-width: 0;
}

.brand-info h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: normal;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-pin-sidebar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.22s ease;
  flex-shrink: 0;
}

.btn-pin-sidebar:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--accent);
}

.btn-pin-sidebar.is-pinned {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.2) 100%);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.btn-pin-sidebar.is-pinned i {
  transform: rotate(-45deg);
}

.brand-sub-container {
  width: 100%;
  margin-top: 10px;
  transition: all 0.25s ease;
}

.brand-sub-badge {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
  color: #fbbf24;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 5px 10px;
  white-space: normal;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.2px;
}

.badge-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.nav-menu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: right;
  position: relative;
}

.nav-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  transition: transform 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item:hover i {
  transform: scale(1.15);
  color: var(--accent);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  color: #fff;
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item.active i {
  color: var(--accent);
}

.nav-count {
  margin-right: auto;
  background: var(--bg-surface);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.user-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================= DESKTOP MINI SIDEBAR (COLLAPSED BY DEFAULT, EXPAND ON HOVER) ================= */
@media (min-width: 769px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
    overflow-x: hidden;
  }

  .sidebar .brand-header {
    padding: 14px 10px;
    overflow: hidden;
  }

  .sidebar .brand-header-main {
    justify-content: center;
    gap: 0;
  }

  .sidebar .logo-box {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin: 0 auto;
    transition: margin 0.25s ease, width 0.25s ease, height 0.25s ease;
  }

  .sidebar .brand-info {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.18s ease, max-width 0.26s ease;
    pointer-events: none;
  }

  .sidebar .brand-header-actions {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, max-width 0.26s ease;
  }

  .sidebar .brand-sub-container {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, max-height 0.26s ease, margin-top 0.26s ease;
  }

  .sidebar .btn-close-sidebar {
    display: none !important;
  }

  .sidebar .nav-menu {
    padding: 14px 8px;
    gap: 8px;
    overflow-x: hidden;
  }

  .sidebar .nav-item {
    padding: 12px 0;
    justify-content: center;
    gap: 0;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
  }

  .sidebar .nav-item i {
    font-size: 1.25rem;
    width: 44px;
    text-align: center;
    flex-shrink: 0;
    margin: 0;
    transition: transform 0.2s ease, color 0.2s ease, font-size 0.2s ease;
  }

  .sidebar .nav-item span:not(.nav-count) {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.15s ease, max-width 0.25s ease;
    pointer-events: none;
  }

  .sidebar .nav-count {
    position: absolute;
    top: 5px;
    left: 8px;
    margin: 0;
    font-size: 0.65rem;
    padding: 1px 5px;
    min-width: 17px;
    text-align: center;
    line-height: 1.3;
    border-radius: 10px;
    transition: all 0.2s ease;
  }

  .sidebar .sidebar-footer {
    padding: 12px 8px;
  }

  .sidebar .user-card {
    padding: 8px 0;
    justify-content: center;
    gap: 0;
    background: transparent;
    border-color: transparent;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.25s ease;
  }

  .sidebar .user-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    margin: 0 auto;
    transition: margin 0.25s ease;
  }

  .sidebar .user-details {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.15s ease, max-width 0.25s ease;
    pointer-events: none;
  }

  .sidebar #btnQuickLock {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, max-width 0.25s ease;
    margin: 0;
    padding: 0;
  }

  /* Hover & Pinned Expansion on Desktop */
  .sidebar:hover,
  .sidebar.is-pinned,
  .app-layout.sidebar-pinned .sidebar {
    width: var(--sidebar-expanded-width);
    box-shadow: -12px 0 38px rgba(0, 0, 0, 0.75);
    z-index: 1000;
  }

  .sidebar:hover .brand-header,
  .sidebar.is-pinned .brand-header,
  .app-layout.sidebar-pinned .sidebar .brand-header {
    padding: 18px 16px 14px 16px;
  }

  .sidebar:hover .brand-header-main,
  .sidebar.is-pinned .brand-header-main,
  .app-layout.sidebar-pinned .sidebar .brand-header-main {
    justify-content: space-between;
    gap: 12px;
  }

  .sidebar:hover .logo-box,
  .sidebar.is-pinned .logo-box,
  .app-layout.sidebar-pinned .sidebar .logo-box {
    margin: 0;
    width: 46px;
    height: 46px;
  }

  .sidebar:hover .brand-info,
  .sidebar.is-pinned .brand-info,
  .app-layout.sidebar-pinned .sidebar .brand-info {
    opacity: 1;
    max-width: 150px;
    pointer-events: auto;
  }

  .sidebar:hover .brand-header-actions,
  .sidebar.is-pinned .brand-header-actions,
  .app-layout.sidebar-pinned .sidebar .brand-header-actions {
    opacity: 1;
    max-width: 80px;
    pointer-events: auto;
  }

  .sidebar:hover .brand-sub-container,
  .sidebar.is-pinned .brand-sub-container,
  .app-layout.sidebar-pinned .sidebar .brand-sub-container {
    opacity: 1;
    max-height: 80px;
    margin-top: 10px;
    pointer-events: auto;
  }

  .sidebar:hover .nav-menu,
  .sidebar.is-pinned .nav-menu,
  .app-layout.sidebar-pinned .sidebar .nav-menu {
    padding: 16px 12px;
    gap: 6px;
  }

  .sidebar:hover .nav-item,
  .sidebar.is-pinned .nav-item,
  .app-layout.sidebar-pinned .sidebar .nav-item {
    padding: 11px 16px;
    justify-content: flex-start;
    gap: 12px;
  }

  .sidebar:hover .nav-item i,
  .sidebar.is-pinned .nav-item i,
  .app-layout.sidebar-pinned .sidebar .nav-item i {
    font-size: 1.1rem;
    width: 22px;
  }

  .sidebar:hover .nav-item span:not(.nav-count),
  .sidebar.is-pinned .nav-item span:not(.nav-count),
  .app-layout.sidebar-pinned .sidebar .nav-item span:not(.nav-count) {
    opacity: 1;
    max-width: 180px;
    pointer-events: auto;
  }

  .sidebar:hover .nav-count,
  .sidebar.is-pinned .nav-count,
  .app-layout.sidebar-pinned .sidebar .nav-count {
    position: static;
    margin-right: auto;
    font-size: 0.72rem;
    padding: 1px 7px;
  }

  .sidebar:hover .sidebar-footer,
  .sidebar.is-pinned .sidebar-footer,
  .app-layout.sidebar-pinned .sidebar .sidebar-footer {
    padding: 14px;
  }

  .sidebar:hover .user-card,
  .sidebar.is-pinned .user-card,
  .app-layout.sidebar-pinned .sidebar .user-card {
    padding: 8px 10px;
    justify-content: flex-start;
    gap: 10px;
    background: var(--bg-surface);
    border-color: var(--border-color);
  }

  .sidebar:hover .user-avatar,
  .sidebar.is-pinned .user-avatar,
  .app-layout.sidebar-pinned .sidebar .user-avatar {
    margin: 0;
    width: 36px;
    height: 36px;
  }

  .sidebar:hover .user-details,
  .sidebar.is-pinned .user-details,
  .app-layout.sidebar-pinned .sidebar .user-details {
    opacity: 1;
    max-width: 140px;
    pointer-events: auto;
  }

  .sidebar:hover #btnQuickLock,
  .sidebar.is-pinned #btnQuickLock,
  .app-layout.sidebar-pinned .sidebar #btnQuickLock {
    opacity: 1;
    max-width: 36px;
    padding: 6px;
    pointer-events: auto;
  }
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  transition: margin-right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.sidebar-pinned .main-content {
  margin-right: var(--sidebar-expanded-width);
}

/* Top Header */
.top-header {
  min-height: var(--header-height);
  height: auto;
  background: rgba(23, 31, 44, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 16px;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.btn-toggle-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.2s ease;
}

.btn-toggle-menu:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fff;
  transform: scale(1.05);
}

.btn-toggle-menu.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent);
  color: var(--accent);
}

.page-title-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.page-title-group h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title-group p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.live-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Content Body */
.content-body {
  padding: 24px;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= CARDS & UTILS ================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.015);
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header .subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-body {
  padding: 20px;
}

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.p-0 { padding: 0 !important; }
.p-4 { padding: 24px !important; }
.pt-4 { padding-top: 24px !important; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.gap-2 { gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.border-top { border-top: 1px solid var(--border-color); }

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-outline-primary {
  background: transparent;
  border-color: rgba(37, 99, 235, 0.5);
  color: #60a5fa;
}
.btn-outline-primary:hover {
  background: rgba(37, 99, 235, 0.15);
}

.btn-outline-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-outline-danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-text-link:hover {
  text-decoration: underline;
}

/* ================= FORM CONTROLS ================= */
.form-group {
  margin-bottom: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.col-2 { flex: 1 1 140px; min-width: 130px; }
.col-3 { flex: 0 0 calc(25% - 9px); }
.col-4 { flex: 0 0 calc(33.333% - 8px); }
.col-6 { flex: 0 0 calc(50% - 6px); }
.col-8 { flex: 0 0 calc(66.666% - 6px); }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  background: #111722;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* ================= POS SPECIFIC STYLES ================= */
.pos-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.invoice-number-tag {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.4);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* Party Type Radio Chips */
.party-type-selector {
  display: flex;
  gap: 8px;
  background: #111722;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.radio-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.radio-chip input[type="radio"] {
  display: none;
}

.radio-chip.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.radio-chip.active i {
  color: var(--accent);
}

.color-options-picker {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-options-picker.compact-color-picker {
  gap: 4px;
}

.color-options-picker.compact-color-picker .btn-color-chip {
  padding: 4px 6px;
  font-size: 0.76rem;
  gap: 3px;
  height: 32px;
}

.color-options-picker.compact-color-picker .chip-color-circle {
  width: 11px;
  height: 11px;
}

.btn-color-chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-color-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-color-chip.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.chip-color-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.chip-color-circle.silver {
  background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
  border: 1px solid #cbd5e1;
  box-shadow: 0 0 6px rgba(148, 163, 184, 0.6);
}

.chip-color-circle.gold {
  background: linear-gradient(135deg, #fde047 0%, #d97706 100%);
  border: 1px solid #fef08a;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.selected-party-preview {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 4px;
}
.preview-item:last-child { margin-bottom: 0; }
.preview-label { color: var(--text-muted); }
.preview-value { color: var(--text-primary); font-weight: 600; }

/* Add Item Form in POS */
.add-item-box {
  background: #131a26;
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
}

.core-items-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chips-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fff;
  border-color: rgba(245, 158, 11, 0.4);
}

.chip-btn i {
  color: var(--accent);
}

/* POS Table Container */
.pos-table-container {
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* POS Invoice Summary Bar */
.invoice-summary-bar {
  background: #111722;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.summary-details {
  display: flex;
  align-items: center;
  gap: 24px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.summary-item strong {
  color: #fff;
  font-size: 1.05rem;
}

.summary-item.highlight strong {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 800;
}

.input-with-currency {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.input-with-currency input {
  width: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  text-align: center;
}

.input-with-currency small {
  margin-right: 6px;
  color: var(--text-muted);
}

.summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operational-summary-details {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.op-summary-title {
  color: #f59e0b;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.op-summary-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.op-summary-meta strong {
  color: #fff;
  font-size: 0.95rem;
}

/* ================= DATA TABLES ================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.88rem;
}

.data-table thead th {
  background: #121924;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.data-table tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

.text-center { text-align: center !important; }

/* Table Action Buttons */
.action-buttons {
  display: inline-flex;
  gap: 6px;
}

.btn-table-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-table-action.edit:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-table-action.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-table-action.view:hover {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.3);
}

.btn-table-action.whatsapp:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

/* ================= GUARANTEED WHATSAPP ICON (Pure SVG Mask) ================= */
i.fa-brands.fa-whatsapp,
i.fa-whatsapp,
.fa-brands.fa-whatsapp,
.fa-whatsapp,
.fab.fa-whatsapp {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  position: relative;
  line-height: 1;
}

i.fa-brands.fa-whatsapp::before,
i.fa-whatsapp::before,
.fa-brands.fa-whatsapp::before,
.fa-whatsapp::before,
.fab.fa-whatsapp::before {
  content: "" !important;
  display: inline-block !important;
  width: 1em !important;
  height: 1em !important;
  background-color: currentColor !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z'/%3E%3C/svg%3E") no-repeat center / contain !important;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z'/%3E%3C/svg%3E") no-repeat center / contain !important;
  vertical-align: -0.125em;
}

/* ================= SECTION TOOLBAR ================= */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.search-box i {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 9px 38px 9px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #fff;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-pills {
  display: flex;
  gap: 6px;
}

.filter-pills .pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pills .pill:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.filter-pills .pill.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.icon-blue { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-meta h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

/* ================= SETTINGS GRID ================= */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ================= MODALS ================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

#invoiceModal {
  z-index: 1100;
}

#dispatchModal {
  z-index: 1200;
}

.modal-dialog {
  width: 100%;
  max-width: 580px;
  margin: auto;
}

.modal-dialog.modal-xl {
  max-width: 1040px;
  width: 95vw;
}

.modal-dialog.modal-sm {
  max-width: 380px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Actionable Modal Header (Invoices & Statements) */
.modal-header-actionable {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.2s ease;
}
.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  transform: rotate(90deg);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
}

/* Modal Actions Bar (Invoice & Statement Modals) */
.modal-actions-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.btn-action {
  padding: 7px 13px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  transition: transform 0.15s ease, opacity 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  opacity: 1;
}

.btn-action:active {
  transform: translateY(0);
}

.btn-download-img {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
}

.btn-print {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.bg-light {
  background-color: #f1f5f9;
}

/* ==========================================================
   PRINTABLE INVOICE SHEET (Modern Crisp Clean Design for Image & Print)
   ========================================================== */
.invoice-sheet {
  background: #ffffff;
  color: #0f172a;
  padding: 36px 40px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-family: 'Cairo', 'Tajawal', sans-serif;
  letter-spacing: normal !important;
  font-feature-settings: "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  direction: rtl;
}

.invoice-sheet * {
  letter-spacing: normal;
}

.invoice-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.sheet-logo-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sheet-logo-box {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid #0f172a;
  background: #000;
  flex-shrink: 0;
}

.invoice-sheet-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.factory-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: normal !important;
  word-spacing: normal;
  font-feature-settings: "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  margin-bottom: 4px;
}

.factory-sub {
  font-size: 0.88rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 8px;
}

.factory-contact-row {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: #334155;
  flex-wrap: wrap;
}

.factory-contact-row i {
  color: #d97706;
}

.stamp-circle {
  width: 90px;
  height: 90px;
  border: 3px dashed #d97706;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #d97706;
  transform: rotate(-10deg);
  background: rgba(245, 158, 11, 0.04);
}

.stamp-brand {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
}

.stamp-text {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 2px;
}

.invoice-meta-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.badge-color-silver {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge-color-gold {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge-color-custom {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge-color-black {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge-color-beige {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fdf8ef;
  color: #78350f;
  border: 1px solid #d8b88c;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge-color-lead {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #334155;
  color: #f1f5f9;
  border: 1px solid #475569;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge-color-gray {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge-color-orange {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Custom Color Select Dropdown */
#posItemColorGroup {
  flex: 1.2 1 155px;
  min-width: 145px;
}

.custom-color-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-color-select-trigger {
  height: 42px;
  width: 100%;
  box-sizing: border-box;
  background: #1e293b;
  border: 1.5px solid #334155;
  border-radius: 8px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  transition: all 0.2s ease;
}

.custom-color-select-trigger:hover,
.custom-color-select-wrapper.open .custom-color-select-trigger {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.custom-color-current {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #f8fafc;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.custom-color-current .color-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-color-arrow {
  font-size: 0.74rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 2px;
}

.custom-color-select-wrapper.open .custom-color-arrow {
  transform: rotate(180deg);
  color: #3b82f6;
}

.custom-color-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  min-width: 180px;
  width: max-content;
  max-width: 250px;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 1050;
  display: none;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.custom-color-select-wrapper.open .custom-color-dropdown-menu {
  display: block;
  animation: colorDropdownFadeIn 0.16s ease-out;
}

@keyframes colorDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-color-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.custom-color-opt .color-opt-name {
  white-space: nowrap;
}

.custom-color-opt:hover {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.custom-color-opt.active {
  background: rgba(59, 130, 246, 0.28);
  color: #93c5fd;
  font-weight: 700;
}

.custom-color-opt.opt-custom-writer {
  border-top: 1px solid #1e293b;
  margin-top: 4px;
  padding-top: 9px;
  color: #f59e0b;
}

.custom-color-opt.opt-custom-writer:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Swatch Dots with Exact Tuned Degrees */
.color-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.custom-color-opt:hover .color-dot {
  transform: scale(1.15);
}

.color-dot.default-dot {
  background: transparent;
  border: 1.5px dashed #64748b;
}

.color-dot.dot-black {
  background: #09090b;
  border: 1.5px solid #52525b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.color-dot.dot-beige {
  background: #d8b88c;
  border: 1.5px solid #b39265;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.color-dot.dot-lead {
  background: #475569;
  border: 1.5px solid #334155;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.color-dot.dot-gray {
  background: #94a3b8;
  border: 1.5px solid #64748b;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.color-dot.dot-orange {
  background: #f97316;
  border: 1.5px solid #c2410c;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.color-dot.dot-custom {
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #f59e0b;
}

/* Cutter Workshop Hard-Copy Checkboxes */
.cutter-check-boxes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.cutter-box {
  width: 22px;
  height: 22px;
  border: 1.8px solid #0f172a;
  border-radius: 4px;
  background: #ffffff;
  display: inline-block;
  box-sizing: border-box;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-item .m-label {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.meta-item .m-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.meta-item .m-val.highlight {
  color: #2563eb;
}

.badge-inv-type {
  display: inline-block;
  background: #e0f2fe;
  color: #0284c7;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.8rem !important;
  width: fit-content;
}

.entity-bill-box {
  background: #f1f5f9;
  border-right: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.bill-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}

.bill-details-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.5fr;
  gap: 12px;
  font-size: 0.88rem;
  color: #1e293b;
}

.bill-details-grid strong {
  color: #475569;
}

.invoice-sheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  table-layout: fixed;
}

.invoice-sheet-table th {
  background: #0f172a;
  color: #ffffff;
  padding: 8px 5px;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.invoice-sheet-table td {
  padding: 7px 5px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.8rem;
  color: #1e293b;
  vertical-align: middle;
}

.invoice-sheet-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

/* Clean & HTML2Canvas-Safe Dimension Badge */
.sheet-dim-badge {
  display: inline-block;
  text-align: center;
  direction: ltr !important;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  line-height: 1.4;
  vertical-align: middle;
}

.sheet-dim-badge .dim-val {
  display: inline;
}

.sheet-dim-badge .dim-sep {
  color: #f59e0b;
  font-weight: 900;
  margin: 0 3px;
}

/* Thickness Badge in Invoice Sheet */
.sheet-thickness-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

/* Supports Count Badge in Invoice Sheet */
.sheet-supports-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  padding: 1px 6px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  white-space: nowrap;
}

bdi {
  display: inline-block;
  unicode-bidi: isolate;
}

/* Quantity Badge in Invoice Sheet */
.sheet-qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  border-radius: 13px;
  font-size: 0.85rem;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.15);
  margin: 0 auto;
}

.invoice-sheet-totals {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.totals-left-notes {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
}

.totals-left-notes strong {
  display: block;
  margin-bottom: 4px;
  color: #475569;
}

.totals-left-notes p {
  color: #64748b;
}

.totals-right-table {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.t-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #475569;
  padding: 4px 0;
  border-bottom: 1px dashed #cbd5e1;
}

.t-row span:last-child {
  font-weight: 700;
  color: #0f172a;
}

.t-row.grand-total {
  border-top: 2px solid #0f172a;
  border-bottom: none;
  padding-top: 8px;
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
}

.t-row.grand-total span:last-child {
  color: #d97706;
  font-size: 1.25rem;
}

.invoice-sheet-signatures {
  display: flex;
  justify-content: space-between;
  padding: 24px 10px 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.invoice-sheet-footer {
  text-align: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  margin-top: 10px;
}

.invoice-sheet-footer p {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 2px;
}

.invoice-sheet-footer small {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* WhatsApp Image Modal Styles */
.whatsapp-instruction-card {
  background: rgba(37, 211, 102, 0.07);
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.instruction-step .step-icon {
  font-size: 1.25rem;
  margin-top: 1px;
  flex-shrink: 0;
}

.instruction-step .step-icon.check {
  color: #10b981;
}

.instruction-step .step-icon.whatsapp {
  color: #25d366;
}

.instruction-step .step-content strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
  margin-bottom: 2px;
}

.instruction-step .step-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.instruction-step .step-content code {
  background: rgba(255, 255, 255, 0.12);
  color: #fbbf24;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-family: inherit;
}

.whatsapp-image-preview-wrapper {
  background: #0b0f17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.whatsapp-image-preview-wrapper .preview-header {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.preview-image-scroll {
  max-height: 250px;
  overflow-y: auto;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}

/* ================= LOCK SCREEN MODAL ================= */
.lock-card {
  text-align: center;
  padding: 28px 24px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.lock-card .form-control {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
}

.lock-card .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.lock-avatar {
  width: 60px;
  height: 60px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: slideInLeft 0.25s ease-out;
  border-right: 4px solid var(--primary);
}

.toast.success { border-right-color: var(--success); }
.toast.success i { color: var(--success); }
.toast.danger { border-right-color: var(--danger); }
.toast.danger i { color: var(--danger); }
.toast.info { border-right-color: var(--info); }
.toast.info i { color: var(--info); }

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ================= ACCOUNT STATEMENT & SUMMARY STYLES ================= */
.btn-table-action.statement {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.btn-table-action.statement:hover {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
  transform: translateY(-2px);
}

.invoices-category-summary-bar {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.cat-summary-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-icon {
  width: 42px;
  height: 42px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.cat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cat-title {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 700;
}

.cat-summary-values {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.val-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.val-box.highlight {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
}

.val-box .v-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.val-box .v-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

/* Settings Users Management */
.card-full-span {
  grid-column: 1 / -1;
}

.user-add-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.permissions-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.perm-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.perm-checkbox-item:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fff;
}

.perm-checkbox-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Password Toggle and Input Wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper .form-control {
  padding-left: 44px !important;
}

.btn-toggle-password {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  z-index: 2;
}

.btn-toggle-password:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

/* Statement Sheet Styling */
.statement-banner-strip {
  background: linear-gradient(135deg, #f8fafc, #edf2f7);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.statement-banner-strip h2 {
  font-size: 1.25rem;
  color: #0f172a;
  margin-bottom: 2px;
}

.statement-banner-strip small {
  color: #64748b;
  font-size: 0.8rem;
}

.s-banner-meta {
  text-align: left;
  font-size: 0.85rem;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.statement-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stmt-metric-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stmt-metric-card.highlight {
  background: #fffbeb;
  border-color: #fde68a;
}

.stmt-metric-card .m-title {
  display: block;
  font-size: 0.76rem;
  color: #64748b;
  margin-bottom: 4px;
}

.stmt-metric-card h3, .stmt-metric-card h4 {
  margin: 0;
  font-size: 1.15rem;
  color: #0f172a;
  font-weight: 700;
}

.statement-main-table tfoot .stmt-tfoot-row td {
  background: #f1f5f9;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-top: 2px solid #cbd5e1;
}

.printable-report-sheet {
  background: #fff;
  color: #000;
  padding: 30px;
}

/* ================= PRINT MEDIA (A4 CRISP & ACCURATE PRINTING) ================= */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }

  /* Completely eliminate all scrollbars in print */
  * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  html, body {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide app shell and navigation */
  .app-layout,
  .sidebar,
  .top-header,
  .main-content,
  #toastContainer,
  .btn,
  .btn-action,
  .btn-close-modal,
  .modal-header,
  .modal-actions-bar,
  .modal-footer {
    display: none !important;
    visibility: hidden !important;
  }

  /* By default in print, hide all modals and reports completely */
  .modal-backdrop,
  #invoiceModal,
  #statementModal,
  #printableReportContainer {
    display: none !important;
    visibility: hidden !important;
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    z-index: auto !important;
  }

  /* Strictly Isolated Print Modes */
  body.printing-invoice-mode #invoiceModal {
    display: block !important;
    visibility: visible !important;
  }
  body.printing-invoice-mode #statementModal,
  body.printing-invoice-mode #printableReportContainer {
    display: none !important;
    visibility: hidden !important;
  }

  body.printing-statement-mode #statementModal {
    display: block !important;
    visibility: visible !important;
  }
  body.printing-statement-mode #invoiceModal,
  body.printing-statement-mode #printableReportContainer {
    display: none !important;
    visibility: hidden !important;
  }

  body.printing-report-mode #printableReportContainer {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body.printing-report-mode #invoiceModal,
  body.printing-report-mode #statementModal {
    display: none !important;
    visibility: hidden !important;
  }

  .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    overflow: visible !important;
  }

  .modal-content {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  .modal-body {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }

  /* Invoice & Statement Printable Sheets on A4 */
  .invoice-sheet {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 4mm 6mm !important;
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    overflow: visible !important;
  }

  .invoice-sheet * {
    visibility: visible !important;
  }

  #printableReportContainer * {
    visibility: visible !important;
  }

  /* Workshop Hard-Copy Boxes in Print */
  .cutter-box {
    border: 1.5pt solid #000000 !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  table, tr, td, th {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-sheet-header,
  .invoice-meta-banner,
  .bill-details-grid,
  .invoice-sheet-totals,
  .invoice-sheet-signatures {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

/* ================= HEADER AUTH BUTTON & DROPDOWN ================= */
.header-auth-wrapper {
  position: relative;
}

.btn-header-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-auth:hover,
.btn-header-auth.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
}

.auth-avatar-icon {
  font-size: 1.25rem;
  color: var(--accent);
}

.auth-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-chevron {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.btn-header-auth.active .auth-chevron {
  transform: rotate(180deg);
}

.header-auth-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 250px;
  background: #172030;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  border-radius: var(--radius-md);
  padding: 12px;
  z-index: 500;
  display: none;
  animation: dropdownFade 0.2s ease;
}

.header-auth-dropdown.open {
  display: block;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-dropdown-user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.drop-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.15rem;
}

.drop-meta strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
}

.drop-meta span {
  font-size: 0.75rem;
}

.auth-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-drop-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: right;
  transition: all 0.2s ease;
}

.auth-drop-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.auth-drop-btn.text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Sidebar Close Button & Mobile Backdrop */
.btn-close-sidebar {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px 8px;
  margin-right: auto;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-close-sidebar:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 95;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
}

/* ================= COMPREHENSIVE RESPONSIVE DESIGN ================= */
@media (max-width: 1024px) {
  .pos-grid {
    grid-template-columns: 1fr;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .statement-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-title-group p {
    display: none;
  }

  .page-title-group h1 {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 285px;
    --header-height: 60px;
  }

  /* Smooth Mobile Sidebar Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    max-width: 86vw;
    z-index: 100;
    transform: translateX(100%);
    box-shadow: -12px 0 35px rgba(0, 0, 0, 0.85);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .btn-pin-sidebar {
    display: none !important;
  }

  .btn-close-sidebar {
    display: inline-flex !important;
  }

  .main-content,
  .app-layout.sidebar-pinned .main-content {
    margin-right: 0 !important;
    min-width: 0;
    overflow-x: hidden;
  }

  /* Header Optimization */
  .top-header {
    padding: 6px 12px;
    gap: 10px;
    min-height: var(--header-height);
    height: auto;
  }

  .header-left {
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .btn-toggle-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    color: var(--accent);
    flex-shrink: 0;
  }

  .page-title-group {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .page-title-group h1 {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
  }

  .page-title-group p {
    display: none;
  }

  .header-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .live-clock {
    padding: 5px 8px;
    font-size: 0.76rem;
    gap: 5px;
    flex-shrink: 0;
  }

  #btnNewInvoiceQuick {
    padding: 6px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .btn-header-auth {
    padding: 6px 10px;
    font-size: 0.84rem;
  }

  .auth-name {
    max-width: 80px;
  }

  /* Content Body */
  .content-body {
    padding: 14px 10px;
  }

  /* Forms & Rows */
  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .col-3, .col-4, .col-6, .col-8 {
    flex: 0 0 100%;
  }

  /* Toolbars on Mobile */
  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-box {
    width: 100%;
  }

  .filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .toolbar-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .toolbar-actions .btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    text-align: center;
    padding: 9px 12px;
    font-size: 0.85rem;
  }

  /* Invoices Category Summary Banner */
  .invoices-category-summary-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }

  .cat-summary-values {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .val-box {
    justify-content: center;
    padding: 8px;
  }

  /* Stats Grid */
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 12px;
    gap: 10px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
  }

  .stat-meta h4 {
    font-size: 1.05rem;
  }

  /* Tables: Mobile Friendly with horizontal touch scroll */
  .table-responsive {
    border-radius: var(--radius-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 620px;
  }

  .btn-table-action {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  /* Modals on Mobile */
  .modal-dialog {
    width: 95% !important;
    max-width: 95% !important;
    margin: 16px auto !important;
    max-height: 94vh !important;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-header-actionable {
    padding: 12px 14px;
    gap: 10px;
  }

  .modal-header-top {
    gap: 8px;
  }

  .modal-title-group h3 {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 14px;
    max-height: calc(94vh - 120px);
    overflow-y: auto;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .modal-actions-bar {
    width: 100%;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .modal-actions-bar .btn-action {
    flex: 1 1 calc(50% - 6px);
    min-width: 125px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  /* Invoice & Statement Printable Sheets on Mobile */
  .invoice-meta-banner {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .bill-details-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .invoice-sheet-totals {
    flex-direction: column;
    gap: 12px;
  }

  .totals-right-table {
    width: 100%;
  }

  .invoice-sheet-signatures {
    flex-direction: column;
    gap: 16px;
  }

  /* POS Invoice Summary Bar & Responsive Action Buttons */
  .card-body {
    padding: 14px 10px;
  }

  .invoice-summary-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 10px;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
  }

  .summary-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .summary-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    box-sizing: border-box;
    gap: 4px;
    min-width: 0;
  }

  .summary-item span {
    font-size: 0.76rem;
    color: var(--text-muted);
  }

  .summary-item strong {
    font-size: 0.95rem;
    color: #fff;
  }

  .summary-item .input-with-currency {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .summary-item .input-with-currency input {
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 2px 6px;
    font-size: 0.85rem;
    text-align: center;
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.12);
  }

  .summary-item.highlight {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 10px 14px;
  }

  .summary-item.highlight span {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fbbf24;
  }

  .summary-item.highlight strong {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f59e0b;
  }

  #posSupplierTotalWeightItem {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 8px 12px;
  }

  .operational-summary-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .summary-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
  }

  .summary-actions .btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
  }

  #btnSaveInvoice {
    order: 1;
    padding: 12px 14px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border-radius: var(--radius-md) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
  }

  #btnClearCart {
    order: 2;
    padding: 8px 14px !important;
    font-size: 0.84rem !important;
    border-radius: var(--radius-md) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    opacity: 0.85;
  }
}

@media (max-width: 680px) {
  .live-clock {
    display: none;
  }

  #btnNewInvoiceQuick span {
    display: none;
  }

  #btnNewInvoiceQuick {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    flex-shrink: 0;
  }

  .auth-name {
    max-width: 68px;
    font-size: 0.8rem;
  }

  .page-title-group h1 {
    font-size: 0.98rem;
  }
}

@media (max-width: 480px) {
  .top-header {
    padding: 4px 8px;
    gap: 6px;
    min-height: 56px;
  }

  .btn-toggle-menu {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }

  .page-title-group h1 {
    font-size: 0.9rem;
  }

  .auth-name {
    display: none;
  }

  .btn-header-auth {
    padding: 6px 8px;
    gap: 4px;
  }

  #btnNewInvoiceQuick {
    width: 34px;
    height: 34px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .statement-metrics-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-actions .btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 360px) {
  .invoice-summary-bar {
    padding: 10px 8px;
    gap: 10px;
  }

  .summary-details {
    gap: 6px;
  }

  .summary-item {
    padding: 6px 8px;
  }

  .summary-item span {
    font-size: 0.72rem;
  }

  .summary-item strong {
    font-size: 0.88rem;
  }

  .summary-item.highlight strong {
    font-size: 1.15rem;
  }

  #btnSaveInvoice {
    font-size: 0.88rem !important;
    padding: 10px 12px !important;
  }

  #btnClearCart {
    font-size: 0.8rem !important;
    padding: 7px 10px !important;
  }
}

/* ================= LINKED EXTERNAL DISPATCH & CUTTER STYLES ================= */
.pos-dispatch-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 12px;
}

.dispatch-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.dispatch-item {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: all 0.2s ease;
}

.dispatch-item:hover {
  border-color: rgba(245, 158, 11, 0.4);
}

.custom-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
}

.custom-check-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

.linked-orders-banner {
  margin: 10px 0;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.linked-inv-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.linked-inv-badge:hover {
  opacity: 0.85;
}

.linked-inv-badge.badge-oven {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.linked-inv-badge.badge-cutter {
  background: #faf5ff;
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.linked-inv-badge.badge-client {
  background: #eff6ff;
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ================= LINK CLIENT INVOICE SECTION (FOR OVEN & CUTTER) ================= */
.pos-link-client-box {
  background: linear-gradient(180deg, rgba(20, 27, 41, 0.95) 0%, rgba(13, 18, 28, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 12px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.pos-link-client-box:hover {
  border-color: rgba(245, 158, 11, 0.5);
}

.link-box-header {
  margin-bottom: 8px;
}

.link-box-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.link-box-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.link-box-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.link-box-body {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.link-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.link-formula-banner {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.link-formula-banner.oven {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.link-formula-banner.cutter {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
}

.link-items-wrap {
  width: 100%;
  box-sizing: border-box;
}

.item-link-chip {
  cursor: pointer;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  box-sizing: border-box;
}

.item-link-chip:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fff;
  border-color: rgba(245, 158, 11, 0.4);
}

.item-link-chip.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

/* Import All Button - Guaranteed fit inside card without overflow */
.btn-import-all {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 8px 10px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border-radius: var(--radius-sm) !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.3 !important;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(30, 64, 175, 0.4) 100%) !important;
  border: 1px solid rgba(59, 130, 246, 0.5) !important;
  color: #93c5fd !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.btn-import-all:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.45) 0%, rgba(30, 64, 175, 0.6) 100%) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-1px) !important;
}

.btn-import-all i {
  flex-shrink: 0;
  font-size: 0.88rem;
}

@keyframes inputPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.8);
    border-color: var(--accent);
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 14px 2px rgba(245, 158, 11, 0.5);
    border-color: var(--accent);
    transform: scale(1.01);
  }
  100% {
    box-shadow: none;
    transform: scale(1);
  }
}

.input-highlight-pulse {
  animation: inputPulseGlow 1.2s ease-out;
}

@media (max-width: 480px) {
  .modal-actions-bar .btn-action {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* Deferred Payment UI Styling */
.pos-deferred-payment-box {
  animation: fadeInDown 0.25s ease-out;
  transition: all 0.3s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= STANDALONE FULL-SCREEN LOGIN SCREEN ================= */
.login-screen-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, #1e293b 0%, #0a0e17 100%);
  padding: 20px;
  overflow-y: auto;
  min-height: 100vh;
  box-sizing: border-box;
}

.login-card-container {
  width: 100%;
  max-width: 440px;
  background: rgba(22, 30, 44, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 22px;
  padding: 34px 26px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(245, 158, 11, 0.15);
  text-align: center;
  margin: auto;
  box-sizing: border-box;
  animation: fadeInScale 0.28s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.login-brand-header {
  margin-bottom: 24px;
}

.login-logo-glow {
  display: inline-block;
  margin-bottom: 12px;
  position: relative;
}

.login-brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
  display: block;
}

.login-brand-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.login-brand-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.login-brand-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
}

.login-form-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: right;
  direction: rtl;
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input {
  width: 100%;
  height: 48px;
  background: #0f1622 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-size: 0.95rem !important;
  padding: 0 14px 0 44px !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}

.login-input:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
  background: #141d2d !important;
}

.btn-toggle-eye {
  position: absolute;
  left: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 2;
}

.btn-toggle-eye:hover {
  color: #f59e0b;
}

.login-alert-error {
  padding: 11px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.login-submit-btn {
  height: 50px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.login-submit-btn:active {
  transform: translateY(1px);
}

.login-pwa-bar {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-login-pwa {
  width: 100%;
  background: rgba(245, 158, 11, 0.12);
  border: 1.5px dashed rgba(245, 158, 11, 0.5);
  border-radius: 12px;
  color: #fbbf24;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-login-pwa:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #ffffff;
}

.login-footer-info {
  margin-top: 14px;
  font-size: 0.74rem;
  color: #64748b;
  direction: rtl;
}

/* POS Cart In-Place Item Editing & Address Customization */
.cart-row-editing {
  background: rgba(245, 158, 11, 0.16) !important;
  box-shadow: inset 4px 0 0 #f59e0b, 0 0 10px rgba(245, 158, 11, 0.1);
  transition: all 0.25s ease;
}

.cart-inline-num {
  transition: all 0.2s ease-in-out;
  outline: none;
}

.cart-inline-num:focus {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.15) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3) !important;
}

.party-address-edit-group input:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25) !important;
}


