/* =====================================================================
   Glass ERP — design system
   Brand: Rising Star Infotech blue (#0E4DA4 -> #1976D2 -> #1E9BE0), navy text (#0B1E3F)
   Font:  headings Plus Jakarta Sans, text DM Sans (weights 400 / 500 / 600)
   ===================================================================== */

:root {
    /* brand */
    --brand-50: #f3f8fd;
    --brand-100: #e3f0fa;
    --brand-200: #cfe5f7;
    --brand-400: #6ec1f5;
    --brand: #1e9be0;           /* cyan accent: bars, active markers */
    --brand-600: #1976d2;
    --brand-700: #0e4da4;       /* primary blue: buttons, links */
    --brand-800: #0b3d82;
    --brand-grad: linear-gradient(135deg, #0e4da4 0%, #1976d2 55%, #1e9be0 100%);
    --navy: #061637;
    --navy-2: #04102a;

    /* neutrals */
    --ink: #0b1e3f;
    --ink-2: #4e5d78;
    --muted: #7a879d;
    --subtle: #9aa7bb;
    --line: #e1ebf5;
    --line-2: #eef4fa;
    --bg: #f5f8fc;
    --surface: #ffffff;
    --hover: #f7fafd;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .03);
    --shadow-lg: 0 12px 32px -8px rgba(11, 30, 63, .16);
    --font-head: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* bootstrap mapping */
    --bs-font-sans-serif: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-body-font-size: .875rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.55;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-emphasis-color: var(--ink);
    --bs-secondary-color: var(--muted);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-sm: 6px;
    --bs-border-radius-lg: 10px;
    --bs-primary: var(--brand-700);
    --bs-primary-rgb: 14, 77, 164;
    --bs-link-color: var(--brand-700);
    --bs-link-color-rgb: 14, 77, 164;
    --bs-link-hover-color: var(--brand-800);
    --bs-link-hover-color-rgb: 11, 61, 130;
    --bs-focus-ring-color: rgba(30, 155, 224, .25);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { background: var(--bg); color: var(--ink); letter-spacing: -.003em; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .card-title, .stat-value, .modal-title, .navbar-brand { font-family: var(--font-head); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
b, strong { font-weight: 600; }
/* nothing heavier than semibold anywhere */
.fw-bold, .fw-bolder { font-weight: 600 !important; }
.fs-4 { font-size: 1.3rem !important; }
.fs-5 { font-size: 1.08rem !important; }
.text-muted { color: var(--muted) !important; }
.text-success { color: #15803d !important; }
.text-danger { color: #c4320a !important; }
a { text-decoration: none; }
::selection { background: var(--brand-200); }
kbd { background: var(--line-2); color: var(--ink-2); border: 1px solid var(--line); font-size: .75em; box-shadow: none; }

/* ---------- buttons ---------- */
.btn { font-weight: 500; font-size: .85rem; border-radius: var(--radius-sm); padding: .45rem .9rem; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn > .bi { vertical-align: -.1em; }
/* icon + text spacing (option-card labels keep block layout) */
.btn:not(label) { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.d-grid > .btn, .btn.w-100:not(label) { display: flex; }
label.btn { display: block; }
.btn-link { text-decoration: none; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { font-size: .8rem; padding: .3rem .6rem; border-radius: 7px; }
.btn-lg { font-size: .95rem; padding: .65rem 1.1rem; }
.btn:focus-visible { box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.btn-primary { background-image: var(--brand-grad); --bs-btn-bg: var(--brand-700); --bs-btn-border-color: var(--brand-700); --bs-btn-hover-bg: var(--brand-800); --bs-btn-hover-border-color: var(--brand-800); --bs-btn-active-bg: var(--brand-800); --bs-btn-active-border-color: var(--brand-800); --bs-btn-disabled-bg: var(--brand-700); --bs-btn-disabled-border-color: var(--brand-700); }
.btn-primary:hover, .btn-primary:focus-visible { background-image: linear-gradient(135deg, #0b3d82 0%, #1565c0 55%, #1a8bd0 100%); box-shadow: 0 8px 20px -10px rgba(14, 77, 164, .6); }
.btn-success { --bs-btn-bg: #16a34a; --bs-btn-border-color: #16a34a; --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d; --bs-btn-active-bg: #15803d; --bs-btn-disabled-bg: #16a34a; --bs-btn-disabled-border-color: #16a34a; }
.btn-outline-primary { --bs-btn-color: var(--brand-700); --bs-btn-border-color: var(--brand-200); --bs-btn-bg: #fff; --bs-btn-hover-color: var(--brand-800); --bs-btn-hover-bg: var(--brand-50); --bs-btn-hover-border-color: var(--brand-400); --bs-btn-active-bg: var(--brand-100); --bs-btn-active-color: var(--brand-800); --bs-btn-active-border-color: var(--brand-400); }
.btn-outline-secondary, .btn-light { --bs-btn-color: var(--ink-2); --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: #d9dce0; --bs-btn-active-bg: var(--line-2); --bs-btn-active-border-color: #d9dce0; --bs-btn-active-color: var(--ink); }
.btn-light { --bs-btn-border-color: transparent; --bs-btn-bg: transparent; }
.btn-outline-danger { --bs-btn-color: #c4320a; --bs-btn-border-color: #f6d4c8; --bs-btn-bg: #fff; --bs-btn-hover-bg: #fef3ef; --bs-btn-hover-color: #a3290a; --bs-btn-hover-border-color: #f0b8a5; --bs-btn-active-bg: #fde6de; --bs-btn-active-color: #a3290a; }
.btn-outline-info { --bs-btn-color: #1e6a96; --bs-btn-border-color: #cfe4f2; --bs-btn-bg: #fff; --bs-btn-hover-bg: #f0f7fc; --bs-btn-hover-color: #18557a; --bs-btn-hover-border-color: #a9cfe8; }
.btn-link { font-weight: 500; }
.btn-icon { border: 0; background: transparent; font-size: 1.35rem; padding: .1rem .3rem; color: var(--ink-2); }
.btn-whatsapp { --bs-btn-color: #128c4a; --bs-btn-bg: #fff; --bs-btn-border-color: #bfe9cf; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #25d366; --bs-btn-hover-border-color: #25d366; --bs-btn-active-bg: #1da851; --bs-btn-active-color: #fff; }
.btn-whatsapp-solid { --bs-btn-color: #fff; --bs-btn-bg: #22c35e; --bs-btn-border-color: #22c35e; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1ba850; --bs-btn-hover-border-color: #1ba850; --bs-btn-active-bg: #189447; --bs-btn-active-color: #fff; }

/* ---------- forms ---------- */
.form-label { font-weight: 500; font-size: .8rem; color: var(--ink-2); margin-bottom: .35rem; }
.form-control, .form-select { font-size: .875rem; border-color: #dfe2e6; border-radius: var(--radius-sm); padding: .5rem .75rem; color: var(--ink); }
.form-control-sm, .form-select-sm { font-size: .8rem; padding: .32rem .6rem; border-radius: 7px; }
.form-control-lg { font-size: 1rem; padding: .65rem .9rem; }
.form-control, .form-select { background-color: #fff; }
.form-control::placeholder { color: #b0b5ba; }
.text-uppercase::placeholder { text-transform: none; }
.card-header form .form-control, .card-header form .form-select { width: auto; }
.card-header form input[type=search] { min-width: 250px; }
input[type=search].form-control { padding-left: 2.1rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%239aa0a6' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10'/%3E%3C/svg%3E") no-repeat .75rem center; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--brand-400); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.form-control:disabled { background: var(--line-2); }
.form-text { font-size: .75rem; color: var(--muted); }
.form-check-input { border-color: #cfd3d8; }
.form-check-input:checked { background-color: var(--brand-700); border-color: var(--brand-700); }
.form-check-input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.form-check-label { color: var(--ink-2); }
.ts-wrapper.single .ts-control, .ts-wrapper .ts-control { border-color: #dfe2e6; border-radius: var(--radius-sm); font-size: .875rem; box-shadow: none; }
.ts-wrapper.focus .ts-control { border-color: var(--brand-400); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.ts-dropdown { border-color: var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .85rem; }
.ts-dropdown .active { background: var(--brand-50); color: var(--ink); }
label.btn.text-start { color: var(--ink-2); }
label.btn.text-start i { color: var(--brand-600); }
.btn-check:checked + .btn-outline-primary { background: var(--brand-50); border-color: var(--brand-600); color: var(--brand-800); box-shadow: inset 0 0 0 1px var(--brand-600); }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 1040; }
.sidebar-brand { display: flex; align-items: center; justify-content: center; padding: 1.1rem 1.25rem .9rem; border-bottom: 1px solid var(--line-2); }
.sidebar-brand img { height: 62px; width: auto; max-width: 212px; object-fit: contain; }
.sidebar-brand .brand-name { font-size: 1.15rem; font-weight: 600; color: var(--ink, #33373b); text-align: center; line-height: 1.25; word-break: break-word; }
.nav-list { padding: .75rem .75rem 1rem; flex: 1; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); margin: 1.1rem .75rem .4rem; font-weight: 600; }
.nav-list .nav-link { position: relative; display: flex; align-items: center; gap: .7rem; color: var(--ink-2); padding: .55rem .75rem; border-radius: var(--radius-sm); font-weight: 500; font-size: .855rem; margin-bottom: 2px; }
.nav-list .nav-link i { font-size: 1.05rem; color: var(--subtle); transition: color .15s; }
.nav-list .nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-list .nav-link:hover i { color: var(--ink-2); }
.nav-list .nav-link.active { background: var(--brand-50); color: var(--brand-800); }
.nav-list .nav-link.active i { color: var(--brand-600); }
.nav-list .nav-link.active::before { content: ''; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-list .nav-count { margin-left: auto; font-size: .7rem; font-weight: 600; background: var(--brand-100); color: var(--brand-800); border-radius: 999px; padding: .05rem .5rem; }
.sidebar-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--line-2); font-size: .72rem; color: var(--subtle); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); padding: .7rem 1.75rem; position: sticky; top: 0; z-index: 1030; min-height: 64px; }
.page-title { font-size: 1.12rem; font-weight: 600; margin: 0; line-height: 1.2; }
.page-sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.content { padding: 1.5rem 1.75rem 2.5rem; max-width: 1600px; width: 100%; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: .82rem; font-weight: 500; }
.user-chip:hover { background: var(--hover); color: var(--ink); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800); display: grid; place-items: center; font-weight: 600; font-size: .78rem; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: -270px; transition: left .2s ease; box-shadow: none; }
    .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
    .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(31, 35, 40, .35); z-index: 1035; }
    .content { padding: 1rem; }
    .topbar { padding: .6rem 1rem; }
}

/* ---------- dropdowns, alerts, modals ---------- */
.dropdown-menu { border-color: var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: .35rem; font-size: .85rem; }
.dropdown-item { border-radius: 6px; padding: .45rem .7rem; color: var(--ink-2); display: flex; align-items: center; gap: .55rem; width: 100%; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--hover); color: var(--ink); }
.dropdown-item:active { background: var(--brand-50); color: var(--brand-800); }
.dropdown-item i { width: 1.1em; color: var(--subtle); }
.dropdown-item.text-danger i { color: inherit; }
.dropdown-header { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); font-weight: 600; padding: .45rem .7rem .25rem; }
.dropdown-divider { border-color: var(--line-2); margin: .3rem 0; }
.dropdown-menu form { margin: 0; }

.alert { border-radius: 10px; font-size: .85rem; border-width: 1px; padding: .75rem 1rem; }
.alert-success { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.alert-danger { background: #fef4f0; border-color: #f8d3c5; color: #9a2a0a; }
.alert-info { background: #f1f7fb; border-color: #d3e6f3; color: #1d5476; }
.alert-light { background: var(--hover); border-color: var(--line); }

.modal-content { border: 0; border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--line-2); padding: 1rem 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top-color: var(--line-2); padding: .85rem 1.25rem; }
.modal-backdrop.show { opacity: .35; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line-2); padding: .95rem 1.2rem; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-body { padding: 1.2rem; }
.card-footer { background: transparent !important; border-top: 1px solid var(--line-2); padding: .85rem 1.2rem; border-radius: 0 0 var(--radius) var(--radius) !important; }
.card-title { font-size: .95rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .45rem; }
.card-title i { color: var(--brand-600); }

.stat-card { padding: 1.1rem 1.15rem; display: flex; flex-direction: row; gap: .9rem; align-items: center; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.stat-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.stat-value { font-size: 1.25rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .76rem; font-weight: 500; margin-top: 2px; }
.tint-green { background: var(--brand-50); color: var(--brand-700); }
.tint-grey { background: #f1f2f3; color: #5f6469; }
.tint-blue { background: #eef6fb; color: #276a92; }
.tint-amber { background: #fdf6e7; color: #9a6206; }
.tint-red { background: #fdf1ed; color: #b4330e; }

/* ---------- tables ---------- */
.table { --bs-table-hover-bg: var(--hover); --bs-table-color: var(--ink); --bs-table-border-color: var(--line-2); margin-bottom: 0; font-size: .855rem; }
.table thead th { background: #fafbfb; color: var(--muted); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td, .table th { padding: .75rem 1rem; vertical-align: middle; }
.table > :not(caption) > * > * { border-bottom-color: var(--line-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { background: #fafbfb; font-weight: 600; border-top: 1px solid var(--line); }
.table a.fw-semibold { color: var(--ink); }
.table a.fw-semibold:hover { color: var(--brand-700); }
.table-actions { white-space: nowrap; text-align: right; }
.table-actions > .btn, .table-actions > form > .btn, .table-actions > .btn-group > .btn { padding: .28rem .5rem; font-size: .78rem; }
.table-actions > form { display: inline-block; }
.table-sm td, .table-sm th { padding: .5rem .75rem; }
.pagination { --bs-pagination-color: var(--ink-2); --bs-pagination-active-bg: var(--brand-700); --bs-pagination-active-border-color: var(--brand-700); --bs-pagination-hover-bg: var(--hover); --bs-pagination-border-color: var(--line); --bs-pagination-font-size: .82rem; margin: 0; }
.pagination + * { font-size: .8rem; }
nav[role=navigation] p.small { margin: 0; color: var(--muted); }

/* ---------- badges (soft) ---------- */
.badge { font-weight: 500; font-size: .72rem; padding: .32em .65em; border-radius: 6px; letter-spacing: .01em; }
.badge.text-bg-success { background: var(--brand-100) !important; color: var(--brand-800) !important; }
.badge.text-bg-primary { background: #eaf0f6 !important; color: #2f4d6b !important; }
.badge.text-bg-info { background: #e9f4fb !important; color: #1f6790 !important; }
.badge.text-bg-warning { background: #fdf3dd !important; color: #8d5a05 !important; }
.badge.text-bg-danger { background: #fdeee8 !important; color: #b0300c !important; }
.badge.text-bg-secondary { background: #f0f1f3 !important; color: #545a60 !important; }
.badge.text-bg-dark { background: #e6e8ea !important; color: #24292e !important; }
.badge.text-bg-light { background: #f2f3f5 !important; color: var(--ink-2) !important; border: 1px solid var(--line); }
.badge-type { font-weight: 500; font-size: .7rem; padding: .3em .55em; border-radius: 5px; }
.badge-sqft { background: #eef6fb; color: #276a92; }
.badge-rft { background: #fdf6e7; color: #8d5a05; }
.badge-fixed { background: #f1f2f3; color: #545a60; }

.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; font-size: .85rem; }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .6rem; color: var(--brand-400); opacity: .8; }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.search-input { position: relative; }
.search-input i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--subtle); font-size: .85rem; pointer-events: none; }
.search-input input { padding-left: 2rem; min-width: 240px; }
.status-tabs { gap: .25rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; overflow: visible; }
.status-tabs .nav-link { color: var(--muted); font-weight: 500; font-size: .84rem; padding: .6rem .9rem; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; background: transparent !important; }
.status-tabs .nav-link:hover { color: var(--ink); }
.status-tabs .nav-link.active { color: var(--brand-800); border-bottom-color: var(--brand); }
.status-tabs .badge { margin-left: .3rem; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: #fff; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 3rem clamp(1.5rem, 6vw, 6rem); }
.auth-form .inner { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-logo { height: 84px; max-width: 100%; object-fit: contain; margin-bottom: 2rem; }
.auth-side { position: relative; overflow: hidden; background: linear-gradient(150deg, #0e4da4 0%, #061637 75%); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 3.5rem; }
.auth-side::before { content: ''; position: absolute; width: 140%; height: 70%; left: -20%; top: 18%; border-radius: 50%; border-top: 10px solid var(--brand); transform: rotate(-12deg); opacity: .9; }
.auth-side::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 10%, rgba(30, 155, 224, .35), transparent 45%); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { color: #fff; font-size: 1.7rem; font-weight: 500; line-height: 1.3; max-width: 420px; }
.auth-side p { color: rgba(255,255,255,.72); max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; color: rgba(255,255,255,.85); font-size: .88rem; }
.auth-points i { color: var(--brand-400); margin-right: .5rem; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- quotation builder ---------- */
.q-section { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.q-section-head { display: flex; align-items: center; gap: .65rem; padding: .7rem 1rem; background: #fafbfb; border-bottom: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.q-section-no { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-100); color: var(--brand-800); font-weight: 600; font-size: .82rem; display: grid; place-items: center; flex-shrink: 0; }
.q-section-title { max-width: 340px; font-weight: 500; text-transform: uppercase; }
.q-section-total { margin-left: auto; font-weight: 500; white-space: nowrap; color: var(--ink-2); font-size: .85rem; }
.q-section-total .sec-total { color: var(--ink); font-weight: 600; }
.q-table { min-width: 1080px; }
.q-table thead th { font-size: .66rem; padding: .55rem .4rem; text-align: center; background: #fff; }
.q-table td { padding: .4rem .3rem; vertical-align: top; border-bottom-color: var(--line-2); }
.q-table .form-control, .q-table .form-select { font-size: .82rem; padding: .32rem .5rem; min-height: 33px; }
.q-table .ts-wrapper .ts-control { font-size: .82rem; padding: .32rem .5rem; min-height: 33px; }
.q-table input.num { text-align: right; font-variant-numeric: tabular-nums; }
.q-table .col-details { width: 160px; }
.q-table .col-item { width: 270px; }
.q-table .col-size { width: 78px; }
.q-table .col-qty { width: 66px; }
.q-table .col-calc { width: 86px; }
.q-table .col-rate { width: 86px; }
.q-table .col-amount { width: 104px; }
.q-table .col-act { width: 68px; }
.q-table .cell-calc { text-align: right; font-variant-numeric: tabular-nums; padding-top: .45rem; color: var(--ink-2); }
.q-table .amount { font-weight: 600; text-align: right; padding-top: .6rem; font-variant-numeric: tabular-nums; }
.charge-hint { display: block; font-size: .68rem; color: var(--brand-700); text-align: right; margin-top: 2px; min-height: 1em; font-weight: 500; }
.calc-input { position: relative; }
.calc-input .sum-btn { position: absolute; right: 3px; top: 4px; border: 0; background: var(--brand-100); color: var(--brand-800); border-radius: 5px; font-size: .7rem; font-weight: 600; padding: 2px 6px; line-height: 1.3; }
.calc-input .sum-btn:hover { background: var(--brand-200); }
.calc-input input { padding-right: 28px !important; }
.row-type { font-size: .66rem; display: inline-block; margin-top: 3px; }
.q-row-actions .btn { padding: .2rem .4rem; }
.q-summary { position: sticky; top: 84px; }
.q-summary .line { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.q-summary .line:last-of-type { border: 0; }
.q-summary .grand { font-size: 1.25rem; font-weight: 600; color: var(--brand-800); letter-spacing: -.01em; }
.help-box { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: .75rem .9rem; font-size: .8rem; color: var(--brand-800); }

/* ---------- workflow ---------- */
.workflow { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.wf-step { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; background: var(--line-2); color: var(--muted); font-weight: 500; font-size: .78rem; }
.wf-step.done { background: var(--brand-100); color: var(--brand-800); }
.wf-step.done::before { content: '\F26E'; font-family: 'bootstrap-icons'; font-size: .85rem; }
.negotiate { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: .95rem 1rem; }
.progress { background: var(--line-2); border-radius: 999px; }
.progress-bar.bg-success { background: linear-gradient(90deg, var(--brand-600), var(--brand)) !important; }

/* ---------- key/value + money summary ---------- */
.kv-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); font-weight: 600; }
.money { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ---------- quotation view (on-screen document) ---------- */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.doc-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: .45rem .55rem; }
.doc-table thead th { background: #fafbfb; color: var(--muted); font-weight: 600; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; text-align: center; }
.doc-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.doc-table .c { text-align: center; }
.doc-table .sec-title { font-weight: 600; }
.doc-table .sec-row td { background: #f4f5f6; font-weight: 600; }
.doc-table .sec-total { color: var(--brand-800); }
.doc-table .subtotal td { background: #fafbfb; font-weight: 600; }
.doc-table .grand td { background: var(--brand-50); font-weight: 600; font-size: .95rem; }

/* select arrow: keep room on the right so text never runs under the chevron */
.form-select { padding-right: 2.25rem; background-position: right .7rem center; background-size: 12px 9px; }
.form-select-sm { padding-right: 2rem; background-position: right .6rem center; }
.q-table .form-select { padding-right: 1.9rem; }
/* searchable (Tom Select) dropdowns: same room for the arrow */
.ts-wrapper.single .ts-control, .q-table .ts-wrapper.single .ts-control { padding-right: 2rem !important; }
.ts-wrapper.single .ts-control::after { right: .75rem !important; }
.ts-wrapper.single .ts-control > .item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ts-wrapper .ts-control, .ts-wrapper.single.input-active .ts-control, .ts-wrapper.full .ts-control { background-color: #fff !important; }

/* =====================================================================
   Tables v2 — list pages
   ===================================================================== */
.table-card { overflow: hidden; }
.table-card > .card-header { padding: .85rem 1.1rem; }
.table-card .table { font-size: .845rem; }
.table-card .table thead th { position: sticky; top: 0; z-index: 1; background: #f9fafb; color: #6b7178; font-size: .68rem; font-weight: 600; letter-spacing: .06em; padding: .65rem 1rem; border-bottom: 1px solid var(--line); }
.table-card .table thead th:first-child, .table-card .table tbody td:first-child { padding-left: 1.25rem; }
.table-card .table thead th:last-child, .table-card .table tbody td:last-child { padding-right: 1.25rem; }
.table-card .table tbody td { padding: .8rem 1rem; border-bottom: 1px solid #f1f2f4; color: var(--ink); }
.table-card .table tbody tr { transition: background-color .12s; }
.table-card .table tbody tr:hover > * { background: #fbfcf8; }
.table-card .table tbody tr:last-child td { border-bottom: 0; }
.table-card .table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-card .table .muted-num { color: var(--subtle); font-variant-numeric: tabular-nums; width: 1%; }

/* primary + secondary text in one cell */
.cell-main { font-weight: 500; color: var(--ink); line-height: 1.35; }
a.cell-main:hover { color: var(--brand-700); }
.cell-sub { font-size: .76rem; color: var(--muted); margin-top: 1px; line-height: 1.35; }
.cell-code { font-weight: 600; color: var(--ink); font-size: .82rem; letter-spacing: .01em; }
a.cell-code:hover { color: var(--brand-700); }

/* avatar + name */
.cell-party { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.cell-party .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 600; flex-shrink: 0; letter-spacing: .02em; }
.cell-party .txt { min-width: 0; }
.cell-party .txt .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.av-green { background: #edf6e0; color: #4d7420; }
.av-grey  { background: #eef0f2; color: #545a60; }
.av-blue  { background: #e8f2fa; color: #2a6390; }
.av-amber { background: #fcf2df; color: #8d5a05; }
.av-teal  { background: #e3f4f1; color: #23705f; }
.av-rose  { background: #fbebee; color: #9c3349; }

/* status pills with a dot */
.badge.text-bg-success, .badge.text-bg-primary, .badge.text-bg-info, .badge.text-bg-warning,
.badge.text-bg-danger, .badge.text-bg-secondary, .badge.text-bg-dark { display: inline-flex; align-items: center; gap: .38rem; padding: .3em .7em .3em .6em; border-radius: 999px; font-size: .72rem; }
.badge.text-bg-success::before, .badge.text-bg-primary::before, .badge.text-bg-info::before, .badge.text-bg-warning::before,
.badge.text-bg-danger::before, .badge.text-bg-secondary::before, .badge.text-bg-dark::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-type { border-radius: 999px; padding: .3em .65em; }
.mode-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 500; color: var(--ink-2); background: #f3f4f6; border-radius: 6px; padding: .2rem .5rem; }

/* amount coloring */
.amt-pos { color: #15803d; font-weight: 600; }
.amt-neg { color: #c4320a; font-weight: 600; }
.amt-strong { font-weight: 600; }
.amt-sub { font-size: .74rem; color: var(--brand-700); font-weight: 500; }

/* ghost action buttons */
.table-card .table-actions { width: 1%; }
.table-actions .act { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: #7a8087; font-size: .92rem; padding: 0; transition: background-color .12s, color .12s, border-color .12s; vertical-align: middle; }
.table-actions .act:hover { background: #f1f2f4; color: var(--ink); }
.table-actions .act.act-wa { color: #1ea952; }
.table-actions .act.act-wa:hover { background: #e8f8ee; color: #138a40; }
.table-actions .act.act-danger:hover { background: #fdeee8; color: #c4320a; }
.table-actions .act.act-primary { color: var(--brand-700); }
.table-actions .act.act-primary:hover { background: var(--brand-50); color: var(--brand-800); }
.table-actions form { display: inline-block; margin: 0; }
.table-actions .dropdown-toggle.act { width: auto; padding: 0 .55rem; gap: .25rem; font-size: .78rem; font-weight: 500; color: var(--ink-2); border-color: var(--line); }
.table-actions .dropdown-toggle.act:hover, .table-actions .dropdown-toggle.act.show { background: var(--hover); border-color: #d9dce0; }
.table-actions .dropdown-toggle::after { display: none; }

/* toolbar inside the card */
.table-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.table-toolbar .form-control, .table-toolbar .form-select { width: auto; }
.table-toolbar input[type=search] { min-width: 260px; }
.table-toolbar .tt-right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

/* footer + pagination */
.table-footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .75rem 1.25rem; border-top: 1px solid var(--line); background: #fcfcfd; font-size: .8rem; color: var(--muted); }
.table-footer strong { color: var(--ink); font-weight: 600; }
.table-footer .tf-size { display: flex; align-items: center; gap: .5rem; margin: 0 0 0 auto; }
.table-footer .tf-size label { white-space: nowrap; }
.table-footer .tf-size .form-select { width: auto; min-width: 72px; }
.pager { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.pager-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 .55rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: .8rem; font-weight: 500; font-variant-numeric: tabular-nums; transition: background-color .12s, border-color .12s, color .12s; }
a.pager-btn:hover { background: var(--hover); border-color: #d6d9dd; color: var(--ink); }
.pager-btn.active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.pager-btn.disabled { color: #c3c7cc; background: #fafafa; cursor: not-allowed; }
.pager-btn.dots { border-color: transparent; background: transparent; min-width: 20px; padding: 0; }
@media (max-width: 767.98px) {
    .table-footer { justify-content: center; }
    .table-footer .tf-size { margin: 0; }
    .table-toolbar input[type=search] { min-width: 0; width: 100% !important; }
}
.table-card .table td.amt-pos, .table-card .table .amt-pos { color: #15803d; } .table-card .table td.amt-neg, .table-card .table .amt-neg { color: #c4320a; }
.sidebar { scrollbar-width: thin; scrollbar-color: #e3e5e8 transparent; }

/* =====================================================================
   Quotation builder v2 — spreadsheet-style fast entry
   ===================================================================== */
.q-section { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 1rem; box-shadow: var(--shadow-sm); overflow: visible; }
.q-section .table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.q-section-head { display: flex; align-items: center; gap: .65rem; padding: .65rem .9rem .65rem 1rem; background: #fff; border-bottom: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; }
.q-section-no { width: 26px; height: 26px; border-radius: 7px; font-size: .78rem; }
.q-section-title { flex: 1; max-width: 460px; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: .35rem .55rem; font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink); text-transform: uppercase; outline: none; transition: background-color .12s, border-color .12s; }
.q-section-title::placeholder { text-transform: none; font-weight: 400; color: #b5bac0; }
.q-section-title:hover { background: #f5f6f8; }
.q-section-title:focus { background: #fff; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(30, 155, 224, .18); }
.q-section-total { margin-left: auto; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-section-total .lbl { font-weight: 500; color: var(--muted); font-size: .78rem; margin-right: .25rem; }
.q-section-head .dropdown-item input { margin-right: .35rem; }

.q-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1rem; padding: 0; transition: background-color .12s, color .12s; }
.q-icon-btn:hover, .q-icon-btn.show { background: #f1f2f4; color: var(--ink); }
.q-icon-btn.sm { width: 28px; height: 28px; font-size: .82rem; }
.q-icon-btn.danger:hover { background: #fdeee8; color: #c4320a; }

.q-grid { width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0; font-size: .845rem; }
.q-grid thead th { font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); padding: .55rem .4rem; border-bottom: 1px solid var(--line-2); background: #fcfcfd; white-space: nowrap; text-align: left; }
.q-grid thead th .unit { text-transform: none; letter-spacing: 0; font-weight: 400; }
.q-grid th.num { text-align: right; }
.q-grid td { padding: .28rem .4rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; background: #fff; transition: background-color .12s; }
.q-grid tbody tr:last-child td { border-bottom: 0; }
.q-grid tbody tr:hover td { background: #fbfcfa; }
.q-grid tbody tr:focus-within td { background: var(--brand-50); }

.q-grid .c-no { width: 38px; text-align: center; padding-left: .75rem; }
.q-grid .c-det { width: 150px; }
.q-grid .c-item { width: auto; min-width: 260px; }
.q-grid .c-size { width: 168px; }
.q-grid .c-qty { width: 70px; }
.q-grid .c-meas { width: 122px; }
.q-grid .c-rate { width: 92px; }
.q-grid .c-amt { width: 112px; }
.q-grid .c-act { width: 70px; text-align: right; padding-right: .75rem; white-space: nowrap; }

.q-grid .row-no { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; font-size: .72rem; font-weight: 600; color: var(--subtle); font-variant-numeric: tabular-nums; }
.q-grid tbody { counter-reset: qrow; }
.q-grid tr.q-row { counter-increment: qrow; }
/* Row whose Qty just went up because the same glass + size was entered again */
.q-grid tr.row-merged td { animation: row-merged 1.6s ease-out; }
@keyframes row-merged { 0%, 35% { background: var(--brand-100); } 100% { background: transparent; } }
.q-grid .row-no::before { content: counter(qrow); }
.q-grid tr.is-blank .row-no::before { content: "+"; color: var(--brand-600); font-size: .9rem; }
.q-grid tr.is-blank .c-act { visibility: hidden; }
.q-grid tr.is-blank .amount { color: #c7cbd0; font-weight: 400; }

/* spreadsheet inputs */
.g-in { width: 100%; min-height: 34px; padding: .38rem .5rem; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; outline: none; transition: background-color .12s, border-color .12s, box-shadow .12s; -moz-appearance: textfield; }
.g-in::-webkit-outer-spin-button, .g-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.g-in::placeholder { color: #c3c7cc; text-transform: none; }
.g-in:hover { background: #f3f4f6; }
.g-in:focus { background: #fff; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(30, 155, 224, .18); }
.g-in.num { text-align: right; font-variant-numeric: tabular-nums; }
.g-in.up { text-transform: uppercase; }

.size-pair { display: flex; align-items: center; gap: 2px; }
.size-pair .g-in { text-align: center; padding-left: .25rem; padding-right: .25rem; font-variant-numeric: tabular-nums; }
.size-pair .x { color: var(--subtle); font-size: .8rem; flex-shrink: 0; }
.size-hint { font-size: .66rem; color: var(--brand-700); text-align: center; line-height: 1.1; font-weight: 500; }
.size-hint:empty { display: none; }
.frame-hint { font-size: .68rem; color: var(--brand-700); font-weight: 500; line-height: 1.2; margin-top: 2px; }
.frame-hint:empty { display: none; }
.q-grid .na { color: #c7cbd0; text-align: center; display: block; }
.q-grid .c-meas .na { text-align: right; padding-right: .5rem; }

.meas { text-align: right; line-height: 1.2; padding-right: .5rem; font-variant-numeric: tabular-nums; }
.meas .m1 { display: block; color: var(--ink); font-weight: 500; }
.meas .m2 { display: block; color: var(--muted); font-size: .72rem; }
.meas small { color: var(--subtle); font-size: .66rem; }
.q-grid .calc-input { position: relative; }
.q-grid .calc-input .g-in { padding-right: 28px; }
.q-grid .calc-input .sum-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.q-grid .amount { text-align: right; font-weight: 600; padding-right: .6rem; font-variant-numeric: tabular-nums; color: var(--ink); }

/* row actions appear on hover / focus */
.q-grid .c-act .q-icon-btn { opacity: 0; }
.q-grid tr:hover .c-act .q-icon-btn, .q-grid tr:focus-within .c-act .q-icon-btn { opacity: 1; }
@media (hover: none) { .q-grid .c-act .q-icon-btn { opacity: 1; } }

/* item search inside the grid: looks like a cell until used */
.q-grid .ts-wrapper .ts-control { border-color: transparent !important; background-color: transparent !important; box-shadow: none !important; min-height: 34px; padding: .38rem 1.9rem .38rem .5rem !important; border-radius: 7px; }
.q-grid .ts-wrapper:hover .ts-control { background-color: #f3f4f6 !important; }
.q-grid .ts-wrapper.focus .ts-control { background-color: #fff !important; border-color: var(--brand-400) !important; box-shadow: 0 0 0 3px rgba(30, 155, 224, .18) !important; }
.q-grid .ts-wrapper.single .ts-control::after { opacity: .45; }
.ts-line { display: flex; align-items: center; gap: .45rem; min-width: 0; width: 100%; }
.ts-line .nm, .ts-opt .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-line .badge-type { flex-shrink: 0; font-size: .62rem; padding: .15em .45em; }
.ts-opt { display: flex; align-items: center; gap: .5rem; }
.ts-opt .nm { flex: 1; }
.ts-opt .badge-type { font-size: .64rem; padding: .15em .45em; }
.ts-opt .rt { color: var(--muted); font-size: .76rem; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.ts-dropdown .no-results { padding: .5rem .75rem; color: var(--muted); }

/* add section */
.q-add-section { display: flex; align-items: center; justify-content: center; gap: .45rem; width: 100%; padding: .8rem; border: 1.5px dashed var(--brand-200); border-radius: var(--radius); background: transparent; color: var(--brand-700); font-weight: 500; font-size: .86rem; transition: background-color .15s, border-color .15s; }
.q-add-section:hover { background: var(--brand-50); border-color: var(--brand-400); }
.q-grid .c-qty .na { text-align: right; padding-right: .5rem; }

/* builder columns: separate Width / Height and Sq.Ft / R.Ft, headers aligned with inputs */
.q-grid { min-width: 1080px; }
.q-grid .c-det { width: 160px; }
.q-grid .c-w, .q-grid .c-h { width: 82px; }
.q-grid .c-qty { width: 68px; }
.q-grid .c-sqft, .q-grid .c-rft { width: 96px; }
.q-grid .c-rate { width: 92px; }
.q-grid .c-amt { width: 112px; }
.q-grid th.ctr { text-align: center; }
/* inputs have .5rem inner padding: give right-aligned headers the same inset */
.q-grid thead th.num { padding-right: calc(.4rem + .5rem + 1px); }
.q-grid thead th.c-det, .q-grid thead th.c-item { padding-left: calc(.4rem + .5rem + 1px); }
.g-in.ctr { text-align: center; font-variant-numeric: tabular-nums; }
.q-grid .c-w .size-hint, .q-grid .c-h .size-hint { text-align: center; }
.q-grid .c-sqft .meas, .q-grid .c-rft .meas { padding-right: calc(.5rem + 1px); text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.q-grid .c-sqft .na, .q-grid .c-rft .na { text-align: right; }
.q-grid .amount { padding-right: calc(.4rem + .5rem + 1px); }

/* =====================================================================
   Validation: red field + message underneath, and toast
   ===================================================================== */
:root { --err: #d0391b; --err-soft: rgba(208, 57, 27, .14); }
.field-error { display: flex; align-items: flex-start; gap: .3rem; margin-top: .3rem; font-size: .76rem; font-weight: 500; color: var(--err); line-height: 1.3; animation: fe-in .15s ease-out; }
.field-error::before { content: "\F333"; font-family: "bootstrap-icons"; font-size: .78rem; line-height: 1.25; }
@keyframes fe-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }

.form-control.is-invalid, .form-select.is-invalid { border-color: var(--err) !important; background-image: none; padding-right: .75rem; }
.form-select.is-invalid { padding-right: 2.25rem; background-image: var(--bs-form-select-bg-img) !important; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 .2rem var(--err-soft) !important; }
.ts-wrapper.is-invalid .ts-control, .q-grid .ts-wrapper.is-invalid .ts-control { border-color: var(--err) !important; background-color: #fff !important; }
.ts-wrapper.is-invalid.focus .ts-control { box-shadow: 0 0 0 .2rem var(--err-soft) !important; }
.g-in.is-invalid, .q-section-title.is-invalid { border-color: var(--err) !important; background: #fff !important; }
.g-in.is-invalid:focus { box-shadow: 0 0 0 3px var(--err-soft) !important; }
.q-grid .field-error { font-size: .7rem; margin-top: .15rem; white-space: normal; }
.form-check-input.is-invalid ~ .form-check-label { color: var(--err); }

.toast-stack { position: fixed; top: 76px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.mg-toast { display: flex; align-items: center; gap: .55rem; min-width: 260px; max-width: 380px; padding: .7rem .95rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: .84rem; font-weight: 500; color: var(--ink); opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; pointer-events: auto; }
.mg-toast.show { opacity: 1; transform: none; }
.mg-toast-danger { border-left: 3px solid var(--err); }
.mg-toast-danger i { color: var(--err); }
.mg-toast-success { border-left: 3px solid var(--brand); }
.mg-toast-success i { color: var(--brand-600); }
.q-grid td { position: relative; } .q-grid .field-error { position: absolute; left: .4rem; top: calc(100% - 6px); z-index: 5; white-space: nowrap; background: #fff; border: 1px solid #f3c5b8; border-radius: 6px; padding: .15rem .45rem; box-shadow: var(--shadow); margin: 0; } .q-grid .c-rate .field-error, .q-grid .c-amt .field-error, .q-grid .c-rft .field-error, .q-grid .c-sqft .field-error { left: auto; right: .4rem; }

/* =====================================================================
   Approve quotation popup
   ===================================================================== */
.approve .modal-header { padding: 1.1rem 1.5rem; }
.approve .modal-body { padding: .5rem 1.5rem 1.25rem; }
.ap-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-size: 1.2rem; }

.ap-step { padding: 1.1rem 0; border-bottom: 1px solid var(--line-2); }
.ap-step:last-child { border-bottom: 0; padding-bottom: .25rem; }
.ap-step-head { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .9rem; margin-bottom: .85rem; color: var(--ink); }
.ap-step-head .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; background: var(--brand-100); color: var(--brand-800); }
.ap-step-head .opt { font-size: .7rem; font-weight: 500; color: var(--subtle); background: var(--line-2); border-radius: 999px; padding: .1rem .5rem; }

/* step 1: quoted -> final, discount */
.ap-price { display: grid; grid-template-columns: auto auto 1fr auto; align-items: end; gap: 1.1rem; background: #fafbfa; border: 1px solid var(--line-2); border-radius: 12px; padding: .9rem 1.1rem; }
.ap-stat-val { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .2rem; white-space: nowrap; }
.ap-arrow { color: var(--subtle); font-size: 1.1rem; margin-bottom: .45rem; }
.ap-final .input-group { margin-top: .3rem; }
.ap-final .form-control { font-size: 1.05rem; font-weight: 600; }
.ap-discount { color: var(--subtle); }
.ap-discount.has { color: #15803d; }
.input-group-text { background: #f6f7f9; border-color: #dfe2e6; color: var(--muted); font-size: .85rem; }
@media (max-width: 575.98px) { .ap-price { grid-template-columns: 1fr 1fr; } .ap-arrow { display: none; } .ap-final { grid-column: 1 / -1; order: -1; } }

/* step 2: segmented control */
.ap-seg { display: inline-flex; background: #f1f2f4; border-radius: 10px; padding: 3px; gap: 2px; }
.ap-seg label { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .95rem; border-radius: 8px; font-size: .84rem; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s; user-select: none; }
.ap-seg label:hover { color: var(--ink); }
.ap-seg .btn-check:checked + label { background: #fff; color: var(--brand-800); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.ap-seg .btn-check:checked + label i { color: var(--brand-600); }
.ap-seg .btn-check:disabled + label { opacity: .45; cursor: not-allowed; }

/* step 3: advance */
.ap-chips { display: flex; gap: .35rem; margin-top: .45rem; }
.ap-chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: .74rem; font-weight: 500; border-radius: 999px; padding: .15rem .65rem; transition: background-color .12s, border-color .12s, color .12s; }
.ap-chip:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.ap-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.ap-modes label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; padding: .45rem .3rem; min-height: 54px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-2); font-size: .78rem; font-weight: 500; cursor: pointer; transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s; }
.ap-modes label i { font-size: 1.05rem; color: var(--subtle); }
.ap-modes label:hover { border-color: #d3d7db; background: var(--hover); }
.ap-modes .btn-check:checked + label { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-800); box-shadow: inset 0 0 0 1px var(--brand-600); }
.ap-modes .btn-check:checked + label i { color: var(--brand-600); }
.ap-modes.is-invalid label { border-color: var(--err); }

/* footer summary */
.ap-foot { justify-content: space-between; background: #fafbfa; border-radius: 0 0 14px 14px; padding: .9rem 1.5rem; }
.ap-summary { display: flex; gap: 1.75rem; }
.ap-summary > div { display: flex; flex-direction: column; }
.ap-summary strong { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .ap-foot { flex-direction: column; align-items: stretch; gap: .75rem; } .ap-summary { justify-content: space-between; } }

/* ---------- Approve popup v2: bill-style price + switchable advance ---------- */
.ap-bill { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ap-bill-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line-2); min-height: 48px; }
.ap-bill-row:last-child { border-bottom: 0; }
.ap-bill-label { color: var(--ink-2); font-size: .86rem; font-weight: 500; margin: 0; }
.ap-bill-label small { display: block; color: var(--subtle); font-size: .72rem; font-weight: 400; margin-top: 1px; }
.ap-bill-val { font-weight: 600; font-size: .95rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.ap-bill-edit { background: #fbfcf9; }
.ap-bill-disc .ap-bill-val { color: var(--subtle); font-weight: 500; font-size: .86rem; }
.ap-bill-disc .ap-bill-val.has { color: #15803d; font-weight: 600; font-size: .95rem; }

.ap-money { width: 200px; flex-shrink: 0; }
.ap-money .form-control { text-align: right; font-weight: 600; font-size: .95rem; font-variant-numeric: tabular-nums; }
.ap-money .input-group-text { font-weight: 500; }
.ap-bill .field-error, .ap-adv .field-error { justify-content: flex-end; }

/* advance switch row */
.ap-toggle { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; cursor: pointer; margin: 0; }
.ap-toggle .ap-toggle-sub { color: var(--subtle); font-size: .78rem; }
.ap-toggle .form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; margin: 0; }

/* advance fields: label left, control right (same rhythm as the price card) */
.ap-adv { display: none; margin-top: .9rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ap-adv.open { display: block; animation: fe-in .15s ease-out; }
.ap-field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1rem; border-bottom: 1px solid var(--line-2); min-height: 52px; }
.ap-field:last-child { border-bottom: 0; }
.ap-field-label { color: var(--ink-2); font-size: .86rem; font-weight: 500; margin: 0; }
.ap-amount-row { display: flex; align-items: center; gap: .4rem; }
.ap-chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: .76rem; font-weight: 500; border-radius: 8px; padding: .38rem .65rem; line-height: 1.2; transition: background-color .12s, border-color .12s, color .12s; }
.ap-chip:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.ap-seg-modes label { padding: .4rem .75rem; font-size: .8rem; }
.ap-seg-modes label i { font-size: .9rem; }
.ap-seg.is-invalid { box-shadow: inset 0 0 0 1px var(--err); }
.ap-ref { width: 280px; max-width: 100%; }

@media (max-width: 575.98px) {
    .ap-bill-row, .ap-field { flex-direction: column; align-items: stretch; }
    .ap-money, .ap-ref { width: 100%; }
    .ap-amount-row .ap-money { width: auto; flex: 1; }
    .ap-seg-modes { display: flex; }
    .ap-seg-modes label { flex: 1; justify-content: center; padding: .4rem .3rem; }
}

/* ---------- Order page: details card ---------- */
.order-card { overflow: hidden; }
.oc-head { display: flex; align-items: center; gap: .85rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.oc-av { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 600; font-size: .9rem; flex-shrink: 0; letter-spacing: .02em; }
.oc-title { min-width: 0; flex: 1; }
.oc-party { font-size: 1.05rem; font-weight: 600; color: var(--ink); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-meta { margin-top: 3px; }
.oc-no { display: inline-block; font-size: .74rem; font-weight: 600; color: var(--ink-2); background: var(--line-2); border-radius: 6px; padding: .12rem .45rem; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.oc-status { flex-shrink: 0; font-size: .76rem !important; }
.oc-list { margin: 0; padding: .35rem 1.25rem .6rem; }
.oc-row { display: flex; align-items: flex-start; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line-2); }
.oc-row:last-child { border-bottom: 0; }
.oc-row dt { width: 128px; flex-shrink: 0; font-weight: 500; font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.oc-row dt i { color: var(--subtle); font-size: .9rem; width: 1rem; }
.oc-row dd { margin: 0; flex: 1; min-width: 0; font-size: .86rem; color: var(--ink); overflow-wrap: anywhere; }
.oc-row dd a { color: var(--ink); }
.oc-row dd a:hover { color: var(--brand-700); }

/* money summary */
.oc-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.oc-money > div { background: #fafbfa; border: 1px solid var(--line-2); border-radius: 10px; padding: .7rem .9rem; }
.oc-money-val { font-size: 1.3rem; font-weight: 600; margin-top: .2rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .oc-money { grid-template-columns: 1fr; } }

/* Company logo preview (Settings) */
.logo-preview { width: 236px; height: 86px; display: flex; align-items: center; justify-content: center; text-align: center; background: #fff; border: 1px dashed var(--line, #d9dcdf); border-radius: 8px; padding: 6px; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Glass ERP logo (Super Admin) ---------- */
.ge-logo { display: inline-flex; align-items: center; gap: calc(var(--ge-size) * .28); line-height: 1; text-decoration: none; }
.ge-mark { flex-shrink: 0; filter: drop-shadow(0 6px 12px rgba(14, 77, 164, .28)); }
.ge-word { font-family: var(--font-head); font-weight: 700; font-size: calc(var(--ge-size) * .62); letter-spacing: -.02em; white-space: nowrap; }
.ge-glass { color: var(--ink); }
.ge-erp { margin-left: .22em; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-logo-wrap { margin-bottom: 2rem; }
@media print { .ge-erp { color: #0e4da4; background: none; } }

/* ---------- footer: Powered by Rising Star Infotech ---------- */
.app-footer { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .9rem 1.75rem; border-top: 1px solid var(--line); background: var(--surface); font-size: .78rem; color: var(--muted); }
.powered-by { color: var(--muted); }
.powered-by a { color: var(--brand-700); font-weight: 600; }
.powered-by a:hover { color: var(--brand-800); text-decoration: underline; }
.auth-powered { margin-top: 2rem; font-size: .8rem; }
@media print { .app-footer { display: none; } }
/* ==========================================================================
   Confirm popup (public/js/dialog.js) — replaces the browser's confirm()
   ========================================================================== */
.ge-dialog { width: min(420px, calc(100vw - 32px)); padding: 1.6rem 1.5rem 1.3rem; border: 0; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 24px 60px rgba(11, 30, 63, .25); text-align: center; }
.ge-dialog::backdrop { background: rgba(11, 30, 63, .45); backdrop-filter: blur(2px); }
.ge-dialog[open] { animation: geDialogIn .16s ease-out; }
@keyframes geDialogIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.ge-dialog-icon { width: 52px; height: 52px; margin: 0 auto .85rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.45rem; background: var(--brand-100); color: var(--brand-700); }
.ge-dialog[data-tone="danger"] .ge-dialog-icon { background: #fdecec; color: #dc2626; }
.ge-dialog-title { font-family: var(--font-head, inherit); font-size: 1.08rem; font-weight: 700; margin: 0 0 .35rem; line-height: 1.4; word-break: break-word; }
.ge-dialog-text { font-size: .88rem; color: var(--ink-2); margin: 0 0 .2rem; line-height: 1.5; }
.ge-dialog-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.25rem; }
.ge-dialog-actions .btn { min-width: 130px; font-weight: 600; padding: .55rem 1rem; border-radius: 10px; }
.ge-dialog-actions .btn-light { background: #f1f4f9; border-color: #e3e8f0; color: var(--ink); }
@media (max-width: 420px) { .ge-dialog-actions { flex-direction: column-reverse; } .ge-dialog-actions .btn { width: 100%; } }
.mg-toast-info { border-left: 3px solid var(--brand-600); }
.mg-toast-info i { color: var(--brand-600); }

/* ==========================================================================
   Register company: Subscription & Payment (admin/companies/_subscription)
   ========================================================================== */
.card-sub { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.choice-card { display: flex; gap: .8rem; align-items: flex-start; height: 100%; padding: 1rem 1.1rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice-card:hover { border-color: var(--brand-200); }
.choice-card.active { border-color: var(--brand-700); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(14, 77, 164, .08); }
.choice-card input { margin-top: .3rem; accent-color: var(--brand-700); width: 16px; height: 16px; flex: none; }
.choice-card > span { display: flex; flex-direction: column; gap: .2rem; }
.choice-title { font-weight: 700; color: var(--ink); font-family: var(--font-head, inherit); }
.choice-title i { color: var(--brand-700); margin-right: .2rem; }
.choice-sub { font-size: .82rem; color: var(--ink-2); line-height: 1.45; }
.ss-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .7rem; }
.ss-quick > span { font-size: .78rem; font-weight: 600; color: var(--muted); margin-right: .2rem; }
.ss-chip { border: 1px solid transparent; background: var(--line-2); color: var(--ink-2); font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 8px; }
.ss-chip:hover { background: var(--brand-100); color: var(--brand-700); }
.ss-chip.active { background: var(--brand-100); border-color: var(--brand-200); color: var(--brand-700); }
.ss-payment { margin-top: 1.2rem; padding: 1.1rem 1.2rem 1.2rem; border: 1px dashed var(--brand-200); border-radius: var(--radius); background: #fbfdff; }
.ss-payment-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.ss-payment-title { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.ss-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--line-2); border: 1px solid var(--line); }
.ss-seg label { cursor: pointer; margin: 0; }
.ss-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ss-seg span { display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .8rem; border-radius: 8px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.ss-seg label.active span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(11, 30, 63, .12); }
.ss-seg label.active input[value=received] + span i { color: #16a34a; }
.ss-seg label.active input[value=pending] + span i { color: #d97706; }
.ss-seg input:focus-visible + span { outline: 2px solid var(--brand-400); }
.ss-invoice { color: var(--ink-2); margin-bottom: .8rem; }
.ss-invoice strong { color: var(--ink); }

/* Buy / change plan popup (admin/companies/_plan_modal) */
.pm-now { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .7rem .9rem; margin-bottom: 1rem; border-radius: var(--radius-sm); background: var(--line-2); font-size: .88rem; }
.pm-now-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: .3rem; }
.ss-dir { display: inline-flex; align-items: center; gap: .2rem; margin-left: .35rem; padding: .05rem .45rem; border-radius: 6px; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.ss-dir.up { background: #dcfce7; color: #15803d; }
.ss-dir.down { background: #fef3c7; color: #b45309; }
.ss-dir.same { background: var(--line-2); color: var(--ink-2); }
.ss-credit-line { margin-bottom: .25rem; }
/* Monthly / Yearly toggle next to the plan */
.ss-seg.ss-cycle { display: flex; width: 100%; padding: 3px; }
.ss-cycle label { flex: 1; }
.ss-cycle span { justify-content: center; width: 100%; padding: .5rem .4rem; }
