/* ============================================================
   Desi Finesse ERP — Global App Styles
   Design system extracted from QuikLog reference screenshots
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  --primary:        #20c997;
  --primary-hover:  #1ab386;
  --primary-light:  #e9f8ef;
  --secondary:      #6b7280;
  --success:        #16a34a;
  --success-light:  #f0fdf4;
  --danger:         #dc2626;
  --danger-light:   #fef2f2;
  --warning:        #d97706;
  --warning-light:  #fffbeb;
  --info:           #0891b2;
  --info-light:     #ecfeff;

  /* Neutrals */
  --bg:             #f7f8fa;
  --surface:        #ffffff;
  --border:         #ececec;
  --border-dark:    #cbd5e1;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-disabled:  #cbd5e1;

  /* Layout */
  --sidebar-width:  260px;
  --header-height:  70px;
  --content-pad:    24px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.12);

  /* Border radii */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;

  /* Typography */
  --font:  'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Base Reset ── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ── App Wrapper ── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left .25s ease;
}
.sidebar-collapsed .app-main { margin-left: 56px; }

/* ── Top Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
}
.header-left  { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 48px; }
.header-center{
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

.global-search-bug2 {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 40px;
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  transition: border-color 200ms, box-shadow 200ms;
}

.global-search-bug2:hover,
.global-search-bug2:focus {
  border-color: #20c997;
  box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.1);
  outline: none;
}

.global-search-bug2 svg {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  pointer-events: none;
}

.global-search-bug2 .global-search-placeholder {
  color: #9ca3af;
  font-size: 0.85rem;
}

.header-lang-btn {
  width: auto !important;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 8px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}

.header-customize-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #1e293b;
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms, box-shadow 200ms;
}
.header-customize-btn:hover {
  background: #0f172a;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.header-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.header-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #ececec;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms, border-color 200ms;
}
.header-filter-chip:hover {
  background: #f5f7fa;
  border-color: #d1d5db;
}

.header-icon-btn {
  text-decoration: none;
}
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

/* Store type chip (Wholesale / Retail / …) — same height as POS/Store */
.header-store-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 12px;
  border: 1px solid #d1fae5;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background .15s, border-color .15s, color .15s;
}
.header-store-type:hover {
  background: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
  text-decoration: none;
}
.header-store-type-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
.header-store-type-label {
  line-height: 1;
  display: inline-block;
}

.header-logo  { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-primary); font-size: 1rem; }
.logo-text    { white-space: nowrap; }

.sidebar-toggle-btn,
.header-icon-btn {
  width: 36px; height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-height: 36px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer;
  transition: background .15s, color .15s;
  box-sizing: border-box;
  line-height: 1;
  padding: 0;
  text-decoration: none;
  vertical-align: middle;
}
.sidebar-toggle-btn:hover,
.header-icon-btn:hover { background: var(--bg); color: var(--text-primary); }

.header-pos-btn {
  width: auto;
  min-width: 0;
  padding: 0 14px;
  gap: 4px;
  background: #20c997;
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}
.header-pos-btn:hover {
  background: #1ab386;
  color: #fff !important;
}

.header-store-btn {
  width: auto;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  gap: 5px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 500;
}
.header-store-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}
.header-store-btn-label {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
}
.header-store-external {
  opacity: .55;
  flex-shrink: 0;
}

.global-search {
  position: relative;
  display: flex; align-items: center;
}
.global-search svg { position: absolute; left: 10px; color: var(--text-muted); pointer-events: none; }
.global-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color .2s, background .2s;
}
.global-search input:focus { border-color: var(--primary); background: var(--surface); }
.global-search input::placeholder { color: var(--text-muted); }

.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 14px; height: 14px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 2px;
}

.user-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 8px 0 4px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  line-height: 1;
  box-sizing: border-box;
}
.user-avatar-btn:hover { background: var(--bg); }
.user-avatar-btn::after { display: none !important; } /* remove BS caret */

