/* Amin Welding Works — Sales Tax Invoice System
   Design tokens follow the approved mockups: navy sidebar, blue primary, light canvas. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../vendor/inter/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../vendor/inter/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../vendor/inter/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../vendor/inter/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('../vendor/inter/inter-latin-800-normal.woff2') format('woff2'); }

:root {
  --aw-navy: #0f1d3a;
  --aw-navy-2: #14264a;
  --aw-primary: #1d63ed;
  --aw-primary-dark: #1652c9;
  --aw-primary-soft: #e8f0fe;
  --aw-success: #10b981;
  --aw-success-soft: #e7f8f0;
  --aw-warning: #f59e0b;
  --aw-warning-soft: #fff6e5;
  --aw-danger: #ef4444;
  --aw-danger-soft: #fdecec;
  --aw-purple: #8b3dff;
  --aw-bg: #f4f6fb;
  --aw-card: #ffffff;
  --aw-border: #e3e7ee;
  --aw-text: #111827;
  --aw-muted: #6b7280;
  --aw-radius: 12px;
  --aw-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --aw-sidebar-w: 248px;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --bs-primary: #1d63ed;
  --bs-primary-rgb: 29, 99, 237;
  --bs-link-color: #1d63ed;
  --bs-link-color-rgb: 29, 99, 237;
  --bs-body-color: #111827;
  --bs-border-color: #e3e7ee;
}

body { background: var(--aw-bg); color: var(--aw-text); font-size: 14px; }
a { text-decoration: none; }
.text-muted { color: var(--aw-muted) !important; }
.fw-800 { font-weight: 800; }
.small-label { font-size: 12px; color: var(--aw-muted); }
.text-navy { color: var(--aw-navy) !important; }

/* Buttons & forms */
.btn { border-radius: 8px; font-weight: 500; padding: .5rem 1rem; }
.btn-sm { padding: .3rem .7rem; }
.btn-primary { --bs-btn-bg: var(--aw-primary); --bs-btn-border-color: var(--aw-primary); --bs-btn-hover-bg: var(--aw-primary-dark); --bs-btn-hover-border-color: var(--aw-primary-dark); --bs-btn-active-bg: var(--aw-primary-dark); --bs-btn-disabled-bg: #9db8f2; --bs-btn-disabled-border-color: #9db8f2; }
.btn-outline-primary { --bs-btn-color: var(--aw-primary); --bs-btn-border-color: var(--aw-primary); --bs-btn-hover-bg: var(--aw-primary); --bs-btn-hover-border-color: var(--aw-primary); }
.btn-light-soft { background: #fff; border: 1px solid var(--aw-border); color: var(--aw-text); }
.btn-light-soft:hover { background: #f8fafc; border-color: #cfd6e1; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--aw-border); background: #fff; color: #374151; }
.btn-icon:hover { background: var(--aw-primary-soft); color: var(--aw-primary); border-color: #c7d8fb; }
.btn-icon.text-danger:hover { background: var(--aw-danger-soft); color: var(--aw-danger) !important; border-color: #f8c4c4; }
.btn-icon.disabled, .btn-icon:disabled { opacity: .4; pointer-events: none; }
.form-control, .form-select { border-radius: 8px; border-color: var(--aw-border); padding: .5rem .75rem; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: #86a8f5; box-shadow: 0 0 0 .2rem rgba(29, 99, 237, .12); }
.form-control[readonly] { background: #f3f5f9; }
.form-label { font-weight: 500; font-size: 13px; margin-bottom: .35rem; color: #1f2937; }
.form-label .req { color: var(--aw-danger); }
.form-text { font-size: 12px; }
.invalid-feedback { font-size: 12px; }
.input-group-text { background: #f8fafc; border-color: var(--aw-border); color: var(--aw-muted); }

/* Layout */
.aw-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--aw-sidebar-w); background: linear-gradient(180deg, var(--aw-navy) 0%, #0b1730 100%); color: #cbd5e1; display: flex; flex-direction: column; z-index: 1040; transition: transform .2s ease, width .2s ease; }
.aw-brand { padding: 22px 18px 18px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.aw-brand img { max-height: 46px; max-width: 160px; background: #fff; border-radius: 10px; padding: 4px 8px; }
.aw-brand .brand-mark { display: inline-flex; width: 58px; height: 44px; }
.aw-brand .name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .2px; margin-top: 8px; line-height: 1.2; }
.aw-brand .sub { color: #aab6cc; font-size: 12px; }
.aw-nav { padding: 12px 10px; flex: 1; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.aw-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
.aw-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; color: #d6deeb; font-size: 14px; margin-bottom: 2px; }
.aw-nav a i { font-size: 17px; width: 20px; text-align: center; }
.aw-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.aw-nav a.active { background: var(--aw-primary); color: #fff; box-shadow: 0 4px 12px rgba(29, 99, 237, .35); }
.aw-nav .nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #6f7f9c; padding: 14px 14px 6px; }
.aw-sidebar-foot { padding: 12px 18px; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 11px; color: #6f7f9c; }
.aw-sidebar-foot button { color: #cbd5e1; font-size: 13px; }

.aw-main { margin-left: var(--aw-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin .2s ease; }
.aw-topbar { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--aw-border); display: flex; align-items: center; gap: 14px; padding: 10px 24px; }
.aw-topbar .search { flex: 1; max-width: 640px; position: relative; }
.aw-topbar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--aw-muted); }
.aw-topbar .search input { padding-left: 36px; padding-right: 64px; background: #fff; }
.aw-topbar .search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: #fff; color: var(--aw-muted); border: 1px solid var(--aw-border); font-size: 11px; padding: 2px 6px; }
.aw-user { display: flex; align-items: center; gap: 10px; color: var(--aw-text); }
.aw-avatar { width: 36px; height: 36px; border-radius: 50%; background: #dbe4f5; color: var(--aw-navy); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.aw-user .meta { line-height: 1.15; }
.aw-user .meta .n { font-weight: 600; font-size: 14px; }
.aw-user .meta .r { font-size: 12px; color: var(--aw-muted); }
.aw-content { padding: 22px 24px 32px; flex: 1; }
.aw-footer { padding: 14px 24px; font-size: 12px; color: var(--aw-muted); }

body.sidebar-collapsed .aw-sidebar { width: 72px; }
body.sidebar-collapsed .aw-main { margin-left: 72px; }
body.sidebar-collapsed .aw-brand .name, body.sidebar-collapsed .aw-brand .sub, body.sidebar-collapsed .aw-nav a span, body.sidebar-collapsed .aw-nav .nav-section, body.sidebar-collapsed .aw-sidebar-foot span { display: none; }
body.sidebar-collapsed .aw-nav a { justify-content: center; padding: 10px; }
body.sidebar-collapsed .aw-brand img { max-width: 44px; }

@media (max-width: 991.98px) {
  .aw-sidebar { transform: translateX(-100%); width: var(--aw-sidebar-w) !important; }
  .aw-main { margin-left: 0 !important; }
  body.sidebar-open .aw-sidebar { transform: none; }
  body.sidebar-open .aw-backdrop { display: block; }
  .aw-topbar { padding: 10px 14px; }
  .aw-content { padding: 16px 14px 28px; }
  .aw-user .meta, .aw-topbar kbd { display: none; }
  body.sidebar-collapsed .aw-brand .name, body.sidebar-collapsed .aw-brand .sub, body.sidebar-collapsed .aw-nav a span, body.sidebar-collapsed .aw-nav .nav-section { display: initial; }
}
.aw-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 28px; font-weight: 800; color: var(--aw-navy); margin: 0; letter-spacing: -.3px; }
.breadcrumb { margin: 4px 0 0; font-size: 14px; --bs-breadcrumb-divider-color: #9ca3af; }
.breadcrumb a, .breadcrumb-item.active { color: var(--aw-muted); }

/* Cards */
.card { border: 1px solid var(--aw-border); border-radius: var(--aw-radius); box-shadow: var(--aw-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--aw-border); padding: 14px 18px; }
.card-body { padding: 18px; }
.card-title { font-size: 17px; font-weight: 700; color: var(--aw-navy); margin: 0; }
.card-sub { font-size: 13px; color: var(--aw-muted); }
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title > i { font-size: 22px; color: var(--aw-navy); }

/* Stat cards */
.stat-card { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 16px; height: 100%; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; flex-shrink: 0; }
.stat-icon.blue { background: var(--aw-primary); } .stat-icon.green { background: #16a34a; } .stat-icon.orange { background: var(--aw-warning); }
.stat-icon.purple { background: var(--aw-purple); } .stat-icon.red { background: var(--aw-danger); } .stat-icon.navy { background: var(--aw-navy); }
.stat-card .label { font-size: 12.5px; color: #4b5563; }
.stat-card .value { font-size: 18px; font-weight: 800; color: var(--aw-text); white-space: nowrap; }
.stat-card .hint { font-size: 12px; color: var(--aw-muted); }

/* Tables */
.table { --bs-table-hover-bg: #f8fafc; margin: 0; font-size: 13.5px; }
.table > thead th { background: #f6f8fc; color: #1f2937; font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--aw-border); white-space: nowrap; padding: 10px 12px; }
.table > tbody td { padding: 10px 12px; vertical-align: middle; border-color: #eef1f6; }
.nowrap, .table td.nowrap { white-space: nowrap; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-total td { font-weight: 700; background: #f6f8fc; }
.table-card { overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--aw-radius) var(--aw-radius); }

/* Badges */
.badge-status { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-status-draft { background: #eef0f4; color: #374151; }
.badge-status-issued { background: #e3edff; color: #1d4ed8; }
.badge-status-validated { background: #dcf5e8; color: #047857; }
.badge-status-cancelled { background: #fde2e2; color: #dc2626; }
.badge-soft { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-soft.blue { background: #e3edff; color: #1d4ed8; } .badge-soft.green { background: #dcf5e8; color: #047857; }
.badge-soft.orange { background: #fff1d6; color: #b45309; } .badge-soft.red { background: #fde2e2; color: #dc2626; }
.badge-soft.gray { background: #eef0f4; color: #374151; } .badge-soft.navy { background: #e6eaf3; color: var(--aw-navy); }
.pill-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-tabs a { padding: 6px 14px; border: 1px solid var(--aw-border); border-radius: 8px; color: #374151; background: #fff; font-size: 13px; }
.pill-tabs a.active { background: var(--aw-primary); border-color: var(--aw-primary); color: #fff; }
.pill-tabs a .count { margin-left: 6px; background: rgba(0, 0, 0, .07); padding: 1px 7px; border-radius: 10px; font-size: 11px; }
.pill-tabs a.active .count { background: rgba(255, 255, 255, .25); }

/* Tabs underline */
.nav-underline-aw { border-bottom: 1px solid var(--aw-border); gap: 0; flex-wrap: nowrap; overflow-x: auto; }
.nav-underline-aw .nav-link { color: #374151; padding: 12px 18px; border-bottom: 2px solid transparent; border-radius: 0; white-space: nowrap; font-weight: 500; }
.nav-underline-aw .nav-link.active { color: var(--aw-primary); border-bottom-color: var(--aw-primary); background: transparent; }

/* Alerts & banners */
.alert { border-radius: 10px; font-size: 13.5px; display: flex; gap: 12px; align-items: flex-start; }
.alert .alert-icon { font-size: 20px; line-height: 1; margin-top: 1px; }
.alert-info { background: #eaf2ff; border-color: #cfe0ff; color: #1e3a8a; }
.alert-warning { background: var(--aw-warning-soft); border-color: #fbe0a8; color: #7c4a03; }
.alert-danger { background: var(--aw-danger-soft); border-color: #f7c8c8; color: #991b1b; }
.alert-success { background: var(--aw-success-soft); border-color: #bfe9d4; color: #065f46; }
.alert .btn-close { margin-left: auto; }

/* Empty state */
.empty-state { text-align: center; padding: 46px 20px; }
.empty-state .icon { width: 84px; height: 84px; border-radius: 50%; background: #eef2f8; display: inline-flex; align-items: center; justify-content: center; font-size: 36px; color: #6b7a99; margin-bottom: 14px; }
.empty-state h5 { font-weight: 700; color: var(--aw-navy); }

/* Pagination */
.pagination { --bs-pagination-border-radius: 8px; --bs-pagination-active-bg: var(--aw-primary); --bs-pagination-active-border-color: var(--aw-primary); --bs-pagination-color: #374151; gap: 6px; margin: 0; }
.pagination .page-link { border-radius: 8px !important; min-width: 34px; text-align: center; font-size: 13px; }
.table-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--aw-border); font-size: 13px; color: var(--aw-muted); }

/* Filter card */
.filter-card .form-label { font-size: 12.5px; }

/* Charts */
.bar-chart { width: 100%; height: 260px; }
.bar-chart .axis text { font-size: 11px; fill: #6b7280; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: #374151; }
.chart-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: var(--c); }

/* Subscription card */
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.kv .k { color: #374151; display: flex; gap: 8px; align-items: center; }
.kv .k i { color: var(--aw-success); }
.kv .v { font-weight: 600; text-align: right; }
.cta-card { background: linear-gradient(160deg, #1d63ed, #1446b8); color: #fff; border: 0; text-align: center; }
.cta-card .btn { background: #fff; color: var(--aw-primary); font-weight: 600; }

/* Invoice form */
.items-table input, .items-table select { font-size: 13px; padding: .35rem .5rem; }
.items-table td { padding: 6px 6px !important; }
.items-table .col-desc { min-width: 330px; }
.items-table .col-qty { width: 90px; } .items-table .col-unit { width: 92px; } .items-table .col-price { width: 120px; }
.items-table .col-rate { width: 96px; } .items-table .col-amt { width: 120px; }
.items-table tr.row-error { background: #fff5f5; }
.totals-box { background: #fff; }
.totals-box .row-t { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.grand-total { background: #e8f0fe; border-radius: 10px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.grand-total .lbl { font-weight: 700; color: var(--aw-navy); font-size: 16px; }
.grand-total .amt { font-weight: 800; color: var(--aw-navy); font-size: 24px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--aw-border); padding: 12px 18px; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-radius: 0 0 var(--aw-radius) var(--aw-radius); }
.product-suggest { position: absolute; z-index: 20; background: #fff; border: 1px solid var(--aw-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); max-height: 240px; overflow-y: auto; width: 100%; min-width: 280px; }
.product-suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; font-size: 13px; }
.product-suggest button:hover, .product-suggest button.active { background: var(--aw-primary-soft); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li::before { content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: #e5e7eb; }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--aw-success); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.timeline .dot.blue { background: var(--aw-primary); } .timeline .dot.red { background: var(--aw-danger); } .timeline .dot.gray { background: #9ca3af; }

/* Auth & installer screens */
.auth-wrap { min-height: 100vh; display: flex; align-items: stretch; background: #f1f4fa; }
.auth-hero { flex: 1.1; background: linear-gradient(135deg, rgba(10, 22, 48, .94), rgba(14, 38, 84, .86)), radial-gradient(circle at 80% 20%, #f59e0b 0, transparent 35%), #0f1d3a; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-hero::after { content: ''; position: absolute; right: -80px; bottom: -80px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 60, .35), transparent 65%); }
.auth-hero h2 { font-size: 34px; font-weight: 800; line-height: 1.15; max-width: 440px; }
.auth-hero p { color: #d0d8e8; max-width: 440px; }
.auth-feature { display: flex; gap: 14px; align-items: center; margin-top: 18px; }
.auth-feature .ic { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.auth-feature b { display: block; font-size: 15px; } .auth-feature small { color: #c3cde0; }
.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(15, 29, 58, .08); padding: 34px 32px; }
.auth-card .logo { text-align: center; margin-bottom: 18px; }
.auth-card .logo .t { font-weight: 800; font-size: 22px; color: var(--aw-navy); margin-top: 8px; }
.auth-card .logo .s { color: var(--aw-muted); }
.powered { text-align: center; font-size: 12px; color: var(--aw-muted); margin-top: 18px; }
.powered b { color: var(--aw-primary); font-weight: 600; }
@media (max-width: 991.98px) { .auth-hero { display: none; } }

.wizard { max-width: 920px; margin: 28px auto; padding: 0 14px; }
.wizard-head { text-align: center; margin-bottom: 16px; }
.wizard-head .t { font-weight: 800; color: var(--aw-navy); font-size: 22px; } .wizard-head .s { color: var(--aw-muted); font-size: 13px; }
.stepper { display: flex; justify-content: space-between; position: relative; margin: 0 0 22px; padding: 0 6px; }
.stepper::before { content: ''; position: absolute; top: 16px; left: 30px; right: 30px; height: 2px; background: #e5e7eb; }
.stepper .st { position: relative; text-align: center; flex: 1; font-size: 12px; color: var(--aw-muted); }
.stepper .st .n { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2px solid #d9dee8; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: #6b7280; margin-bottom: 6px; position: relative; }
.stepper .st.done .n { background: var(--aw-success); border-color: var(--aw-success); color: #fff; }
.stepper .st.current .n { background: var(--aw-primary); border-color: var(--aw-primary); color: #fff; box-shadow: 0 0 0 5px rgba(29, 99, 237, .15); }
.stepper .st.current { color: var(--aw-primary); font-weight: 600; }
@media (max-width: 575.98px) { .stepper .st span.lbl { display: none; } }
.req-table td { padding: 8px 12px !important; }

/* Blocked / status pages */
.status-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 14px; background: radial-gradient(circle at 0% 30%, #fde2e2 0, transparent 30%), radial-gradient(circle at 100% 80%, #e3edff 0, transparent 30%), #f4f6fb; }
.status-card { max-width: 520px; width: 100%; background: #fff; border-radius: 18px; box-shadow: 0 16px 50px rgba(15, 29, 58, .08); padding: 32px 28px; text-align: center; }
.status-card .big-icon { width: 110px; height: 110px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 50px; margin-bottom: 14px; }
.status-card h1 { font-size: 26px; font-weight: 800; color: var(--aw-navy); }
.support-box { background: #f5f7fc; border-radius: 12px; padding: 14px; margin: 18px 0; }
.support-box .row > div a { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--aw-border); border-radius: 10px; padding: 8px 10px; color: var(--aw-text); font-size: 12px; text-align: left; height: 100%; }
.support-box i { font-size: 18px; }

/* Misc */
.logo-preview { border: 1px dashed #cfd6e1; border-radius: 12px; min-height: 150px; display: flex; align-items: center; justify-content: center; background: #fafbfd; padding: 12px; }
.logo-preview img { max-height: 130px; max-width: 100%; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child, .perm-matrix td:nth-child(2), .perm-matrix th:nth-child(2) { text-align: left; }
.diff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; background: #f7f9fc; padding: 16px; border-radius: 10px; font-size: 13px; }
.diff-grid dt { font-weight: 500; color: #4b5563; } .diff-grid dd { margin-bottom: 6px; word-break: break-word; }
.progress { height: 8px; border-radius: 8px; background: #e8edf5; }
.progress-bar { background: var(--aw-primary); }
.not-configured { background: #eceff4; color: #374151; font-weight: 700; font-size: 12px; padding: 5px 12px; border-radius: 6px; letter-spacing: .4px; }
.locked-field { position: relative; }
.locked-field .bi-lock-fill { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #6b7280; }
.toast-container { z-index: 1090; }
.update-steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; }

/* ---------- Printable invoice (screen + print) ---------- */
.inv-sheet { background: #fff; color: #000; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 12mm; font-family: 'Inter', Arial, sans-serif; font-size: 10.5pt; box-shadow: 0 6px 30px rgba(0, 0, 0, .08); }
.inv-head { display: flex; gap: 16px; align-items: center; border-bottom: 1.5px solid #1f2a44; padding-bottom: 8px; }
.inv-head .logo { width: 150px; flex-shrink: 0; text-align: center; }
.inv-head .logo img { max-width: 150px; max-height: 80px; }
.inv-head .co { flex: 1; text-align: center; line-height: 1.35; font-size: 10.5pt; }
.inv-head .co .nm { font-size: 22pt; font-weight: 800; letter-spacing: .5px; color: #0f1d3a; line-height: 1.1; }
.inv-title { background: #1f2a44; color: #fff; text-align: center; font-weight: 800; font-size: 15pt; letter-spacing: 1px; padding: 5px; margin: 8px 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-title.cn { background: #7f1d1d; }
.inv-meta { display: flex; gap: 10px; margin-bottom: 8px; }
.inv-box { border: 1px solid #000; padding: 6px 8px; }
.inv-billto { flex: 1.6; }
.inv-billto .h { font-weight: 700; font-size: 10pt; }
.inv-billto .bn { font-weight: 700; font-size: 11.5pt; }
.inv-info { flex: 1; padding: 0; }
.inv-info table { width: 100%; border-collapse: collapse; }
.inv-info td { border-bottom: 1px solid #000; padding: 4px 8px; font-size: 10pt; }
.inv-info tr:last-child td { border-bottom: 0; }
.inv-info td:first-child { border-right: 1px solid #000; width: 1%; white-space: nowrap; }
.inv-info td:last-child { font-weight: 700; }
.inv-items { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.inv-items th { background: #dfe6f3; border: 1px solid #000; padding: 5px 4px; text-align: center; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-items td { border: 1px solid #000; padding: 4px; vertical-align: top; }
.inv-items td.c { text-align: center; } .inv-items td.r { text-align: right; white-space: nowrap; }
.inv-items thead { display: table-header-group; }
.inv-items tr { page-break-inside: avoid; }
.inv-bottom { display: flex; gap: 10px; margin-top: 8px; page-break-inside: avoid; }
.inv-notes { flex: 1.1; font-size: 9pt; }
.inv-notes .box { border: 1px solid #000; padding: 6px 8px; margin-bottom: 6px; white-space: pre-line; }
.inv-totals { flex: 1; }
.inv-totals table { width: 100%; border-collapse: collapse; }
.inv-totals td { border: 1px solid #000; padding: 4px 8px; font-size: 10pt; }
.inv-totals td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.inv-totals tr.gt td { background: #dfe6f3; font-size: 12pt; font-weight: 800; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-words { border: 1px solid #000; border-top: 0; padding: 6px 8px; font-size: 9.5pt; }
.inv-sign { display: flex; justify-content: flex-end; gap: 40px; margin-top: 26px; page-break-inside: avoid; }
.inv-sign .s { width: 190px; text-align: center; font-size: 9.5pt; }
.inv-sign .s img { max-height: 50px; max-width: 170px; display: block; margin: 0 auto 2px; }
.inv-sign .line { border-top: 1px solid #000; padding-top: 3px; font-weight: 700; }
.inv-foot { text-align: center; font-size: 8.5pt; color: #333; margin-top: 14px; }
.inv-preview .inv-sheet { width: auto; min-height: 0; padding: 24px; box-shadow: none; }
.inv-watermark { color: #b91c1c; font-weight: 800; text-align: center; font-size: 13pt; border: 2px solid #b91c1c; padding: 4px; margin-bottom: 6px; }

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff !important; }
  .no-print, .aw-sidebar, .aw-topbar, .aw-footer, .btn, .print-toolbar { display: none !important; }
  .aw-main { margin: 0 !important; }
  .aw-content { padding: 0 !important; }
  .inv-sheet { box-shadow: none; width: auto; min-height: 0; padding: 0; margin: 0; }
  .print-bg { padding: 0 !important; background: none !important; min-height: 0 !important; }
}

/* Small screens: compact stat cards so long amounts never overflow */
@media (max-width: 575.98px) {
  .stat-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .stat-icon { width: 38px; height: 38px; font-size: 18px; }
  .stat-card .value { font-size: 15px; white-space: normal; word-break: break-word; }
  .page-head h1 { font-size: 24px; }
}

/* FBR fields under each invoice line */
.fbr-fields { display: grid; grid-template-columns: 92px 1fr 1.4fr; gap: 4px; margin-top: 4px; }
.fbr-fields .form-control-sm, .fbr-fields .form-select-sm { font-size: 11.5px; padding: .2rem .4rem; }
.fbr-badge { display: inline-flex; align-items: center; gap: 6px; }

.inv-fbr { display: flex; align-items: center; gap: 14px; margin-top: 10px; page-break-inside: avoid; }
.inv-fbr .di-logo { max-height: 60px; max-width: 140px; }
.inv-fbr .qr svg { display: block; }

/* ---------- Modern invoice design (navy / orange) ---------- */
.invm { padding: 0 !important; font-size: 9.5pt; color: #1f2937; position: relative; overflow: hidden; display: flex; flex-direction: column; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.invm .inv-watermark { margin: 8px 12mm 0; }
.invm-top { display: flex; gap: 12px; padding: 0 0 0 12mm; }
.invm-brand { flex: 1; display: flex; gap: 12px; padding-top: 10mm; align-items: flex-start; }
.invm-logo img { max-width: 34mm; max-height: 34mm; display: block; }
.invm-co { line-height: 1.35; }
.invm-n1 { font-size: 28pt; font-weight: 900; color: var(--nm); line-height: .95; letter-spacing: .5px; }
.invm-n2 { font-size: 15pt; font-weight: 800; color: var(--dark); line-height: 1.1; margin-bottom: 2px; }
.invm-tag { font-size: 8.5pt; font-weight: 600; margin-bottom: 5px; }
.invm-line { display: flex; gap: 6px; font-size: 8.8pt; }
.invm-line i { color: var(--dark); font-size: 9pt; width: 12px; }
.invm-tax { font-size: 8.8pt; margin-top: 3px; }
.invm-right { width: 48%; display: flex; flex-direction: column; align-items: flex-end; }
.invm-band { white-space: nowrap; background: var(--acc); color: #fff; font-weight: 800; font-size: 17pt; letter-spacing: .5px; padding: 6mm 12mm 6mm 18mm; width: 100%; text-align: right; clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%); }
.invm-info { margin: 4mm 12mm 0 0; border-collapse: collapse; width: 74mm; font-size: 9pt; border: 1px solid #dbe1ea; }
.invm-info td { padding: 4px 8px; border-bottom: 1px solid #e5e9f0; }
.invm-info td:first-child { background: #f3f5f9; font-weight: 600; width: 44%; }
.invm-bill { margin: 5mm 12mm 0; border: 1px solid #dbe1ea; border-radius: 4px; }
.invm-tabh { display: inline-block; background: var(--acc); color: #fff; font-weight: 700; font-size: 11pt; padding: 4px 34px 4px 16px; clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%); }
.invm-billbody { display: flex; gap: 16px; padding: 8px 16px 10px; }
.invm-billl { flex: 1; font-size: 10pt; }
.invm-billl .bn { font-weight: 800; font-size: 11pt; }
.invm-billr { font-size: 9pt; border-collapse: collapse; }
.invm-billr td { padding: 1px 6px; }
.invm-items { margin: 5mm 12mm 0; width: calc(100% - 24mm); border-collapse: collapse; font-size: 8.6pt; }
.invm-items th { background: var(--acc); color: #fff; padding: 6px 4px; font-weight: 700; text-align: center; border-right: 1px solid rgba(255,255,255,.3); line-height: 1.2; }
.invm-items td { padding: 6px 4px; border-bottom: 1px solid #e5e9f0; vertical-align: top; }
.invm-items tbody tr:nth-child(even) td { background: var(--tint); }
.invm-items td.c { text-align: center; } .invm-items td.r { text-align: right; white-space: nowrap; }
.invm-items thead { display: table-header-group; } .invm-items tr { page-break-inside: avoid; }
.invm-mid { display: flex; gap: 10px; margin: 5mm 12mm 0; page-break-inside: avoid; }
.invm-left { flex: 1; }
.invm-fbr { display: flex; gap: 12px; align-items: center; border: 1px solid #dbe1ea; border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; }
.invm-fbr .qr svg { display: block; }
.invm-fbr .di-logo { max-height: 44px; max-width: 150px; display: block; margin-bottom: 4px; }
.invm-note { font-size: 8.6pt; border: 1px solid #e5e9f0; border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; white-space: pre-line; }
.invm-totals { width: 48%; border-collapse: collapse; font-size: 9.5pt; border: 1px solid #dbe1ea; align-self: flex-start; }
.invm-totals td { padding: 5px 10px; border-bottom: 1px solid #e5e9f0; }
.invm-totals td:last-child { text-align: right; font-weight: 700; white-space: nowrap; border-left: 1px solid #e5e9f0; }
.invm-totals tr.gt td { background: var(--acc); color: #fff; font-size: 12pt; font-weight: 800; }
.invm-words { margin: 4mm 12mm 0; background: var(--tint); border: 1px solid #e5e9f0; border-radius: 4px; padding: 7px 14px; font-size: 9.5pt; }
.invm-words b { color: var(--acc); }
.invm-foot3 { display: flex; gap: 14px; margin: 5mm 12mm 0; align-items: stretch; page-break-inside: avoid; }
.invm-bank { width: 42%; border: 1px solid #dbe1ea; border-radius: 4px; }
.invm-bank .h, .invm-terms .h { font-weight: 800; font-size: 10.5pt; color: var(--dark); }
.invm-bank .h { background: var(--tint); padding: 4px 10px; }
.invm-bank .b { display: flex; gap: 10px; align-items: center; padding: 6px 10px; }
.invm-bank .b i { font-size: 22pt; color: var(--acc); }
.invm-bank table { font-size: 8.2pt; } .invm-bank td { padding: 0 3px; white-space: nowrap; }
.invm-bank .b i { font-size: 18pt !important; }
.invm-terms { flex: 1; font-size: 8.3pt; } .invm-terms ol { padding-left: 16px; margin: 4px 0 0; }
.invm-sign { width: 30%; display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; text-align: center; }
.invm-sign .stamp { border: 1.5px dashed #b6c0cf; border-radius: 4px; height: 22mm; color: #9aa6b8; font-size: 8pt; padding-top: 4px; }
.invm-sign img { max-height: 14mm; max-width: 50mm; margin: 2px auto 0; }
.invm-sign .line { border-top: 1px solid #333; margin-top: 8mm; padding-top: 3px; font-size: 8.5pt; }
.invm-bottom { display: flex; margin-top: auto; padding-top: 6mm; font-size: 9pt; }
.invm-bottom .l { background: var(--acc); color: #fff; font-weight: 700; padding: 7px 40px 7px 12mm; clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%); white-space: nowrap; }
.invm-bottom .r { flex: 1; background: var(--dark); color: #fff; padding: 7px 12mm; text-align: right; margin-left: -18px; }
.inv-preview .invm { padding: 0 !important; }
@media print { .invm { min-height: 277mm !important; } }
.invm-bank td:last-child { white-space: normal; word-break: break-all; } .invm-bank { min-width: 0; } .invm-bank .b { overflow: hidden; }