.user-avatar-img     { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.user-avatar-initials {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}
.user-name-text { font-size: 0.85rem; font-weight: 500; }

/* ── Content Area ── */
.content-area {
  flex: 1;
  padding: var(--content-pad);
  max-width: 100%;
}

.app-footer-copyright {
  text-align: center;
  margin: 24px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e5e7eb);
  font-size: .72rem;
  color: #94a3b8;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left { flex: 1; }
.page-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.page-subtitle { font-size: 0.8rem; color: var(--text-muted); margin: 2px 0 0; }
.page-breadcrumb { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.page-breadcrumb a { color: var(--text-muted); }
.page-breadcrumb a:hover { color: var(--primary); }
.page-breadcrumb span { margin: 0 5px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Stat Cards ── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-card-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.stat-card-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-card-icon.green  { background: var(--success-light); color: var(--success); }
.stat-card-icon.red    { background: var(--danger-light);  color: var(--danger);  }
.stat-card-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-card-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-card-icon.teal   { background: var(--info-light);   color: var(--info); }

.stat-card-body { flex: 1; min-width: 0; }
.stat-card-value { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.stat-card-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.stat-card-change { font-size: 0.72rem; margin-top: 4px; }
.stat-card-change.up   { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* ── Cards / Panels ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-header-title { font-weight: 600; font-size: 0.92rem; color: var(--text-primary); }
.card-body  { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg); border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* ── Table Toolbar ── */
.table-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.table-toolbar .search-input-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.table-toolbar .search-input-wrap svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.table-toolbar .search-input {
  width: 100%; padding: 7px 10px 7px 32px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.85rem; background: var(--bg); outline: none; color: var(--text-primary);
}
.table-toolbar .search-input:focus { border-color: var(--primary); background: #fff; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ── Data Table ── */
.data-table-wrap { overflow-x: auto; }

.table-erp {
  width: 100%; border-collapse: collapse;
}
.table-erp thead th {
  padding: 10px 14px;
  font-size: 0.73rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-erp tbody td {
  padding: 11px 14px;
  font-size: 0.85rem; color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-erp tbody tr:last-child td { border-bottom: none; }
.table-erp tbody tr:hover td { background: var(--primary-light); }

.table-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.8rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}

/* ── Badges / Status Pills ── */
.badge-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.badge-status.active,   .badge-status.completed,
.badge-status.approved, .badge-status.passed   { background: var(--success-light); color: var(--success); }
.badge-status.inactive, .badge-status.cancelled,
.badge-status.rejected, .badge-status.failed   { background: var(--danger-light);  color: var(--danger); }
.badge-status.pending,  .badge-status.draft,
.badge-status.planned   { background: var(--warning-light); color: var(--warning); }
.badge-status.running,  .badge-status.in_progress { background: var(--primary-light); color: var(--primary); }
.badge-status.rework                             { background: #fdf4ff; color: #7c3aed; }
.badge-status.partial                            { background: var(--info-light); color: var(--info); }

/* ── Buttons ── */
.btn { border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; transition: all .15s; }
.btn-primary   { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon svg { width: 15px; height: 15px; }
.btn-xs { font-size: .72rem; padding: 2px 8px; border-radius: var(--radius-sm); }
.bg-primary-light { background: var(--primary-light) !important; }

/* ── Forms ── */
.form-label { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control, .form-select {
  border-color: var(--border); font-size: 0.88rem; color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control::placeholder { color: var(--text-muted); font-size: 0.85rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }
.form-error-text { font-size: 0.75rem; color: var(--danger); margin-top: 3px; }
.is-invalid { border-color: var(--danger) !important; }

.section-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.section-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 14px; }

/* ── Two-column form layout ── */
.form-page-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 1024px) { .form-page-layout { grid-template-columns: 1fr; } }

.form-sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; position: sticky; top: calc(var(--header-height) + 16px); }

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.empty-state h5 { color: var(--text-secondary); font-size: 1rem; margin-bottom: 6px; }
.empty-state p  { font-size: 0.85rem; max-width: 320px; margin: 0 auto 16px; }

/* ── Flash / Toast Alerts ── */
.flash-alert { border-radius: var(--radius-sm); font-size: 0.87rem; border: none; }

/* ── Modals ── */
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }
.modal-title  { font-size: 1rem; font-weight: 600; }

/* ── Auth page ── */
.auth-body {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-main { margin-left: 0; }
  .content-area { padding: 16px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
}

/* ── Utilities ── */
.text-primary-color { color: var(--primary) !important; }
.text-muted-sm { font-size: 0.78rem; color: var(--text-muted); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.d-flex-center { display: flex; align-items: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Stepper (sampling multi-step) ── */
.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0 0 20px;
  overflow-x: auto;
}
.step-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.step-item-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  transition: .2s;
}
.step-label {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.step-connector {
  width: 48px; height: 2px;
  background: var(--border);
  flex-shrink: 0;
  margin-top: -18px;
}
.step-item.active .step-circle {
  background: var(--primary);
  color: #fff;
}
.step-item.active .step-label { color: var(--primary); font-weight: 600; }
.step-item.done .step-circle {
  background: var(--success);
  color: #fff;
}
.step-item.done .step-label { color: var(--success); }
.step-item.done ~ .step-connector,
.step-item.active ~ .step-connector { background: var(--primary); }

/* ── Print overrides ── */
@media print {
  .sidebar, .top-header, .page-header-actions, .table-toolbar { display: none !important; }
  .app-main { margin-left: 0 !important; }
  .content-area { padding: 0 !important; }
}

/* ── Global Search (bug-2: use .global-search-bug2 in header) ── */
.global-search-placeholder {
  flex: 1;
  color: #9ca3af;
  font-size: .875rem;
  user-select: none;
}
.global-search-kbd {
  font-size: .65rem;
  color: #9ca3af;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.5;
  flex-shrink: 0;
}

/* Global search modal */
.global-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  padding: 72px 16px 24px;
  align-items: flex-start;
  justify-content: center;
}
.global-search-overlay.is-open {
  display: flex;
}
.global-search-modal {
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  border: 1px solid #e8ecf1;
}
.global-search-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f5;
  background: #fafbfc;
}
.global-search-modal-icon {
  flex-shrink: 0;
  color: #94a3b8;
}
.global-search-modal-head input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #1e293b;
  background: transparent;
  line-height: 1.4;
}
.global-search-modal-head input::placeholder {
  color: #94a3b8;
}
.global-search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.global-search-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.global-search-results {
  max-height: min(440px, calc(100vh - 180px));
  overflow-y: auto;
  padding: 6px 0 10px;
}
body.search-modal-open {
  overflow: hidden;
}

/* Search results */
.search-hint {
  padding: 18px 20px;
  color: #9ca3af;
  font-size: .875rem;
  text-align: center;
}
.search-cat-label {
  padding: 6px 16px 4px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #9ca3af;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #1a1a2e;
  text-decoration: none;
  cursor: pointer;
  border-radius: 8px;
  margin: 2px 8px;
  transition: background .12s;
}
.search-result-item:hover,
.search-result-item:focus,
.search-result-item.is-active {
  background: #f0fdf8;
  outline: none;
}
.search-result-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
  border: 1px solid #e8ecf1;
}
.search-result-thumb.ph {
  display: inline-block;
}
.search-result-icon {
  font-size: 1.1rem;
  min-width: 28px;
  text-align: center;
}
.search-result-body {
  display: flex;
  flex-direction: column;
}
.search-result-label {
  font-size: .875rem;
  font-weight: 500;
}
.search-result-sub {
  font-size: .75rem;
  color: #9ca3af;
}

/* ═══════════════════════════════════════════════════════════════
   PHASE 10 — Mobile Responsive & PWA Enhancements
   ═══════════════════════════════════════════════════════════════ */

/* Mobile sidebar overlay */
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 1100;
    transition: left .25s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .app-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }
  .app-main {
    margin-left: 0 !important;
    width: 100%;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1099;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.active { display: block; }

  /* Compact header on mobile */
  .app-header {
    padding: 0 12px;
    height: 52px;
  }
  .header-center { display: none; }
  .header-right .notif-bell-btn span:not(.notif-badge) { display: none; }

  /* Stack page header on mobile */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  /* Full-width cards */
  .stat-card { min-width: 0; }

  /* Horizontal scroll for tables */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-erp { min-width: 600px; }

  /* Stack row on mobile */
  .row.g-4 { --bs-gutter-x: 12px; }

  /* Form layout: full width on mobile */
  .form-page-layout { grid-template-columns: 1fr !important; }

  /* Dashboard chart grids */
  .dash-charts-grid   { grid-template-columns: 1fr !important; }
  .dash-kpi-row       { grid-template-columns: repeat(2,1fr) !important; }
  .dash-kpi-row .stat-card:last-child { grid-column: span 2; }

  /* Print views: hide on mobile */
  .no-mobile { display: none !important; }
}

@media (max-width: 480px) {
  .dash-kpi-row { grid-template-columns: 1fr !important; }
  .dash-kpi-row .stat-card:last-child { grid-column: auto; }
  .btn { font-size: .8rem; padding: 6px 12px; }
  .modal-dialog { margin: 8px; }
}

/* Floating mobile menu button */
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: var(--primary-600);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(67,97,238,.45);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
}
.mobile-fab:hover { transform: scale(1.08); }
@media (max-width: 768px) { .mobile-fab { display: flex; } }

/* PWA installed banner — shown only when in standalone mode */
@media all and (display-mode: standalone) {
  .pwa-install-banner { display: none !important; }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .btn, .form-select, .form-control { min-height: 44px; }
  .table-erp td, .table-erp th { padding: 12px 14px; }
  .sidebar-link { padding: 12px 18px; }
  .nav-item .dropdown-item { padding: 10px 16px; }
}

/* Smooth momentum scroll */
.data-table-wrap,
.content-area,
.sidebar-nav {
  -webkit-overflow-scrolling: touch;
}
