/* ========================================
   Invoice Manager - Main Stylesheet
   ======================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

/* ========================================
   Layout
   ======================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--gray-900);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
    padding: 8px 12px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    background: var(--gray-800);
    color: var(--white);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-700);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--white);
    flex-shrink: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--white);
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gray-600);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-body {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
}

/* ========================================
   Cards & Panels
   ======================================== */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 24px;
}

/* ========================================
   Stats Grid
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: #047857;
    border-color: #047857;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ========================================
   Forms
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-label .required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .form-row-2,
    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Tables
   ======================================== */

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.table-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.table-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: var(--gray-300);
}

/* ========================================
   Badges & Status
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-draft { background: var(--gray-100); color: var(--gray-600); }
.badge-sent { background: var(--primary-light); color: var(--primary-dark); }
.badge-paid { background: var(--success-light); color: var(--success); }
.badge-overdue { background: var(--danger-light); color: var(--danger); }
.badge-cancelled { background: var(--warning-light); color: var(--warning); }

.badge-dot.draft { background: var(--gray-400); }
.badge-dot.sent { background: var(--primary); }
.badge-dot.paid { background: var(--success); }
.badge-dot.overdue { background: var(--danger); }
.badge-dot.cancelled { background: var(--warning); }

/* ========================================
   Invoice Builder
   ======================================== */

.invoice-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.invoice-form-panel {
    min-width: 0;
}

.invoice-preview-panel {
    position: sticky;
    top: 80px;
    min-width: 0;
}

@media (max-width: 1200px) {
    .invoice-builder {
        grid-template-columns: 1fr;
    }
    .invoice-preview-panel {
        position: static;
    }
}

.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.invoice-items-table th {
    background: var(--gray-50);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.8125rem;
}

.invoice-items-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.invoice-items-table .item-desc {
    min-width: 200px;
}

.invoice-items-table .item-qty,
.invoice-items-table .item-price,
.invoice-items-table .item-total {
    min-width: 100px;
}

.invoice-items-table .item-actions {
    width: 60px;
    text-align: center;
}

.invoice-items-table input,
.invoice-items-table textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

.invoice-items-table input:focus,
.invoice-items-table textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.invoice-items-table textarea {
    resize: vertical;
    min-height: 40px;
}

.item-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gray-400);
    border-radius: 4px;
    transition: all 0.2s;
}

.item-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.item-btn svg {
    width: 18px;
    height: 18px;
}

.invoice-totals {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.total-row {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 0.875rem;
}

.total-row .label {
    color: var(--gray-500);
    min-width: 100px;
    text-align: right;
}

.total-row .value {
    min-width: 120px;
    text-align: right;
    font-weight: 500;
    color: var(--gray-700);
}

.total-row.grand-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    border-top: 2px solid var(--gray-200);
    padding-top: 12px;
    margin-top: 4px;
}

.total-row.grand-total .value {
    color: var(--primary);
    font-size: 1.25rem;
}

/* ========================================
   Invoice Preview / Print
   ======================================== */

.invoice-preview {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.invoice-preview-header {
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.invoice-preview-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.invoice-preview-body {
    padding: 0;
}

.invoice-paper {
    background: var(--white);
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 20mm;
    box-sizing: border-box;
    font-size: 10pt;
    line-height: 1.5;
    color: #000;
}

.invoice-paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.invoice-paper-company h2 {
    font-size: 18pt;
    font-weight: 700;
    margin-bottom: 6px;
    color: #000;
}

.invoice-paper-company p {
    font-size: 9pt;
    color: #333;
    line-height: 1.6;
    margin: 2px 0;
}

.invoice-paper-title {
    text-align: right;
}

.invoice-paper-title h1 {
    font-size: 24pt;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.invoice-meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 9pt;
}

.invoice-meta-label {
    color: #666;
    font-weight: 500;
}

.invoice-meta-value {
    color: #000;
    font-weight: 600;
}

.invoice-paper-to {
    margin-bottom: 30px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.invoice-paper-to-label {
    font-size: 8pt;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    margin-bottom: 6px;
    font-weight: 600;
}

.invoice-paper-to-name {
    font-size: 12pt;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
}

.invoice-paper-to-details {
    font-size: 9pt;
    color: #333;
    line-height: 1.6;
}

.invoice-paper-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.invoice-paper-items th {
    background: var(--gray-800);
    color: var(--white);
    padding: 10px 12px;
    text-align: left;
    font-size: 9pt;
    font-weight: 600;
}

.invoice-paper-items th:last-child,
.invoice-paper-items td:last-child {
    text-align: right;
}

.invoice-paper-items td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 9pt;
}

.invoice-paper-items .item-number {
    width: 40px;
    color: var(--gray-500);
}

.invoice-paper-items .item-desc {
    width: auto;
}

.invoice-paper-items .item-qty,
.invoice-paper-items .item-price,
.invoice-paper-items .item-vat,
.invoice-paper-items .item-total {
    width: 90px;
    text-align: right;
    white-space: nowrap;
}

.invoice-paper-totals {
    width: 280px;
    margin-left: auto;
}

.invoice-paper-totals td {
    padding: 6px 12px;
    font-size: 9pt;
}

.invoice-paper-totals .total-label {
    text-align: right;
    color: #666;
}

.invoice-paper-totals .total-value {
    text-align: right;
    font-weight: 600;
    width: 120px;
}

.invoice-paper-totals .grand-total td {
    border-top: 2px solid #000;
    font-size: 11pt;
    font-weight: 700;
    color: #000;
    padding-top: 10px;
}

.invoice-paper-notes {
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.invoice-paper-notes h4 {
    font-size: 9pt;
    font-weight: 700;
    margin-bottom: 6px;
    color: #000;
    text-transform: uppercase;
}

.invoice-paper-notes p {
    font-size: 9pt;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

.invoice-paper-terms {
    margin-top: 20px;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .sidebar,
    .topbar,
    .invoice-preview-header,
    .invoice-form-panel,
    .btn-print,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .invoice-preview {
        border: none;
        box-shadow: none;
    }

    .invoice-preview-body {
        padding: 0;
    }

    .invoice-paper {
        width: 100%;
        padding: 0;
        margin: 0;
    }

    body {
        background: white;
    }

    .content-body {
        padding: 0;
        max-width: none;
    }
}

@page {
    size: A4;
    margin: 15mm;
}

/* ========================================
   Login Page
   ======================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.login-logo p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    width: 100%;
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: none;
}

.alert.show {
    display: flex;
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #a7f3d0;
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gray-400);
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   Search & Filters
   ======================================== */

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.search-box input {
    width: 100%;
    padding: 9px 12px 9px 40px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.filter-select {
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Invoice Detail View
   ======================================== */

.invoice-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* ========================================
   Loading Spinner
   ======================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-overlay.show {
    display: flex;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ========================================
   Mobile Responsive
   ======================================== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .sidebar-backdrop.show {
        display: block;
    }
}

@media (max-width: 640px) {
    .content-body {
        padding: 16px;
    }

    .card-header,
    .card-body {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .login-box {
        padding: 24px;
    }

    .invoice-paper {
        padding: 12mm;
        font-size: 9pt;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-gray { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.w-full { width: 100%; }

.hidden { display: none; }


/* ============================
   Lineo Invoice View Format
============================ */

.lineo-invoice-wrapper {
    background: #f3f4f6;
    padding: 32px;
    overflow-x: auto;
}

.lineo-invoice-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 20mm 18mm 14mm;
    background: #fff;
    color: #333;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    line-height: 1.45;
    position: relative;
    box-sizing: border-box;
}

.lineo-invoice-top {
    display: grid;
    grid-template-columns: 1.25fr 1.1fr 0.9fr 1fr;
    gap: 28px;
    align-items: start;
}

.lineo-logo {
    max-width: 135px;
    height: auto;
    display: block;
}

.lineo-website {
    margin-top: 10px;
    color: #555;
    font-size: 11px;
}

.lineo-title-block h1 {
    margin: 0 0 5px;
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.lineo-title-block p,
.lineo-contact-block p,
.lineo-address-block p {
    margin: 0 0 6px;
    color: #666;
}

.lineo-header-line {
    border-top: 3px solid #111;
    margin: 22px 0 18px;
}

.lineo-info-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 40px;
    margin-bottom: 18px;
}

.lineo-client-box p {
    margin: 0 0 4px;
}

.lineo-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 70px;
}

.lineo-meta-grid p {
    margin: 0 0 4px;
}

.lineo-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.lineo-items-table thead {
    background: #f2f2f2;
}

.lineo-items-table th {
    padding: 13px 10px;
    font-size: 10.5px;
    text-align: left;
    font-weight: 700;
    color: #222;
}

.lineo-items-table td {
    padding: 28px 10px 10px;
    vertical-align: top;
    font-size: 10.5px;
    color: #222;
}

.lineo-items-table th:nth-child(1),
.lineo-items-table td:nth-child(1) {
    width: 45px;
    text-align: center;
}

.lineo-items-table th:nth-child(3),
.lineo-items-table td:nth-child(3),
.lineo-items-table th:nth-child(5),
.lineo-items-table td:nth-child(5),
.lineo-items-table th:nth-child(6),
.lineo-items-table td:nth-child(6) {
    text-align: right;
}

.lineo-items-table th:nth-child(4),
.lineo-items-table td:nth-child(4) {
    text-align: center;
}

.lineo-totals {
    width: 170px;
    margin-left: auto;
    margin-top: 175px;
    font-size: 11px;
    text-align: right;
}

.lineo-total-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
    font-weight: 600;
}

.lineo-grand-total strong {
    color: #e56b52;
    font-weight: 800;
}

.lineo-footer-line {
    border-top: 3px solid #111;
    margin-top: 34px;
}

.lineo-footer {
    padding-top: 18px;
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 30px;
    align-items: start;
}

.lineo-footer-left p {
    margin: 0 0 7px;
    color: #666;
}

.lineo-signature-space {
    height: 48px;
}

.lineo-footer-right {
    text-align: right;
    padding-top: 25px;
}

.lineo-stamp {
    max-width: 135px;
    height: auto;
}

.lineo-note {
    margin-top: 32px;
    max-width: 620px;
    font-size: 10.5px;
    line-height: 1.7;
    color: #777;
}

.lineo-page-number {
    position: absolute;
    bottom: 10mm;
    left: 0;
    right: 0;
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    color: #111;
}

/* Print / PDF */
@media print {
    body {
        margin: 0;
        background: #fff;
    }

    .sidebar,
    .topbar,
    .invoice-detail-actions,
    .no-print,
    button {
        display: none !important;
    }

    .app-layout,
    .main-content,
    .content-body,
    #invoiceDetail,
    .lineo-invoice-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        background: #fff !important;
        display: block !important;
    }

    .lineo-invoice-page {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 20mm 18mm 14mm;
        box-shadow: none;
        page-break-after: always;
    }

    @page {
        size: A4;
        margin: 0;
    }
}



/* Inventory and Delivery Note additions */
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.badge-delivered { background: #dcfce7; color: #166534; }
.badge-draft { background: #f1f5f9; color: #334155; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-dot.delivered { background: #16a34a; }
.badge-dot.draft { background: #64748b; }
.badge-dot.cancelled { background: #dc2626; }
@media print {
    .sidebar, .topbar, .no-print, .card.no-print { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .content-body { padding: 0 !important; }
    .invoice-paper { box-shadow: none !important; margin: 0 auto !important; }
}

/* ============================
   Delivery Note / Invoice Style Print Layout
============================ */

.invoice-a4 {
    background: #fff;
    color: #111827;
    max-width: 900px;
    margin: 0 auto;
    padding: 36px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    font-size: 13px;
}

.document-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 24px;
    color: #111827;
}

.dn-header-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    margin-bottom: 28px;
}

.dn-company {
    font-size: 13px;
    line-height: 1.65;
    color: #374151;
}

.dn-company strong {
    font-size: 15px;
    color: #111827;
}

.dn-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #e5e7eb;
}

.dn-meta-cell {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    min-height: 54px;
}

.dn-meta-cell:nth-child(odd) {
    border-right: 1px solid #e5e7eb;
}

.dn-meta-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 5px;
}

.dn-meta-value {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.dn-client-block {
    margin-bottom: 24px;
    line-height: 1.65;
    color: #374151;
}

.dn-client-block strong {
    color: #111827;
    font-size: 15px;
}

.dn-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    margin-bottom: 42px;
}

.dn-items-table th {
    background: #f3f4f6;
    color: #111827;
    font-weight: 700;
    font-size: 12px;
    border: 1px solid #d1d5db;
    padding: 9px 10px;
    text-align: left;
}

.dn-items-table td {
    border: 1px solid #d1d5db;
    padding: 10px;
    vertical-align: top;
}

.dn-items-table .col-no {
    width: 45px;
    text-align: center;
}

.dn-items-table .col-unit {
    width: 90px;
    text-align: center;
}

.dn-items-table .col-qty {
    width: 80px;
    text-align: center;
}

.dn-signature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 36px;
}

.dn-signature-box {
    min-height: 130px;
}

.dn-signature-title {
    font-weight: 700;
    margin-bottom: 18px;
    color: #111827;
}

.dn-sign-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    margin-bottom: 18px;
    align-items: end;
}

.dn-sign-line {
    border-bottom: 1px solid #9ca3af;
    height: 22px;
}

.dn-footer {
    margin-top: 34px;
    font-size: 11px;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
}

@media print {
    body {
        background: #fff !important;
    }

    .sidebar,
    .topbar,
    .no-print,
    .sidebar-backdrop {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .content-body {
        padding: 0 !important;
    }

    .invoice-a4 {
        max-width: none;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        padding: 20mm 16mm;
        margin: 0;
    }

    @page {
        size: A4;
        margin: 0;
    }
}

.dn-logo-wrap {
    margin-bottom: 14px;
}

.dn-logo {
    max-width: 160px;
    max-height: 70px;
    object-fit: contain;
    display: block;
}

/* ============================
   Delivery Note Print Page Break Fix
============================ */

@media print {
    .dn-items-table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: auto;
    }

    .dn-items-table thead {
        display: table-header-group;
    }

    .dn-items-table tfoot {
        display: table-footer-group;
    }

    .dn-items-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .dn-signature-grid {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-top: 28px;
    }

    .dn-footer {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

@media print {
    .dn-signature-grid {
        page-break-before: auto;
    }

    .dn-signature-box {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}


/* =========================================================
   FINAL DELIVERY NOTE PRINT FIX
   Keeps multi-page delivery notes professional
   - repeats item table header on new pages
   - prevents row/signature/footer splitting
   - reduces print row height
   - removes awkward browser layout spacing
========================================================= */

@media print {
    /* Hide app chrome */
    .sidebar,
    .topbar,
    .no-print,
    .card.no-print,
    .sidebar-backdrop,
    .invoice-preview-header,
    .invoice-detail-actions {
        display: none !important;
    }

    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .app-layout,
    .main-content,
    .content-body,
    #deliveryNoteDetail {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        display: block !important;
        background: #fff !important;
    }

    /* A4 delivery note paper */
    .invoice-a4 {
        width: 210mm !important;
        max-width: none !important;
        min-height: auto !important;
        margin: 0 auto !important;
        padding: 14mm 14mm 12mm !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        font-size: 11px !important;
        color: #000 !important;
        background: #fff !important;
    }

    .document-title {
        font-size: 22px !important;
        margin-bottom: 16px !important;
    }

    .dn-header-grid {
        gap: 22px !important;
        margin-bottom: 18px !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .dn-client-block {
        margin-bottom: 14px !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Item table page break behavior */
    .dn-items-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 10px !important;
        margin-left: 0 !important;
        margin-right: auto !important;
        margin-bottom: 22px !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    .dn-items-table thead {
        display: table-header-group !important;
    }

    .dn-items-table tfoot {
        display: table-footer-group !important;
    }

    .dn-items-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .dn-items-table th,
    .dn-items-table td {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        padding: 6px 8px !important;
        font-size: 10.5px !important;
        line-height: 1.35 !important;
    }

    .dn-items-table th {
        background: #f3f4f6 !important;
    }

    .dn-items-table .col-no {
        width: 38px !important;
    }

    .dn-items-table .col-unit {
        width: 70px !important;
    }

    .dn-items-table .col-qty {
        width: 65px !important;
    }

    /* Keep signature area together at the end */
    .dn-signature-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 48px !important;
        margin-top: 26px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .dn-signature-box {
        min-height: 105px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .dn-signature-title {
        margin-bottom: 12px !important;
    }

    .dn-sign-row {
        grid-template-columns: 70px 1fr !important;
        margin-bottom: 12px !important;
    }

    .dn-sign-line {
        height: 18px !important;
    }

    .dn-footer {
        margin-top: 18px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    @page {
        size: A4;
        margin: 0;
    }
}

/* =========================================================
   FINAL OVERRIDE - Professional Delivery Note Print Margins
   Keep this block at the very bottom of styles.css
========================================================= */
@media print {
    html,
    body {
        width: 210mm;
        min-height: 297mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .sidebar,
    .topbar,
    .invoice-preview-header,
    .invoice-form-panel,
    .invoice-detail-actions,
    .no-print,
    .card.no-print,
    .sidebar-backdrop,
    button {
        display: none !important;
    }

    .app-layout,
    .main-content,
    .content-body,
    #deliveryNoteDetail {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        background: #ffffff !important;
        display: block !important;
    }

    .invoice-a4 {
        width: 100% !important;
        max-width: none !important;
        min-height: auto !important;
        margin: 0 !important;
        padding: 12mm 10mm 10mm 10mm !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
        font-size: 10.5px !important;
    }

    .document-title {
        margin-top: 0 !important;
        margin-bottom: 12mm !important;
        font-size: 22px !important;
        line-height: 1.1 !important;
    }

    .dn-header-grid {
        margin-bottom: 10mm !important;
        gap: 18mm !important;
    }

    .dn-client-block {
        margin-bottom: 8mm !important;
    }

    .dn-items-table {
        width: 100% !important;
        margin-top: 6mm !important;
        margin-bottom: 10mm !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
    }

    .dn-items-table thead {
        display: table-header-group !important;
    }

    .dn-items-table tr,
    .dn-items-table td,
    .dn-items-table th {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .dn-items-table th {
        padding: 6px 8px !important;
        font-size: 10px !important;
    }

    .dn-items-table td {
        padding: 6px 8px !important;
        font-size: 10px !important;
    }

    .dn-signature-grid {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-top: 10mm !important;
        gap: 14mm !important;
    }

    .dn-signature-box {
        min-height: 105px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .dn-signature-title {
        margin-bottom: 10px !important;
    }

    .dn-sign-row {
        margin-bottom: 10px !important;
    }

    .dn-footer {
        margin-top: 10mm !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

@page {
    size: A4;
    margin: 0;
}

/* =========================================================
   FINAL OVERRIDE - Delivery Note professional print margins
   Keep this block at the very bottom of styles.css
========================================================= */

@page {
    size: A4;
    margin: 14mm 14mm 14mm 14mm;
}

@media print {
    html,
    body {
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .sidebar,
    .topbar,
    .invoice-preview-header,
    .invoice-form-panel,
    .invoice-detail-actions,
    .no-print,
    .card.no-print,
    .sidebar-backdrop,
    button {
        display: none !important;
    }

    .app-layout,
    .main-content,
    .content-body,
    #deliveryNoteDetail {
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        display: block !important;
    }

    .invoice-a4 {
        width: auto !important;
        max-width: none !important;
        min-height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
        font-size: 10.5px !important;
    }

    .document-title {
        margin-top: 0 !important;
        margin-bottom: 10mm !important;
        font-size: 21px !important;
        line-height: 1.1 !important;
    }

    .dn-logo {
        max-width: 145px !important;
        max-height: 60px !important;
    }

    .dn-header-grid {
        margin-bottom: 8mm !important;
        gap: 14mm !important;
    }

    .dn-client-block {
        margin-bottom: 7mm !important;
    }

    .dn-items-table {
        width: 100% !important;
        margin-top: 5mm !important;
        margin-bottom: 9mm !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
    }

    .dn-items-table thead {
        display: table-header-group !important;
    }

    .dn-items-table tr,
    .dn-items-table td,
    .dn-items-table th {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .dn-items-table th,
    .dn-items-table td {
        padding: 5px 7px !important;
        font-size: 9.8px !important;
    }

    .dn-signature-grid {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-top: 9mm !important;
        gap: 14mm !important;
    }

    .dn-signature-box {
        min-height: 100px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .dn-signature-title {
        margin-bottom: 9px !important;
    }

    .dn-sign-row {
        margin-bottom: 9px !important;
    }

    .dn-footer {
        margin-top: 8mm !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

/* ============================
   Quotation / Purchase Order document print layout
============================ */
.lineo-doc-wrapper { background:#f3f4f6; padding:32px; overflow-x:auto; }
.lineo-doc-page { width:210mm; min-height:297mm; margin:0 auto; background:#fff; padding:18mm 16mm; color:#111827; font-size:12px; box-sizing:border-box; position:relative; box-shadow:0 8px 30px rgba(15,23,42,.08); }
.lineo-doc-header { display:grid; grid-template-columns:1fr 1fr; gap:32px; margin-bottom:26px; align-items:start; }
.lineo-doc-header h3 { margin:10px 0 4px; font-size:16px; }
.lineo-doc-header p { margin:0; color:#4b5563; line-height:1.6; }
.lineo-doc-title { border:1px solid #e5e7eb; padding:16px; }
.lineo-doc-title h1 { margin:0 0 14px; font-size:24px; letter-spacing:1px; }
.lineo-doc-title div, .lineo-doc-totals div { display:flex; justify-content:space-between; gap:20px; border-bottom:1px solid #eef2f7; padding:8px 0; }
.lineo-doc-title span, .lineo-doc-totals span { color:#6b7280; }
.lineo-doc-party { margin:20px 0 22px; padding:14px; background:#f9fafb; border:1px solid #eef2f7; }
.lineo-doc-party span { display:block; font-size:11px; text-transform:uppercase; color:#6b7280; margin-bottom:4px; }
.lineo-doc-party strong { display:block; font-size:15px; }
.lineo-doc-party p { margin:6px 0 0; color:#4b5563; white-space:pre-line; }
.lineo-doc-items { width:100%; border-collapse:collapse; margin-bottom:18px; }
.lineo-doc-items th { background:#f3f4f6; border:1px solid #d1d5db; padding:8px; font-weight:700; text-align:left; }
.lineo-doc-items td { border:1px solid #d1d5db; padding:8px; vertical-align:top; }
.lineo-doc-items .item-number { width:35px; text-align:center; color:#6b7280; }
.doc-img-cell { width:82px; text-align:center; }
.doc-item-img { max-width:70px; max-height:70px; object-fit:contain; display:block; margin:0 auto; }
.lineo-doc-totals { width:280px; margin-left:auto; margin-top:18px; }
.lineo-doc-totals .grand { border-top:2px solid #111827; font-size:14px; font-weight:800; }
.lineo-doc-notes { margin-top:22px; border-top:1px solid #e5e7eb; padding-top:12px; }
.lineo-doc-notes p { margin:6px 0 0; white-space:pre-line; color:#4b5563; }
.lineo-doc-footer { display:flex; justify-content:space-between; color:#6b7280; font-size:11px; margin-top:36px; }

@media print {
    .lineo-doc-wrapper { background:#fff !important; padding:0 !important; overflow:visible !important; }
    .lineo-doc-page { width:100%; min-height:auto; margin:0; box-shadow:none; padding:0; }
    .lineo-doc-items thead { display:table-header-group; }
    .lineo-doc-items tr { page-break-inside:avoid; break-inside:avoid; }
    .lineo-doc-totals, .lineo-doc-notes, .lineo-doc-footer { page-break-inside:avoid; break-inside:avoid; }
}



/* ERP Upgrade UI */
.page-subtitle{font-size:.8rem;color:var(--gray-500);margin-top:2px}.erp-hero{padding:28px;margin-bottom:24px;display:flex;justify-content:space-between;gap:20px;align-items:center;background:linear-gradient(135deg,#fff,#f8fafc)}.erp-hero h1{font-size:1.8rem;margin:.2rem 0;color:var(--gray-900)}.erp-hero p{color:var(--gray-600);max-width:680px}.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:.7rem;color:var(--primary);font-weight:700}.erp-hero-actions{display:flex;gap:10px;flex-wrap:wrap}.module-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin-bottom:24px}.module-card{display:block;background:#fff;border:1px solid var(--gray-200);border-radius:14px;padding:18px;text-decoration:none;color:var(--gray-800);box-shadow:var(--shadow-sm);transition:.2s}.module-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md);border-color:var(--primary-light)}.module-card strong{display:block;font-size:1rem;margin-bottom:6px}.module-card span{font-size:.85rem;color:var(--gray-500)}.preview-bottom.invoice-builder{display:flex;flex-direction:column}.preview-bottom .invoice-preview-panel{position:static;order:2}.preview-bottom .invoice-form-panel{order:1}.logo-preview-box{border:1px dashed var(--gray-300);border-radius:12px;min-height:120px;display:flex;align-items:center;justify-content:center;background:#fff}.logo-preview-box img{max-height:100px;max-width:220px}.template-mini-preview{height:120px;border:1px solid var(--gray-200);border-radius:12px;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#fff,#f3f4f6);font-weight:700;color:var(--gray-700)}.lineo-doc-page.template-classic{font-family:Georgia,serif}.lineo-doc-page.template-compact{font-size:85%;padding:24px}.form-help{display:block;color:var(--gray-500);font-size:.75rem;margin-top:4px}.mt-2{margin-top:.5rem}.mb-3{margin-bottom:1rem}.text-gray{color:var(--gray-500)}
@media(max-width:900px){.erp-hero{flex-direction:column;align-items:flex-start}.topbar{align-items:flex-start}.topbar-actions{flex-wrap:wrap}}

/* ========================================
   Back Button
   ======================================== */
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px 0 10px;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.back-btn:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    border-color: var(--gray-400);
    box-shadow: var(--shadow-sm);
}

.back-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .topbar {
        gap: 10px;
    }

    .topbar-left {
        gap: 8px;
        min-width: 0;
    }

    .back-btn {
        height: 32px;
        padding: 0 9px;
    }

    .back-btn span {
        display: none;
    }
}

@media print {
    .back-btn {
        display: none !important;
    }
}

/* ========================================
   ERP Patch: modern login, fonts, bottom preview, CSV actions
   ======================================== */
:root {
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-document: "Aptos", "Segoe UI", Arial, sans-serif;
}
body, input, select, textarea, button { font-family: var(--font-sans); }
.invoice-paper, .lineo-doc-page, .lineo-invoice-page { font-family: var(--font-document); }
.invoice-builder.preview-bottom { display: flex !important; flex-direction: column; gap: 24px; }
.invoice-builder.preview-bottom .invoice-form-panel,
.invoice-builder.preview-bottom .invoice-preview-panel { width: 100%; max-width: 100%; }
.invoice-builder.preview-bottom .invoice-preview-panel { position: static !important; top: auto; }
.inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.csv-upload-label { cursor: pointer; }
.password-field { position: relative; display: flex; align-items: center; }
.password-field .form-control { padding-right: 72px; }
.password-toggle {
    position: absolute;
    right: 8px;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
    padding: 6px 8px;
}
.login-helper {
    margin: -12px 0 20px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: .85rem;
    text-align: center;
}
.field-error { display: block; min-height: 18px; margin-top: 5px; color: var(--danger); font-size: .78rem; }
.form-control.field-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.doc-company-logo { max-height: 58px; max-width: 180px; object-fit: contain; margin-bottom: 10px; }
.invoice-paper.template-classic, .lineo-doc-page.template-classic { font-family: Georgia, "Times New Roman", serif; }
.invoice-paper.template-compact, .lineo-doc-page.template-compact { font-size: 88%; padding: 26px; }
@media print {
    .inline-actions, .csv-upload-label, .password-toggle { display: none !important; }
}

/* ERP sidebar grouped menu */
.nav-group-title{font-size:.72rem;font-weight:800;color:var(--gray-500);padding:12px 16px 6px;letter-spacing:.02em}
.nav-divider{height:1px;background:rgba(148,163,184,.22);margin:10px 16px 4px}
.data-table tr.row-clickable{cursor:pointer;transition:background .15s ease}
.data-table tr.row-clickable:hover{background:#f8fafc}
.project-filter-bar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;justify-content:space-between;margin-bottom:14px}
.project-filter-bar .search-box{flex:1;min-width:240px}.project-filter-bar select{max-width:180px}.doc-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:18px}.doc-summary-card{background:#fff;border:1px solid var(--gray-200);border-radius:14px;padding:16px;box-shadow:var(--shadow-sm)}.doc-summary-card span{font-size:.78rem;color:var(--gray-500)}.doc-summary-card strong{display:block;font-size:1.55rem;margin-top:5px}.project-doc-section{margin-top:18px}.project-doc-section h3{margin-bottom:10px}.project-select-wrap{display:flex;gap:8px}.project-select-wrap select{flex:1}.project-select-wrap a{white-space:nowrap}


/* SaaS onboarding checklist */
.onboarding-card { border-left: 4px solid var(--primary); margin-bottom: 24px; }
.onboarding-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.onboarding-step { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); text-decoration: none; color: var(--gray-800); background: var(--white); transition: all .2s; }
.onboarding-step:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.onboarding-step span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); font-weight: 700; flex: 0 0 26px; }
.onboarding-step.done span { background: var(--success-light); color: var(--success); }
.onboarding-step strong { display:block; font-size: .92rem; }
.onboarding-step small { display:block; color: var(--gray-500); margin-top: 3px; line-height: 1.4; }

/* Dashboard + branding patch */
.dashboard-filter-card { margin-bottom: 18px; }
.dashboard-filter-row { display:grid; grid-template-columns: 1.5fr 180px 140px 150px 150px; gap:12px; align-items:end; }
.stat-link { text-decoration:none; color:inherit; cursor:pointer; }
.stat-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.row-clickable { cursor:pointer; }
.row-clickable:hover { background: var(--gray-50); }
.no-logo-box { min-height:120px; color: var(--gray-500); font-size:.85rem; text-align:center; }
.doc-esignature { margin:28px 0 10px; max-width:260px; border-top:1px solid var(--gray-300); padding-top:10px; display:flex; flex-direction:column; gap:3px; }
.doc-esignature .doc-signature-img { max-width:180px; max-height:70px; object-fit:contain; margin-bottom:4px; }
.doc-esignature span { color:var(--gray-500); font-size:.8rem; }
@media(max-width: 920px){ .dashboard-filter-row { grid-template-columns:1fr; } }
.lineo-signed-stamp{margin:18px 0 8px auto;border:1px solid #111;padding:12px 16px;max-width:280px;text-align:center;border-radius:10px;background:rgba(255,255,255,.75);font-size:12px}.mini-card{display:block;padding:10px;border:1px solid var(--border,#e5e7eb);border-radius:10px;margin:4px}.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px}.btn-success{background:#15803d;color:#fff}.btn-danger{background:#b91c1c;color:#fff}


/* Step 9 UI fixes */
.nav-link { position: relative; }
.nav-badge { margin-left:auto; min-width:22px; height:22px; padding:0 7px; border-radius:999px; background:#dc2626; color:#fff; font-size:.72rem; font-weight:800; display:inline-flex; align-items:center; justify-content:center; }
.settings-tabbar { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 18px; position:sticky; top:0; z-index:8; background:#f8fafc; padding:10px 0; }
.settings-tab { border:1px solid var(--gray-200); background:#fff; color:var(--gray-700); border-radius:999px; padding:10px 14px; font-weight:700; text-decoration:none; cursor:pointer; box-shadow:var(--shadow-sm); }
.settings-tab.active, .settings-tab:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.info-box { background:#f8fafc; border:1px solid var(--gray-200); border-radius:12px; padding:12px; color:var(--gray-600); line-height:1.45; }
.text-signature { border-top:1px solid #d1d5db; padding-top:10px; max-width:280px; margin-top:28px; }

/* Fix legacy modal markup used by Credit Notes */
.modal.show { position:fixed; inset:0; z-index:3000; display:flex !important; align-items:center; justify-content:center; background:rgba(15,23,42,.45); padding:24px; max-width:none; max-height:none; width:auto; border-radius:0; box-shadow:none; overflow:auto; }
.modal:not(.show) { display:none; }
.modal.show .modal-content { background:#fff; border-radius:18px; width:min(920px, calc(100vw - 48px)); max-height:calc(100vh - 48px); overflow:auto; box-shadow:0 24px 70px rgba(15,23,42,.25); }
.modal.show .modal-lg { width:min(980px, calc(100vw - 48px)); }

/* Safer A4 print/export layout for all document previews */
@media print {
    @page { size:A4; margin:10mm; }
    html, body { margin:0 !important; padding:0 !important; background:#fff !important; width:100% !important; overflow:visible !important; }
    .app-layout, .main-content, .content-body, .invoice-preview-body { display:block !important; margin:0 !important; padding:0 !important; width:100% !important; max-width:none !important; overflow:visible !important; background:#fff !important; }
    .sidebar, .sidebar-backdrop, .topbar, .no-print, .invoice-preview-header, .invoice-form-panel, .settings-tabbar { display:none !important; }
    .lineo-doc-wrapper { background:#fff !important; padding:0 !important; margin:0 !important; overflow:visible !important; width:100% !important; }
    .lineo-doc-page { width:190mm !important; max-width:190mm !important; min-height:auto !important; margin:0 auto !important; padding:8mm !important; box-shadow:none !important; box-sizing:border-box !important; font-size:9px !important; }
    .lineo-doc-header { gap:16px !important; margin-bottom:14px !important; }
    .lineo-doc-title h1 { font-size:18px !important; }
    .lineo-doc-items { table-layout:fixed !important; width:100% !important; font-size:8px !important; }
    .lineo-doc-items th, .lineo-doc-items td { padding:5px !important; word-break:break-word !important; overflow-wrap:anywhere !important; }
    .lineo-doc-items th:first-child, .lineo-doc-items td:first-child { width:18mm !important; }
    .lineo-doc-totals { width:55mm !important; font-size:9px !important; }
    .invoice-paper, .lineo-invoice-page { width:190mm !important; max-width:190mm !important; padding:8mm !important; margin:0 auto !important; box-shadow:none !important; box-sizing:border-box !important; }
    img { max-width:100% !important; }
}


/* Step 10: modal compatibility fix.
   Step 9 added legacy .modal.show rules for direct modal markup, but that hid
   normal .modal elements inside .modal-overlay. Keep both patterns working. */
.modal-overlay.show > .modal { display:block !important; }
.modal-overlay.show { z-index:3000; }
.modal-overlay .modal { background:var(--white); border-radius:var(--radius-lg); width:100%; max-width:760px; max-height:90vh; overflow-y:auto; box-shadow:var(--shadow-lg); }
.approval-hint { color: var(--gray-500); font-size: .875rem; }

/* Step 12: Professional e-signature certificate block (DocuSign/Adobe-style visual, no image upload) */
.esign-certificate-card {
    margin: 22px 0 10px auto;
    max-width: 420px;
    border: 1px solid #d1d5db;
    border-left: 6px solid #16a34a;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    font-size: 12px;
    color: #111827;
    page-break-inside: avoid;
    break-inside: avoid;
}
.esign-certificate-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #e5e7eb;
}
.esign-certificate-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #065f46;
}
.esign-certificate-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 15px;
}
.esign-certificate-badge {
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: #166534;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
    text-transform: uppercase;
}
.esign-certificate-body { padding: 12px 14px 14px; }
.esign-signature-line {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 22px;
    line-height: 1.1;
    color: #111827;
    margin-bottom: 4px;
    font-style: italic;
}
.esign-signer-name { font-weight: 800; font-size: 13px; }
.esign-signer-role { color: #4b5563; margin-top: 2px; }
.esign-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}
.esign-meta-cell {
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #ffffff;
    padding: 7px 8px;
    min-width: 0;
}
.esign-meta-cell span {
    display: block;
    color: #6b7280;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    margin-bottom: 2px;
}
.esign-meta-cell strong {
    display: block;
    color: #111827;
    font-size: 10.5px;
    word-break: break-word;
}
.esign-hash-box {
    margin-top: 10px;
    padding: 8px 9px;
    border-radius: 9px;
    background: #111827;
    color: #f9fafb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9.5px;
    line-height: 1.45;
    word-break: break-all;
}
.esign-disclaimer {
    margin-top: 8px;
    color: #6b7280;
    font-size: 9.5px;
    line-height: 1.35;
}

@media print {
    .esign-certificate-card {
        max-width: 390px !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .esign-certificate-head,
    .esign-meta-cell,
    .esign-hash-box,
    .esign-certificate-badge,
    .esign-certificate-icon {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}


/* Step 14: Compact signature-line style eSignature visual */
.smart-esign-stack {
    width: 330px;
    max-width: 100%;
    margin: 16px auto 8px 0;
    color: #4b5563;
    page-break-inside: avoid;
    break-inside: avoid;
}
.smart-esign-stack.smart-esign-compact {
    background: transparent;
}
.smart-esign-script {
    margin: 0;
    padding: 0 0 5px;
    border-bottom: 1px solid #cbd5e1;
}
.smart-esign-script-name {
    font-family: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive;
    font-size: 36px;
    line-height: .96;
    color: #111827;
    transform: rotate(-1.5deg);
    transform-origin: left center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.smart-esign-script-meta {
    margin-top: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9px;
    color: #94a3b8;
    letter-spacing: .02em;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Legacy blocks retained for backward compatibility but hidden in compact mode */
.smart-esign-compact .smart-esign-pill,
.smart-esign-compact .smart-esign-details,
.smart-esign-compact .smart-esign-mark,
.smart-esign-compact .smart-esign-label {
    display: none !important;
}
@media print {
    .smart-esign-stack {
        width: 310px !important;
        margin-top: 10px !important;
        margin-left: 0 !important;
        margin-right: auto !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .smart-esign-script-name { font-size: 32px !important; }
    .smart-esign-script-meta {
        font-size: 8.5px !important;
        color: #6b7280 !important;
    }
}

/* Step 19 - SaaS admin and workflow settings polish */
.saas-admin-page .saas-hero .card-body{display:flex;justify-content:space-between;gap:24px;align-items:center;flex-wrap:wrap;}
.saas-hero h1{font-size:1.65rem;line-height:1.25;margin:4px 0 8px;color:var(--text-primary,#111827);max-width:760px;}
.eyebrow{font-size:.75rem;text-transform:uppercase;letter-spacing:.12em;color:var(--primary,#4f46e5);font-weight:700;margin:0;}
.saas-hero-actions{display:flex;gap:10px;flex-wrap:wrap;}
.saas-dashboard-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(320px,.8fr);gap:20px;margin-top:20px;}
.saas-shortcuts{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;}
.saas-shortcuts a{display:block;border:1px solid var(--border-color,#e5e7eb);border-radius:14px;padding:14px;text-decoration:none;color:inherit;background:#fff;transition:.2s ease;}
.saas-shortcuts a:hover{transform:translateY(-1px);box-shadow:0 8px 24px rgba(15,23,42,.08);}
.saas-shortcuts span{display:block;color:var(--text-muted,#6b7280);font-size:.82rem;margin-top:5px;line-height:1.35;}
.saas-mix-list{display:flex;flex-direction:column;gap:10px;}
.saas-mix-row{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--border-color,#e5e7eb);border-radius:12px;padding:11px 12px;background:#fff;}
.saas-checklist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;}
.saas-checklist li{display:flex;gap:10px;align-items:flex-start;color:var(--text-secondary,#374151);}
.saas-checklist span{width:22px;height:22px;border-radius:50%;background:#f3f4f6;display:inline-flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700;flex:0 0 auto;}
.workflow-settings-table th,.workflow-settings-table td{vertical-align:middle;}
.workflow-settings-table .form-control{min-width:145px;}
.workflow-settings-table .wf-notes{min-width:220px;}
.switch-row{display:flex;gap:8px;align-items:center;white-space:nowrap;font-size:.86rem;color:var(--text-secondary,#374151);}
.workflow-action-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
@media (max-width:900px){.saas-dashboard-grid{grid-template-columns:1fr}.saas-admin-page .saas-hero .card-body{align-items:flex-start}.workflow-settings-table{min-width:980px}}


/* STEP 20 UI polish */
.status-inline{border:1px solid var(--border-color,#e5e7eb);border-radius:999px;padding:.35rem .65rem;background:#fff;font-size:.85rem;text-transform:capitalize;min-width:112px;cursor:pointer}
.attachment-list{display:grid;gap:.5rem;margin-top:1rem}.attachment-row{display:flex;gap:.75rem;align-items:center;justify-content:space-between;border:1px solid var(--border-color,#e5e7eb);border-radius:12px;padding:.65rem .75rem;background:#fafafa}.attachment-row a{font-weight:600}.attachment-row span{font-size:.78rem;color:#6b7280;text-transform:capitalize;margin-left:auto}.modal-wide{max-width:900px}.clickable-row{cursor:pointer}.clickable-row:hover{background:#f8fafc}.quote-img-upload{display:grid;gap:.35rem;min-width:130px}.doc-item-img{max-width:70px;max-height:52px;object-fit:contain;border:1px solid #e5e7eb;border-radius:8px;background:#fff}.dashboard-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-bottom:1rem}.mini-chart{display:grid;gap:.75rem}.mini-chart-row{display:grid;grid-template-columns:110px 1fr 70px;gap:.75rem;align-items:center}.mini-chart-row span{font-size:.85rem;color:#475569;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mini-chart-row div{height:10px;background:#eef2f7;border-radius:99px;overflow:hidden}.mini-chart-row i{display:block;height:100%;background:linear-gradient(90deg,#d6b98c,#8d6b3f);border-radius:99px}.mini-chart-row strong{text-align:right;font-size:.85rem}.erp-hero{background:linear-gradient(135deg,#fff,#f8f2e8);border:1px solid #eadcc8}.module-grid .module-card{transition:transform .15s ease, box-shadow .15s ease}.module-grid .module-card:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(15,23,42,.08)}@media(max-width:900px){.dashboard-chart-grid{grid-template-columns:1fr}.mini-chart-row{grid-template-columns:80px 1fr 48px}}


/* Step 21 cleanup: Lufga support, print header/logo, and left-aligned descriptions */
:root { --font-document: var(--ls-font, Inter, Manrope, Arial, sans-serif); }
.lineo-doc-wrapper, .lineo-invoice-wrapper, .invoice-paper { font-family: var(--font-document); }
.lineo-logo { display:block; max-width:150px; max-height:70px; object-fit:contain; margin-bottom:8px; }
.lineo-company-block h3 { margin-top:6px; }
.lineo-doc-items th, .lineo-doc-items td { text-align:left; }
.lineo-doc-items .col-no, .lineo-doc-items .item-number { text-align:center; width:32px; }
.lineo-doc-items .col-image, .lineo-doc-items .doc-img-cell { text-align:center; width:82px; }
.lineo-doc-items .col-price, .lineo-doc-items .col-qty, .lineo-doc-items .col-amount, .lineo-doc-items .text-right { text-align:right; }
.lineo-doc-items .col-unit { text-align:center; }
.lineo-doc-items .col-desc { text-align:left !important; direction:ltr; white-space:pre-line; }

@media print {
    .lineo-doc-wrapper, .lineo-print-wrapper { background:#fff !important; padding:0 !important; margin:0 !important; overflow:visible !important; width:100% !important; }
    .lineo-doc-page, .lineo-print-page { width:190mm !important; max-width:190mm !important; min-height:auto !important; margin:0 auto !important; padding:8mm !important; box-shadow:none !important; box-sizing:border-box !important; color:#111827 !important; background:#fff !important; font-family: var(--font-document, Inter, Manrope, Arial, sans-serif) !important; }
    .lineo-doc-header, .lineo-print-header { display:grid !important; grid-template-columns:1fr 1fr !important; gap:16px !important; align-items:start !important; margin-bottom:14px !important; }
    .lineo-logo { display:block !important; max-width:38mm !important; max-height:18mm !important; object-fit:contain !important; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
    .lineo-doc-items { table-layout:fixed !important; width:100% !important; border-collapse:collapse !important; font-size:8.5px !important; }
    .lineo-doc-items th, .lineo-doc-items td { padding:5px !important; word-break:normal !important; overflow-wrap:anywhere !important; text-align:left !important; vertical-align:top !important; }
    .lineo-doc-items .col-no, .lineo-doc-items .item-number { text-align:center !important; width:8mm !important; }
    .lineo-doc-items .col-image, .lineo-doc-items .doc-img-cell { text-align:center !important; width:18mm !important; }
    .lineo-doc-items .col-price { text-align:right !important; width:18mm !important; }
    .lineo-doc-items .col-unit { text-align:center !important; width:12mm !important; }
    .lineo-doc-items .col-qty { text-align:right !important; width:10mm !important; }
    .lineo-doc-items .col-amount { text-align:right !important; width:20mm !important; }
    .lineo-doc-items .col-desc { text-align:left !important; direction:ltr !important; }
    .doc-item-img { max-width:16mm !important; max-height:13mm !important; object-fit:contain !important; }
}

/* ============================
   STEP 22: Production ERP polish
   ============================ */
:root{
  --erp-bg:#f6f4ef; --erp-card:#ffffff; --erp-ink:#1f2933; --erp-muted:#6b7280; --erp-line:#e8e2d6; --erp-accent:#111827; --erp-soft:#f2eadf;
}
body.erp-production-ui{background:var(--erp-bg); color:var(--erp-ink); font-family:Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;}
.erp-production-ui .sidebar{background:#12100d; border-right:0; box-shadow:8px 0 30px rgba(17,24,39,.08)}
.erp-production-ui .sidebar-logo,.erp-production-ui .nav-section-title,.erp-production-ui .nav-group-title,.erp-production-ui .user-name{color:#fff}
.erp-production-ui .nav-link{border-radius:14px; margin:3px 10px; transition:all .18s ease; color:rgba(255,255,255,.78)}
.erp-production-ui .nav-link:hover,.erp-production-ui .nav-link.active{background:rgba(255,255,255,.12); color:#fff; transform:translateX(2px)}
.erp-production-ui .main-content{background:linear-gradient(135deg,#faf8f3 0%,#f3efe7 100%)}
.erp-production-ui .topbar{background:rgba(250,248,243,.82); backdrop-filter:blur(14px); border-bottom:1px solid var(--erp-line)}
.erp-production-ui .card{border:1px solid var(--erp-line); border-radius:22px; box-shadow:0 14px 40px rgba(31,41,51,.06); overflow:hidden}
.erp-production-ui .card-header{border-bottom:1px solid var(--erp-line); background:linear-gradient(180deg,#fff,#fbfaf7)}
.erp-production-ui .btn{border-radius:13px; font-weight:700; letter-spacing:.01em}
.erp-production-ui .btn-primary{background:#111827; border-color:#111827; color:#fff}
.erp-production-ui .btn-secondary{background:#fff; border:1px solid var(--erp-line); color:#111827}
.erp-production-ui .erp-hero{padding:28px; display:flex; justify-content:space-between; gap:18px; align-items:center; background:radial-gradient(circle at top right,#efe1cc,transparent 30%),#fff}
.erp-production-ui .erp-hero h1{font-size:2rem; margin:4px 0 8px; letter-spacing:-.04em}
.erp-production-ui .eyebrow{font-size:.75rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:#9a6b34}
.erp-production-ui .stats-grid{gap:16px}.erp-production-ui .stat-card{border-radius:22px; min-height:118px; border:1px solid var(--erp-line); background:#fff; transition:.18s ease}.erp-production-ui .stat-card:hover{transform:translateY(-2px); box-shadow:0 18px 45px rgba(31,41,51,.08)}
.erp-production-ui .stat-value{font-size:1.45rem; letter-spacing:-.03em}.erp-production-ui .stat-label{color:var(--erp-muted); font-weight:700}
.erp-production-ui .module-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin:18px 0}.erp-production-ui .module-card{border:1px solid var(--erp-line);border-radius:20px;padding:18px;background:#fff;text-decoration:none;color:inherit;display:block;transition:.18s}.erp-production-ui .module-card:hover{transform:translateY(-2px);box-shadow:0 14px 35px rgba(31,41,51,.08)}.erp-production-ui .module-card span{display:block;color:var(--erp-muted);font-size:.86rem;margin-top:6px;line-height:1.45}
.erp-production-ui .toolbar{background:#fbfaf7;border:1px solid var(--erp-line);border-radius:18px;padding:12px;gap:10px;align-items:center;flex-wrap:wrap}.erp-production-ui .form-control,.erp-production-ui .filter-select{border-radius:13px;border:1px solid var(--erp-line);background:#fff}.erp-production-ui .data-table th{background:#fbfaf7;color:#5f6470;text-transform:uppercase;font-size:.72rem;letter-spacing:.08em}.erp-production-ui .data-table td{vertical-align:middle}.erp-production-ui .clickable-row:hover{background:#fffaf3}.erp-production-ui .row-actions{display:inline-flex;gap:6px;flex-wrap:wrap;align-items:center}.erp-production-ui .status-inline{border:1px solid var(--erp-line);border-radius:999px;background:#fff;padding:6px 12px;font-weight:800;color:#374151;min-width:130px}.erp-production-ui .doc-type-pill,.erp-production-ui .status-chip{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--erp-line);background:#fff;border-radius:999px;padding:6px 10px;font-weight:800;font-size:.78rem}.erp-production-ui .status-chip{justify-content:space-between;width:100%;margin:5px 0}.erp-production-ui .status-chip small{color:var(--erp-muted)}
.erp-production-ui .mini-chart{min-height:180px;display:flex;flex-direction:column;justify-content:center;gap:8px}.spark-row{display:grid;grid-template-columns:90px 1fr 70px;gap:10px;align-items:center;font-size:.84rem}.spark-track{height:10px;background:#eee6da;border-radius:999px;overflow:hidden}.spark-track i{display:block;height:100%;background:#111827;border-radius:999px}.empty-mini-chart{color:var(--erp-muted);text-align:center;padding:32px}.dashboard-chart-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;margin:18px 0}
.erp-production-ui .lineo-doc-page,.erp-production-ui .lineo-invoice-page{font-family:Inter, Manrope, system-ui, sans-serif}.lineo-doc-items th:nth-child(3),.lineo-doc-items td:nth-child(3),.lineo-print-items th:nth-child(3),.lineo-print-items td:nth-child(3){text-align:left!important}.lineo-doc-items th,.lineo-doc-items td{vertical-align:top}.lineo-doc-logo img,.lineo-logo{max-height:68px;max-width:180px;object-fit:contain}.quote-img-upload img,.doc-item-img{max-width:72px;max-height:72px;object-fit:contain;border-radius:10px;border:1px solid var(--erp-line);background:#fff}
@media print{body{background:#fff!important}.sidebar,.topbar,.no-print,.invoice-detail-actions{display:none!important}.main-content{margin:0!important;padding:0!important;background:#fff!important}.lineo-doc-wrapper,.lineo-invoice-wrapper{background:#fff!important;padding:0!important}.lineo-doc-page,.lineo-invoice-page{box-shadow:none!important;border:0!important;margin:0!important;width:100%!important}.lineo-doc-items th:nth-child(3),.lineo-doc-items td:nth-child(3),.lineo-print-items th:nth-child(3),.lineo-print-items td:nth-child(3){text-align:left!important}}


/* STEP 23: Work Inbox and document collaboration */
.work-inbox-widget{position:fixed;top:18px;right:22px;z-index:2200}.work-inbox-button{position:relative;width:44px;height:44px;border:1px solid var(--erp-line,#e6dccf);border-radius:999px;background:#fff;box-shadow:0 12px 28px rgba(15,23,42,.12);display:flex;align-items:center;justify-content:center;cursor:pointer}.work-inbox-button:hover{transform:translateY(-1px);box-shadow:0 16px 36px rgba(15,23,42,.16)}.work-inbox-icon{font-size:20px}.work-inbox-badge{position:absolute;top:-6px;right:-6px;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#dc2626;color:#fff;font-size:.72rem;font-weight:900;align-items:center;justify-content:center;border:2px solid #fff}.work-inbox-dropdown{display:none;position:absolute;top:54px;right:0;width:min(390px,calc(100vw - 28px));background:#fff;border:1px solid var(--erp-line,#e6dccf);border-radius:18px;box-shadow:0 24px 70px rgba(15,23,42,.22);overflow:hidden}.work-inbox-dropdown.show{display:block}.work-inbox-head,.work-inbox-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;background:#fbfaf7;border-bottom:1px solid var(--erp-line,#e6dccf)}.work-inbox-head small{display:block;color:#6b7280;font-size:.75rem;margin-top:2px}.work-inbox-head a{font-weight:800;color:#7c5d2e}.work-inbox-foot{border-top:1px solid var(--erp-line,#e6dccf);border-bottom:0;justify-content:flex-end}.work-inbox-list{max-height:390px;overflow:auto;padding:8px}.work-inbox-empty,.table-empty{color:#6b7280;text-align:center;padding:18px}.work-inbox-item{display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:start;padding:12px;border:1px solid transparent;border-radius:14px;cursor:pointer;margin-bottom:6px}.work-inbox-item:hover{background:#fffaf3;border-color:#eadcc8}.work-inbox-item.unread{background:#fff8ec;border-color:#eadcc8}.work-inbox-item-icon{width:34px;height:34px;border-radius:12px;background:#f3eee6;display:flex;align-items:center;justify-content:center;font-weight:900}.work-inbox-item-main strong{display:block;color:#1f2937;font-size:.92rem}.work-inbox-item-main p{margin:3px 0;color:#4b5563;font-size:.82rem;line-height:1.35}.work-inbox-item-main small{color:#8a6b3f;font-weight:800}.work-inbox-priority{border:1px solid #e5e7eb;border-radius:999px;padding:4px 8px;font-size:.68rem;text-transform:uppercase;font-weight:900;color:#6b7280}.work-inbox-priority.high,.work-inbox-priority.urgent{background:#fef2f2;color:#b91c1c;border-color:#fecaca}.work-inbox-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-bottom:1rem}.work-inbox-page-list{display:grid;gap:8px}.work-inbox-page-list .work-inbox-item{grid-template-columns:44px 1fr auto;padding:16px;border:1px solid var(--erp-line,#e6dccf);background:#fff}.work-inbox-page-list .work-inbox-item.unread{background:#fff8ec}.toolbar.compact{display:flex;gap:8px;align-items:center}.document-collab-card{border:1px solid var(--erp-line,#e6dccf)}.doc-comments{display:grid;gap:8px;margin-bottom:12px}.doc-comment{border:1px solid #e5e7eb;border-radius:14px;background:#fbfaf7;padding:11px 12px}.doc-comment strong{color:#1f2937}.doc-comment span{float:right;color:#6b7280;font-size:.75rem}.doc-comment p{margin:6px 0 0;color:#374151;white-space:pre-wrap}.doc-comment-form{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:start}.mt-3{margin-top:1rem}@media(max-width:900px){.work-inbox-widget{top:14px;right:14px}.work-inbox-summary-grid{grid-template-columns:1fr 1fr}.doc-comment-form{grid-template-columns:1fr}.work-inbox-page-list .work-inbox-item{grid-template-columns:38px 1fr}.work-inbox-priority{display:none}}@media print{.work-inbox-widget,.document-collab-card{display:none!important}}


/* STEP 24: authentication/profile/work-inbox/document alignment */
.auth-links{margin-top:10px;text-align:right}.auth-links a{font-weight:800;color:#7c5d2e}.auth-card{box-shadow:0 24px 80px rgba(15,23,42,.16)}
.topbar{gap:16px}.topbar-actions{margin-left:auto;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.work-inbox-widget.in-topbar{position:relative!important;top:auto!important;right:auto!important;z-index:80;display:inline-flex}.work-inbox-widget.in-topbar .work-inbox-button{width:40px;height:40px;box-shadow:none;background:#fff}.work-inbox-widget.in-topbar .work-inbox-dropdown{right:0;top:48px}.work-inbox-widget:not(.in-topbar){right:104px!important;top:16px!important}
.user-profile-shell{display:grid;grid-template-columns:280px 1fr;gap:24px;align-items:start}.user-profile-card{border:1px solid var(--erp-line,#e6dccf);border-radius:24px;background:linear-gradient(180deg,#fff,#fbfaf7);padding:24px;text-align:center;box-shadow:0 16px 40px rgba(15,23,42,.06)}.profile-avatar-large{width:96px;height:96px;border-radius:28px;margin:0 auto 14px;background:#111827;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2.2rem;font-weight:900}.user-profile-card h2{margin:0;color:#111827}.user-profile-card p{margin:6px 0 14px;color:#6b7280;font-weight:700}.user-profile-main{min-width:0}.profile-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}.profile-stat-grid div{border:1px solid var(--erp-line,#e6dccf);border-radius:16px;padding:14px;background:#fff}.profile-stat-grid strong{display:block;font-size:1.4rem;color:#111827}.profile-stat-grid span{color:#6b7280;font-size:.78rem;font-weight:800;text-transform:uppercase}.settings-subtitle{margin:18px 0 10px;color:#111827}.toggle-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.toggle-grid label{border:1px solid var(--erp-line,#e6dccf);border-radius:14px;padding:11px 12px;background:#fff;display:flex;gap:8px;align-items:center;font-weight:700}.badge-draft{background:#f3f4f6;color:#374151}.document-preview-normalized{box-sizing:border-box}.lineo-doc-wrapper .lineo-doc-page,.invoice-preview .lineo-doc-page,#quotationPreview .lineo-doc-page{width:210mm;max-width:100%;margin-left:auto;margin-right:auto}.lineo-doc-items th,.lineo-doc-items td,.lineo-print-items th,.lineo-print-items td{vertical-align:top}.lineo-doc-items th:nth-child(2),.lineo-doc-items td:nth-child(2),.invoice-items-table th:nth-child(2),.invoice-items-table td:nth-child(2){text-align:left!important}.doc-page-footer,.lineo-doc-footer,.invoice-paper-footer{max-width:100%;box-sizing:border-box;overflow:hidden}.doc-page-number,.page-number{position:static!important;display:block;text-align:center;margin-top:8px;color:#6b7280;font-size:.75rem}
@media(max-width:1000px){.user-profile-shell{grid-template-columns:1fr}.toggle-grid,.profile-stat-grid{grid-template-columns:1fr 1fr}.topbar{align-items:flex-start}.topbar-actions{width:100%;justify-content:flex-start}.work-inbox-widget.in-topbar .work-inbox-dropdown{right:auto;left:0}}
@media(max-width:640px){.toggle-grid,.profile-stat-grid{grid-template-columns:1fr}.work-inbox-dropdown{width:calc(100vw - 24px)!important}}
@media print{.doc-page-number,.page-number{position:static!important}.lineo-doc-page,.invoice-paper{overflow:hidden!important}.lineo-doc-footer,.invoice-paper-footer{break-inside:avoid;page-break-inside:avoid;margin-bottom:0!important}.lineo-doc-items th:nth-child(2),.lineo-doc-items td:nth-child(2),.invoice-items-table th:nth-child(2),.invoice-items-table td:nth-child(2){text-align:left!important}}


/* ============================
   STEP 25 — Stability / unified print-PDF foundation
   ============================ */
:root{--doc-a4-width:210mm;--doc-a4-min-height:297mm;--doc-a4-pad-x:14mm;--doc-a4-pad-y:12mm;--doc-border:#d8dee8;--doc-text:#101827;}
.document-shell,.lineo-doc-wrapper,.invoice-preview-body{box-sizing:border-box;}
.invoice-preview,.invoice-preview-body,#quotationPreview,.document-preview-normalized{background:#f5f7fb;overflow:auto;}
.lineo-doc-wrapper{width:100%;padding:18px 0;background:#f5f7fb;}
.lineo-doc-page,.lineo-print-page,.invoice-paper{width:var(--doc-a4-width)!important;max-width:var(--doc-a4-width)!important;min-height:var(--doc-a4-min-height);margin:0 auto!important;padding:var(--doc-a4-pad-y) var(--doc-a4-pad-x)!important;background:#fff!important;box-sizing:border-box!important;color:var(--doc-text)!important;border:0!important;box-shadow:0 16px 45px rgba(15,23,42,.11)!important;font-family:var(--font-document, Inter, Manrope, Arial, sans-serif)!important;overflow:hidden;}
.lineo-doc-header{display:grid!important;grid-template-columns:minmax(0,1fr) 98mm!important;gap:16mm!important;align-items:start;margin-bottom:12mm!important;}
.lineo-company-block{min-width:0;}
.lineo-logo{display:block;max-width:46mm!important;max-height:22mm!important;width:auto!important;height:auto!important;object-fit:contain;margin:0 0 5mm 0;}
.lineo-company-block h3{font-size:13px!important;margin:0 0 3mm!important;font-weight:900;letter-spacing:.01em;color:#0f172a;}
.lineo-company-block p{font-size:10px!important;line-height:1.55!important;margin:0;color:#334155;}
.lineo-doc-title{border:1px solid var(--doc-border)!important;padding:6mm!important;min-height:48mm;box-sizing:border-box;background:#fff;}
.lineo-doc-title h1{font-size:19px!important;line-height:1.15!important;margin:0 0 8mm!important;letter-spacing:.08em;color:#0f172a;font-weight:900;}
.lineo-doc-title>div{display:grid!important;grid-template-columns:1fr auto!important;gap:8px;align-items:center;border-bottom:1px solid #e8edf4;padding:3.3mm 0;font-size:10px;}
.lineo-doc-title>div:last-child{border-bottom:0;}
.lineo-doc-title span{color:#64748b;}
.lineo-doc-title strong{font-weight:900;color:#0f172a;text-align:right;white-space:nowrap;}
.lineo-doc-party{background:#f8fafc;border:1px solid #edf1f7;padding:5mm 6mm!important;margin:0 0 8mm!important;}
.lineo-doc-party span{display:block;text-transform:uppercase;letter-spacing:.05em;font-size:9px;color:#64748b;margin-bottom:3mm;}
.lineo-doc-party strong{display:block;font-size:13px;color:#0f172a;margin-bottom:2mm;}
.lineo-doc-party p{margin:0;font-size:10.5px;color:#334155;line-height:1.45;}
.lineo-doc-items,.lineo-print-items{width:100%!important;border-collapse:collapse!important;table-layout:fixed!important;margin:0 0 8mm!important;font-size:10px!important;}
.lineo-doc-items th,.lineo-doc-items td,.lineo-print-items th,.lineo-print-items td{border:1px solid #d2d9e4!important;padding:3.5mm 3mm!important;vertical-align:top!important;line-height:1.38!important;color:#0f172a;box-sizing:border-box;}
.lineo-doc-items th,.lineo-print-items th{background:#f5f6f8!important;font-weight:900!important;text-align:left!important;font-size:9px!important;}
.lineo-doc-items .col-no{width:9mm;text-align:center!important;}
.lineo-doc-items .col-desc{width:auto;text-align:left!important;white-space:normal!important;word-break:break-word;overflow-wrap:anywhere;}
.lineo-doc-items .col-image{width:28mm;text-align:center!important;}
.lineo-doc-items .col-price{width:22mm;text-align:right!important;white-space:nowrap!important;}
.lineo-doc-items .col-unit{width:16mm;text-align:center!important;white-space:nowrap!important;}
.lineo-doc-items .col-qty{width:14mm;text-align:center!important;white-space:nowrap!important;}
.lineo-doc-items .col-amount{width:27mm;text-align:right!important;white-space:normal!important;overflow-wrap:anywhere;}
.lineo-doc-items .col-remarks{width:44mm;text-align:left!important;}
.doc-item-img{max-width:20mm!important;max-height:20mm!important;width:auto!important;height:auto!important;object-fit:contain;border:1px solid #e5e7eb;border-radius:5px;background:#fff;padding:1mm;}
.lineo-doc-totals{width:68mm;margin-left:auto;margin-top:5mm;font-size:10px;}
.lineo-doc-totals>div{display:grid;grid-template-columns:1fr auto;gap:6mm;border-bottom:1px solid #edf1f7;padding:3mm 0;}
.lineo-doc-totals .grand{border-top:2px solid #111827;border-bottom:0;margin-top:2mm;font-size:15px;font-weight:900;}
.lineo-footer-line{height:2px;background:#111827;margin:10mm 0 5mm;break-inside:avoid;page-break-inside:avoid;}
.lineo-doc-footer{display:grid!important;grid-template-columns:1fr auto;gap:8px;align-items:center;font-size:9.5px;color:#64748b;max-width:100%;overflow:hidden;box-sizing:border-box;break-inside:avoid;page-break-inside:avoid;}
.lineo-doc-page-number{grid-column:1 / -1;text-align:center;margin-top:2mm;font-size:9px;color:#64748b;position:static!important;}
.dn-signature-grid{display:grid;grid-template-columns:1fr 1fr;gap:8mm;margin:12mm 0 8mm;break-inside:avoid;page-break-inside:avoid;}
.dn-signature-box{border:1px solid #d2d9e4;padding:5mm;min-height:32mm;}
.dn-signature-title{font-weight:900;margin-bottom:6mm;color:#0f172a;}
.dn-sign-row{display:grid;grid-template-columns:18mm 1fr;gap:4mm;align-items:end;margin-bottom:7mm;font-size:10px;color:#475569;}
.dn-sign-line{border-bottom:1px solid #94a3b8;height:7mm;}
.lineo-doc-notes{margin-top:6mm;font-size:10px;color:#334155;break-inside:avoid;page-break-inside:avoid;}.lineo-doc-notes strong{display:block;color:#0f172a;margin-bottom:2mm}.lineo-doc-notes p{margin:0;white-space:pre-wrap;line-height:1.45}
@page{size:A4;margin:0;}
@media print{
 html,body{width:210mm!important;min-height:297mm!important;margin:0!important;padding:0!important;background:#fff!important;}
 *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}
 .sidebar,.sidebar-backdrop,.topbar,.no-print,.invoice-preview-header,.invoice-form-panel,.settings-tabbar,.work-inbox-widget,.document-collab-card,.invoice-detail-actions{display:none!important;}
 .app-layout,.main-content,.content-body,.invoice-builder,.preview-bottom,.invoice-create-layout,.invoice-preview-panel,.invoice-preview,.invoice-preview-body,#quotationDetail,#invoiceDetail,#deliveryNoteDetail,#poDetail{display:block!important;margin:0!important;padding:0!important;width:210mm!important;max-width:210mm!important;background:#fff!important;box-shadow:none!important;border:0!important;overflow:visible!important;}
 .lineo-doc-wrapper{padding:0!important;margin:0!important;background:#fff!important;width:210mm!important;max-width:210mm!important;overflow:visible!important;}
 .lineo-doc-page,.lineo-print-page,.invoice-paper{width:210mm!important;max-width:210mm!important;min-height:297mm!important;margin:0!important;padding:12mm 14mm!important;box-shadow:none!important;border:0!important;overflow:hidden!important;}
 .lineo-doc-header{grid-template-columns:minmax(0,1fr) 98mm!important;gap:16mm!important;}
 .lineo-doc-items tr,.lineo-doc-items td,.lineo-doc-items th{break-inside:avoid!important;page-break-inside:avoid!important;}
 .lineo-doc-footer,.lineo-doc-page-number,.lineo-footer-line{break-inside:avoid!important;page-break-inside:avoid!important;}
 .lineo-doc-items .col-desc,.lineo-doc-items th:nth-child(2),.lineo-doc-items td:nth-child(2){text-align:left!important;}
 .lineo-doc-page-number,.page-number,.doc-page-number{position:static!important;left:auto!important;right:auto!important;bottom:auto!important;}
}
@media (max-width:900px){.lineo-doc-wrapper{padding:12px 0}.lineo-doc-page,.lineo-print-page{width:210mm!important;transform-origin:top left}.invoice-preview-body{overflow:auto}.lineo-doc-header{grid-template-columns:1fr 98mm!important}}
/* Work Inbox topbar stability */
.topbar{gap:14px;}.topbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:auto;}.topbar .work-inbox-widget{position:relative!important;top:auto!important;right:auto!important;z-index:20;order:80;}.topbar .work-inbox-button{width:40px;height:40px;box-shadow:none;}.topbar .work-inbox-dropdown{top:48px;right:0;}
body:not(.work-inbox-mounted) .work-inbox-widget{right:88px!important;top:18px!important;}
@media(max-width:700px){.topbar{align-items:flex-start;}.topbar-actions{width:100%;justify-content:flex-end}.topbar .work-inbox-dropdown{right:-8px;width:calc(100vw - 24px)}}
/* Status/error stability */
.status-invalid{outline:2px solid #dc2626!important;background:#fef2f2!important}.api-error-detail{font-family:ui-monospace,monospace;font-size:.82rem;color:#7f1d1d;white-space:pre-wrap}

/* ============================
   STEP 25B — Unified document visual style
   Quotation, Delivery Note, PO and Credit Note now use the same visual language as Invoice.
============================ */
.lineo-unified-wrapper{background:#f3f4f6;padding:32px;overflow-x:auto;}
.lineo-unified-page{font-family:var(--font-document, Inter, Manrope, Arial, sans-serif)!important;color:#333;}
.lineo-unified-page .lineo-title-block h1{font-size:15px;font-weight:800;color:#222;letter-spacing:.03em;text-transform:uppercase;}
.lineo-party-label{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#777;margin-bottom:6px!important;font-weight:800;}
.lineo-unified-items-table{table-layout:fixed;border-collapse:collapse;margin-top:12px;}
.lineo-unified-items-table thead{background:#f2f2f2;}
.lineo-unified-items-table th{padding:13px 10px!important;font-size:10.5px!important;text-align:left!important;font-weight:800!important;color:#222!important;border:0!important;}
.lineo-unified-items-table td{padding:20px 10px 10px!important;vertical-align:top!important;font-size:10.5px!important;color:#222!important;border:0!important;border-bottom:1px solid #eeeeee!important;line-height:1.45;}
.lineo-unified-items-table .lineo-col-no{width:38px;text-align:center!important;}
.lineo-unified-items-table .lineo-col-desc{text-align:left!important;white-space:pre-line;word-break:normal;overflow-wrap:anywhere;}
.lineo-unified-items-table .lineo-col-image{width:70px;text-align:center!important;}
.lineo-unified-items-table .lineo-col-price{width:82px;text-align:right!important;white-space:nowrap;}
.lineo-unified-items-table .lineo-col-unit{width:54px;text-align:center!important;}
.lineo-unified-items-table .lineo-col-qty{width:48px;text-align:right!important;}
.lineo-unified-items-table .lineo-col-amount{width:95px;text-align:right!important;white-space:normal;overflow-wrap:anywhere;}
.lineo-unified-items-table .lineo-col-remarks{width:150px;text-align:left!important;}
.lineo-unified-items-table .doc-item-img{max-width:58px;max-height:58px;object-fit:contain;border:1px solid #eee;border-radius:8px;background:#fff;}
.lineo-unified-totals{margin-top:55px!important;width:205px!important;}
.lineo-unified-signatures{margin-top:42px;display:grid;grid-template-columns:1fr 1fr;gap:36px;break-inside:avoid;page-break-inside:avoid;}
.lineo-unified-footer{break-inside:avoid;page-break-inside:avoid;}
.lineo-unified-page .lineo-note{font-size:10px;line-height:1.55;color:#777;}
.lineo-unified-page .lineo-page-number{bottom:8mm;}
@media print{
  .lineo-unified-wrapper{background:#fff!important;padding:0!important;margin:0!important;overflow:visible!important;}
  .lineo-unified-page{width:210mm!important;max-width:210mm!important;min-height:297mm!important;margin:0!important;padding:12mm 14mm!important;box-shadow:none!important;overflow:hidden!important;}
  .lineo-unified-items-table{font-size:9px!important;table-layout:fixed!important;}
  .lineo-unified-items-table th{padding:8px 7px!important;font-size:8.8px!important;}
  .lineo-unified-items-table td{padding:14px 7px 8px!important;font-size:9px!important;break-inside:avoid!important;page-break-inside:avoid!important;}
  .lineo-unified-items-table tr{break-inside:avoid!important;page-break-inside:avoid!important;}
  .lineo-unified-items-table .lineo-col-desc{text-align:left!important;}
  .lineo-unified-page .lineo-page-number{position:absolute!important;left:0!important;right:0!important;bottom:8mm!important;}
}

/* ============================
   Step 25C - Signature, roles and org chart polish
   ============================ */
.workflow-action-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.lineo-signature-stack{display:flex;gap:8px;flex-wrap:wrap;align-items:stretch;margin:12px 0}
.lineo-compact-signature{display:inline-flex;align-items:center;gap:8px;border:1px solid #d8dce4;border-radius:10px;padding:7px 10px;background:#fff;max-width:330px;box-shadow:0 4px 14px rgba(17,24,39,.05)}
.lineo-compact-signature .lineo-sig-mark{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#111827;color:#fff;font-size:12px;font-weight:800;letter-spacing:.03em;flex:0 0 30px}
.lineo-compact-signature.lineo-initial-signature .lineo-sig-mark{background:#f4f0e7;color:#4b3a21;border:1px solid #d8c9ad}
.lineo-sig-details{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.lineo-sig-details strong{font-size:12px;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lineo-sig-details span,.lineo-sig-kind{font-size:9.5px;color:#6b7280;text-transform:none}
.lineo-sig-kind{text-transform:uppercase;letter-spacing:.06em;font-weight:700;color:#8a6b38}
.lineo-signature-chip-row{display:inline-flex;gap:6px;align-items:center;flex-wrap:wrap}
.lineo-signature-chip{border:1px solid #d8dce4;border-radius:999px;padding:6px 10px;font-size:12px;background:#fff;color:#6b7280;font-weight:700}
.lineo-signature-chip.done{border-color:#b7dfc3;background:#effaf2;color:#1f7a3b}
.signature-permission-box{display:grid;gap:8px;margin-top:10px;padding:12px;border:1px solid var(--border-color,#e5e7eb);border-radius:14px;background:#fafafa}
.sub-permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 6px 18px;color:#6b7280;font-size:.9rem}
.segmented-control{display:flex;gap:4px;border:1px solid var(--border-color,#e5e7eb);border-radius:999px;padding:4px;background:#fff}
.segmented-btn{border:0;background:transparent;border-radius:999px;padding:8px 14px;font-weight:700;cursor:pointer;color:#6b7280}
.segmented-btn.active{background:#111827;color:#fff}
.org-chart-wrap{overflow:auto;padding:24px;min-height:240px;background:linear-gradient(180deg,#fff,#fafafa);border-radius:16px;border:1px solid var(--border-color,#e5e7eb)}
.org-chart ul{padding-top:20px;position:relative;display:flex;justify-content:center;gap:18px;list-style:none;margin:0}
.org-chart li{text-align:center;position:relative;padding:20px 6px 0 6px}
.org-chart li::before,.org-chart li::after{content:'';position:absolute;top:0;right:50%;border-top:1px solid #d1d5db;width:50%;height:20px}
.org-chart li::after{right:auto;left:50%;border-left:1px solid #d1d5db}
.org-chart li:only-child::before,.org-chart li:only-child::after{display:none}
.org-chart li:first-child::before,.org-chart li:last-child::after{border:0}
.org-chart li:last-child::before{border-right:1px solid #d1d5db;border-radius:0 8px 0 0}
.org-chart li:first-child::after{border-radius:8px 0 0 0}
.org-chart ul ul::before{content:'';position:absolute;top:0;left:50%;border-left:1px solid #d1d5db;width:0;height:20px}
.org-node{min-width:170px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:12px;display:inline-flex;align-items:center;flex-direction:column;gap:3px;box-shadow:0 8px 24px rgba(17,24,39,.06)}
.org-avatar{width:38px;height:38px;border-radius:50%;background:#111827;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;margin-bottom:4px}
.org-node strong{font-size:13px;color:#111827}.org-node span{font-size:11px;color:#8a6b38;font-weight:700}.org-node small{font-size:10px;color:#6b7280;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;margin-top:12px}.permission-pill{display:flex;gap:8px;align-items:center;border:1px solid #e5e7eb;border-radius:12px;padding:9px 10px;background:#fff;font-size:12px}.modal-wide{max-width:980px}.profile-signature-card{margin-top:16px;border:1px solid #e5e7eb;border-radius:14px;padding:14px;background:#fff}
@media print{.lineo-compact-signature{box-shadow:none;break-inside:avoid}.lineo-signature-stack{break-inside:avoid}.org-chart-wrap,.segmented-control{display:none!important}}

/* Step 26 - stamp removed, sleek signature and email settings */
.lineo-stamp,.lineo-footer-right img[src*="stamp"]{display:none!important;}
.linsys-script-signature{width:300px;max-width:100%;margin:18px 0 8px;color:#111827;}
.linsys-script-signature .smart-esign-script{border-bottom:1px solid #d7dde6;padding:0 0 6px;}
.linsys-script-signature .smart-esign-script-name{font-family:"Segoe Script","Brush Script MT","Lucida Handwriting",cursive;font-size:31px;line-height:1;color:#0f172a;letter-spacing:.01em;transform:rotate(-.8deg);font-weight:400;}
.linsys-script-signature .smart-esign-script-meta{font-family:Inter,Arial,sans-serif;font-size:9.5px;color:#64748b;letter-spacing:.03em;text-transform:uppercase;margin-top:5px;}
.email-status-card{border:1px solid var(--gray-200,#e5e7eb);border-radius:12px;background:#fff;padding:12px 14px;font-weight:700;color:#64748b;}
.email-status-card.ok{border-color:#bbf7d0;background:#f0fdf4;color:#15803d;}
.email-status-card.warn{border-color:#fde68a;background:#fffbeb;color:#a16207;}
@media print{.linsys-script-signature{width:280px!important;margin-top:10px!important}.linsys-script-signature .smart-esign-script-name{font-size:28px!important}.linsys-script-signature .smart-esign-script-meta{font-size:8.5px!important;color:#475569!important}}

/* Step 26 hotfix - keep document signature inside the Authorized Sign footer area */
.lineo-footer-left .lineo-signature-stack-in-footer{margin:4px 0 14px;display:block;}
.lineo-footer-left .lineo-signature-stack-in-footer .linsys-script-signature{margin:0 0 4px;}
.lineo-footer-left .lineo-signature-stack-in-footer .smart-esign-stack{margin-bottom:6px;}
@media print{.lineo-footer-left .lineo-signature-stack-in-footer{margin:2px 0 10px!important;}}

/* Step 26.1 - compact approval/signing action panel */
.linsys-approval-card{border:1px solid #e5e7eb;box-shadow:0 10px 24px rgba(15,23,42,.05);}
.linsys-approval-panel{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;}
.linsys-approval-main{display:flex;align-items:center;gap:14px;min-width:0;flex-wrap:wrap;}
.linsys-approval-title{display:flex;align-items:center;gap:8px;min-width:0;}
.linsys-approval-title span{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#64748b;font-weight:800;}
.linsys-approval-title strong{font-size:13px;text-transform:capitalize;border:1px solid #dbe2ea;background:#f8fafc;border-radius:999px;padding:5px 10px;color:#0f172a;white-space:nowrap;}
.linsys-approval-sub{display:flex;align-items:center;gap:6px;}
.linsys-approval-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.compact-signature-chips .lineo-signature-chip{padding:5px 9px;font-size:11px;}
.linsys-more-actions{position:relative;display:inline-block;}
.linsys-more-actions summary{list-style:none;cursor:pointer;}
.linsys-more-actions summary::-webkit-details-marker{display:none;}
.linsys-more-actions-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:30;display:grid;gap:6px;min-width:190px;padding:8px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 18px 40px rgba(15,23,42,.16);}
.linsys-more-actions-menu .btn{justify-content:flex-start;text-align:left;width:100%;}
@media (max-width:760px){.linsys-approval-panel{align-items:flex-start;flex-direction:column}.linsys-approval-actions{width:100%;justify-content:flex-start}.linsys-more-actions-menu{left:0;right:auto}}
@media print{.linsys-approval-card{display:none!important}}

/* Step 26.2 - signature sizing and initial placement polish */
.lineo-invoice-page,
.lineo-unified-page,
.lineo-commercial-page,
.lineo-doc-page,
.invoice-paper{position:relative;}
.lineo-footer-left .lineo-signature-stack-in-footer .linsys-script-main{width:240px;transform:scale(.8);transform-origin:left top;margin-bottom:-8px;}
.lineo-footer-left .lineo-signature-stack-in-footer .linsys-script-main .smart-esign-script-name{font-size:31px;}
.linsys-initial-corner{position:absolute;right:14mm;bottom:14mm;z-index:4;pointer-events:none;text-align:right;}
.linsys-initial-corner .linsys-script-initial{width:150px;transform:scale(.5);transform-origin:right bottom;margin:0;}
.linsys-initial-corner .linsys-script-initial .smart-esign-script{border-bottom:1px solid #cbd5e1;}
.linsys-initial-corner .linsys-script-initial .smart-esign-script-name{font-size:26px;line-height:1;}
.linsys-initial-corner .linsys-script-initial .smart-esign-script-meta{font-size:8px;white-space:nowrap;}
@media print{
  .lineo-footer-left .lineo-signature-stack-in-footer .linsys-script-main{width:224px!important;transform:scale(.8)!important;transform-origin:left top!important;margin-bottom:-8px!important;}
  .linsys-initial-corner{right:14mm!important;bottom:14mm!important;}
  .linsys-initial-corner .linsys-script-initial{width:140px!important;transform:scale(.5)!important;transform-origin:right bottom!important;}
}


/* ============================
   STEP 26.3 UX polish
   ============================ */
.linsys-toast-center{position:fixed;inset:0;z-index:5000;display:flex;align-items:center;justify-content:center;pointer-events:none;padding:24px;}
.linsys-toast{min-width:min(420px,92vw);max-width:560px;display:flex;gap:10px;align-items:flex-start;padding:16px 18px;border-radius:18px;background:#fff;border:1px solid #e5e7eb;box-shadow:0 24px 70px rgba(15,23,42,.24);opacity:0;transform:translateY(8px) scale(.96);transition:.22s ease;color:#111827;}
.linsys-toast.show{opacity:1;transform:translateY(0) scale(1);}
.linsys-toast strong{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;min-width:68px;}
.linsys-toast span{font-size:.95rem;line-height:1.35;}
.linsys-toast-success{border-left:5px solid #10b981}.linsys-toast-danger{border-left:5px solid #ef4444}.linsys-toast-warning{border-left:5px solid #f59e0b}.linsys-toast-info{border-left:5px solid #3b82f6}
.alert-info{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}.alert-warning{background:#fffbeb;color:#92400e;border:1px solid #fde68a}
.card,.card-body,.invoice-preview-body,.content-body,.table-container{overflow:visible;}
.data-table{position:relative;z-index:1;}
.linsys-more-actions{position:relative;z-index:2000;}
.linsys-more-actions[open]{z-index:4500;}
.linsys-more-actions-menu{z-index:4600!important;}
.quote-desc-cell{min-width:360px;width:48%;}.quote-desc-input{min-height:58px;resize:vertical;}.quote-img-cell{width:118px;max-width:118px;}.quote-img-upload.compact{display:grid;gap:4px;align-items:center}.quote-img-input{font-size:.72rem;padding:6px}.quote-thumb{width:46px;height:46px;object-fit:cover;border-radius:8px;border:1px solid #e5e7eb}.quote-img-upload small{font-size:.68rem;color:#6b7280;max-width:105px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.quotation-line-row td{vertical-align:top}.revision-pill{display:inline-flex;padding:2px 8px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:.72rem;margin-top:4px}.external-quotation-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:18px;box-shadow:0 12px 30px rgba(15,23,42,.06)}.external-quotation-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:14px}.external-quotation-head h3{margin:0 0 4px}.external-quotation-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:16px}.external-quotation-meta div{background:#f9fafb;border:1px solid #eef2f7;border-radius:12px;padding:10px}.external-quotation-meta strong,.external-quotation-meta span{display:block}.external-quotation-meta strong{font-size:.72rem;color:#6b7280;text-transform:uppercase;letter-spacing:.04em}.external-pdf-preview{width:100%;height:720px;border:1px solid #e5e7eb;border-radius:14px;background:#f3f4f6}.external-image-preview{max-width:100%;border-radius:14px;border:1px solid #e5e7eb}.cn-invoice-preview{margin:10px 0}.supplier-status-blacklisted{background:#111827!important;color:#fff!important}.blacklist-reason{display:block;color:#991b1b;font-size:.75rem;margin-top:4px}.org-chart-wrap{overflow:auto;padding:18px;background:linear-gradient(180deg,#f8fafc,#fff);border-radius:18px;min-height:360px}.org-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px}.org-tree{display:flex;gap:28px;align-items:flex-start}.org-node{display:flex;flex-direction:column;align-items:center;position:relative}.org-card{display:flex;gap:10px;align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:12px;min-width:260px;box-shadow:0 12px 25px rgba(15,23,42,.08)}.org-avatar{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:#111827;color:#fff;font-weight:700}.org-main{display:grid;gap:2px;flex:1}.org-main span,.org-main small{color:#6b7280;font-size:.78rem}.org-main label{font-size:.72rem;color:#4b5563;margin-top:6px}.form-control-sm{font-size:.75rem;padding:5px 7px;height:auto}.org-children{display:flex;gap:18px;margin-top:28px;position:relative}.org-children:before{content:'';position:absolute;top:-16px;left:8%;right:8%;height:1px;background:#cbd5e1}.org-children>.org-node:before{content:'';position:absolute;top:-28px;left:50%;height:28px;width:1px;background:#cbd5e1}.template-mini-preview{min-height:170px;border:1px solid #e5e7eb;border-radius:18px;padding:14px;background:#fff;box-shadow:inset 0 0 0 999px rgba(249,250,251,.45);transition:.2s}.tmp-head{display:flex;justify-content:space-between;font-size:.72rem;color:#6b7280;text-transform:uppercase}.tmp-title{font-weight:800;font-size:1.1rem;margin:14px 0}.tmp-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.tmp-grid i,.tmp-lines b,.tmp-total{display:block;background:#e5e7eb;border-radius:6px;height:12px}.tmp-lines{display:grid;gap:7px;margin-top:14px}.tmp-total{width:45%;height:18px;margin-left:auto;margin-top:14px;background:#111827}.template-mini-classic{font-family:Georgia,serif;border-color:#d1d5db}.template-mini-classic .tmp-title{text-align:center;border-top:1px solid #111827;border-bottom:1px solid #111827;padding:8px 0}.template-mini-classic .tmp-total{background:#6b7280}.template-mini-compact{padding:10px;min-height:130px}.template-mini-compact .tmp-title{font-size:.9rem;margin:8px 0}.template-mini-compact .tmp-grid{grid-template-columns:1fr 1fr 1fr 1fr}.template-mini-modern{border-top:5px solid #111827}
@media(max-width:900px){.quote-desc-cell{min-width:240px}.external-quotation-meta{grid-template-columns:1fr}.external-pdf-preview{height:520px}.org-tree,.org-children{flex-direction:column}.org-children:before,.org-children>.org-node:before{display:none}}

.settings-link-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.settings-link-card{display:block;text-decoration:none;color:#111827;border:1px solid #e5e7eb;border-radius:16px;padding:16px;background:#fff;box-shadow:0 8px 20px rgba(15,23,42,.04);transition:.18s}.settings-link-card:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(15,23,42,.08);border-color:#cbd5e1}.settings-link-card strong,.settings-link-card span{display:block}.settings-link-card span{color:#6b7280;font-size:.86rem;margin-top:5px}

/* Step 26.3.1 hotfix - keep approval More dropdown above document preview */
.card.linsys-approval-card,
.erp-production-ui .card.linsys-approval-card{
  overflow:visible !important;
  position:relative !important;
  z-index:12000 !important;
}
.linsys-approval-card .linsys-approval-panel,
.linsys-approval-card .linsys-approval-actions,
.linsys-approval-card .linsys-more-actions{
  overflow:visible !important;
}
.linsys-more-actions[open]{
  position:relative !important;
  z-index:13000 !important;
}
.linsys-more-actions[open] .linsys-more-actions-menu{
  display:grid !important;
  position:absolute !important;
  z-index:14000 !important;
}
.invoice-preview-body,
.lineo-doc-wrapper,
.lineo-print-wrapper{
  position:relative;
  z-index:1;
}

/* Step 26.4 - Workflow/role/quotation UI refinements */
.linsys-approval-card-v264{position:relative;z-index:80;overflow:visible!important}.linsys-approval-card-v264 .linsys-approval-panel{align-items:center}.linsys-pending-with{display:inline-flex;align-items:center;gap:4px;margin-left:10px;padding:4px 9px;border-radius:999px;background:#fff7ed;color:#9a3412;font-size:.75rem;font-weight:800}.linsys-approval-hint{font-size:.82rem;color:#64748b;margin-top:6px}.linsys-approval-card-v264 .linsys-more-actions{position:relative;z-index:9999}.linsys-approval-card-v264 .linsys-more-actions-menu{z-index:10000;min-width:210px}.quote-desc-cell{min-width:420px;width:44%}.quote-img-cell{width:92px!important;max-width:92px!important}.quote-img-upload.compact{max-width:86px}.quote-img-input{max-width:86px;font-size:.66rem}.quote-thumb{width:42px!important;height:42px!important}.quote-img-upload small{max-width:84px!important}.quote-price-cell{width:132px!important;min-width:132px}.quote-unit-cell{width:112px!important;min-width:112px}.quote-qty-cell{width:104px!important;min-width:104px}.quote-amount-cell{width:112px!important;min-width:112px}.role-permission-group{border:1px solid var(--border-color,#e5e7eb);border-radius:16px;background:#fff;padding:14px;margin-bottom:12px}.role-permission-group h4{margin:0 0 10px;font-size:.85rem;text-transform:uppercase;letter-spacing:.06em;color:#334155}.role-permission-group>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.role-permission-group label{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;background:#f8fafc;font-weight:700;font-size:.82rem}.role-permission-group input{accent-color:#111827}@media(max-width:900px){.quote-desc-cell{min-width:260px}.quote-price-cell,.quote-unit-cell,.quote-qty-cell{min-width:95px}.role-permission-group>div{grid-template-columns:1fr}.linsys-approval-card-v264 .linsys-approval-panel{align-items:flex-start}.linsys-pending-with{margin-left:0;margin-top:6px}}

/* ============================
   Step 26.5 - Final workflow/layout stabilization
   ============================ */
.workflow-settings-table th:nth-child(7),
.workflow-settings-table td:nth-child(7){min-width:145px;}
.workflow-settings-table .switch-row{white-space:normal;line-height:1.25;}

/* Keep the quotation editor inside the viewport without breaking the More dropdown on view pages. */
body.document-create-page{max-width:100%;overflow-x:hidden;}
.document-create-page .main-content,.document-create-page .content-body,.document-create-page .invoice-builder,.document-create-page .invoice-form-panel,.document-create-page .invoice-create-layout{max-width:100%;min-width:0;box-sizing:border-box;}
.document-create-page .table-container,
.quotation-create-page .table-container,
.delivery-note-create-page .table-container,
.purchase-order-create-page .table-container,
#quotationItemsTable.closest-table-container{max-width:100%;overflow-x:hidden!important;}
.invoice-items-table{width:100%;table-layout:fixed;}
.invoice-items-table th,.invoice-items-table td{padding:8px 8px;}
.invoice-items-table input,.invoice-items-table textarea,.invoice-items-table select,.invoice-items-table .form-control{min-width:0;max-width:100%;box-sizing:border-box;}
#quotationItemsTable .quote-desc-cell{min-width:0!important;width:42%!important;}
#quotationItemsTable .quote-img-cell{width:92px!important;max-width:92px!important;}
#quotationItemsTable .quote-price-cell{width:128px!important;min-width:128px!important;}
#quotationItemsTable .quote-unit-cell{width:104px!important;min-width:104px!important;}
#quotationItemsTable .quote-qty-cell{width:104px!important;min-width:104px!important;}
#quotationItemsTable .quote-amount-cell{width:108px!important;min-width:108px!important;}
#quotationItemsTable .actions{width:88px!important;min-width:88px!important;}

/* Professional org chart cards */
.org-card-clickable{cursor:pointer;text-align:left;border:1px solid #e2e8f0;background:linear-gradient(180deg,#fff,#f8fafc);transition:.18s ease;width:100%;}
.org-card-clickable:hover{transform:translateY(-1px);border-color:#cbd5e1;box-shadow:0 16px 34px rgba(15,23,42,.12)}
.org-card-clickable .org-avatar img,.org-avatar-lg img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block;}
.org-main em{font-size:.68rem;font-style:normal;color:#64748b;background:#f1f5f9;border-radius:999px;padding:2px 8px;display:inline-flex;width:max-content;margin-top:3px;}
.org-reporting-label{display:block;margin-top:8px;font-size:.72rem;color:#475569;min-width:260px;}
.org-print-head{display:none;margin-bottom:22px;padding-bottom:12px;border-bottom:1px solid #e5e7eb;}
.org-print-head strong,.org-print-head span{display:block}.org-print-head strong{font-size:1.35rem;color:#111827}.org-print-head span{color:#64748b;font-size:.85rem}.org-avatar-lg{width:76px!important;height:76px!important;border-radius:20px!important;font-size:1.6rem!important}.org-profile-view{display:flex;gap:16px;align-items:center;margin-bottom:16px}.org-profile-view h2{margin:0 0 4px}.org-profile-view p{margin:0 0 4px;color:#8a6b38;font-weight:800}.org-tree-v265{align-items:flex-start;}

@media print{
  body.print-org-chart .sidebar,
  body.print-org-chart .topbar,
  body.print-org-chart .settings-tabbar,
  body.print-org-chart .segmented-control,
  body.print-org-chart .org-toolbar,
  body.print-org-chart [data-users-view="list"],
  body.print-org-chart .modal-overlay,
  body.print-org-chart .no-print{display:none!important;}
  body.print-org-chart .app-layout,
  body.print-org-chart .main-content,
  body.print-org-chart .content-body,
  body.print-org-chart .card,
  body.print-org-chart .card-body,
  body.print-org-chart #usersOrgChart{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;box-shadow:none!important;border:0!important;overflow:visible!important;background:#fff!important;}
  body.print-org-chart .org-print-head{display:block!important;}
  body.print-org-chart .org-tree{display:flex!important;gap:18px!important;overflow:visible!important;}
  body.print-org-chart .org-card{box-shadow:none!important;break-inside:avoid!important;page-break-inside:avoid!important;}
  body.print-org-chart .org-reporting-label{display:none!important;}
}


/* ============================
   Step 26.5.1 - targeted horizontal scroll + signatory UI refinement
   ============================ */
/* Allow admin/configuration matrix screens to scroll horizontally when they have many columns. */
#rolesMatrix.table-container,
#rolesMatrix,
.table-responsive {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
}
#rolesMatrix .role-matrix-table,
#rolesMatrix table {
    min-width: 1320px;
    width: max-content;
}
.workflow-settings-table {
    min-width: 1180px;
    width: max-content;
}
#rolesMatrix::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar { height: 10px; }
#rolesMatrix::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

/* Keep horizontal clipping limited to create/edit document entry pages only. */
body.document-create-page {
    overflow-x: hidden !important;
}
body.document-create-page .invoice-items-table,
body.document-create-page .data-table {
    table-layout: fixed;
}
body.document-create-page .table-container {
    overflow-x: hidden !important;
}
body:not(.document-create-page) .content-body {
    overflow: visible;
}

/* Refined Authorized Signatory modal permission picker. */
.signatory-permission-wizard {
    padding: 0;
    border: 0;
    background: transparent;
    display: grid;
    gap: 14px;
}
.signatory-help-card {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: linear-gradient(180deg,#f8fafc,#fff);
}
.signatory-help-card strong,
.sig-section-title strong,
.sig-master-toggle strong,
.sig-option-card strong {
    color: #111827;
}
.signatory-help-card span,
.sig-section-title small,
.sig-master-toggle small,
.sig-option-card small {
    color: #64748b;
    font-size: .82rem;
    line-height: 1.35;
}
.sig-permission-section {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 8px 20px rgba(15,23,42,.035);
}
.sig-permission-primary {
    border-color: #dbeafe;
    background: linear-gradient(180deg,#f8fbff,#fff);
}
.sig-master-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 12px;
    cursor: pointer;
}
.sig-master-toggle > span,
.sig-option-card > span,
.sig-doc-card > span {
    display: grid;
    gap: 3px;
}
.sig-master-toggle input,
.sig-option-card input,
.sig-doc-card input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #111827;
    flex: 0 0 auto;
}
.sig-section-title {
    display: grid;
    gap: 3px;
    margin-bottom: 12px;
}
.sig-sub-options {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}
.sig-option-card,
.sig-doc-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    padding: 11px 12px;
    cursor: pointer;
    transition: .16s ease;
}
.sig-option-card:hover,
.sig-doc-card:hover {
    border-color: #cbd5e1;
    background: #fff;
}
.sig-option-card:has(input:checked),
.sig-doc-card:has(input:checked) {
    border-color: #bae6fd;
    background: #f0f9ff;
    box-shadow: inset 0 0 0 1px rgba(14,165,233,.18);
}
.sig-doc-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}
.sig-doc-card {
    align-items: center;
}
.sig-doc-card span {
    font-weight: 800;
    color: #111827;
}
@media(max-width:720px){
    .sig-sub-options,
    .sig-doc-grid { grid-template-columns: 1fr; }
}

/* Step 26.5.2 - Sidebar account menu, Lufga Light section labels and account profile */
.nav-section-title,
.nav-group-title {
    font-family: var(--ls-font, Inter, Manrope, Arial, sans-serif);
    font-weight: 300 !important;
    letter-spacing: .08em;
}
.nav-group-title-sub { padding-top: 8px; }
.account-menu-wrap { position: relative; }
.user-info-button {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 14px;
    text-align: left;
    transition: background .18s ease;
}
.user-info-button:hover { background: rgba(255,255,255,.08); }
.user-info-button .user-meta { min-width: 0; flex: 1; }
.user-info-button .user-name,
.user-info-button .user-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-caret { color: rgba(255,255,255,.55); margin-left: auto; font-size: 1.05rem; }
.user-avatar-live { position: relative; overflow: visible; }
.user-avatar-live img,
.profile-avatar-large img,
.org-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    display: block;
}
.online-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #22c55e;
    border: 2px solid #111827;
    box-shadow: 0 0 0 2px rgba(34,197,94,.16);
}
.online-dot-large { width: 16px; height: 16px; border-color: #fff; right: 10px; bottom: 10px; }
.account-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    background: #fff;
    color: var(--gray-800);
    border: 1px solid rgba(148,163,184,.28);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15,23,42,.28);
    overflow: hidden;
    z-index: 4100;
}
.account-dropdown.show { display: block; }
.account-dropdown-head { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); background: linear-gradient(135deg,#f8fafc,#fff); }
.account-dropdown-head strong,
.account-dropdown-head small { display: block; }
.account-dropdown-head small { color: var(--gray-500); margin-top: 3px; word-break: break-all; }
.account-dropdown-head span { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .78rem; color: #15803d; font-weight: 700; }
.account-dropdown-head i { width: 8px; height: 8px; border-radius: 999px; background: #22c55e; display: inline-block; }
.account-dropdown a,
.account-dropdown button {
    display: flex;
    width: 100%;
    border: 0;
    background: #fff;
    color: var(--gray-700);
    text-decoration: none;
    padding: 11px 16px;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    gap: 8px;
}
.account-dropdown a:hover,
.account-dropdown button:hover { background: #f8fafc; color: var(--gray-900); }
.account-page .card { margin-bottom: 18px; }
.account-hero-card { overflow: visible; }
.account-profile-card { align-self: start; position: sticky; top: 18px; }
.profile-avatar-upload-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto 12px; }
.profile-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    overflow: hidden;
}
.account-upload-block { margin-top: 14px; display: grid; gap: 6px; justify-items: center; }
.account-upload-block small { color: var(--gray-500); font-size: .75rem; }
@media(max-width: 920px){ .account-profile-card { position: static; } }

/* ============================
   STEP 26.6 — A4 print quality and generated document consistency
   Applies to Quotation, Invoice, DN, PO and Credit Note generated by LinSys.
============================ */
.lineo-paged-wrapper{background:#f3f4f6;padding:32px;display:grid;gap:24px;justify-items:center;overflow-x:auto;}
.lineo-paged-page{position:relative;width:210mm;min-height:297mm;background:#fff;padding:14mm 14mm 16mm;box-shadow:0 14px 42px rgba(15,23,42,.12);border-radius:0;overflow:hidden;box-sizing:border-box;}
.lineo-266-header{display:grid;grid-template-columns:1.1fr 1.25fr .8fr .95fr;gap:16px;align-items:start;min-height:27mm;}
.lineo-266-header.compact{grid-template-columns:1fr 1.15fr .8fr .95fr .9fr;min-height:20mm;}
.lineo-266-title-block h1{font-size:14px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;margin:0 0 7px;color:#111827;}
.lineo-266-title-block p,.lineo-266-contact-block p,.lineo-266-address-block p{margin:0 0 4px;font-size:10px;line-height:1.35;color:#374151;}
.lineo-266-logo-block .lineo-logo{max-width:43mm;max-height:18mm;object-fit:contain;}
.lineo-266-logo-block .lineo-website{font-size:10px;margin-top:4px;color:#4b5563;}
.lineo-266-continued{text-align:right;font-size:10px;color:#4b5563;}
.lineo-266-continued strong,.lineo-266-continued span{display:block;}
.lineo-266-line{border-top:2px solid #111827;margin:8mm 0 5mm;}
.lineo-266-info-grid{display:grid;grid-template-columns:1.05fr 1.55fr;gap:26px;margin-bottom:7mm;}
.lineo-266-info-grid .lineo-client-box p,.lineo-266-info-grid .lineo-meta-grid p{font-size:10.2px;line-height:1.4;margin:0 0 4px;}
.lineo-266-info-grid .lineo-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 28px;}
.lineo-266-subject{display:grid;grid-template-columns:34mm 1fr;gap:10px;border:1px solid #eef0f3;border-radius:10px;padding:7px 10px;margin:-2mm 0 6mm;font-size:10px;}
.lineo-266-subject strong{text-transform:uppercase;letter-spacing:.06em;color:#6b7280;}
.lineo-266-subject span{white-space:pre-wrap;color:#111827;}
.lineo-266-items-table{width:100%;table-layout:fixed;border-collapse:collapse;margin-top:0!important;}
.lineo-266-items-table thead{display:table-header-group;background:#f3f4f6;}
.lineo-266-items-table tr{break-inside:avoid;page-break-inside:avoid;}
.lineo-266-items-table th{padding:8px 7px!important;font-size:8.6px!important;line-height:1.2;text-transform:none;color:#374151!important;white-space:nowrap;}
.lineo-266-items-table td{padding:8px 7px!important;font-size:9px!important;line-height:1.32;border-bottom:1px solid #eef0f3!important;vertical-align:top!important;color:#1f2937!important;}
.lineo-266-items-table .lineo-col-no{width:8mm;text-align:center!important;}
.lineo-266-items-table .lineo-col-desc{width:auto;text-align:left!important;white-space:pre-line;overflow-wrap:break-word;word-break:normal;}
.lineo-266-items-table .lineo-col-image{width:24mm;text-align:center!important;}
.lineo-266-items-table .lineo-col-price{width:23mm;text-align:right!important;white-space:nowrap;}
.lineo-266-items-table .lineo-col-unit{width:15mm;text-align:center!important;white-space:nowrap;}
.lineo-266-items-table .lineo-col-qty{width:15mm;text-align:right!important;white-space:nowrap;}
.lineo-266-items-table .lineo-col-amount{width:28mm;text-align:right!important;white-space:nowrap!important;overflow-wrap:normal!important;word-break:keep-all!important;}
.lineo-266-items-table .lineo-col-amount span{white-space:nowrap!important;display:inline-block;}
.lineo-266-items-table .lineo-col-remarks{width:34mm;text-align:left!important;}
.lineo-266-items-table .doc-item-img{max-width:18mm!important;max-height:16mm!important;object-fit:contain;border:1px solid #e5e7eb;border-radius:6px;background:#fff;}
.lineo-266-totals{width:49mm!important;margin:7mm 0 0 auto!important;font-size:10px!important;break-inside:avoid;page-break-inside:avoid;}
.lineo-266-totals .lineo-total-row{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px!important;white-space:nowrap;}
.lineo-266-totals .lineo-grand-total{border-top:1px solid #111827;padding-top:6px;margin-top:4px;}
.lineo-266-dn-signatures{margin-top:8mm!important;break-inside:avoid;page-break-inside:avoid;}
.lineo-paged-page .lineo-footer-line{border-top:2px solid #111827;margin:8mm 0 4mm!important;break-inside:avoid;page-break-inside:avoid;}
.lineo-paged-page .lineo-footer{padding-top:0!important;display:grid;grid-template-columns:1.4fr .6fr;gap:24px;break-inside:avoid;page-break-inside:avoid;}
.lineo-paged-page .lineo-footer-left p{font-size:9.5px;line-height:1.45;margin:0 0 5px;color:#4b5563;}
.lineo-paged-page .lineo-signature-space{height:28mm;}
.lineo-266-doc-note,.lineo-266-bank{margin-top:4mm;font-size:9.5px;color:#4b5563;}
.lineo-266-doc-note p,.lineo-266-bank p{margin:2px 0!important;}
.lineo-paged-page .lineo-note{max-width:none;margin-top:6mm;font-size:8.6px;line-height:1.45;color:#6b7280;break-inside:avoid;page-break-inside:avoid;}
.lineo-paged-page .lineo-page-number{position:absolute;left:0;right:0;bottom:6mm;text-align:center;font-weight:800;font-size:9.2px;color:#111827;}
.lineo-terms-page .lineo-terms-content{font-size:10px;line-height:1.58;color:#1f2937;}
.lineo-terms-page .lineo-terms-content h2{font-size:15px;letter-spacing:.08em;margin:0 0 8mm;text-align:left;}
.lineo-terms-page .lineo-terms-content p{white-space:normal;margin:0;}
/* Safety net for older document renderers that may still be used in cached pages. */
.lineo-items-table .lineo-col-amount,.lineo-items-table td:last-child,.lineo-doc-items td:last-child{white-space:nowrap!important;overflow-wrap:normal!important;word-break:keep-all!important;}
.lineo-unified-totals,.lineo-totals{margin-top:12mm!important;}
.lineo-unified-items-table .lineo-col-amount{white-space:nowrap!important;overflow-wrap:normal!important;word-break:keep-all!important;}
@media print{
  @page{size:A4;margin:0;}
  html,body{width:210mm!important;background:#fff!important;overflow:visible!important;}
  .sidebar,.topbar,.invoice-detail-actions,.no-print,button,.work-inbox-widget{display:none!important;}
  .app-layout,.main-content,.content-body{display:block!important;margin:0!important;padding:0!important;background:#fff!important;width:210mm!important;max-width:210mm!important;overflow:visible!important;}
  .lineo-paged-wrapper{display:block!important;background:#fff!important;padding:0!important;margin:0!important;gap:0!important;overflow:visible!important;}
  .lineo-paged-page{width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;margin:0!important;padding:12mm 13mm 15mm!important;box-shadow:none!important;border:0!important;page-break-after:always!important;break-after:page!important;overflow:hidden!important;}
  .lineo-paged-page:last-child{page-break-after:auto!important;break-after:auto!important;}
  .lineo-266-header{min-height:22mm;gap:12px;}
  .lineo-266-header.compact{min-height:17mm;}
  .lineo-266-line{margin:6mm 0 4mm;}
  .lineo-266-info-grid{gap:20px;margin-bottom:5mm;}
  .lineo-266-items-table th{padding:6px 6px!important;font-size:8.2px!important;}
  .lineo-266-items-table td{padding:6px 6px!important;font-size:8.5px!important;line-height:1.25;}
  .lineo-266-items-table .doc-item-img{max-width:16mm!important;max-height:14mm!important;}
  .lineo-266-totals{margin-top:6mm!important;}
  .lineo-paged-page .lineo-footer-line{margin:6mm 0 3.5mm!important;}
  .lineo-paged-page .lineo-note{margin-top:4mm;font-size:8.2px;}
  .lineo-paged-page .lineo-page-number{bottom:5mm;}
}
@media(max-width:980px){.lineo-paged-wrapper{justify-items:start}.lineo-paged-page{transform-origin:top left;}}

/* ============================
   STEP 26.6.1 — Document row density + continuation page cleanup
   Keeps non-final continuation pages cleaner and lets users choose row height.
============================ */
.doc-print-density{display:inline-flex;align-items:center;gap:8px;margin:0 4px;font-size:.82rem;color:#4b5563;font-weight:700;}
.doc-print-density span{white-space:nowrap;}
.doc-print-density select{height:42px;min-width:124px;padding:0 34px 0 12px;border-radius:14px;}
.lineo-continuation-footer{position:absolute;left:14mm;right:14mm;bottom:15mm;border-top:1px solid #e5e7eb;padding-top:3mm;text-align:right;font-size:8.8px;color:#9ca3af;letter-spacing:.03em;}
.lineo-continuation-footer span{display:inline-block;}
.lineo-paged-wrapper.print-density-compact .lineo-266-items-table td{padding:6px 6px!important;font-size:8.5px!important;line-height:1.22!important;}
.lineo-paged-wrapper.print-density-compact .lineo-266-items-table th{padding:6px 6px!important;}
.lineo-paged-wrapper.print-density-compact .lineo-266-items-table .doc-item-img{max-width:16mm!important;max-height:14mm!important;}
.lineo-paged-wrapper.print-density-standard .lineo-266-items-table tr{height:20mm;}
.lineo-paged-wrapper.print-density-standard .lineo-266-items-table td{padding:9px 7px!important;font-size:9.1px!important;line-height:1.34!important;}
.lineo-paged-wrapper.print-density-standard .lineo-266-items-table .doc-item-img{max-width:19mm!important;max-height:17mm!important;}
.lineo-paged-wrapper.print-density-spacious .lineo-266-items-table tr{height:24mm;}
.lineo-paged-wrapper.print-density-spacious .lineo-266-items-table td{padding:12px 8px!important;font-size:9.4px!important;line-height:1.42!important;}
.lineo-paged-wrapper.print-density-spacious .lineo-266-items-table .doc-item-img{max-width:22mm!important;max-height:20mm!important;}
.lineo-paged-wrapper.print-density-standard .lineo-266-items-table .lineo-col-image,
.lineo-paged-wrapper.print-density-spacious .lineo-266-items-table .lineo-col-image{vertical-align:middle!important;}
@media print{
  .doc-print-density{display:none!important;}
  .lineo-continuation-footer{left:13mm;right:13mm;bottom:13mm;}
  .lineo-paged-wrapper.print-density-compact .lineo-266-items-table td{padding:5.5px 6px!important;font-size:8.3px!important;line-height:1.2!important;}
  .lineo-paged-wrapper.print-density-standard .lineo-266-items-table td{padding:8px 7px!important;font-size:8.9px!important;line-height:1.31!important;}
  .lineo-paged-wrapper.print-density-spacious .lineo-266-items-table td{padding:10px 8px!important;font-size:9.2px!important;line-height:1.38!important;}
}

/* ============================
   Step 26.6.1A - Quotation input layout + account/company profile separation
============================ */
.company-profile-panel .card-header .page-subtitle{display:block;margin-top:4px;color:#6b7280;font-size:.85rem;font-weight:500;}
#createQuotationPage .table-container,
.quote-create-page .table-container,
.quotation-create-page .table-container{overflow-x:hidden!important;}
#quotationItemsTable .step2661-quote-line .quote-line-no{width:30px!important;min-width:30px!important;padding-left:4px!important;padding-right:4px!important;text-align:center;}
#quotationItemsTable .step2661-quote-line .quote-desc-cell{width:44%!important;min-width:0!important;padding-left:2px!important;}
#quotationItemsTable .step2661-quote-line .quote-img-cell{width:72px!important;min-width:72px!important;max-width:72px!important;padding-left:5px!important;padding-right:5px!important;}
#quotationItemsTable .step2661-quote-line .quote-price-cell{width:126px!important;min-width:126px!important;}
#quotationItemsTable .step2661-quote-line .quote-unit-cell{width:96px!important;min-width:96px!important;}
#quotationItemsTable .step2661-quote-line .quote-qty-cell{width:96px!important;min-width:96px!important;}
#quotationItemsTable .step2661-quote-line .quote-amount-cell{width:108px!important;min-width:108px!important;white-space:nowrap;}
#quotationItemsTable .step2661-quote-line .quote-row-actions{width:82px!important;min-width:82px!important;}
#quotationItemsTable .quote-desc-input{width:100%;min-height:54px;resize:vertical;}
.quote-img-icon-upload{display:flex!important;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;width:68px!important;max-width:68px!important;min-width:68px!important;overflow:hidden;}
.quote-upload-icon{width:34px;height:30px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #d8d0c6;border-radius:10px;background:#fff;color:#111827;font-weight:900;cursor:pointer;box-shadow:0 2px 8px rgba(15,23,42,.04);line-height:1;}
.quote-upload-icon:hover{background:#f8f6f2;border-color:#111827;}
.quote-img-icon-upload .quote-thumb{max-width:42px!important;max-height:34px!important;object-fit:contain;border:1px solid #e5e7eb;border-radius:6px;background:#fff;}
.quote-img-icon-upload small{display:block;max-width:64px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;font-size:.66rem;color:#6b7280;}
.quote-row-action-stack{display:flex;flex-direction:column;gap:6px;align-items:stretch;}
.quote-row-action-stack .btn{width:100%;justify-content:center;padding:6px 8px!important;font-size:.72rem!important;min-height:30px;border-radius:9px;}
.btn-danger-soft{border:1px solid #fecaca!important;background:#fff5f5!important;color:#991b1b!important;}
.btn-danger-soft:hover{background:#fee2e2!important;color:#7f1d1d!important;}
@media(max-width:1200px){
  #quotationItemsTable .step2661-quote-line .quote-desc-cell{width:38%!important;}
  #quotationItemsTable .step2661-quote-line .quote-price-cell{width:116px!important;min-width:116px!important;}
  #quotationItemsTable .step2661-quote-line .quote-unit-cell,
  #quotationItemsTable .step2661-quote-line .quote-qty-cell{width:86px!important;min-width:86px!important;}
}
.recycle-bin-page .data-table td{vertical-align:middle;}
.recycle-bin-page .doc-type-pill{text-transform:uppercase;letter-spacing:.05em;font-size:.7rem;}
.work-inbox-icon{font-size:1.05rem;line-height:1;}

/* STEP 27 - Payments, receivables, statements */
.soft-card{background:#fbfaf7;border:1px solid rgba(20,28,45,.08);box-shadow:none;margin-top:18px}.receipt-total-bar{display:flex;justify-content:flex-end;align-items:center;gap:20px;border-top:1px solid rgba(20,28,45,.08);padding-top:14px;margin-top:14px;font-size:1rem}.receipt-total-bar strong{font-size:1.25rem;color:#0f172a}.receipt-allocation-row .receipt-amount-input{max-width:120px;margin-left:auto}.step27-payment-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 16px;padding:12px;border:1px solid rgba(20,28,45,.08);background:#fbfaf7;border-radius:14px}.step27-payment-summary div{display:flex;flex-direction:column;gap:4px}.step27-payment-summary span{font-size:.72rem;color:#64748b;text-transform:uppercase;letter-spacing:.08em}.step27-payment-summary strong{font-size:.98rem;color:#0f172a}.receipt-print-page .lineo-items-table th,.receipt-print-page .lineo-items-table td{font-size:10.4px}.statement-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}.statement-summary-grid div,.aging-buckets div{border:1px solid rgba(20,28,45,.08);border-radius:14px;padding:12px;background:#fbfaf7}.statement-summary-grid span,.aging-buckets span{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:#64748b}.statement-summary-grid strong,.aging-buckets strong{display:block;margin-top:6px;color:#0f172a;font-size:1.05rem}.aging-buckets{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:0 0 18px}.receivables-stats{margin-bottom:18px}.step27-terms-card textarea{font-size:.9rem;line-height:1.55}.btn-danger-soft{background:#fff1f2;color:#be123c;border-color:#fecdd3}.btn-danger-soft:hover{background:#ffe4e6;color:#9f1239}@media(max-width:900px){.step27-payment-summary,.statement-summary-grid,.aging-buckets{grid-template-columns:1fr}.receipt-total-bar{justify-content:space-between}.receipt-allocation-row .receipt-amount-input{max-width:100%}}@media print{.receipt-print-page{box-shadow:none!important;margin:0!important}.statement-print-card{box-shadow:none!important;border:0!important}.statement-print-card .card-header{border-bottom:2px solid #111827}.step27-payment-summary.no-print{display:none!important}.aging-buckets{break-inside:avoid}.data-table{font-size:10px}}

/* STEP 27.1 — compact grouped sidebar and account menu polish */
.sidebar-module { margin: 4px 0 8px; }
.sidebar-module-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    background: transparent;
    color: var(--gray-400);
    padding: 9px 12px 7px;
    cursor: pointer;
    font-family: var(--ls-font, Inter, Manrope, Arial, sans-serif);
    font-size: .72rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-radius: 12px;
}
.sidebar-module-toggle:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-module-toggle b { transition: transform .18s ease; color: rgba(255,255,255,.5); }
.sidebar-module-links { display: none; padding: 2px 0 4px; }
.sidebar-module.open .sidebar-module-links { display: block; }
.sidebar-module.open .sidebar-module-toggle b { transform: rotate(180deg); }
.sidebar-module .nav-link { padding: 8px 12px 8px 18px; font-size: .84rem; }
.sidebar-module .nav-link svg { width: 18px; height: 18px; }
.sidebar-footer { padding: 10px 12px; }
.user-info-button { padding: 5px 3px; gap: 8px; border-radius: 12px; }
.user-info-button .user-avatar { width: 30px; height: 30px; font-size: .76rem; }
.user-info-button .user-name { font-size: .8rem; }
.user-info-button .user-role { font-size: .68rem; }
.account-caret { font-size: .9rem; }
.account-dropdown { border-radius: 14px; max-width: 235px; left: auto; right: 0; }
.account-dropdown-head { padding: 10px 12px; }
.account-dropdown-head strong { font-size: .86rem; }
.account-dropdown-head small { font-size: .72rem; }
.account-dropdown-head span { margin-top: 6px; font-size: .7rem; }
.account-dropdown a,
.account-dropdown button { padding: 9px 12px; font-size: .82rem; font-weight: 700; }

/* Step 27.1.2 - Keep Inbox popup above document/action dropdowns */
.notification-popover,
.notification-dropdown,
.inbox-popover,
.inbox-dropdown,
#notificationDropdown,
#notificationPanel {
    z-index: 99999 !important;
}
.workflow-more-menu,
.document-more-menu,
.document-action-menu,
.doc-action-dropdown,
.action-dropdown,
.dropdown-menu,
.linsys-more-actions-menu {
    z-index: 9000;
}
.app-header,
.topbar,
.header-actions {
    z-index: 100000 !important;
}

/* ============================
   Step 27.2 - Unified Workflow Builder
   ============================ */
.workflow-builder-page .wb-shell{display:grid;grid-template-columns:260px minmax(0,1fr);gap:18px;align-items:start}.wb-doc-panel{position:sticky;top:92px}.wb-doc-list{display:grid;gap:10px}.wb-doc-pill{border:1px solid var(--border-color,#e5e7eb);background:#fff;border-radius:16px;padding:14px 16px;text-align:left;font-weight:800;letter-spacing:.02em;color:#1f2937;cursor:pointer;transition:.2s}.wb-doc-pill:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(15,23,42,.08)}.wb-doc-pill.active{background:#0f172a;color:#fff;border-color:#0f172a}.wb-main-panel{display:grid;gap:18px;min-width:0}.wb-settings-card{overflow:visible}.wb-setting-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.wb-switch-card{border:1px solid var(--border-color,#e5e7eb);border-radius:18px;padding:14px;display:flex;gap:10px;align-items:flex-start;background:#fff;cursor:pointer}.wb-switch-card input{margin-top:4px;accent-color:#0f172a}.wb-switch-card strong{display:block;color:#111827}.wb-switch-card small{display:block;color:#6b7280;line-height:1.35;margin-top:3px}.wb-legend{display:flex;gap:12px;align-items:center;flex-wrap:wrap;color:#6b7280;font-size:.82rem;font-weight:700}.wb-dot{display:inline-block;width:10px;height:10px;border-radius:999px;margin-right:5px}.wb-dot.access{background:#3b82f6}.wb-dot.workflow{background:#f97316}.wb-dot.signature{background:#111827}.workflow-org-chart{overflow:auto;padding:8px 4px;max-width:100%}.wb-chart-level{display:flex;gap:18px;justify-content:center;align-items:flex-start;position:relative;min-width:max-content;margin:10px 0 20px}.wb-chart-level .wb-chart-level{padding-top:18px;border-top:1px solid #d7dde8}.wb-user-node{min-width:292px;max-width:320px;border:1px solid #e5e7eb;border-radius:22px;background:#fff;box-shadow:0 14px 40px rgba(15,23,42,.06);overflow:hidden}.wb-user-card{display:flex;gap:12px;align-items:center;padding:16px}.wb-avatar{width:54px;height:54px;border-radius:16px;background:#111827;color:#fff;display:grid;place-items:center;font-weight:900;overflow:hidden;flex:0 0 auto}.wb-avatar img{width:100%;height:100%;object-fit:cover}.wb-user-meta{min-width:0}.wb-user-meta strong{display:block;color:#0f172a;font-size:.98rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wb-user-meta span{display:block;color:#4b5563;font-weight:800;font-size:.82rem}.wb-user-meta small,.wb-user-meta em{display:block;color:#6b7280;font-style:normal;font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wb-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 14px 14px}.wb-action-chip{border:1px solid #e5e7eb;background:#f9fafb;color:#4b5563;border-radius:999px;padding:8px 10px;font-size:.75rem;font-weight:900;cursor:pointer;transition:.15s}.wb-action-chip:hover{background:#fff;transform:translateY(-1px)}.wb-action-chip.on.access{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}.wb-action-chip.on.workflow{background:#ffedd5;color:#c2410c;border-color:#fdba74}.wb-action-chip.on.signature{background:#111827;color:#fff;border-color:#111827}.wb-action-chip:disabled{opacity:.55;cursor:wait}.workflow-org-chart::-webkit-scrollbar{height:10px}.workflow-org-chart::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}@media(max-width:1100px){.workflow-builder-page .wb-shell{grid-template-columns:1fr}.wb-doc-panel{position:static}.wb-doc-list{grid-template-columns:repeat(2,minmax(0,1fr))}.wb-setting-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.wb-doc-list,.wb-setting-grid{grid-template-columns:1fr}.wb-user-node{min-width:270px}.wb-action-grid{grid-template-columns:1fr}}

/* STEP 27.2.2 — project-context creation and simplified admin navigation */
.project-section-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
}
.project-section-header h3{margin:0;}
.project-section-header .btn{white-space:nowrap;}
.settings-shortcut-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:16px;
}
.settings-shortcut-card{
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:20px;
    background:#fff;
    border:1px solid var(--gray-200);
    border-radius:18px;
    box-shadow:var(--shadow-sm);
    color:inherit;
    text-decoration:none;
    transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.settings-shortcut-card:hover{
    transform:translateY(-2px);
    box-shadow:var(--shadow-md);
    border-color:var(--gray-300);
}
.settings-shortcut-card span{font-size:1.45rem;}
.settings-shortcut-card strong{font-size:1rem;color:var(--gray-900);}
.settings-shortcut-card small{color:var(--gray-500);line-height:1.45;}
.work-inbox-foot{gap:8px;flex-wrap:wrap;}
@media(max-width:700px){
    .project-section-header{align-items:flex-start;flex-direction:column;}
}


/* STEP 27.2.3 — keep permission/role modals above sticky title bars */
body .modal.show,
body .modal-overlay.show {
    z-index: 200000 !important;
}
body .modal.show {
    align-items: flex-start;
    padding-top: 32px;
    padding-bottom: 32px;
}
body #roleModal.show .modal-content {
    width: min(1180px, calc(100vw - 48px));
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body #roleModal.show .modal-header,
body #roleModal.show .modal-footer {
    flex: 0 0 auto;
    background: #fff;
    z-index: 1;
}
body #roleModal.show .modal-body {
    overflow: auto;
    max-height: calc(100vh - 190px);
}
@media (max-width: 700px) {
    body .modal.show { padding: 12px; }
    body #roleModal.show .modal-content { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
}


/* Organization Builder CSS moved to assets/css/pages/organization-builder.css */

.linsys-approval-card-v275d { position:relative; z-index:80; overflow:visible!important; }
.linsys-approval-panel-v275d { align-items:flex-start; padding:16px 18px; gap:18px; }
.linsys-approval-main-v275d { flex:1 1 auto; min-width:0; }
.linsys-approval-title-v275d { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.linsys-approval-title-v275d span:first-child { font-size:12px; text-transform:uppercase; letter-spacing:.10em; color:#64748b; font-weight:900; }
.linsys-approval-title-v275d strong { border:1px solid rgba(15,23,42,.09); background:#f8fafc; color:#0f172a; border-radius:999px; padding:5px 11px; text-transform:capitalize; font-size:13px; }
.linsys-current-step { background:#fff7ed; color:#9a3412; border:1px solid rgba(234,88,12,.18); border-radius:999px; padding:5px 10px; font-size:13px; font-weight:800; }
.lineo-signature-chip.active { background:#eff6ff; color:#1d4ed8; border-color:rgba(37,99,235,.24); }
.linsys-flow-path { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.linsys-flow-step { display:flex; align-items:flex-start; gap:7px; border:1px solid rgba(15,23,42,.08); background:#fff; border-radius:14px; padding:8px 10px; min-width:150px; max-width:240px; }
.linsys-flow-step > span { width:18px; height:18px; flex:0 0 18px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:10px; font-weight:900; margin-top:1px; background:#dcfce7; color:#166534; }
.linsys-flow-step.pending > span { background:#fef3c7; color:#92400e; }
.linsys-flow-step strong { display:block; font-size:12px; color:#0f172a; }
.linsys-flow-step small { display:block; margin-top:2px; color:#64748b; font-size:11px; line-height:1.35; }
.linsys-flow-step em { display:block; margin-top:4px; color:#94a3b8; font-size:11px; font-style:normal; line-height:1.35; }
.linsys-approval-actions-v275d { min-width:280px; justify-content:flex-end; align-content:flex-start; }
.linsys-approval-actions-v275d .btn-success,
.linsys-approval-actions-v275d .btn-danger { min-width:112px; }
.linsys-approval-card-v275d .linsys-more-actions-menu { z-index:10000; min-width:220px; }
@media(max-width:900px){ .linsys-approval-panel-v275d{flex-direction:column;} .linsys-approval-actions-v275d{width:100%;justify-content:flex-start;min-width:0;} .linsys-flow-step{max-width:100%;} }
@media print{ .linsys-approval-card-v275d{display:none!important;} }

/* Step 28.5-28.7 subscription banners, limits and locked screens */
.linsys-subscription-banner{margin:0 0 16px 0;border:1px solid var(--border-color,#e5e7eb);border-radius:14px;padding:14px 16px;display:flex;gap:14px;align-items:center;justify-content:space-between;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.06)}
.linsys-subscription-banner strong{display:block;font-size:14px;color:var(--text-color,#111827)}
.linsys-subscription-banner span{display:block;font-size:12px;color:var(--text-muted,#6b7280);margin-top:3px}
.linsys-subscription-banner .linsys-subscription-meter{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.linsys-subscription-pill{border:1px solid var(--border-color,#e5e7eb);border-radius:999px;padding:5px 9px;background:#f9fafb;font-size:12px;color:#374151;white-space:nowrap}
.linsys-subscription-banner.status-grace,.linsys-subscription-banner.status-past_due{border-color:#f59e0b;background:#fffbeb}
.linsys-subscription-banner.status-trial{border-color:#93c5fd;background:#eff6ff}
.linsys-limit-lock{position:fixed;inset:0;z-index:9999;background:rgba(15,23,42,.42);display:flex;align-items:center;justify-content:center;padding:24px}
.linsys-limit-lock-card{max-width:520px;background:#fff;border-radius:18px;padding:24px;box-shadow:0 30px 90px rgba(15,23,42,.25)}
.linsys-limit-lock-card h3{margin:0 0 8px 0}.linsys-limit-lock-card p{color:#4b5563;margin:0 0 16px 0}.linsys-limit-lock-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.subscription-lock-body{min-height:100vh;background:linear-gradient(135deg,#f8fafc,#eef2ff);display:flex;align-items:center;justify-content:center;padding:24px}
.subscription-lock-card{max-width:760px;width:100%;background:#fff;border-radius:22px;padding:32px;box-shadow:0 30px 90px rgba(15,23,42,.14);border:1px solid #e5e7eb}
.subscription-lock-card h1{margin:4px 0 10px;font-size:30px}.subscription-lock-card p{color:#4b5563}.subscription-lock-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.subscription-lock-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin-top:18px}.subscription-lock-meta div{background:#f9fafb;border:1px solid #e5e7eb;border-radius:12px;padding:10px}.subscription-lock-meta small{display:block;color:#6b7280}.subscription-lock-meta strong{display:block;margin-top:3px}
@media(max-width:768px){.linsys-subscription-banner{align-items:flex-start;flex-direction:column}.linsys-subscription-banner .linsys-subscription-meter{justify-content:flex-start}.subscription-lock-card{padding:22px}.subscription-lock-card h1{font-size:24px}}

/* Step 29.4J - Signature Profile visual upgrade */
.signature-profile-page { display:flex; flex-direction:column; gap:18px; }
.signature-hero-card { display:flex; justify-content:space-between; gap:24px; align-items:center; border:1px solid rgba(15,23,42,.08); background:linear-gradient(135deg,#fff 0%,#faf7ef 100%); border-radius:28px; padding:28px 32px; box-shadow:0 20px 50px rgba(15,23,42,.06); }
.signature-hero-card h3 { margin:6px 0 8px; font-size:30px; letter-spacing:-.04em; color:#0f172a; }
.signature-hero-card p { max-width:720px; margin:0; color:#64748b; line-height:1.65; }
.signature-kicker { text-transform:uppercase; letter-spacing:.18em; font-size:12px; font-weight:800; color:#9a6b2f; }
.signature-hero-preview { display:flex; gap:12px; align-items:stretch; min-width:300px; }
.sig-preview-main.mini,.sig-preview-initial.mini { min-width:145px; border:1px solid rgba(15,23,42,.1); background:rgba(255,255,255,.8); border-radius:22px; padding:14px 16px; display:flex; flex-direction:column; justify-content:center; box-shadow:0 12px 35px rgba(15,23,42,.06); }
.sig-preview-main.mini small,.sig-preview-initial.mini small { color:#64748b; text-transform:uppercase; letter-spacing:.12em; font-size:10px; font-weight:800; margin-top:6px; }
.sig-script-name { font-family:"Segoe Script","Brush Script MT","Lucida Handwriting",cursive; font-weight:400; color:#0f172a; line-height:1; }
.signature-profile-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(335px,1fr)); gap:18px; }
.signature-profile-card { background:#fff; border:1px solid rgba(15,23,42,.08); border-radius:26px; padding:20px; box-shadow:0 18px 45px rgba(15,23,42,.065); display:flex; flex-direction:column; gap:14px; transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.signature-profile-card:hover { transform:translateY(-2px); border-color:rgba(15,23,42,.16); box-shadow:0 24px 60px rgba(15,23,42,.09); }
.signature-profile-card.is-inactive { opacity:.72; }
.signature-profile-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.signature-profile-head h3 { margin:0; font-size:18px; color:#0f172a; letter-spacing:-.02em; }
.signature-profile-head p { margin:4px 0 0; color:#64748b; font-size:13px; }
.signature-status { border-radius:999px; padding:6px 10px; font-size:11px; text-transform:uppercase; letter-spacing:.08em; font-weight:800; background:#f1f5f9; color:#64748b; }
.signature-status.active { background:#dcfce7; color:#15803d; }
.signature-status.inactive { background:#fee2e2; color:#991b1b; }
.signature-profile-user { border-radius:16px; background:#f8fafc; padding:10px 12px; color:#334155; font-size:13px; }
.signature-profile-user span { display:block; color:#94a3b8; margin-top:3px; }
.signature-profile-preview-row { display:grid; grid-template-columns:1.5fr .9fr; gap:12px; }
.signature-preview-box { position:relative; overflow:hidden; border:1px solid rgba(15,23,42,.08); background:linear-gradient(180deg,#fff,#fbfdff); border-radius:20px; padding:16px; min-height:116px; display:flex; flex-direction:column; justify-content:center; }
.signature-preview-box::after { content:""; position:absolute; right:-24px; bottom:-34px; width:90px; height:90px; border-radius:50%; background:#e0f2fe; opacity:.55; }
.signature-preview-box.initial::after { background:#dcfce7; }
.signature-preview-box span { color:#64748b; text-transform:uppercase; letter-spacing:.12em; font-size:10px; font-weight:800; margin-bottom:8px; position:relative; z-index:1; }
.signature-preview-box strong { font-size:25px; position:relative; z-index:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.signature-preview-box.initial strong { font-size:30px; letter-spacing:.02em; }
.signature-preview-box small { margin-top:7px; color:#64748b; position:relative; z-index:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.signature-profile-authority { font-size:12px; color:#64748b; border-top:1px solid rgba(15,23,42,.08); padding-top:12px; line-height:1.5; }
.signature-profile-actions { display:flex; justify-content:flex-end; }
.signature-profile-modal { max-width:900px; }
.signature-live-preview { display:grid; grid-template-columns:1.5fr .9fr; gap:14px; margin:12px 0 16px; }
.signature-live-card { border:1px solid rgba(15,23,42,.1); border-radius:22px; background:#fff; padding:18px; min-height:142px; display:flex; flex-direction:column; justify-content:center; position:relative; overflow:hidden; }
.signature-live-card::after { content:""; position:absolute; right:-38px; bottom:-48px; width:120px; height:120px; border-radius:50%; background:#eff6ff; }
.signature-live-initial::after { background:#ecfdf5; }
.signature-preview-label { position:relative; z-index:1; text-transform:uppercase; letter-spacing:.14em; color:#64748b; font-size:11px; font-weight:800; margin-bottom:12px; }
.signature-live-card .sig-script-name { position:relative; z-index:1; font-size:38px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.signature-live-initial .sig-script-name { font-size:44px; letter-spacing:.03em; }
.signature-preview-meta { position:relative; z-index:1; color:#64748b; margin-top:10px; font-size:13px; }
.form-help { display:block; color:#64748b; margin-top:6px; font-size:12px; line-height:1.45; }
@media (max-width: 900px){
  .signature-hero-card { flex-direction:column; align-items:flex-start; padding:22px; }
  .signature-hero-preview { min-width:0; width:100%; }
  .signature-live-preview,.signature-profile-preview-row { grid-template-columns:1fr; }
}

/* STEP 30.24 — Main sidebar compression + My Organization restructure */
@media (min-width: 1025px){
  .sidebar{width:244px;}
  .main-content{margin-left:244px;}
}
.sidebar-module-links-structured .nav-link{padding-top:7px;padding-bottom:7px;}
.sidebar-mini-divider{height:1px;background:rgba(148,163,184,.18);margin:6px 14px;}
.sidebar-module[data-sidebar-group="settings"] .sidebar-module-toggle span,
.sidebar-module[data-sidebar-group="admin-tools"] .sidebar-module-toggle span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sidebar-module[data-sidebar-group="settings"] .nav-link,
.sidebar-module[data-sidebar-group="admin-tools"] .nav-link{font-size:.82rem;}
.sidebar-module[data-sidebar-group="admin-tools"]{margin-top:2px;}

/* Step 31.8C - LinSys branded dialog boxes replacing browser confirm/prompt/alert */
.linsys-dialog-backdrop{position:fixed;inset:0;z-index:12000;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,.46);backdrop-filter:blur(6px);padding:24px;}
.linsys-dialog-backdrop.show{display:flex;}
.linsys-dialog-card{position:relative;width:min(460px,calc(100vw - 32px));background:#fff;border:1px solid rgba(226,232,240,.95);border-radius:24px;box-shadow:0 32px 90px rgba(15,23,42,.30);padding:28px 28px 22px;animation:linsysDialogIn .16s ease-out;color:#111827;}
.linsys-dialog-x{position:absolute;right:16px;top:14px;width:32px;height:32px;border:0;border-radius:999px;background:#f8fafc;color:#64748b;font-size:20px;line-height:32px;cursor:pointer;}
.linsys-dialog-x:hover{background:#eef2f7;color:#111827;}
.linsys-dialog-icon{width:46px;height:46px;border-radius:16px;display:flex;align-items:center;justify-content:center;margin-bottom:14px;background:linear-gradient(135deg,#f7efe1,#e7d0a6);color:#6f4f1d;font-weight:800;font-size:22px;box-shadow:0 10px 24px rgba(141,107,63,.12);}
.linsys-dialog-title{margin:0 34px 8px 0;font-size:1.18rem;line-height:1.2;font-weight:800;color:#0f172a;}
.linsys-dialog-message{font-size:.96rem;line-height:1.55;color:#475569;margin:0 0 18px;}
.linsys-dialog-input{display:none;width:100%;min-height:92px;resize:vertical;margin:4px 0 18px;}
.linsys-dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:8px;}
.linsys-dialog-actions .btn{min-width:96px;justify-content:center;}
.linsys-dialog-backdrop.dialog-alert .linsys-dialog-icon{background:linear-gradient(135deg,#dbeafe,#eff6ff);color:#1d4ed8;}
.linsys-dialog-backdrop.dialog-prompt .linsys-dialog-icon{background:linear-gradient(135deg,#ecfdf5,#d1fae5);color:#047857;}
@keyframes linsysDialogIn{from{opacity:0;transform:translateY(8px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:560px){.linsys-dialog-backdrop{padding:14px}.linsys-dialog-card{padding:24px 20px 18px;border-radius:20px}.linsys-dialog-actions{display:grid;grid-template-columns:1fr 1fr}.linsys-dialog-actions .btn{width:100%}.linsys-dialog-backdrop.dialog-alert .linsys-dialog-actions{grid-template-columns:1fr}}

/* Step 31.9-31.11 Document Designer */
.doc-designer-shell{display:grid;grid-template-columns:260px minmax(340px,520px) minmax(420px,1fr);gap:18px;align-items:start}.doc-designer-left,.doc-designer-editor,.doc-designer-preview{min-height:120px}.doc-designer-type-tabs{display:flex;flex-direction:column;gap:8px}.doc-type-tab,.doc-template-list-item{width:100%;border:1px solid var(--border-color,#e5e7eb);background:#fff;border-radius:12px;padding:10px 12px;text-align:left;cursor:pointer;color:var(--text-primary,#111827)}.doc-type-tab.active,.doc-template-list-item.active{border-color:var(--primary-color,#0f766e);box-shadow:0 0 0 3px rgba(15,118,110,.12);font-weight:700}.doc-template-list{display:flex;flex-direction:column;gap:8px}.doc-template-list-item strong{display:block}.doc-template-list-item span{display:block;color:var(--text-secondary,#6b7280);font-size:12px;margin-top:3px}.doc-toggle-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;padding:12px;border:1px solid var(--border-color,#e5e7eb);border-radius:14px;background:#fafafa}.doc-toggle-grid label{display:flex;gap:8px;align-items:center;font-size:13px}.doc-color-input{height:42px;padding:4px}.doc-designer-preview-area{background:#f3f4f6;border-radius:16px;padding:18px;overflow:auto;max-height:calc(100vh - 210px)}.doc-designer-preview-area .lineo-invoice-wrapper{transform-origin:top left}.doc-sample-logo{width:58px;height:58px;border-radius:16px;display:grid;place-items:center;background:var(--doc-accent,#0f766e);color:white;font-size:28px;font-weight:800}.doc-sample-img{width:54px;height:40px;border-radius:8px;background:linear-gradient(135deg,#eef2ff,#d1d5db)}.linsys-doc-template-shell{--doc-accent:#0f766e;--doc-font-family:Inter,Manrope,Arial,sans-serif}.linsys-doc-template-shell .lineo-invoice-page{font-family:var(--doc-font-family)!important}.linsys-doc-template-shell .lineo-266-line,.linsys-doc-template-shell .lineo-footer-line{border-color:var(--doc-accent)!important;background:var(--doc-accent)!important}.linsys-doc-template-shell .lineo-266-title-block h1{color:var(--doc-accent)!important}.doc-layout-executive_clean .lineo-invoice-page{border-top:8px solid var(--doc-accent)}.doc-layout-minimal_formal .lineo-invoice-page{box-shadow:none;border:1px solid #e5e7eb}.doc-layout-minimal_formal .lineo-266-header{gap:12px}.doc-layout-bold_commercial .lineo-266-title-block{background:var(--doc-accent);color:#fff;border-radius:16px;padding:16px}.doc-layout-bold_commercial .lineo-266-title-block h1,.doc-layout-bold_commercial .lineo-266-title-block p{color:#fff!important}.doc-header-compact .lineo-266-header{padding-bottom:6px}.doc-header-compact .lineo-logo{max-height:44px}.doc-header-split .lineo-266-header{grid-template-columns:1fr 1.2fr 1fr!important}.doc-footer-minimal .lineo-footer,.doc-footer-minimal .lineo-footer-line{display:none!important}.doc-footer-legal .lineo-note,.doc-footer-legal .lineo-template-footer-note{font-size:10px;color:#374151}.doc-logo-center .lineo-266-logo-block{text-align:center;align-items:center}.doc-logo-right .lineo-266-logo-block{order:4;text-align:right;align-items:flex-end}.doc-hide-logo .lineo-266-logo-block img,.doc-hide-logo .doc-sample-logo,.doc-hide-logo .lineo-logo{display:none!important}.doc-hide-trn .doc-trn-row,.doc-hide-trn .lineo-266-title-block .doc-template-trn-row{display:none!important}.doc-hide-bank .lineo-266-bank{display:none!important}.doc-hide-signature .lineo-signature-space,.doc-hide-signature .dn-signature-grid,.doc-hide-signature .lineo-footer-left>p:first-child{display:none!important}.doc-hide-terms .lineo-terms-page,.doc-hide-terms .lineo-template-terms{display:none!important}.doc-hide-item-images .lineo-col-image,.doc-hide-item-images th.lineo-col-image,.doc-hide-item-images td.lineo-col-image{display:none!important}.lineo-template-header-note,.lineo-template-footer-note,.lineo-template-terms,.lineo-template-bank{border:1px solid rgba(15,118,110,.18);background:rgba(15,118,110,.06);border-radius:12px;padding:10px 12px;margin:10px 0;font-size:12px;line-height:1.45}.lineo-template-footer-note{background:#fafafa;border-color:#e5e7eb}.doc-stamp-reserve .lineo-footer-right:empty:after{content:'Company Stamp';display:grid;place-items:center;width:120px;height:90px;border:1px dashed #9ca3af;border-radius:12px;color:#9ca3af;font-size:12px}.document-designer-page .form-row-2{grid-template-columns:repeat(2,minmax(0,1fr))}@media(max-width:1280px){.doc-designer-shell{grid-template-columns:1fr}.doc-designer-type-tabs{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.doc-designer-preview-area{max-height:none}}@media print{.lineo-template-header-note,.lineo-template-footer-note,.lineo-template-terms,.lineo-template-bank{break-inside:avoid}.document-designer-page .sidebar,.document-designer-page .topbar{display:none!important}}

/* ============================
   Step 31.12 Advanced Document Designer
   ============================ */
.doc-designer-advanced-page .content-body.doc-designer-body{padding:14px 16px;background:#f6f7f9;min-height:calc(100vh - 76px)}
.doc-designer-topbar{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid #e5e7eb}
.doc-designer-actions{gap:8px;flex-wrap:wrap}.doc-designer-advanced-shell{display:grid;grid-template-columns:280px minmax(520px,1fr) 330px;gap:14px;align-items:start}.doc-designer-panel{position:sticky;top:86px;max-height:calc(100vh - 104px);overflow:auto}.doc-panel-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;box-shadow:0 12px 34px rgba(15,23,42,.06);padding:14px;margin-bottom:14px}.doc-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}.doc-panel-head h3{margin:0;font-size:15px;color:#111827}.doc-panel-head p{margin:2px 0 0;color:#6b7280;font-size:12px}.doc-designer-advanced-page .doc-designer-type-tabs{display:grid;grid-template-columns:1fr;gap:8px;margin-bottom:12px}.doc-designer-advanced-page .doc-type-tab{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #e5e7eb;background:#fff;border-radius:13px;padding:10px 12px;cursor:pointer;text-align:left}.doc-designer-advanced-page .doc-type-tab span{font-weight:700;color:#111827}.doc-designer-advanced-page .doc-type-tab small{font-size:10px;color:#6b7280;background:#f3f4f6;border-radius:999px;padding:3px 7px}.doc-designer-advanced-page .doc-type-tab.active{border-color:var(--primary-color,#0f766e);box-shadow:0 0 0 3px rgba(15,118,110,.12);background:#f7fffd}.doc-designer-advanced-page .doc-template-list{display:flex;flex-direction:column;gap:8px}.doc-designer-advanced-page .doc-template-list-item{width:100%;border:1px solid #e5e7eb;background:#fff;border-radius:13px;padding:10px 12px;text-align:left;cursor:pointer}.doc-designer-advanced-page .doc-template-list-item strong{display:block;color:#111827}.doc-designer-advanced-page .doc-template-list-item span{display:block;color:#6b7280;font-size:12px;margin-top:3px}.doc-designer-advanced-page .doc-template-list-item.active{border-color:var(--primary-color,#0f766e);box-shadow:0 0 0 3px rgba(15,118,110,.12)}.doc-block-library{display:grid;gap:8px}.doc-library-block{border:1px solid #e5e7eb;border-radius:13px;background:#fff;padding:10px 12px;text-align:left;cursor:pointer;transition:.15s ease}.doc-library-block:hover{transform:translateY(-1px);border-color:var(--primary-color,#0f766e);box-shadow:0 8px 20px rgba(15,23,42,.08)}.doc-library-block strong{display:block;font-size:13px;color:#111827}.doc-library-block span{display:block;font-size:11px;color:#6b7280;margin-top:2px}.doc-designer-canvas-panel{min-width:0}.doc-canvas-toolbar{background:#fff;border:1px solid #e5e7eb;border-radius:18px;box-shadow:0 12px 34px rgba(15,23,42,.06);padding:12px;margin-bottom:14px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.doc-template-meta-form{display:grid;grid-template-columns:150px minmax(180px,1fr) 160px 54px;gap:8px;flex:1;min-width:420px}.doc-template-meta-form .form-control,.doc-canvas-tools .form-control{height:38px}.doc-canvas-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.doc-toggle{display:flex;align-items:center;gap:6px;font-size:12px;color:#374151;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;padding:8px 10px}.doc-zoom-select{width:86px}.doc-canvas-stage{background:linear-gradient(135deg,#e5e7eb,#f8fafc);border:1px solid #e5e7eb;border-radius:22px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.65);padding:24px;min-height:760px;overflow:auto;display:flex;justify-content:center;align-items:flex-start}.doc-a4-canvas{position:relative;width:210mm;min-height:297mm;background:#fff;border-radius:10px;box-shadow:0 28px 80px rgba(15,23,42,.22);padding:var(--doc-margin-mm,10mm);font-family:var(--doc-font,Inter,Manrope,Arial,sans-serif);transform-origin:top center;transition:.15s ease}.doc-a4-canvas.show-grid{background-image:linear-gradient(rgba(15,118,110,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(15,118,110,.05) 1px,transparent 1px);background-size:8mm 8mm}.doc-a4-canvas:before{content:'';position:absolute;inset:0;border-top:7px solid var(--doc-accent,#0f766e);border-radius:10px 10px 0 0;pointer-events:none}.doc-a4-canvas.layout-executive_clean:before{border-top-width:10px}.doc-a4-canvas.layout-minimal_formal:before{border-top-width:1px}.doc-a4-canvas.layout-bold_commercial:before{border-top-color:#111827}.doc-a4-canvas.layout-luxury_grid:after{content:'';position:absolute;right:10mm;top:10mm;width:38mm;height:38mm;border:1px solid rgba(15,118,110,.18);border-radius:50%;pointer-events:none}.doc-a4-canvas.layout-compact_a4{font-size:92%}.doc-canvas-watermark{position:absolute;inset:0;display:grid;place-items:center;font-size:52px;font-weight:800;color:rgba(17,24,39,.06);transform:rotate(-28deg);letter-spacing:8px;text-transform:uppercase;pointer-events:none}.doc-canvas-zone{position:relative;border:1px dashed rgba(107,114,128,.26);border-radius:14px;padding:18px 12px 12px;margin-bottom:12px;display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:start}.doc-canvas-zone.zone-header{min-height:52mm}.doc-canvas-zone.zone-body{min-height:130mm}.doc-canvas-zone.zone-footer{min-height:46mm;margin-bottom:0}.doc-zone-label{position:absolute;top:4px;left:10px;font-size:9px;letter-spacing:.14em;color:#9ca3af;font-weight:800}.doc-canvas-block{border:1px solid rgba(209,213,219,.95);background:#fff;border-radius:13px;padding:10px;min-height:42px;cursor:pointer;transition:.12s ease;position:relative}.doc-canvas-block:hover{box-shadow:0 8px 24px rgba(15,23,42,.08);border-color:rgba(15,118,110,.5)}.doc-canvas-block.selected{border-color:var(--doc-accent,#0f766e);box-shadow:0 0 0 3px rgba(15,118,110,.14),0 12px 28px rgba(15,23,42,.08)}.doc-canvas-block.is-hidden{opacity:.38;background:#f9fafb}.doc-canvas-block.is-hidden .doc-block-preview{filter:grayscale(1)}.doc-canvas-block.is-locked .doc-block-toolbar span:after{content:' 🔒';font-size:10px}.doc-canvas-block.width-full{grid-column:1/-1}.doc-canvas-block.width-left{grid-column:1/2}.doc-canvas-block.width-right{grid-column:2/3}.doc-canvas-block.width-half{grid-column:auto}.doc-canvas-block.align-center{text-align:center}.doc-canvas-block.align-right{text-align:right}.doc-canvas-block.has-border{border-style:solid;border-width:1.5px}.doc-canvas-block.has-shade{background:rgba(15,118,110,.045)}.doc-block-toolbar{display:flex;justify-content:space-between;gap:8px;align-items:center;border-bottom:1px solid #f1f5f9;margin:-2px 0 8px;padding-bottom:6px}.doc-block-toolbar strong{font-size:11px;color:#111827}.doc-block-toolbar span{font-size:10px;color:#6b7280}.doc-block-preview{font-size:11px;color:#374151;line-height:1.45}.doc-preview-header{display:grid;grid-template-columns:44px 1fr auto;gap:12px;align-items:center;text-align:left}.doc-preview-logo{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--doc-accent,#0f766e);color:#fff;font-weight:900;font-size:22px}.doc-preview-header h2{font-size:16px;margin:0;color:#111827}.doc-preview-header p{margin:2px 0;color:#4b5563}.doc-preview-contact{text-align:right;color:#4b5563}.doc-mini-grid{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;text-align:left}.doc-mini-grid span{color:#6b7280}.block-label{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--doc-accent,#0f766e);font-weight:800;margin:0 0 3px}.doc-reference-line{padding:8px 10px;border-left:3px solid var(--doc-accent,#0f766e);background:#f9fafb;text-align:left}.doc-preview-table{width:100%;border-collapse:collapse;text-align:left;font-size:10px}.doc-preview-table th{background:var(--doc-accent,#0f766e);color:#fff;padding:6px;border:1px solid rgba(255,255,255,.25)}.doc-preview-table td{padding:6px;border:1px solid #e5e7eb}.doc-mini-img{display:block;width:28px;height:20px;border-radius:6px;background:linear-gradient(135deg,#e0f2fe,#d1d5db)}.doc-total-preview{margin-left:auto;max-width:260px;display:grid;gap:5px;text-align:left}.doc-total-preview div{display:flex;justify-content:space-between;border-bottom:1px solid #e5e7eb;padding:5px 0}.doc-total-preview .grand{background:var(--doc-accent,#0f766e);color:#fff;border-radius:10px;padding:8px 10px;border:0}.doc-sign-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.doc-sign-grid div{height:48px;border:1px dashed #9ca3af;border-radius:10px;display:grid;place-items:center;color:#6b7280}.doc-image-placeholder{height:62px;border:1px dashed #9ca3af;border-radius:12px;display:grid;place-items:center;background:#f9fafb;color:#6b7280}.doc-qr-placeholder{width:54px;height:54px;border-radius:8px;background:repeating-linear-gradient(45deg,#111827 0 4px,#fff 4px 8px);display:grid;place-items:center;color:#fff;font-weight:900;margin:0 auto 6px}.doc-page-settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.doc-page-settings-grid .form-group{margin-bottom:0}.doc-inspector-empty{border:1px dashed #d1d5db;border-radius:14px;background:#f9fafb;padding:16px;color:#6b7280;font-size:13px}.doc-inspector-form{display:grid;gap:10px}.doc-inspector-row{display:flex;gap:8px;flex-wrap:wrap}.doc-inspector-row label,.doc-column-inspector label{display:flex;gap:6px;align-items:center;font-size:12px;background:#f9fafb;border:1px solid #e5e7eb;border-radius:9px;padding:7px 9px;text-transform:capitalize}.doc-column-inspector{display:flex;gap:7px;flex-wrap:wrap}.doc-column-inspector .form-label{width:100%;margin:0}.doc-inspector-actions{display:flex;gap:8px;flex-wrap:wrap;padding-top:4px}.doc-toggle-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px}.doc-toggle-grid.compact label{font-size:12px}.doc-legacy-settings textarea{min-height:58px}.doc-color-input{min-width:46px;padding:3px!important}.doc-advanced-applied{position:relative}.doc-advanced-watermark{position:absolute;inset:0;display:grid;place-items:center;font-size:58px;font-weight:900;letter-spacing:8px;color:rgba(17,24,39,.055);text-transform:uppercase;transform:rotate(-28deg);pointer-events:none;z-index:1}.doc-advanced-hide{display:none!important}.lineo-template-custom-text{border:1px solid rgba(15,118,110,.18);background:rgba(15,118,110,.05);border-radius:12px;padding:10px 12px;margin:10px 0;font-size:12px}.doc-footer-boxed .lineo-footer{border:1px solid #e5e7eb;border-radius:12px;padding:10px}.doc-header-letterhead .lineo-266-header{border-bottom:1px solid rgba(15,118,110,.25);padding-bottom:12px}.doc-layout-luxury_grid .lineo-invoice-page{background-image:linear-gradient(rgba(15,118,110,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(15,118,110,.035) 1px,transparent 1px);background-size:14mm 14mm}.doc-layout-compact_a4 .lineo-invoice-page{font-size:92%;line-height:1.25}.doc-advanced-applied .lineo-invoice-page{padding:var(--doc-margin-mm,10mm)!important}@media(max-width:1500px){.doc-designer-advanced-shell{grid-template-columns:240px minmax(460px,1fr) 300px}.doc-template-meta-form{grid-template-columns:140px minmax(160px,1fr) 145px 52px}}@media(max-width:1180px){.doc-designer-advanced-shell{grid-template-columns:1fr}.doc-designer-panel{position:static;max-height:none}.doc-template-meta-form{min-width:0;grid-template-columns:1fr 1fr}.doc-canvas-stage{justify-content:flex-start}.doc-a4-canvas{transform-origin:top left}}@media(max-width:720px){.doc-template-meta-form{grid-template-columns:1fr}.doc-canvas-tools{width:100%}.doc-canvas-stage{padding:12px}.doc-a4-canvas{width:210mm}.doc-page-settings-grid{grid-template-columns:1fr}.doc-canvas-zone{grid-template-columns:1fr}.doc-canvas-block.width-left,.doc-canvas-block.width-right,.doc-canvas-block.width-half{grid-column:1/-1}}@media print{.doc-designer-advanced-page .sidebar,.doc-designer-advanced-page .topbar,.doc-designer-left-panel,.doc-designer-right-panel,.doc-canvas-toolbar{display:none!important}.doc-designer-advanced-shell{display:block}.doc-canvas-stage{padding:0;border:0;background:#fff}.doc-a4-canvas{box-shadow:none;transform:none!important;border-radius:0}}

/* Step 31.12B: full-screen Document Designer + template use selector */
.doc-designer-fullscreen-page .doc-designer-app-layout{display:block;min-height:100vh;background:#f3f6f9;}
.doc-designer-fullscreen-page .sidebar{display:none!important;}
.doc-designer-fullscreen-page .doc-designer-main-full{margin-left:0!important;width:100%!important;max-width:none!important;min-height:100vh;}
.doc-designer-fullscreen-page .doc-designer-topbar{position:sticky;top:0;z-index:70;border-bottom:1px solid rgba(226,232,240,.92);backdrop-filter:blur(14px);background:rgba(255,255,255,.96);padding:12px 18px;}
.doc-designer-fullscreen-page .doc-designer-topbar .topbar-left{gap:14px;}
.doc-designer-fullscreen-page .doc-designer-back-btn{height:38px;border-radius:999px;border:1px solid #e5e7eb;background:#fff;color:#111827;font-weight:800;padding:0 14px;box-shadow:0 8px 20px rgba(15,23,42,.06);}
.doc-designer-fullscreen-page .doc-designer-back-btn:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(15,23,42,.1);}
.doc-designer-fullscreen-page .doc-designer-body{padding:16px 18px 26px;}
.doc-designer-fullscreen-page .doc-designer-advanced-shell{max-width:none;}
.doc-use-current-note{font-size:12px;line-height:1.45;color:#475569;background:#f8fafc;border:1px solid #e2e8f0;border-radius:13px;padding:10px 12px;margin-bottom:10px;}
.doc-use-matrix{display:grid;gap:8px;}
.doc-use-row{display:grid;grid-template-columns:1fr;gap:8px;border:1px solid #e5e7eb;border-radius:13px;background:#fff;padding:10px;}
.doc-use-info strong{display:block;font-size:12px;color:#111827;}
.doc-use-info span{display:block;font-size:11px;color:#64748b;margin-top:2px;}
.doc-use-controls{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;}
.doc-use-controls .form-control{height:34px;font-size:12px;}
.doc-template-list-item span{line-height:1.35;}
@media(max-width:900px){.doc-designer-fullscreen-page .doc-designer-topbar{align-items:flex-start;}.doc-designer-fullscreen-page .doc-designer-actions{width:100%;justify-content:flex-start;}.doc-use-controls{grid-template-columns:1fr;}}
@media print{.doc-designer-fullscreen-page .doc-designer-topbar{display:none!important;}}

/* Step 31.12C: Document Studio simplified full-screen layout */
.doc-studio-fullscreen-page{margin:0;background:#f6f8fb;color:#0f172a;overflow:hidden;}
.doc-studio-fullscreen-page .sidebar{display:none!important;}
.doc-studio-app-layout{display:block;min-height:100vh;background:#f6f8fb;}
.doc-studio-page{margin-left:0!important;width:100%!important;max-width:none!important;min-height:100vh;}
.btn.btn-dark{background:#0f2b5b;color:#fff;border-color:#0f2b5b;}
.doc-studio-topbar{height:74px;display:grid;grid-template-columns:minmax(310px,1.2fr) minmax(420px,1.8fr) auto;gap:18px;align-items:center;padding:10px 18px;border-bottom:1px solid #e5eaf2;background:rgba(255,255,255,.98);position:sticky;top:0;z-index:90;box-shadow:0 8px 22px rgba(15,23,42,.04);}
.doc-studio-brand-title{display:flex;align-items:center;gap:16px;min-width:0;}
.doc-studio-back{border:0;background:#fff;color:#0f172a;font-weight:800;display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 12px;border-radius:12px;box-shadow:0 0 0 1px #e5e7eb inset;cursor:pointer;}
.doc-studio-back:hover{background:#f8fafc;box-shadow:0 6px 18px rgba(15,23,42,.08),0 0 0 1px #dbe3ef inset;}
.doc-studio-brand-title h1{font-size:21px;line-height:1;margin:0;color:#111827;letter-spacing:-.02em;}
.doc-studio-brand-title p{margin:5px 0 0;color:#64748b;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.doc-studio-top-fields{display:grid;grid-template-columns:180px minmax(220px,1fr) 120px;gap:14px;align-items:center;}
.doc-studio-top-fields label{display:grid;gap:5px;color:#64748b;font-size:11px;font-weight:700;}
.doc-studio-top-fields select,.doc-studio-top-fields input{height:38px;border:1px solid #dbe3ef;border-radius:9px;background:#fff;padding:0 12px;font-size:13px;color:#111827;}
.doc-studio-status{height:28px;border-radius:999px;padding:0 11px;display:inline-flex;align-items:center;width:max-content;font-size:12px;font-weight:800;}
.doc-studio-status.published{background:#ecfdf5;color:#047857;}
.doc-studio-status.draft{background:#f8fafc;color:#475569;}
.doc-studio-status.dirty{background:#fff7ed;color:#c2410c;}
.doc-studio-actions{display:flex;gap:9px;justify-content:flex-end;align-items:center;white-space:nowrap;}
.doc-studio-actions .btn{height:38px;border-radius:9px;padding:0 15px;font-weight:800;}
.doc-studio-alert{position:absolute;right:18px;top:82px;z-index:100;max-width:460px;}
.doc-studio-shell{height:calc(100vh - 74px);display:grid;grid-template-columns:250px minmax(640px,1fr) 320px;overflow:hidden;}
.doc-studio-sidebar{background:#fff;border-right:1px solid #e5eaf2;overflow:auto;min-height:0;}
.doc-studio-right{border-right:0;border-left:1px solid #e5eaf2;}
.doc-studio-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:18px 16px 12px;border-bottom:1px solid #eef2f7;}
.doc-studio-panel-head h3{margin:0;font-size:14px;color:#0f172a;}
.doc-studio-panel-head p{margin:5px 0 0;font-size:12px;color:#64748b;line-height:1.35;}
.doc-studio-icon-btn{border:0;background:#fff;color:#2563eb;border-radius:8px;width:28px;height:28px;cursor:pointer;font-size:18px;line-height:1;}
.doc-studio-section-group{padding:14px 14px 4px;}
.doc-studio-mini-label{display:block;color:#475569;font-size:10px;letter-spacing:.08em;text-transform:uppercase;font-weight:900;margin:0 0 9px;}
.doc-studio-section-list{display:grid;gap:7px;}
.doc-studio-section{width:100%;border:1px solid #e5eaf2;background:#fff;border-radius:10px;min-height:44px;display:grid;grid-template-columns:28px 1fr 24px;gap:9px;align-items:center;text-align:left;padding:8px 10px;color:#0f172a;cursor:pointer;transition:.12s ease;}
.doc-studio-section:hover{border-color:#bfdbfe;background:#f8fbff;}
.doc-studio-section.active{border-color:#1e88e5;background:#eff6ff;box-shadow:0 0 0 2px rgba(30,136,229,.10);}
.doc-section-ico{width:26px;height:26px;border-radius:8px;background:#f1f5f9;color:#1e3a8a;display:grid;place-items:center;font-weight:900;font-size:13px;}
.doc-studio-section.active .doc-section-ico{background:#dbeafe;color:#1d4ed8;}
.doc-studio-section strong{display:block;font-size:12px;line-height:1.2;color:#111827;}
.doc-studio-section small{display:block;font-size:10px;color:#64748b;margin-top:2px;}
.doc-studio-section em{font-style:normal;color:#64748b;font-size:12px;text-align:right;}
.doc-studio-section em.on{color:#16a34a;}.doc-studio-section em.off{color:#94a3b8;}
.doc-studio-add-custom{width:100%;height:34px;border:1px dashed #93c5fd;border-radius:10px;background:#f8fbff;color:#1d4ed8;font-weight:800;margin-top:9px;cursor:pointer;}
.doc-studio-template-mini{border-top:1px solid #eef2f7;margin-top:12px;}
.doc-studio-template-list{display:grid;gap:7px;}
.doc-studio-template-item{border:1px solid #e5e7eb;background:#fff;border-radius:10px;padding:9px 10px;text-align:left;cursor:pointer;}
.doc-studio-template-item.active{border-color:#1e88e5;background:#eff6ff;}
.doc-studio-template-item strong{display:block;font-size:12px;color:#111827;line-height:1.2;}
.doc-studio-template-item span{display:block;font-size:10px;color:#64748b;margin-top:3px;}
.doc-studio-empty-mini{font-size:12px;color:#64748b;background:#f8fafc;border:1px dashed #dbe3ef;border-radius:10px;padding:10px;line-height:1.35;}
.doc-studio-sync-note{margin:14px;border:1px solid #dbeafe;background:#eff6ff;color:#1e3a8a;border-radius:12px;padding:11px;font-size:11px;line-height:1.45;}
.doc-studio-sync-note button{border:0;background:transparent;color:#1d4ed8;font-weight:900;padding:0;text-decoration:underline;cursor:pointer;}
.doc-studio-preview-wrap{min-width:0;display:grid;grid-template-rows:58px 1fr 46px;background:#f6f8fb;}
.doc-studio-preview-toolbar{display:grid;grid-template-columns:minmax(330px,1fr) auto minmax(240px,auto);gap:14px;align-items:center;padding:10px 16px;border-bottom:1px solid #e5eaf2;background:#fff;}
.doc-studio-preview-left{display:flex;gap:12px;align-items:center;min-width:0;}
.doc-studio-preview-left label{display:grid;grid-template-columns:auto;gap:4px;color:#64748b;font-size:10px;font-weight:800;}
.doc-studio-preview-left select{height:34px;min-width:150px;border:1px solid #dbe3ef;border-radius:9px;background:#fff;padding:0 10px;color:#111827;font-size:12px;}
.doc-studio-view-tools{display:flex;align-items:center;gap:8px;border:1px solid #e5eaf2;background:#fff;border-radius:10px;padding:4px;}
.doc-studio-view-tools button{width:28px;height:26px;border:0;border-radius:7px;background:#f8fafc;color:#0f172a;font-weight:900;cursor:pointer;}
.doc-studio-view-tools select{height:28px;border:0;background:#fff;color:#0f172a;font-weight:800;font-size:12px;}
.doc-studio-view-tools span{font-size:12px;min-width:40px;text-align:center;color:#475569;font-weight:800;}
.doc-studio-page-tabs{display:flex;justify-content:flex-end;gap:7px;overflow:auto;}
.doc-studio-page-tabs button{height:34px;min-width:42px;border:1px solid #e5eaf2;background:#fff;border-radius:9px;color:#0f172a;font-weight:800;font-size:12px;cursor:pointer;padding:0 12px;white-space:nowrap;}
.doc-studio-page-tabs button.active{background:#eff6ff;border-color:#1e88e5;color:#1d4ed8;}
.doc-studio-preview-stage{min-height:0;overflow:auto;padding:18px 20px 34px;background:linear-gradient(135deg,#f8fafc 0,#eef3f9 100%);}
.doc-studio-pages{min-height:100%;display:flex;gap:18px;align-items:flex-start;justify-content:center;}
.doc-studio-pages.single{justify-content:center;}
.doc-studio-pages.spread{justify-content:center;}
.doc-studio-pages.all{justify-content:flex-start;flex-wrap:wrap;align-content:flex-start;}
.doc-studio-a4{position:relative;width:210mm;min-height:297mm;background:#fff;border:1px solid #dbe3ef;border-radius:4px;box-shadow:0 20px 50px rgba(15,23,42,.14);transform:scale(var(--studio-zoom,.82));transform-origin:top center;margin-bottom:18px;font-family:var(--doc-font-family,Inter,Arial,sans-serif);color:#111827;flex:0 0 auto;}
.doc-studio-pages.single .doc-studio-a4{margin-left:auto;margin-right:auto;}
.doc-studio-page-inner{padding:18mm 16mm 14mm;min-height:297mm;position:relative;z-index:2;display:grid;grid-template-columns:1fr 1fr;gap:10px 12px;align-content:start;}
.doc-page-caption{position:absolute;top:-28px;left:0;right:0;text-align:center;color:#475569;font-size:12px;font-weight:800;z-index:5;}
.doc-studio-a4.active-page{outline:2px solid rgba(30,136,229,.35);outline-offset:4px;}
.doc-studio-watermark{position:absolute;inset:0;display:grid;place-items:center;z-index:1;font-size:58px;font-weight:900;letter-spacing:8px;color:rgba(15,23,42,.06);transform:rotate(-28deg);text-transform:uppercase;pointer-events:none;}
.doc-preview-section{position:relative;border:1px solid transparent;border-radius:6px;padding:4px;min-height:18px;}
.doc-preview-section:hover,.doc-preview-section.selected{border-color:#93c5fd;background:rgba(239,246,255,.45);box-shadow:0 0 0 2px rgba(147,197,253,.18);}
.doc-preview-section.w-full{grid-column:1/-1;}.doc-preview-section.w-left{grid-column:1/2;}.doc-preview-section.w-right{grid-column:2/3;}.doc-preview-section.w-half{grid-column:auto;}
.doc-preview-section.align-center{text-align:center;}.doc-preview-section.align-right{text-align:right;}.doc-preview-section.has-border{border-color:#dbe3ef;}.doc-preview-section.has-shade{background:#f8fafc;}
.doc-studio-company{display:grid;grid-template-columns:54px 1fr auto;gap:12px;align-items:center;border-bottom:2px solid var(--doc-accent,#1e88e5);padding-bottom:10px;}
.doc-studio-company.compact{grid-template-columns:36px 1fr auto;padding-bottom:8px;border-bottom-width:1px;}
.doc-studio-logo{width:48px;height:48px;border-radius:12px;background:var(--doc-accent,#1e88e5);display:grid;place-items:center;color:#fff;font-weight:900;overflow:hidden;}
.doc-studio-company.compact .doc-studio-logo{width:34px;height:34px;border-radius:9px;}
.doc-studio-logo img{max-width:100%;max-height:100%;object-fit:contain;background:#fff;}
.doc-studio-logo.big{width:70px;height:70px;border-radius:16px;}
.doc-studio-company h2{font-size:20px;letter-spacing:.08em;margin:0 0 3px;text-transform:uppercase;color:#0f172a;}
.doc-studio-company.compact h2{font-size:15px;letter-spacing:.06em;}
.doc-studio-company p{font-size:10px;color:#475569;margin:0;line-height:1.35;}
.doc-studio-company-meta{text-align:right;font-size:10px;color:#334155;line-height:1.55;}
.doc-studio-title-block{text-align:right;}
.doc-studio-title-block h2{font-size:21px;letter-spacing:.12em;color:#1e3a8a;margin:0;text-transform:uppercase;}
.doc-studio-title-block p{margin:4px 0 0;color:#64748b;font-weight:800;}
.doc-block-label{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#1d4ed8;font-weight:900;margin:0 0 6px;}
.doc-preview-section p{font-size:11px;line-height:1.45;color:#334155;margin:4px 0;}.doc-preview-section strong{font-size:12px;color:#0f172a;}
.doc-studio-info{width:100%;border-collapse:collapse;font-size:10.5px;}.doc-studio-info td,.doc-studio-info th{border:1px solid #dbe3ef;padding:7px 9px;text-align:left;}.doc-studio-info td{color:#475569;background:#f8fafc;}.doc-studio-info th{font-weight:800;color:#0f172a;background:#fff;}
.doc-studio-item-table{width:100%;border-collapse:collapse;font-size:9.5px;margin-top:4px;}.doc-studio-item-table th{background:var(--doc-accent,#1e88e5);color:#fff;text-transform:uppercase;font-size:8.5px;letter-spacing:.04em;padding:6px 5px;border:1px solid rgba(255,255,255,.35);}.doc-studio-item-table td{padding:6px 5px;border:1px solid #dbe3ef;color:#0f172a;}
.doc-flow-note{border:1px dashed #bfdbfe;color:#64748b;text-align:center;font-size:10px;margin-top:6px;padding:5px;background:#f8fbff;}
.doc-studio-totals{margin-left:auto;max-width:280px;border:1px solid #dbe3ef;border-radius:4px;overflow:hidden;font-size:11px;}.doc-studio-totals div{display:flex;justify-content:space-between;gap:12px;padding:8px 10px;border-bottom:1px solid #e5eaf2;}.doc-studio-totals div:last-child{border-bottom:0;}.doc-studio-totals .grand{background:var(--doc-accent,#1e88e5);color:#fff;font-size:13px;}.doc-studio-totals .grand strong{color:#fff;}
.doc-studio-note-line{border:1px solid #dbe3ef;padding:8px;font-size:10px;}.doc-studio-signatures{display:grid;grid-template-columns:1fr 1fr;gap:28px;margin-top:8px;}.doc-studio-signatures div{border-top:1px solid #64748b;padding-top:7px;min-height:45px;}.doc-studio-signatures strong,.doc-studio-signatures span,.doc-studio-signatures small{display:block;font-size:10px;color:#334155;margin-top:3px;}
.doc-studio-footer-note{background:#0f2b5b;color:#fff;text-align:center;font-size:11px;padding:8px 10px;display:flex;justify-content:center;gap:24px;}.doc-studio-footer-note span{opacity:.9;position:absolute;right:16mm;}
.doc-studio-bank{border:1px solid #dbe3ef;border-radius:4px;padding:8px;background:#f8fafc;}.doc-studio-qr{text-align:center;}.doc-studio-qr span{display:block;width:54px;height:54px;margin:0 auto 6px;background:repeating-linear-gradient(45deg,#111827 0 4px,#fff 4px 8px);border-radius:6px;}.doc-studio-stamp{width:74px;height:74px;border:2px dashed #94a3b8;border-radius:50%;display:grid;place-items:center;color:#64748b;font-weight:900;margin:auto;}
.doc-studio-terms h3{text-align:center;letter-spacing:.08em;margin:4px 0 16px;color:#0f172a;}.doc-studio-terms p{font-size:11px;line-height:1.65;color:#111827;}.doc-studio-required-preview{display:grid;gap:10px;}.doc-studio-required-preview div{border:1px solid #dbeafe;background:#f8fbff;border-radius:4px;padding:8px;position:relative;}.doc-studio-required-preview strong{display:block;font-size:11px;margin-bottom:5px;}.doc-studio-required-preview span{display:block;background:#fff;border:1px solid #dbe3ef;padding:7px;font-size:10.5px;}.doc-studio-required-preview em{position:absolute;right:8px;top:8px;font-style:normal;font-size:9px;border-radius:999px;padding:2px 6px;background:#fee2e2;color:#b91c1c;}
.doc-studio-acceptance{border:1px solid #93c5fd;border-radius:5px;padding:10px;background:#f8fbff;}.doc-studio-acceptance div{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;margin-top:20px;}.doc-studio-acceptance span{border-bottom:1px solid #94a3b8;font-size:10px;color:#334155;padding-bottom:4px;}
.doc-studio-bottom-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 18px;border-top:1px solid #e5eaf2;background:#fff;color:#64748b;font-size:12px;}
.doc-studio-bottom-bar div{display:flex;gap:8px;}.doc-studio-bottom-bar .btn{height:30px;border-radius:8px;}
.doc-studio-inspector-tabs{height:48px;display:grid;grid-template-columns:1fr 1fr 1fr;border-bottom:1px solid #e5eaf2;background:#fff;position:sticky;top:0;z-index:5;}.doc-studio-inspector-tabs button{border:0;background:#fff;color:#475569;text-transform:uppercase;font-size:11px;font-weight:900;cursor:pointer;border-bottom:2px solid transparent;}.doc-studio-inspector-tabs button.active{color:#1d4ed8;border-bottom-color:#1e88e5;background:#f8fbff;}
.doc-studio-inspector{padding:16px;}.doc-inspector-title{display:flex;gap:11px;align-items:center;margin-bottom:14px;}.doc-inspector-title>span{width:36px;height:36px;border-radius:10px;background:#eff6ff;color:#1d4ed8;display:grid;place-items:center;font-weight:900;}.doc-inspector-title h3{margin:0;font-size:15px;color:#0f172a;}.doc-inspector-title p{margin:3px 0 0;font-size:12px;color:#64748b;line-height:1.35;}
.doc-inspector-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:8px 0 12px;}.doc-inspector-row label{display:flex;gap:7px;align-items:center;border:1px solid #e5eaf2;background:#f8fafc;border-radius:9px;padding:7px 9px;font-size:12px;color:#334155;}.doc-inspector-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}.doc-column-inspector{display:flex;gap:7px;flex-wrap:wrap;}.doc-column-inspector label{display:flex;gap:6px;align-items:center;border:1px solid #e5eaf2;background:#fff;border-radius:9px;padding:7px 9px;font-size:12px;text-transform:capitalize;}
.doc-branding-logo-row{display:flex;align-items:center;gap:12px;margin-bottom:12px;}.doc-required-editor{display:grid;gap:9px;}.doc-required-row{border:1px solid #e5eaf2;background:#f8fafc;border-radius:10px;padding:8px;display:grid;gap:7px;}.doc-required-row label{font-size:12px;display:flex;gap:7px;align-items:center;}.doc-studio-use-box{border-top:1px solid #e5eaf2;padding:16px;background:#fff;}.doc-studio-use-box h3{font-size:14px;margin:0 0 4px;}.doc-studio-use-box p{font-size:12px;color:#64748b;margin:0 0 10px;line-height:1.35;}
.doc-studio-left-collapsed .doc-studio-shell{grid-template-columns:0 minmax(640px,1fr) 320px;}.doc-studio-left-collapsed .doc-studio-left{overflow:hidden;border:0;}.doc-studio-left-collapsed .doc-studio-left>*{display:none;}
@media(max-width:1400px){.doc-studio-shell{grid-template-columns:230px minmax(520px,1fr) 300px;}.doc-studio-topbar{grid-template-columns:minmax(260px,1fr) minmax(360px,1.5fr) auto;}.doc-studio-actions .btn{padding:0 11px;}.doc-studio-a4{--studio-zoom:.72;}}
@media(max-width:1100px){.doc-studio-fullscreen-page{overflow:auto;}.doc-studio-topbar{height:auto;grid-template-columns:1fr;align-items:start;}.doc-studio-top-fields{grid-template-columns:1fr 1fr 120px;}.doc-studio-shell{height:auto;min-height:calc(100vh - 74px);grid-template-columns:1fr;}.doc-studio-sidebar{max-height:none;border-left:0;border-right:0;}.doc-studio-preview-wrap{min-height:760px;}.doc-studio-right{border-left:0;}.doc-studio-preview-toolbar{grid-template-columns:1fr;}.doc-studio-page-tabs{justify-content:flex-start;}.doc-studio-a4{transform-origin:top left;}}
@media(max-width:720px){.doc-studio-top-fields{grid-template-columns:1fr;}.doc-studio-actions{flex-wrap:wrap;justify-content:flex-start;}.doc-studio-preview-left{flex-wrap:wrap;}.doc-studio-a4{width:210mm;}.doc-studio-page-inner{grid-template-columns:1fr;}.doc-preview-section.w-left,.doc-preview-section.w-right,.doc-preview-section.w-half{grid-column:1/-1;}}
@media print{.doc-studio-topbar,.doc-studio-left,.doc-studio-right,.doc-studio-preview-toolbar,.doc-studio-bottom-bar,.doc-page-caption{display:none!important;}.doc-studio-shell{display:block;height:auto;}.doc-studio-preview-stage{padding:0;overflow:visible;background:#fff;}.doc-studio-pages{display:block;}.doc-studio-a4{transform:none!important;box-shadow:none;border:0;border-radius:0;margin:0;page-break-after:always;}}

/* Step 31.12D - Document Studio interface cleanup */
.doc-studio-fullscreen-page{background:#f7f9fc;}
.doc-studio-topbar{
    height:68px;
    grid-template-columns:minmax(300px,1.05fr) minmax(380px,.95fr) auto;
    gap:16px;
    padding:9px 16px;
    box-shadow:0 8px 18px rgba(15,23,42,.035);
}
.doc-studio-title-line{display:flex;align-items:center;gap:10px;min-width:0;}
.doc-studio-brand-title h1{font-size:20px;white-space:nowrap;}
.doc-studio-brand-title p{font-size:12px;max-width:360px;}
.doc-studio-back{height:38px;padding:0 12px;border-radius:11px;}
.doc-studio-top-fields{grid-template-columns:minmax(150px,220px) minmax(220px,1fr);gap:12px;}
.doc-studio-top-fields label{font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;}
.doc-studio-top-fields select,.doc-studio-top-fields input{height:36px;border-radius:10px;}
.doc-studio-status{height:24px;padding:0 10px;font-size:11px;white-space:nowrap;}
.doc-studio-actions{gap:8px;min-width:0;}
.doc-studio-actions .btn{height:36px;border-radius:10px;padding:0 14px;}
.doc-studio-actions .btn-dark{background:#071738;color:#fff;border-color:#071738;}
.doc-studio-more{position:relative;}
.doc-studio-more>summary{list-style:none;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;}
.doc-studio-more>summary::-webkit-details-marker{display:none;}
.doc-studio-more-menu{position:absolute;right:0;top:calc(100% + 8px);width:220px;background:#fff;border:1px solid #dbe3ef;border-radius:14px;box-shadow:0 18px 48px rgba(15,23,42,.16);padding:8px;z-index:130;display:grid;gap:4px;}
.doc-studio-more-menu button{height:36px;border:0;border-radius:10px;background:#fff;color:#0f172a;text-align:left;padding:0 12px;font-weight:700;cursor:pointer;}
.doc-studio-more-menu button:hover{background:#f1f5f9;color:#1d4ed8;}
.doc-studio-alert{top:76px;}
.doc-studio-shell{height:calc(100vh - 68px);grid-template-columns:242px minmax(720px,1fr) 300px;}
.doc-studio-panel-head{padding:14px 14px 10px;}
.doc-studio-panel-head h3{font-size:14px;}
.doc-studio-section-group{padding:12px 12px 2px;}
.doc-studio-section{border-radius:12px;min-height:42px;padding:8px 9px;grid-template-columns:28px 1fr 20px;}
.doc-studio-section strong{font-size:12px;}.doc-studio-section small{font-size:10px;}
.doc-studio-preview-wrap{grid-template-rows:50px 40px 1fr 42px;}
.doc-studio-preview-toolbar{grid-template-columns:1fr auto;gap:12px;padding:8px 14px;}
.doc-studio-preview-left{gap:10px;overflow:hidden;}
.doc-studio-preview-left label{font-size:10px;text-transform:uppercase;letter-spacing:.03em;}
.doc-studio-preview-left select{height:32px;border-radius:9px;min-width:170px;max-width:260px;}
.doc-studio-view-tools{height:34px;padding:3px;border-radius:11px;background:#f8fafc;}
.doc-studio-page-rail{display:flex;align-items:center;justify-content:center;gap:8px;overflow-x:auto;padding:6px 14px;border-bottom:1px solid #e5eaf2;background:#fff;scrollbar-width:thin;}
.doc-studio-page-rail button{height:28px;min-width:36px;border:1px solid #e5eaf2;background:#fff;border-radius:9px;color:#0f172a;font-weight:800;font-size:11.5px;cursor:pointer;padding:0 12px;white-space:nowrap;}
.doc-studio-page-rail button.active{background:#eff6ff;border-color:#1e88e5;color:#1d4ed8;box-shadow:0 0 0 2px rgba(30,136,229,.10);}
.doc-studio-preview-stage{padding:16px 18px 28px;background:#eef3f9;}
.doc-studio-pages{gap:22px;}
.doc-studio-bottom-bar{height:42px;padding:7px 14px;font-size:11.5px;}
.doc-studio-bottom-bar .btn{height:28px;}
.doc-studio-inspector-tabs{height:44px;}
.doc-studio-inspector{padding:14px;}
.doc-inspector-title h3{font-size:14px;}
.doc-studio-use-box{border-top:1px solid #e5eaf2;padding:0;background:#fff;}
.doc-studio-use-box>summary{list-style:none;cursor:pointer;padding:13px 14px;font-size:13px;font-weight:900;color:#0f172a;border-bottom:1px solid #eef2f7;}
.doc-studio-use-box>summary::-webkit-details-marker{display:none;}
.doc-studio-use-box>summary:after{content:'▾';float:right;color:#64748b;}
.doc-studio-use-box:not([open])>summary:after{content:'▸';}
.doc-studio-use-box>p,.doc-studio-use-box .doc-use-matrix{margin-left:14px;margin-right:14px;}
.doc-studio-use-box>p{font-size:11.5px;color:#64748b;margin-top:12px;margin-bottom:9px;line-height:1.35;}
.doc-studio-use-box .doc-use-matrix{margin-bottom:14px;}
.doc-studio-template-mini{max-height:220px;overflow:auto;}
.doc-studio-sync-note{margin:12px;font-size:10.5px;padding:10px;}
.doc-studio-left-collapsed .doc-studio-shell{grid-template-columns:0 minmax(720px,1fr) 300px;}
@media(max-width:1500px){
    .doc-studio-topbar{grid-template-columns:minmax(250px,.85fr) minmax(330px,.95fr) auto;gap:12px;}
    .doc-studio-brand-title p{max-width:260px;}
    .doc-studio-shell{grid-template-columns:230px minmax(590px,1fr) 288px;}
    .doc-studio-actions .btn{padding:0 11px;}
    .doc-studio-preview-left select{min-width:150px;max-width:220px;}
}
@media(max-width:1240px){
    .doc-studio-topbar{height:auto;grid-template-columns:1fr;align-items:start;}
    .doc-studio-actions{justify-content:flex-start;flex-wrap:wrap;}
    .doc-studio-shell{height:auto;min-height:calc(100vh - 68px);grid-template-columns:1fr;overflow:auto;}
    .doc-studio-sidebar{max-height:none;border-left:0;border-right:0;}
    .doc-studio-preview-wrap{min-height:780px;}
    .doc-studio-preview-toolbar{grid-template-columns:1fr;}
    .doc-studio-page-rail{justify-content:flex-start;}
}

/* ============================
   STEP 31.12E — Quotation Live PDF Pagination Engine
   Adds template-aware first / continuation / terms pages for quotation print/PDF.
============================ */
.lineo-312e-wrapper{--doc-accent:#1e88e5;}
.lineo-312e-page{padding:12mm 13mm 15mm!important;}
.lineo-312e-header{display:grid;grid-template-columns:1.25fr 1fr .85fr;gap:14mm;align-items:start;min-height:24mm;}
.lineo-312e-header.compact{min-height:18mm;grid-template-columns:1.35fr 1fr .75fr;}
.lineo-312e-brand{display:flex;gap:10px;align-items:center;min-width:0;}
.lineo-312e-brand img{max-width:36mm;max-height:17mm;object-fit:contain;display:block;}
.lineo-312e-brand>span{width:14mm;height:14mm;border-radius:4mm;background:var(--doc-accent,#1e88e5);color:#fff;display:grid;place-items:center;font-size:15px;font-weight:900;}
.lineo-312e-brand strong{display:block;font-size:13.5px;line-height:1.15;color:#111827;letter-spacing:.04em;text-transform:uppercase;}
.lineo-312e-brand small{display:block;margin-top:2px;font-size:8.8px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:52mm;}
.lineo-312e-title{text-align:right;}
.lineo-312e-title h1{font-size:16px;line-height:1.1;margin:0 0 5px;color:var(--doc-accent,#1e88e5);letter-spacing:.12em;text-transform:uppercase;font-weight:900;}
.lineo-312e-title p{margin:0;font-size:10px;color:#475569;font-weight:700;}
.lineo-312e-contact{text-align:right;font-size:9.2px;color:#475569;line-height:1.3;}
.lineo-312e-contact p{margin:0 0 3px!important;}
.lineo-312e-rule{height:2px;background:var(--doc-accent,#1e88e5);margin:4mm 0 5mm;}
.lineo-312e-info-grid{display:grid;grid-template-columns:1fr 1.25fr;gap:18mm;margin-bottom:5mm;}
.lineo-312e-info-grid h3{margin:0 0 3px;font-size:12px;line-height:1.25;color:#111827;}
.lineo-312e-info-grid p{font-size:9.4px;line-height:1.38;margin:0 0 3px;color:#334155;}
.lineo-312e-info-grid .lineo-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px;}
.lineo-312e-subject{display:grid;grid-template-columns:28mm 1fr;gap:8px;border:1px solid #e8edf5;border-radius:8px;padding:6px 8px;margin:0 0 4mm;font-size:9.2px;break-inside:avoid;page-break-inside:avoid;}
.lineo-312e-subject strong{color:#64748b;text-transform:uppercase;letter-spacing:.06em;}
.lineo-312e-subject span{white-space:pre-wrap;color:#111827;}
.lineo-312e-continued-strip{display:flex;justify-content:space-between;gap:10mm;align-items:center;border:1px solid #e8edf5;background:#f8fafc;border-radius:8px;padding:5px 8px;margin-bottom:4mm;font-size:9px;color:#475569;}
.lineo-312e-continued-strip strong{font-size:10px;color:#111827;}
.lineo-312e-items{margin-top:0!important;}
.lineo-312e-items th{background:var(--doc-accent,#1e88e5)!important;color:#fff!important;border-color:rgba(255,255,255,.22)!important;font-size:8.1px!important;padding:6px 5px!important;}
.lineo-312e-items td{font-size:8.6px!important;line-height:1.26!important;padding:6px 5px!important;}
.lineo-312e-items .lineo-col-no{width:8mm!important;text-align:center!important;}
.lineo-312e-items .lineo-col-image{width:20mm!important;text-align:center!important;}
.lineo-312e-items .lineo-col-qty{width:13mm!important;text-align:right!important;}
.lineo-312e-items .lineo-col-unit{width:14mm!important;text-align:center!important;}
.lineo-312e-items .lineo-col-price{width:22mm!important;text-align:right!important;}
.lineo-312e-items .lineo-col-discount{width:15mm!important;text-align:right!important;}
.lineo-312e-items .lineo-col-vat{width:13mm!important;text-align:center!important;}
.lineo-312e-items .lineo-col-amount{width:24mm!important;text-align:right!important;white-space:nowrap!important;}
.lineo-312e-final-blocks{display:grid;grid-template-columns:1fr 55mm;gap:12mm;align-items:start;margin-top:6mm;break-inside:avoid;page-break-inside:avoid;}
.lineo-312e-amount-words{border:1px solid #e8edf5;border-radius:8px;padding:7px 9px;font-size:9.2px;color:#334155;}
.lineo-312e-amount-words strong{display:block;margin-bottom:4px;color:#111827;}
.lineo-312e-amount-words p{margin:0;line-height:1.38;}
.lineo-312e-totals{width:55mm!important;margin:0!important;}
.lineo-312e-notes{margin-top:5mm;border:1px solid #e8edf5;border-radius:8px;padding:7px 9px;font-size:9.2px;color:#334155;break-inside:avoid;page-break-inside:avoid;}
.lineo-312e-notes strong{display:block;color:#111827;margin-bottom:3px;}
.lineo-312e-notes p{margin:0;line-height:1.38;}
.lineo-312e-signatures{grid-template-columns:1fr 1fr!important;gap:20mm!important;font-size:9.2px!important;}
.lineo-312e-signatures .lineo-signature-space{height:20mm!important;border-bottom:1px solid #94a3b8;}
.lineo-continuation-footer{position:absolute;left:13mm;bottom:9mm;font-size:8.5px;font-weight:700;color:#64748b;}
.lineo-312e-terms-content{font-size:9.4px;line-height:1.55;color:#1f2937;}
.lineo-312e-terms-content h2{text-align:center;font-size:14px;letter-spacing:.12em;margin:3mm 0 7mm;color:#111827;}
.lineo-312e-terms-text{white-space:normal;margin-bottom:6mm;}
.lineo-312e-required-inputs{display:grid;gap:4mm;margin:6mm 0;}
.lineo-312e-term-field{border:1px solid #dbeafe;border-radius:8px;background:#f8fbff;padding:6px 8px;display:grid;grid-template-columns:38mm 1fr;gap:8px;break-inside:avoid;page-break-inside:avoid;}
.lineo-312e-term-field strong{font-size:9px;color:#111827;}
.lineo-312e-term-field span{font-size:9px;color:#334155;line-height:1.35;}
.lineo-312e-acceptance{border:1px solid #bfdbfe;border-radius:10px;padding:8px 10px;margin-top:6mm;break-inside:avoid;page-break-inside:avoid;}
.lineo-312e-acceptance strong{display:block;margin-bottom:4px;color:#111827;}
.lineo-312e-acceptance p{margin:0 0 8mm;color:#334155;}
.lineo-312e-acceptance div{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10mm;font-size:9px;color:#475569;}
.lineo-312e-acceptance span{border-top:1px solid #94a3b8;padding-top:3px;}
@media print{
  .lineo-312e-page{width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;padding:10mm 12mm 14mm!important;overflow:hidden!important;page-break-after:always!important;break-after:page!important;}
  .lineo-312e-page:last-child{page-break-after:auto!important;break-after:auto!important;}
  .lineo-312e-header{min-height:21mm;gap:10mm;}
  .lineo-312e-header.compact{min-height:16mm;}
  .lineo-312e-rule{margin:3.5mm 0 4mm;}
  .lineo-312e-info-grid{margin-bottom:4mm;gap:14mm;}
  .lineo-312e-items th{padding:5px 5px!important;font-size:7.8px!important;}
  .lineo-312e-items td{padding:5px 5px!important;font-size:8.2px!important;line-height:1.22!important;}
  .lineo-312e-final-blocks{margin-top:5mm;}
  .lineo-312e-signatures .lineo-signature-space{height:17mm!important;}
}

/* STEP 31.12F — Quotation template required inputs */
.quotation-template-inputs-panel{margin:18px 0;}
.qti-card{border:1px solid var(--border-color,#e5e7eb);background:linear-gradient(180deg,#ffffff,#f8fafc);border-radius:18px;padding:16px;box-shadow:0 10px 28px rgba(15,23,42,.05);}
.qti-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px;}
.qti-head h4{margin:0;color:var(--text-primary,#111827);font-size:16px;font-weight:800;letter-spacing:.01em;}
.qti-head p{margin:4px 0 0;color:var(--text-muted,#64748b);font-size:12px;}
.qti-badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#eef4ff;color:#1d4ed8;font-weight:800;font-size:11px;white-space:nowrap;}
.qti-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.qti-field{display:flex;flex-direction:column;gap:6px;}
.qti-field label{font-size:12px;font-weight:800;color:var(--text-secondary,#334155);}
.qti-field label span{color:#dc2626;}
.qti-field textarea{resize:vertical;min-height:48px;line-height:1.45;}
.qti-field.is-required textarea:focus{border-color:#1d4ed8;box-shadow:0 0 0 3px rgba(29,78,216,.08);}
.qti-preview-summary{margin-top:18px;border:1px solid #dbeafe;border-radius:12px;background:#f8fbff;padding:12px 14px;font-size:12px;}
.qti-preview-summary h4{margin:0 0 8px;color:#1e3a8a;font-size:13px;}
.qti-preview-summary div{display:grid;grid-template-columns:170px 1fr;gap:10px;border-top:1px solid #e5eefb;padding:7px 0;}
.qti-preview-summary div:first-of-type{border-top:0;}
.qti-preview-summary strong{color:#0f172a;}
.qti-preview-summary span{color:#334155;}
@media(max-width:900px){.qti-grid{grid-template-columns:1fr}.qti-preview-summary div{grid-template-columns:1fr;gap:3px}}

/* STEP 31.12G — Invoice / PO / DN live pagination refinements */
.lineo-312g-wrapper{--doc-accent:#1e88e5;}
.lineo-312g-page .lineo-col-remarks{width:34mm!important;color:#475569!important;}
.lineo-312g-page .lineo-312e-items .lineo-col-desc{word-break:break-word;white-space:normal;}
.lineo-312g-page .lineo-312e-items .lineo-col-remarks{word-break:break-word;white-space:normal;font-size:8.1px!important;line-height:1.24!important;}
.lineo-312g-page .lineo-312e-signatures span{font-weight:500;color:#475569;}
.lineo-312g-wrapper[data-doc-type="DELIVERY_NOTE"] .lineo-312e-items .lineo-col-desc{width:auto!important;}
.lineo-312g-wrapper[data-doc-type="DELIVERY_NOTE"] .lineo-312e-items .lineo-col-qty{width:18mm!important;}
.lineo-312g-wrapper[data-doc-type="DELIVERY_NOTE"] .lineo-312e-items .lineo-col-unit{width:18mm!important;}
.lineo-312g-wrapper[data-doc-type="DELIVERY_NOTE"] .lineo-312e-final-blocks{display:none!important;}
@media print{
  .lineo-312g-page .lineo-col-remarks{width:32mm!important;}
  .lineo-312g-page .lineo-312e-items .lineo-col-remarks{font-size:7.8px!important;}
}

/* STEP 31.12H — Customer Statement live pagination */
.lineo-312h-wrapper{--doc-accent:#1e88e5;}
.lineo-312h-actions{justify-content:flex-end;gap:10px;margin:0 0 14px;}
.lineo-312h-info-grid{grid-template-columns:1.05fr 1.2fr;}
.lineo-312h-items{table-layout:fixed;width:100%;}
.lineo-312h-items th{font-size:7.8px!important;white-space:nowrap;}
.lineo-312h-items td{font-size:8.2px!important;line-height:1.22!important;vertical-align:top;}
.lineo-312h-items .lineo-st-date{width:21mm!important;}
.lineo-312h-items .lineo-st-type{width:20mm!important;}
.lineo-312h-items .lineo-st-ref{width:34mm!important;word-break:break-word;}
.lineo-312h-items .lineo-st-status{width:22mm!important;word-break:break-word;}
.lineo-312h-items .lineo-st-amt{width:24mm!important;white-space:nowrap!important;}
.lineo-312h-items .lineo-st-balance{width:26mm!important;white-space:nowrap!important;}
.lineo-312h-opening-row td{background:#f8fafc!important;color:#0f172a!important;font-weight:800;}
.lineo-312h-closing-block{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:6mm;break-inside:avoid;page-break-inside:avoid;}
.lineo-312h-closing-block div{border:1px solid #e8edf5;border-radius:9px;padding:7px 8px;background:#fbfdff;}
.lineo-312h-closing-block span{display:block;font-size:7.8px;text-transform:uppercase;letter-spacing:.07em;color:#64748b;margin-bottom:3px;}
.lineo-312h-closing-block strong{display:block;font-size:10px;color:#111827;white-space:nowrap;}
.lineo-312h-closing-block .grand{border-color:rgba(30,136,229,.35);background:linear-gradient(180deg,rgba(30,136,229,.08),rgba(255,255,255,.95));}
.lineo-312h-closing-block .grand strong{color:var(--doc-accent,#1e88e5);font-size:11px;}
.lineo-312h-terms-page .lineo-312e-terms-content h2{color:var(--doc-accent,#1e88e5);}
@media(max-width:900px){.lineo-312h-actions{justify-content:flex-start;flex-wrap:wrap}.lineo-312h-closing-block{grid-template-columns:1fr 1fr}}
@media print{
  .lineo-312h-actions{display:none!important;}
  .lineo-312h-page .lineo-312h-items th{font-size:7.4px!important;padding:5px 4px!important;}
  .lineo-312h-page .lineo-312h-items td{font-size:7.8px!important;padding:5px 4px!important;}
  .lineo-312h-page .lineo-st-date{width:19mm!important;}
  .lineo-312h-page .lineo-st-type{width:18mm!important;}
  .lineo-312h-page .lineo-st-ref{width:32mm!important;}
  .lineo-312h-page .lineo-st-status{width:20mm!important;}
  .lineo-312h-page .lineo-st-amt{width:22mm!important;}
  .lineo-312h-page .lineo-st-balance{width:25mm!important;}
}

/* ============================
   STEP 31.12I — Document Studio cleanup, fit-page preview and printable studio preview
   Keeps the interface simple: fixed app shell, scrollable preview, one-page view by default.
============================ */
html, body.doc-studio-fullscreen-page{height:100%;}
.doc-studio-fullscreen-page{overflow:hidden!important;background:#f4f7fb;}
.doc-studio-app-layout,.doc-studio-page{height:100vh!important;min-height:0!important;overflow:hidden!important;}
.doc-studio-topbar{
    height:60px!important;
    grid-template-columns:minmax(250px,.82fr) minmax(420px,1fr) auto!important;
    gap:12px!important;
    padding:8px 14px!important;
    box-shadow:0 4px 14px rgba(15,23,42,.045)!important;
}
.doc-studio-brand-title{gap:12px!important;}
.doc-studio-back{height:34px!important;border-radius:10px!important;padding:0 11px!important;font-size:13px!important;}
.doc-studio-brand-title h1{font-size:18px!important;letter-spacing:-.03em!important;}
.doc-studio-brand-title p{display:none!important;}
.doc-studio-title-line{gap:8px!important;}
.doc-studio-status{height:22px!important;font-size:10px!important;padding:0 9px!important;}
.doc-studio-top-fields{grid-template-columns:minmax(150px,220px) minmax(220px,1fr)!important;gap:10px!important;}
.doc-studio-top-fields label{gap:3px!important;font-size:9.5px!important;letter-spacing:.08em!important;color:#64748b!important;}
.doc-studio-top-fields select,.doc-studio-top-fields input{height:34px!important;border-radius:10px!important;font-size:12.5px!important;}
.doc-studio-actions{gap:7px!important;}
.doc-studio-actions .btn{height:34px!important;border-radius:10px!important;padding:0 12px!important;font-size:12.5px!important;}
.doc-studio-more-menu{top:calc(100% + 6px)!important;}
.doc-studio-shell{
    height:calc(100vh - 60px)!important;
    min-height:0!important;
    grid-template-columns:235px minmax(0,1fr) 300px!important;
    overflow:hidden!important;
}
.doc-studio-sidebar{min-height:0!important;overflow:auto!important;}
.doc-studio-left{border-right:1px solid #dbe3ef!important;}
.doc-studio-right{display:flex!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important;border-left:1px solid #dbe3ef!important;}
.doc-studio-panel-head{padding:12px 13px 9px!important;}
.doc-studio-panel-head h3{font-size:13.5px!important;}
.doc-studio-panel-head p{font-size:11px!important;}
.doc-studio-section-group{padding:10px 11px 2px!important;}
.doc-studio-mini-label{font-size:9.5px!important;margin-bottom:7px!important;}
.doc-studio-section{min-height:39px!important;border-radius:11px!important;padding:7px 8px!important;grid-template-columns:26px 1fr 18px!important;gap:8px!important;}
.doc-section-ico{width:24px!important;height:24px!important;border-radius:8px!important;font-size:12px!important;}
.doc-studio-section strong{font-size:11.5px!important;}
.doc-studio-section small{font-size:9.5px!important;}
.doc-studio-sync-note,.doc-studio-template-mini{display:none!important;}
.doc-studio-preview-wrap{
    min-width:0!important;
    min-height:0!important;
    height:100%!important;
    overflow:hidden!important;
    grid-template-rows:44px 36px minmax(0,1fr) 32px!important;
    background:#eef3f9!important;
}
.doc-studio-preview-toolbar{height:44px!important;min-height:0!important;grid-template-columns:minmax(0,1fr) auto!important;padding:6px 12px!important;gap:10px!important;}
.doc-studio-preview-left{gap:8px!important;min-width:0!important;overflow:hidden!important;}
.doc-studio-preview-left label{font-size:9.5px!important;gap:2px!important;}
.doc-studio-preview-left select{height:30px!important;min-width:145px!important;max-width:230px!important;border-radius:9px!important;font-size:11.5px!important;}
.doc-studio-view-tools{height:30px!important;padding:2px!important;border-radius:10px!important;}
.doc-studio-view-tools button{width:26px!important;height:24px!important;}
.doc-studio-view-tools span{font-size:11px!important;min-width:54px!important;}
.doc-studio-view-tools select{height:24px!important;font-size:11px!important;}
.doc-studio-page-rail{height:36px!important;padding:4px 12px!important;justify-content:center!important;overflow-x:auto!important;}
.doc-studio-page-rail button{height:27px!important;border-radius:9px!important;font-size:11px!important;padding:0 10px!important;}
.doc-studio-preview-stage{
    min-height:0!important;
    height:100%!important;
    overflow:auto!important;
    padding:22px 18px 36px!important;
    background:linear-gradient(135deg,#f8fafc 0,#e9eff7 100%)!important;
    overscroll-behavior:contain;
    scrollbar-width:thin;
}
.doc-studio-pages{
    min-height:0!important;
    display:flex!important;
    gap:22px!important;
    align-items:flex-start!important;
    justify-content:center!important;
    padding:26px 0 28px!important;
}
.doc-studio-pages.all{justify-content:center!important;flex-wrap:wrap!important;align-content:flex-start!important;}
.doc-studio-pages.spread{justify-content:flex-start!important;min-width:max-content!important;}
.doc-studio-page-scale{
    width:calc(210mm * var(--studio-zoom,.62));
    height:calc(297mm * var(--studio-zoom,.62));
    flex:0 0 auto;
    position:relative;
    margin:0 0 28px;
}
.doc-studio-a4{
    position:absolute!important;
    left:0!important;
    top:0!important;
    margin:0!important;
    transform:scale(var(--studio-zoom,.62))!important;
    transform-origin:top left!important;
}
.doc-studio-pages.single .doc-studio-page-scale{margin-left:auto;margin-right:auto;}
.doc-page-caption{top:-25px!important;font-size:11px!important;}
.doc-studio-bottom-bar{height:32px!important;padding:5px 12px!important;font-size:10.5px!important;background:#fff!important;border-top:1px solid #dbe3ef!important;}
.doc-studio-bottom-bar .btn{height:24px!important;font-size:10.5px!important;padding:0 9px!important;}
.doc-studio-inspector-tabs{height:40px!important;flex:0 0 auto!important;}
.doc-studio-inspector-tabs button{font-size:11px!important;}
.doc-studio-inspector{flex:1 1 auto!important;min-height:0!important;overflow:auto!important;padding:13px!important;}
.doc-studio-use-box{flex:0 0 auto!important;max-height:34%!important;overflow:auto!important;}
.doc-studio-use-box>summary{padding:11px 13px!important;font-size:12px!important;}
.doc-studio-alert{top:66px!important;right:14px!important;}
.doc-branding-logo-row{align-items:center!important;gap:9px!important;}
.doc-studio-logo.big{width:58px!important;height:58px!important;border-radius:14px!important;}
@media(max-width:1450px){
    .doc-studio-shell{grid-template-columns:220px minmax(0,1fr) 280px!important;}
    .doc-studio-topbar{grid-template-columns:minmax(220px,.75fr) minmax(360px,.95fr) auto!important;}
    .doc-studio-actions .btn{padding:0 9px!important;}
}
@media(max-width:1180px){
    .doc-studio-fullscreen-page{overflow:auto!important;}
    .doc-studio-app-layout,.doc-studio-page{height:auto!important;overflow:visible!important;}
    .doc-studio-topbar{height:auto!important;grid-template-columns:1fr!important;}
    .doc-studio-shell{height:auto!important;grid-template-columns:1fr!important;overflow:visible!important;}
    .doc-studio-preview-wrap{height:82vh!important;min-height:680px!important;}
    .doc-studio-right{display:block!important;overflow:auto!important;}
}
@media print{
    .doc-studio-page-scale{width:auto!important;height:auto!important;margin:0!important;display:block!important;}
    .doc-studio-a4{position:relative!important;transform:none!important;box-shadow:none!important;border:0!important;border-radius:0!important;margin:0!important;page-break-after:always;}
}

/* ============================
   STEP 31.12J — Document Studio preview geometry + PDF cleanup
   Fixes clipped A4 preview, confusing scroll behaviour, selected outlines in preview PDF,
   and accidental blank/split pages when using Preview PDF.
============================ */
.doc-studio-shell{grid-template-columns:220px minmax(0,1fr) 280px!important;}
.doc-studio-preview-stage{overflow:auto!important;min-width:0!important;min-height:0!important;}
.doc-studio-pages{min-width:max-content!important;align-items:flex-start!important;}
.doc-studio-pages.single{min-width:0!important;justify-content:center!important;}
.doc-studio-pages.all{min-width:0!important;justify-content:center!important;}
.doc-studio-page-scale{
    width:calc(794px * var(--studio-zoom,.62))!important;
    height:calc(1123px * var(--studio-zoom,.62))!important;
    flex:0 0 auto!important;
    position:relative!important;
    overflow:visible!important;
    margin:0 auto 34px!important;
}
.doc-studio-a4{
    width:794px!important;
    height:1123px!important;
    min-height:1123px!important;
    max-height:1123px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    transform:scale(var(--studio-zoom,.62))!important;
    transform-origin:top left!important;
}
.doc-studio-page-inner{
    height:100%!important;
    min-height:0!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    padding:54px 56px 46px!important;
}
.doc-studio-pages.single .doc-studio-page-scale{margin-left:auto!important;margin-right:auto!important;}
.doc-page-caption{pointer-events:none!important;}
.doc-studio-company{min-height:60px;}
.doc-studio-company.compact{min-height:46px;}
.doc-studio-item-table{table-layout:fixed!important;}
.doc-studio-item-table th,.doc-studio-item-table td{overflow:hidden;text-overflow:ellipsis;}
.doc-studio-required-preview{gap:8px!important;}
.doc-studio-required-preview div{padding:7px!important;}
.doc-studio-terms p{max-height:90px;overflow:hidden;}
.doc-studio-terms-page .doc-studio-terms p{max-height:none;}
.doc-studio-print-clean .doc-page-caption,.doc-studio-print-clean .doc-studio-a4.active-page{outline:0!important;}
@media(max-width:1450px){.doc-studio-shell{grid-template-columns:210px minmax(0,1fr) 270px!important;}.doc-studio-topbar{grid-template-columns:minmax(210px,.7fr) minmax(330px,.9fr) auto!important;}}
@media print{
    .doc-studio-page-scale{width:210mm!important;height:297mm!important;margin:0!important;overflow:hidden!important;page-break-after:always!important;break-after:page!important;}
    .doc-studio-page-scale:last-child{page-break-after:auto!important;break-after:auto!important;}
    .doc-studio-a4{width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;overflow:hidden!important;transform:none!important;box-shadow:none!important;border:0!important;border-radius:0!important;}
    .doc-studio-page-inner{height:100%!important;min-height:0!important;padding:16mm 14mm 12mm!important;overflow:hidden!important;}
    .doc-preview-section.selected,.doc-preview-section:hover{border-color:transparent!important;background:transparent!important;box-shadow:none!important;}
    .doc-page-caption{display:none!important;}
}

/* ============================
   PATCH 4 — Document Studio / live PDF cleanup
   Keeps previews scrollable on screen and creates cleaner A4 output for Print / Save PDF.
============================ */
.doc-studio-preview-stage,
.doc-studio-preview-wrap,
.doc-studio-pages{
    min-width:0!important;
    min-height:0!important;
}
.doc-studio-preview-stage{
    overflow:auto!important;
    overscroll-behavior:contain;
}
.doc-studio-pages.single,
.doc-studio-pages.spread,
.doc-studio-pages.all{
    align-content:flex-start!important;
}
.doc-studio-pages.single .doc-studio-page-scale,
.doc-studio-pages.spread .doc-studio-page-scale{
    flex:0 0 auto!important;
}
.invoice-view-page,
#invoiceDetail,
#quotationDetail,
#deliveryNoteDetail,
#poDetail,
#creditNoteDetail,
#paymentReceiptDetail,
#customerStatementResult{
    min-width:0;
    overflow:visible;
}
#invoiceDetail .lineo-paged-wrapper,
#quotationDetail .lineo-paged-wrapper,
#deliveryNoteDetail .lineo-paged-wrapper,
#poDetail .lineo-paged-wrapper,
#creditNoteDetail .lineo-paged-wrapper,
#paymentReceiptDetail .lineo-paged-wrapper,
#customerStatementResult .lineo-paged-wrapper{
    max-width:100%;
    width:100%;
    overflow:auto;
    align-content:start;
}
.lineo-paged-wrapper[data-template-engine="31.12E"],
.lineo-paged-wrapper[data-template-engine="31.12G"],
.lineo-paged-wrapper[data-template-engine="31.12H"]{
    scroll-padding:24px;
}
.lineo-paged-page{
    flex:0 0 auto;
}
.lineo-312e-page,
.lineo-312g-page,
.lineo-312h-page{
    background:#fff!important;
}
.lineo-312e-items td,
.lineo-312g-items td,
.lineo-312h-items td{
    overflow-wrap:break-word;
}
.lineo-312e-items .lineo-col-amount,
.lineo-312g-items .lineo-col-amount,
.lineo-312h-items .lineo-st-amt,
.lineo-312h-items .lineo-st-balance{
    white-space:nowrap!important;
    overflow-wrap:normal!important;
}
@media screen and (max-width: 980px){
    #invoiceDetail .lineo-paged-wrapper,
    #quotationDetail .lineo-paged-wrapper,
    #deliveryNoteDetail .lineo-paged-wrapper,
    #poDetail .lineo-paged-wrapper,
    #creditNoteDetail .lineo-paged-wrapper,
    #paymentReceiptDetail .lineo-paged-wrapper,
    #customerStatementResult .lineo-paged-wrapper{
        justify-items:start!important;
    }
}
@media print{
    html,body{width:210mm!important;min-width:210mm!important;background:#fff!important;overflow:visible!important;}
    .sidebar,.topbar,.doc-studio-topbar,.doc-studio-left,.doc-studio-right,.doc-studio-preview-toolbar,.doc-studio-bottom-bar,.doc-studio-page-rail,.no-print,.invoice-detail-actions,.document-collab-card,.linsys-approval-card,.work-inbox-widget{display:none!important;}
    .app-layout,.main-content,.content-body,.invoice-view-page,#invoiceDetail,#quotationDetail,#deliveryNoteDetail,#poDetail,#creditNoteDetail,#paymentReceiptDetail,#customerStatementResult{display:block!important;margin:0!important;padding:0!important;width:210mm!important;max-width:210mm!important;background:#fff!important;box-shadow:none!important;border:0!important;overflow:visible!important;}
    .lineo-paged-wrapper[data-template-engine]{display:block!important;width:210mm!important;max-width:210mm!important;background:#fff!important;padding:0!important;margin:0!important;gap:0!important;overflow:visible!important;}
    .lineo-paged-wrapper[data-template-engine] .lineo-paged-page{width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;margin:0!important;padding:12mm 13mm 15mm!important;box-shadow:none!important;border:0!important;border-radius:0!important;page-break-after:always!important;break-after:page!important;overflow:hidden!important;}
    .lineo-paged-wrapper[data-template-engine] .lineo-paged-page:last-child{page-break-after:auto!important;break-after:auto!important;}
    .lineo-paged-wrapper[data-template-engine] .lineo-page-number{bottom:5mm!important;}
}

/* Patch 4B - Simplified Document Template Picker */
.template-picker-page .content-body{
    max-width:1320px;
    margin:0 auto;
}
.ltp-hero{
    display:flex;
    justify-content:space-between;
    gap:24px;
    padding:26px 28px;
    border:1px solid rgba(15,23,42,.08);
    background:linear-gradient(135deg,#fff 0%,#f8fafc 52%,#eef6ff 100%);
}
.ltp-hero h3{
    margin:4px 0 8px;
    font-size:1.45rem;
    color:#111827;
}
.ltp-hero p{
    max-width:780px;
    margin:0;
    color:#64748b;
    line-height:1.55;
}
.ltp-eyebrow{
    display:inline-flex;
    align-items:center;
    padding:5px 10px;
    border-radius:999px;
    background:#eff6ff;
    color:#1d4ed8;
    font-weight:700;
    font-size:.78rem;
    letter-spacing:.02em;
}
.ltp-hero-steps{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    min-width:330px;
}
.ltp-hero-steps span{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
    padding:10px 12px;
    border-radius:14px;
    background:#fff;
    border:1px solid #e5e7eb;
    color:#334155;
    font-weight:700;
    box-shadow:0 12px 28px rgba(15,23,42,.06);
}
.ltp-tabs{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin:18px 0;
    padding:8px;
    border-radius:18px;
    background:#f8fafc;
    border:1px solid #e5e7eb;
}
.ltp-tabs button{
    border:0;
    background:transparent;
    color:#475569;
    padding:11px 16px;
    border-radius:12px;
    font-weight:800;
    cursor:pointer;
}
.ltp-tabs button.active{
    background:#111827;
    color:#fff;
    box-shadow:0 12px 24px rgba(17,24,39,.18);
}
.ltp-tab-panel{display:none;}
.ltp-tab-panel.active{display:block;}
.ltp-card-header{
    align-items:center;
    gap:18px;
}
.ltp-type-select{
    display:grid;
    gap:6px;
    min-width:250px;
    color:#64748b;
    font-size:.78rem;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.06em;
}
.ltp-gallery-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(270px,1fr));
    gap:18px;
}
.ltp-template-card{
    display:flex;
    flex-direction:column;
    gap:12px;
    padding:16px;
    border:1px solid #e5e7eb;
    border-radius:20px;
    background:#fff;
    box-shadow:0 16px 34px rgba(15,23,42,.06);
    transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ltp-template-card:hover{
    transform:translateY(-2px);
    box-shadow:0 20px 44px rgba(15,23,42,.10);
}
.ltp-template-card.is-default{
    border-color:#2563eb;
    box-shadow:0 18px 42px rgba(37,99,235,.14);
}
.ltp-card-top{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
}
.ltp-card-top span,
.ltp-card-top strong{
    padding:5px 9px;
    border-radius:999px;
    font-size:.72rem;
    font-weight:800;
}
.ltp-card-top span{background:#f1f5f9;color:#334155;}
.ltp-card-top strong{background:#ecfdf5;color:#047857;}
.ltp-template-card h4{
    margin:0;
    color:#111827;
    font-size:1.05rem;
}
.ltp-template-card p{
    margin:0;
    color:#64748b;
    line-height:1.48;
    min-height:42px;
}
.ltp-card-actions{
    display:flex;
    gap:8px;
    margin-top:auto;
}
.ltp-card-actions .btn{flex:1;}
.ltp-preview-thumb{
    --ltp-accent:#0f766e;
    height:230px;
    border-radius:16px;
    background:#fff;
    border:1px solid #e5e7eb;
    box-shadow:inset 0 0 0 8px #f8fafc;
    padding:22px 20px;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    gap:14px;
    position:relative;
}
.ltp-preview-thumb:before{
    content:"";
    position:absolute;
    top:0;left:0;right:0;
    height:5px;
    background:var(--ltp-accent);
}
.ltp-preview-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}
.ltp-preview-head b{
    display:block;
    color:#111827;
    font-size:.85rem;
}
.ltp-preview-head small{
    display:block;
    color:#94a3b8;
    margin-top:3px;
    font-size:.68rem;
}
.ltp-preview-head strong{
    color:var(--ltp-accent);
    font-size:.8rem;
    letter-spacing:.08em;
}
.ltp-preview-meta{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    font-size:.68rem;
    color:#64748b;
}
.ltp-preview-meta span{
    padding:8px 10px;
    border-radius:10px;
    background:#f8fafc;
    border:1px solid #edf2f7;
}
.ltp-preview-lines{
    display:grid;
    gap:7px;
}
.ltp-preview-lines i{
    display:block;
    height:18px;
    border-radius:6px;
    background:linear-gradient(90deg,#e5e7eb 0%,#f8fafc 100%);
}
.ltp-preview-lines i:first-child{background:var(--ltp-accent);opacity:.75;}
.ltp-preview-total{
    margin-top:auto;
    margin-left:auto;
    min-width:48%;
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:11px 12px;
    border-radius:10px;
    background:#f8fafc;
    border:1px solid #e5e7eb;
    color:#111827;
    font-size:.76rem;
}
.ltp-style-executive_clean{box-shadow:inset 0 0 0 8px #f1f5f9;}
.ltp-style-minimal_formal{box-shadow:none;}
.ltp-style-bold_commercial{background:linear-gradient(180deg,#fff 0%,#f8fafc 100%);}
.ltp-style-luxury_grid{background:#fffaf0;box-shadow:inset 0 0 0 8px #fff7ed;}
.ltp-style-compact_a4{height:230px;padding:18px 18px;gap:10px;}
.ltp-style-compact_a4 .ltp-preview-lines i{height:14px;}
.ltp-saved-list{
    display:grid;
    gap:10px;
}
.ltp-saved-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:14px 16px;
    border:1px solid #e5e7eb;
    border-radius:14px;
    background:#fff;
}
.ltp-saved-row strong{display:block;color:#111827;}
.ltp-saved-row small{display:block;color:#64748b;margin-top:3px;}
.ltp-saved-actions{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.ltp-form-grid{
    display:grid;
    grid-template-columns:260px 1fr;
    gap:26px;
    align-items:start;
}
.ltp-logo-box{
    display:grid;
    gap:12px;
    justify-items:start;
}
.ltp-logo-preview{
    width:220px;
    height:140px;
    border:1px dashed #cbd5e1;
    border-radius:18px;
    background:#f8fafc;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#64748b;
    font-weight:800;
    overflow:hidden;
}
.ltp-logo-preview img{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    padding:16px;
}
.ltp-logo-box small{color:#64748b;}
.ltp-form-main{min-width:0;}
.ltp-checkline{
    display:flex;
    align-items:center;
    gap:10px;
    margin:4px 0 18px;
    color:#475569;
    font-weight:700;
}
.ltp-modal{
    position:fixed;
    inset:0;
    z-index:5000;
    display:none;
}
.ltp-modal.show{display:block;}
.ltp-modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(15,23,42,.55);
    backdrop-filter:blur(4px);
}
.ltp-modal-card{
    position:relative;
    width:min(960px,calc(100vw - 32px));
    max-height:calc(100vh - 42px);
    margin:22px auto;
    overflow:auto;
    background:#fff;
    border-radius:22px;
    box-shadow:0 28px 90px rgba(15,23,42,.35);
    padding:24px;
}
.ltp-modal-x{
    position:absolute;
    top:16px;
    right:16px;
    width:38px;
    height:38px;
    border:0;
    border-radius:50%;
    background:#f1f5f9;
    cursor:pointer;
    font-size:1.4rem;
}
.ltp-large-preview{
    display:grid;
    grid-template-columns:minmax(280px,420px) 1fr;
    gap:24px;
    align-items:start;
}
.ltp-large-preview .ltp-preview-thumb{
    height:560px;
    max-width:420px;
    padding:34px 30px;
}
.ltp-large-preview .ltp-preview-lines i{height:34px;}
.ltp-preview-copy{
    padding:18px 6px;
}
.ltp-preview-copy h4{
    margin:0 0 10px;
    color:#111827;
    font-size:1.35rem;
}
.ltp-preview-copy p{
    color:#64748b;
    line-height:1.6;
    margin:0 0 18px;
}
@media (max-width: 1020px){
    .ltp-hero{flex-direction:column;}
    .ltp-hero-steps{min-width:0;width:100%;}
    .ltp-form-grid{grid-template-columns:1fr;}
    .ltp-large-preview{grid-template-columns:1fr;}
    .ltp-large-preview .ltp-preview-thumb{max-width:none;height:430px;}
}
@media (max-width: 640px){
    .ltp-card-header,.ltp-saved-row{align-items:stretch;flex-direction:column;}
    .ltp-type-select{min-width:0;width:100%;}
    .ltp-hero-steps{grid-template-columns:1fr;}
    .ltp-card-actions{flex-direction:column;}
    .ltp-modal-card{padding:18px;}
}

/* Patch 4C - Runtime hooks for file-based document template styles */
.linsys-doc-template-shell.doc-layout-template1{--doc-accent:var(--doc-accent,#0f766e);}
.linsys-doc-template-shell.doc-layout-template2 .lineo-266-title-block,
.linsys-doc-template-shell.doc-layout-template2 .lineo-header{border-radius:14px;background:linear-gradient(135deg,var(--doc-accent,#1f3a5f),#111827)!important;color:#fff!important;padding:14px!important;}
.linsys-doc-template-shell.doc-layout-template2 .lineo-266-title-block h1,
.linsys-doc-template-shell.doc-layout-template2 .lineo-header *{color:inherit!important;}
.linsys-doc-template-shell.doc-layout-template3{font-size:.94em;}
.linsys-doc-template-shell.doc-layout-template3 .lineo-unified-items-table th,
.linsys-doc-template-shell.doc-layout-template3 .lineo-items-table th{padding:6px 5px!important;font-size:10px!important;}
.linsys-doc-template-shell.doc-layout-template3 .lineo-unified-items-table td,
.linsys-doc-template-shell.doc-layout-template3 .lineo-items-table td{padding:6px 5px!important;font-size:10px!important;}
.linsys-doc-template-shell.doc-layout-template4{background:#fffdf8!important;border-color:rgba(138,106,63,.25)!important;}
.linsys-doc-template-shell.doc-layout-template4 .lineo-266-title-block h1,
.linsys-doc-template-shell.doc-layout-template4 .lineo-doc-title{font-family:Georgia,serif!important;letter-spacing:.08em;color:var(--doc-accent,#8a6a3f)!important;}
.linsys-doc-template-shell.doc-layout-template4 .lineo-unified-items-table th,
.linsys-doc-template-shell.doc-layout-template4 .lineo-items-table th{background:transparent!important;color:var(--doc-accent,#8a6a3f)!important;border-bottom:1px solid var(--doc-accent,#8a6a3f)!important;}

/* =========================================================
   Patch 32.0 — LinSys Universal Theme Foundation
   Module Group Navigation + softer SaaS typography
   Runtime copy is intentionally kept in styles.css because every
   page already loads that file. Source split is also saved under
   assets/css/theme/ for future modular cleanup.
   ========================================================= */
@media screen {
:root {
    --ls-font: Inter, Manrope, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --ls-bg: #f4f7fb;
    --ls-bg-soft: #eef3f9;
    --ls-surface: #ffffff;
    --ls-surface-soft: #f8fafd;
    --ls-rail: #edf2f8;
    --ls-panel: #f7f9fc;
    --ls-text: #1d2736;
    --ls-muted: #7c8799;
    --ls-muted-2: #9aa5b5;
    --ls-border: #dde5ef;
    --ls-border-soft: #e8eef6;
    --ls-accent: #6d5dfc;
    --ls-accent-2: #4f7cff;
    --ls-success: #16a34a;
    --ls-danger: #dc2626;
    --ls-radius-sm: 10px;
    --ls-radius: 14px;
    --ls-radius-lg: 20px;
    --ls-shadow-soft: 0 10px 32px rgba(31, 41, 55, .06);
    --ls-sidebar-width: 292px;
    --ls-rail-width: 72px;

    --font-sans: var(--ls-font);
    --primary: var(--ls-accent-2);
    --primary-dark: #3d66df;
    --primary-light: #e7edff;
    --gray-50: var(--ls-bg);
    --gray-100: #edf2f8;
    --gray-200: var(--ls-border);
    --gray-300: #cbd5e1;
    --gray-400: var(--ls-muted-2);
    --gray-500: var(--ls-muted);
    --gray-600: #536173;
    --gray-700: #374151;
    --gray-800: var(--ls-text);
    --gray-900: #151c28;
    --shadow: var(--ls-shadow-soft);
    --shadow-md: 0 14px 40px rgba(31,41,55,.08);
    --shadow-lg: 0 22px 60px rgba(31,41,55,.10);
    --radius: var(--ls-radius-sm);
    --radius-lg: var(--ls-radius);
}

html { background: var(--ls-bg); }
body {
    background: var(--ls-bg);
    color: var(--ls-text);
    font-family: var(--ls-font);
    font-weight: 400;
    letter-spacing: -.012em;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}
body, input, select, textarea, button { font-family: var(--ls-font); }

h1, h2, h3, h4, h5, h6,
.page-title,
.card-title,
.modal-title,
.stat-card h3,
.dashboard-welcome h1 {
    font-weight: 560;
    letter-spacing: -.035em;
    color: var(--ls-text);
}
strong, b { font-weight: 560; }
label, .form-label, .nav-section-title { font-weight: 500; }

.app-layout { background: var(--ls-bg); }
.main-content {
    background: var(--ls-bg);
    transition: margin-left .24s ease, background .24s ease;
}
.topbar {
    min-height: 70px;
    background: rgba(247, 249, 252, .88);
    border-bottom: 1px solid var(--ls-border-soft);
    backdrop-filter: blur(16px);
    box-shadow: none;
}
.page-title { font-size: 1.2rem; }
.content-body { padding: 24px 28px; }
.card,
.stat-card,
.summary-card,
.dashboard-card,
.invoice-form-panel,
.invoice-preview-panel,
.table-container,
.soft-card,
.doc-summary-card {
    background: var(--ls-surface);
    border: 1px solid var(--ls-border-soft);
    border-radius: var(--ls-radius-lg);
    box-shadow: var(--ls-shadow-soft);
}
.card-header,
.modal-header {
    border-bottom-color: var(--ls-border-soft);
}
.card-title { font-size: 1rem; }
.page-subtitle,
.form-help,
.info-box,
small { color: var(--ls-muted); }
.btn {
    border-radius: 12px;
    font-weight: 520;
    letter-spacing: -.01em;
    box-shadow: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--ls-accent-2), var(--ls-accent));
    border-color: transparent;
}
.btn-secondary,
.btn-ghost {
    background: #fff;
    border-color: var(--ls-border);
    color: var(--ls-text);
}
.form-control,
.filter-select,
.search-box input,
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
    border-color: var(--ls-border);
    border-radius: 12px;
    box-shadow: none;
    font-weight: 400;
}
.form-control:focus,
.filter-select:focus,
.search-box input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(79,124,255,.55);
    box-shadow: 0 0 0 4px rgba(79,124,255,.10);
}
.data-table thead th {
    color: var(--ls-muted);
    font-weight: 560;
    letter-spacing: .04em;
    background: #f8fafd;
}
.data-table tbody td { color: #334155; }
.status-badge, .badge { font-weight: 560; }

/* Universal grouped module sidebar */
@media (min-width: 1025px) {
    .sidebar.linsys-sidebar { width: var(--ls-sidebar-width); }
    .sidebar.linsys-sidebar ~ .main-content,
    .sidebar.linsys-sidebar + .main-content { margin-left: var(--ls-sidebar-width); }
    .sidebar.linsys-sidebar.is-collapsed { width: var(--ls-rail-width); }
    .sidebar.linsys-sidebar.is-collapsed ~ .main-content,
    .sidebar.linsys-sidebar.is-collapsed + .main-content { margin-left: var(--ls-rail-width); }
}
.sidebar.linsys-sidebar {
    color: var(--ls-text);
    background: var(--ls-panel);
    border-right: 1px solid var(--ls-border);
    box-shadow: 10px 0 34px rgba(15, 23, 42, .035);
    display: grid;
    grid-template-columns: var(--ls-rail-width) minmax(0, 1fr);
    padding: 0;
    overflow: visible;
    transition: width .24s ease, transform .3s ease;
}
.linsys-icon-rail {
    min-width: 0;
    background: var(--ls-rail);
    border-right: 1px solid var(--ls-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    gap: 14px;
    overflow: hidden;
}
.linsys-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    position: relative;
    text-decoration: none;
    background: #fff;
    color: var(--ls-accent-2);
    border: 1px solid var(--ls-border-soft);
    box-shadow: 0 10px 24px rgba(79,124,255,.10);
}
.linsys-brand-mark svg { width: 25px; height: 25px; }
.linsys-brand-mark span {
    position: absolute;
    right: -3px;
    bottom: -3px;
    min-width: 16px;
    height: 16px;
    border-radius: 99px;
    background: var(--ls-accent);
    color: #fff;
    font-size: 9px;
    line-height: 16px;
    text-align: center;
    font-weight: 600;
}
.linsys-rail-stack {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    overflow: visible;
}
.linsys-rail-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.linsys-rail-link {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: #536173;
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.linsys-rail-link svg { width: 22px; height: 22px; }
.linsys-rail-link span { display: none; }
.linsys-rail-link:hover {
    background: #fff;
    color: var(--ls-accent-2);
    transform: translateY(-1px);
}
.linsys-rail-link.active {
    background: #fff;
    color: var(--ls-accent);
    box-shadow: 0 10px 24px rgba(79,124,255,.12);
}
.linsys-rail-link.active::before {
    content: "";
    position: absolute;
    left: -10px;
    width: 3px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--ls-accent), var(--ls-accent-2));
}
.linsys-collapse-toggle svg { transition: transform .2s ease; }
.sidebar.linsys-sidebar.is-collapsed .linsys-collapse-toggle svg { transform: rotate(180deg); }
.linsys-rail-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: var(--ls-accent);
    border: 1px solid var(--ls-border-soft);
    text-decoration: none;
    font-weight: 560;
    position: relative;
    overflow: visible;
}
.linsys-rail-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.linsys-rail-avatar i {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #22c55e;
}
.linsys-secondary-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--ls-panel);
    overflow: hidden;
}
.linsys-panel-head {
    min-height: 96px;
    padding: 22px 20px 14px;
    border-bottom: 1px solid var(--ls-border-soft);
    display: flex;
    align-items: flex-end;
}
.linsys-app-name {
    font-size: 1.28rem;
    color: var(--ls-accent);
    letter-spacing: .015em;
    font-weight: 560;
}
.linsys-panel-head p {
    margin: 5px 0 0;
    color: var(--ls-muted);
    font-size: .79rem;
    line-height: 1.35;
}
.sidebar.linsys-sidebar .sidebar-nav.linsys-group-nav {
    flex: 1;
    padding: 16px 14px;
    overflow: hidden;
}
.linsys-group-panel { display: none; }
.linsys-group-panel.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.linsys-group-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 0 6px 10px;
}
.linsys-group-title span {
    color: var(--ls-text);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-weight: 560;
}
.linsys-group-title small {
    font-size: .68rem;
    color: var(--ls-muted-2);
}
.linsys-group-links {
    display: grid;
    gap: 4px;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link {
    gap: 11px;
    color: #2d394c;
    border-radius: 14px;
    padding: 10px 11px;
    font-size: .88rem;
    font-weight: 420;
    min-height: 44px;
    background: transparent;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link svg {
    width: 19px;
    height: 19px;
    color: #8b96a8;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link b {
    font-size: .86rem;
    font-weight: 450;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link small {
    margin-top: 1px;
    color: var(--ls-muted);
    font-size: .72rem;
    line-height: 1.15;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link:hover {
    background: #fff;
    color: var(--ls-accent-2);
    box-shadow: 0 8px 20px rgba(31,41,55,.045);
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link.active {
    background: #fff;
    color: var(--ls-accent);
    box-shadow: 0 10px 24px rgba(79,124,255,.10);
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link.active::after {
    content: "";
    margin-left: auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ls-accent);
}
.sidebar.linsys-sidebar .linsys-sidebar-footer {
    border-top: 1px solid var(--ls-border-soft);
    padding: 13px 14px 14px;
    background: rgba(255,255,255,.35);
}
.sidebar.linsys-sidebar .user-info-button {
    width: 100%;
    border: 1px solid var(--ls-border-soft);
    background: #fff;
    color: var(--ls-text);
    padding: 9px;
    border-radius: 16px;
}
.sidebar.linsys-sidebar .user-name { color: var(--ls-text); font-weight: 500; }
.sidebar.linsys-sidebar .user-role { color: var(--ls-muted); }
.sidebar.linsys-sidebar .account-caret { color: var(--ls-muted); margin-left: auto; }
.sidebar.linsys-sidebar .account-dropdown {
    right: 14px;
    bottom: 72px;
    left: auto;
    border: 1px solid var(--ls-border-soft);
    box-shadow: 0 20px 60px rgba(15,23,42,.14);
}
.sidebar.linsys-sidebar.is-collapsed {
    grid-template-columns: var(--ls-rail-width) 0;
}
.sidebar.linsys-sidebar.is-collapsed .linsys-secondary-panel {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
}
.sidebar.linsys-sidebar.is-collapsed .linsys-rail-link.active::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #151c28;
    color: #fff;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
}
.sidebar.linsys-sidebar.is-collapsed .linsys-rail-link:hover::after { opacity: 1; }

@media (max-width: 1024px) {
    .sidebar.linsys-sidebar {
        width: min(var(--ls-sidebar-width), calc(100vw - 48px));
        grid-template-columns: var(--ls-rail-width) minmax(0, 1fr);
        transform: translateX(-100%);
    }
    .sidebar.linsys-sidebar.open { transform: translateX(0); }
    .sidebar.linsys-sidebar.is-collapsed {
        width: min(var(--ls-sidebar-width), calc(100vw - 48px));
        grid-template-columns: var(--ls-rail-width) minmax(0, 1fr);
    }
    .sidebar.linsys-sidebar.is-collapsed .linsys-secondary-panel {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
    .main-content { margin-left: 0 !important; }
    .content-body { padding: 18px; }
}

/* Workspace pages: same theme, minimal canvas */
.ob-fullscreen-layout .main-content,
body.dashboard-configurator-page .main-content,
body.document-designer-page .main-content,
.document-template-workspace .main-content {
    background: var(--ls-bg);
}
.ob-final-topbar,
.dashboard-configurator-page .dc-topbar,
.document-studio-topbar,
.dst-topbar {
    font-family: var(--ls-font);
    font-weight: 450;
}
.ob-final-topbar strong,
.ob-final-build-rail strong,
.ob-final-view-rail strong,
.dc-topbar h1,
.dc-card h3,
.document-studio-topbar h1,
.dst-title {
    font-weight: 560 !important;
    letter-spacing: -.03em;
}
.ob-final-build-rail,
.ob-final-view-rail,
.ob-inspector,
.dc-card,
.document-studio-panel,
.dst-panel {
    border-color: var(--ls-border-soft) !important;
    box-shadow: var(--ls-shadow-soft) !important;
}
}

/* Patch 32.1 — navigation cleanup, top-right account and enquiry pipeline */
@media (min-width: 1025px) {
    .sidebar.linsys-sidebar.linsys-direct-mode { width: var(--ls-rail-width); grid-template-columns: var(--ls-rail-width) 0; }
    .sidebar.linsys-sidebar.linsys-direct-mode ~ .main-content,
    .sidebar.linsys-sidebar.linsys-direct-mode + .main-content { margin-left: var(--ls-rail-width); }
}
.sidebar.linsys-sidebar.linsys-direct-mode .linsys-secondary-panel { opacity: 0; pointer-events: none; transform: translateX(-8px); }
.topbar { position: relative; }
.topbar .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar .linsys-topbar-account { margin-left: auto; position: relative; }
.topbar .linsys-topbar-account .user-info-button { width: auto; min-width: 0; height: 46px; padding: 3px; border-radius: 999px; background: #fff; border: 1px solid var(--ls-border-soft, #e5e9f2); box-shadow: 0 12px 28px rgba(15,23,42,.06); }
.topbar .linsys-topbar-account .user-info-button:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(15,23,42,.09); }
.topbar .linsys-topbar-account .user-meta,
.topbar .linsys-topbar-account .account-caret { display: none !important; }
.topbar .linsys-topbar-account .user-avatar { width: 38px; height: 38px; }
.topbar .linsys-topbar-account .account-dropdown { top: calc(100% + 10px); right: 0; bottom: auto; left: auto; z-index: 1200; }
.linsys-user-notification-badge,
.linsys-menu-notification-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; align-items: center; justify-content: center; background: #6d5cff; color: #fff; font-size: 10px; font-weight: 650; line-height: 18px; box-shadow: 0 0 0 2px #fff; }
.user-avatar .linsys-user-notification-badge { position: absolute; top: -5px; right: -5px; }
.account-dropdown a .linsys-menu-notification-badge { margin-left: auto; box-shadow: none; }
.linsys-dashboard-topbar { margin: 0; background: rgba(255,255,255,.84); border-bottom: 1px solid var(--ls-border-soft, #e5e9f2); backdrop-filter: blur(12px); }
.linsys-dashboard-message-card { margin-bottom: 16px; border-radius: 20px; overflow: hidden; }
.linsys-dashboard-message-preview { display: grid; gap: 8px; }
.enquiry-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}.enquiry-kpi{background:#fff;border:1px solid var(--border-color,#e5e7eb);border-radius:16px;padding:16px;box-shadow:0 8px 20px rgba(15,23,42,.04)}.enquiry-kpi span{display:block;color:var(--text-muted,#6b7280);font-size:12px;text-transform:uppercase;letter-spacing:.05em;font-weight:520}.enquiry-kpi strong{display:block;margin-top:6px;font-size:24px;color:var(--text-color,#111827);font-weight:560}.enquiry-kpi small{display:block;margin-top:4px;color:var(--text-muted,#6b7280)}.enquiry-modal .modal{max-width:980px}.enquiry-converted{font-size:12px;color:#15803d;font-weight:560}.linsys-list-card-header{align-items:center;justify-content:space-between}.linsys-filter-row{display:grid;grid-template-columns:minmax(240px,1fr) minmax(160px,220px) minmax(160px,220px);gap:12px;align-items:center}.linsys-enquiry-table .enquiry-row-status{min-width:150px;height:36px;padding:0 10px;border-radius:12px;font-size:.82rem}.linsys-enquiry-table td{vertical-align:middle}.linsys-enquiry-table .actions{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}.linsys-enquiry-table .actions .btn{white-space:nowrap}.work-inbox-item{border:1px solid var(--ls-border-soft,#e7ebf3);border-radius:14px;padding:10px;display:flex;gap:10px;align-items:flex-start;background:#fff;cursor:pointer}.work-inbox-item.unread{background:#fbfcff;border-color:rgba(109,92,255,.22)}.work-inbox-item-icon{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:#f3f6fb}.work-inbox-item-main{flex:1;min-width:0}.work-inbox-item-main strong{font-weight:560;font-size:.9rem;color:#1f2937}.work-inbox-item-main p{margin:2px 0;color:#667085;font-size:.78rem;line-height:1.35}.work-inbox-item-main small{color:#8a94a6}.work-inbox-priority{font-size:.68rem;border-radius:999px;background:#f3f6fb;padding:4px 7px;color:#667085;text-transform:capitalize}.work-inbox-empty{color:#7b8496;font-size:.88rem;padding:12px;border:1px dashed var(--ls-border-soft,#e7ebf3);border-radius:14px;background:#fff}
@media(max-width:900px){.enquiry-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.linsys-filter-row{grid-template-columns:1fr}.topbar .linsys-topbar-account{margin-left:0}}@media(max-width:560px){.enquiry-kpis{grid-template-columns:1fr}.linsys-enquiry-table .actions{justify-content:flex-start}.linsys-dashboard-topbar .page-title{display:none}}

/* =========================================================
   Patch 32.2 — Universal Account, Theme Settings + Enquiry UX Cleanup
   ========================================================= */
html[data-linsys-theme="dark"] {
    --ls-bg: #101522;
    --ls-bg-soft: #151b2a;
    --ls-surface: #171e2d;
    --ls-surface-soft: #1c2536;
    --ls-rail: #141b29;
    --ls-panel: #161e2d;
    --ls-text: #eef3fb;
    --ls-muted: #9aa7bb;
    --ls-muted-2: #77839a;
    --ls-border: #2b3548;
    --ls-border-soft: #263146;
    --ls-accent: #8d83ff;
    --ls-accent-2: #6f95ff;
    --gray-50: var(--ls-bg);
    --gray-100: var(--ls-bg-soft);
    --gray-200: var(--ls-border);
    --gray-700: #dbe5f4;
    --gray-800: var(--ls-text);
    --gray-900: #f8fbff;
    --text-color: var(--ls-text);
    --text-muted: var(--ls-muted);
    --border-color: var(--ls-border-soft);
}
html[data-linsys-theme="dark"] body,
html[data-linsys-theme="dark"] .main-content,
html[data-linsys-theme="dark"] .content-body { background: var(--ls-bg) !important; color: var(--ls-text); }
html[data-linsys-theme="dark"] .card,
html[data-linsys-theme="dark"] .modal,
html[data-linsys-theme="dark"] .table-container,
html[data-linsys-theme="dark"] .linsys-page-card,
html[data-linsys-theme="dark"] .sidebar.linsys-sidebar .linsys-secondary-panel,
html[data-linsys-theme="dark"] .account-dropdown,
html[data-linsys-theme="dark"] .form-control { background: var(--ls-surface) !important; color: var(--ls-text) !important; border-color: var(--ls-border-soft) !important; }
html[data-linsys-theme="dark"] .topbar,
html[data-linsys-theme="dark"] .linsys-dashboard-topbar { background: rgba(16,21,34,.86) !important; border-color: var(--ls-border-soft) !important; }
html[data-linsys-theme="dark"] .data-table th,
html[data-linsys-theme="dark"] .data-table td { border-color: var(--ls-border-soft) !important; color: var(--ls-text); }
html[data-linsys-theme="dark"] .data-table tbody tr:hover { background: rgba(255,255,255,.035); }
html[data-linsys-theme="dark"] .text-gray,
html[data-linsys-theme="dark"] .page-subtitle,
html[data-linsys-theme="dark"] small { color: var(--ls-muted) !important; }

body, input, select, textarea, button { font-weight: 400; }
h1,h2,h3,h4,h5,h6,.page-title,.card-title,.modal-title { font-weight: 540 !important; }
strong,b,.btn,.nav-link b,.linsys-group-title span { font-weight: 520 !important; }
.form-label,label { font-weight: 480 !important; }

.sidebar.linsys-sidebar .linsys-brand-img { width: 34px; height: 34px; border-radius: 12px; object-fit: cover; display:block; }
.sidebar.linsys-sidebar .linsys-sidebar-footer .account-menu-wrap:not(.linsys-topbar-account) { display:none; }
.topbar .linsys-topbar-account .account-dropdown,
.account-dropdown {
    width: 312px !important;
    min-width: 312px !important;
    max-width: min(312px, calc(100vw - 24px));
    border-radius: 22px !important;
    padding: 10px !important;
    font-size: .92rem;
}
.account-dropdown-head { padding: 12px 12px 14px !important; border-bottom: 1px solid var(--ls-border-soft,#e8eef6); margin-bottom: 6px; }
.account-dropdown-head strong { display:block; font-size: .98rem; line-height:1.3; font-weight:540 !important; color:var(--ls-text,#1d2736); }
.account-dropdown-head small { display:block; margin-top:3px; white-space:normal; overflow:hidden; text-overflow:ellipsis; color:var(--ls-muted,#7c8799); }
.account-dropdown a,
.account-dropdown button { border-radius: 14px !important; padding: 11px 12px !important; font-weight: 480 !important; line-height: 1.3; gap: 10px; }
.account-dropdown a:hover,
.account-dropdown button:hover { background: var(--ls-surface-soft,#f8fafd) !important; }
.user-avatar { position:relative; }

.linsys-theme-choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.linsys-theme-choice { border:1px solid var(--ls-border-soft,#e8eef6); background:var(--ls-surface,#fff); border-radius:18px; padding:16px; text-align:left; cursor:pointer; box-shadow:0 8px 20px rgba(15,23,42,.04); }
.linsys-theme-choice strong { display:block; margin-bottom:4px; color:var(--ls-text,#1d2736); }
.linsys-theme-choice span { color:var(--ls-muted,#7c8799); font-size:.86rem; }
.linsys-theme-choice.active { border-color:var(--ls-accent,#6d5dfc); box-shadow:0 0 0 3px rgba(109,92,255,.14); }
.linsys-icon-preview { min-height: 110px; }
.linsys-icon-preview img { width:72px; height:72px; object-fit:cover; border-radius:18px; }

.linsys-drawer { position:fixed; inset:0 0 0 auto; width:min(560px,100vw); transform:translateX(105%); transition:transform .22s ease; z-index:1500; pointer-events:none; }
.linsys-drawer.open { transform:translateX(0); pointer-events:auto; }
.linsys-drawer-panel { height:100%; background:var(--ls-surface,#fff); border-left:1px solid var(--ls-border-soft,#e8eef6); box-shadow:-24px 0 60px rgba(15,23,42,.16); display:flex; flex-direction:column; }
.linsys-drawer-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.22); opacity:0; pointer-events:none; transition:opacity .2s ease; z-index:1490; }
.linsys-drawer-backdrop.open { opacity:1; pointer-events:auto; }
.linsys-drawer-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:22px 24px; border-bottom:1px solid var(--ls-border-soft,#e8eef6); }
.linsys-drawer-head h3 { margin:2px 0 4px; font-size:1.15rem; }
.enquiry-drawer-actions { display:flex; gap:8px; flex-wrap:wrap; padding:14px 24px; border-bottom:1px solid var(--ls-border-soft,#e8eef6); }
.enquiry-drawer-body { padding:18px 24px 28px; overflow:auto; }
.enquiry-drawer-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.enquiry-drawer-summary div { border:1px solid var(--ls-border-soft,#e8eef6); border-radius:16px; padding:12px; background:var(--ls-surface-soft,#f8fafd); min-width:0; }
.enquiry-drawer-summary small { display:block; color:var(--ls-muted,#7c8799); font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; }
.enquiry-drawer-summary strong { display:block; color:var(--ls-text,#1d2736); word-break:break-word; }
.enquiry-drawer-summary span { color:var(--ls-muted,#7c8799); font-size:.82rem; }
.enquiry-drawer-tabs { display:flex; gap:8px; margin-bottom:12px; border-bottom:1px solid var(--ls-border-soft,#e8eef6); padding-bottom:8px; }
.enquiry-drawer-tabs button { border:0; background:transparent; color:var(--ls-muted,#7c8799); border-radius:999px; padding:8px 12px; cursor:pointer; }
.enquiry-drawer-tabs button.active { background:var(--ls-accent,#6d5dfc); color:#fff; }
.enquiry-drawer-tab { display:none; }
.enquiry-drawer-tab.active { display:block; }
.enquiry-activity-list { display:grid; gap:9px; }
.enquiry-activity-item,
.enquiry-attachment-item { border:1px solid var(--ls-border-soft,#e8eef6); border-radius:14px; padding:11px 12px; background:var(--ls-surface,#fff); }
.enquiry-activity-item p { margin:4px 0; color:var(--ls-muted,#7c8799); font-size:.85rem; }
.enquiry-activity-item small,
.enquiry-attachment-item small { display:block; color:var(--ls-muted,#7c8799); margin-top:4px; }
.enquiry-attachment-item a { font-weight:520; color:var(--ls-accent,#6d5dfc); text-decoration:none; }
.enquiry-action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }

.linsys-enquiry-table .enquiry-row td { vertical-align:middle; }
.linsys-enquiry-table .enquiry-row td > small,
.linsys-enquiry-table .enquiry-assigned-cell small { display:block; color:var(--ls-muted,#7c8799); margin-top:3px; }
.enquiry-smart-btn { margin-top:7px; display:inline-flex; }
.enquiry-priority-badge { display:inline-flex; align-items:center; justify-content:center; padding:5px 9px; border-radius:999px; font-size:.73rem; background:#f3f6fb; color:#667085; text-transform:capitalize; }
.enquiry-priority-badge.priority-high { background:#fff7ed; color:#c2410c; }
.enquiry-priority-badge.priority-urgent { background:#fee2e2; color:#b91c1c; }
.enquiry-priority-badge.priority-low { background:#ecfdf5; color:#047857; }
.enquiry-latest span { display:block; color:var(--ls-text,#1d2736); font-size:.86rem; }
.enquiry-followup-alert { display:inline-block; margin-top:4px; padding:3px 7px; border-radius:999px; font-size:.72rem; }
.enquiry-followup-alert.today { background:#eef2ff; color:#4f46e5; }
.enquiry-followup-alert.overdue { background:#fee2e2; color:#b91c1c; }
.enquiry-modal-tools { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; padding-top:12px; border-top:1px solid var(--ls-border-soft,#e8eef6); }
.badge-returned { background:#fef3c7; color:#92400e; }
.badge-new { background:#eef2ff; color:#4338ca; }
.badge-assigned { background:#e0f2fe; color:#0369a1; }
.badge-contacted { background:#ecfdf5; color:#047857; }
.badge-follow_up { background:#fef3c7; color:#92400e; }
.badge-quotation_required,.badge-quotation_sent { background:#f5f3ff; color:#6d28d9; }
.badge-won { background:#dcfce7; color:#15803d; }
.badge-lost { background:#fee2e2; color:#b91c1c; }
.badge-on_hold { background:#f3f4f6; color:#374151; }

@media(max-width:800px){
    .linsys-theme-choice-grid,
    .enquiry-drawer-summary,
    .enquiry-action-grid { grid-template-columns:1fr; }
    .linsys-drawer { width:100vw; }
}

/* =========================================================
   Patch 32.2A — Hotfix: dark theme consistency + scrollable admin menu
   ========================================================= */
@media screen {
    .sidebar.linsys-sidebar .sidebar-nav.linsys-group-nav {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 0 !important;
        scrollbar-width: thin;
    }
    .linsys-group-panel.active {
        min-height: 0 !important;
        max-height: calc(100vh - 128px) !important;
    }
    .linsys-group-links {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        max-height: calc(100vh - 174px) !important;
        padding-right: 4px;
        scrollbar-width: thin;
    }
    .sidebar.linsys-sidebar .nav-link.linsys-nav-link {
        min-height: 40px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .sidebar.linsys-sidebar .nav-link.linsys-nav-link small {
        display: none;
    }
    .sidebar.linsys-sidebar .nav-link.linsys-nav-link:hover small,
    .sidebar.linsys-sidebar .nav-link.linsys-nav-link.active small {
        display: block;
    }

    html[data-linsys-theme="dark"] .sidebar.linsys-sidebar,
    html[data-linsys-theme="dark"] .linsys-icon-rail,
    html[data-linsys-theme="dark"] .linsys-secondary-panel,
    html[data-linsys-theme="dark"] .sidebar.linsys-sidebar .sidebar-nav.linsys-group-nav,
    html[data-linsys-theme="dark"] .sidebar.linsys-sidebar .linsys-sidebar-footer {
        background: var(--ls-panel) !important;
        border-color: var(--ls-border-soft) !important;
        color: var(--ls-text) !important;
    }
    html[data-linsys-theme="dark"] .linsys-brand-mark,
    html[data-linsys-theme="dark"] .linsys-rail-link.active,
    html[data-linsys-theme="dark"] .linsys-rail-link:hover,
    html[data-linsys-theme="dark"] .sidebar.linsys-sidebar .nav-link.linsys-nav-link.active,
    html[data-linsys-theme="dark"] .sidebar.linsys-sidebar .nav-link.linsys-nav-link:hover {
        background: var(--ls-surface-soft) !important;
        color: var(--ls-accent) !important;
        box-shadow: 0 12px 30px rgba(0,0,0,.18) !important;
    }
    html[data-linsys-theme="dark"] .linsys-rail-link,
    html[data-linsys-theme="dark"] .sidebar.linsys-sidebar .nav-link.linsys-nav-link,
    html[data-linsys-theme="dark"] .linsys-group-title span,
    html[data-linsys-theme="dark"] .linsys-app-name {
        color: var(--ls-text) !important;
    }
    html[data-linsys-theme="dark"] .sidebar.linsys-sidebar .nav-link.linsys-nav-link svg,
    html[data-linsys-theme="dark"] .linsys-rail-link svg,
    html[data-linsys-theme="dark"] .linsys-group-title small,
    html[data-linsys-theme="dark"] .linsys-panel-head p,
    html[data-linsys-theme="dark"] .sidebar.linsys-sidebar .nav-link.linsys-nav-link small {
        color: var(--ls-muted) !important;
    }

    html[data-linsys-theme="dark"] .card,
    html[data-linsys-theme="dark"] .card-header,
    html[data-linsys-theme="dark"] .card-body,
    html[data-linsys-theme="dark"] .linsys-list-card-header,
    html[data-linsys-theme="dark"] .linsys-filter-row,
    html[data-linsys-theme="dark"] .toolbar,
    html[data-linsys-theme="dark"] .table-container,
    html[data-linsys-theme="dark"] .data-table,
    html[data-linsys-theme="dark"] .data-table thead th,
    html[data-linsys-theme="dark"] .modal-header,
    html[data-linsys-theme="dark"] .modal-body,
    html[data-linsys-theme="dark"] .modal-footer,
    html[data-linsys-theme="dark"] .enquiry-kpi,
    html[data-linsys-theme="dark"] .work-inbox-item,
    html[data-linsys-theme="dark"] .work-inbox-empty,
    html[data-linsys-theme="dark"] .enquiry-activity-item,
    html[data-linsys-theme="dark"] .enquiry-attachment-item,
    html[data-linsys-theme="dark"] .enquiry-drawer-summary div,
    html[data-linsys-theme="dark"] .doc-summary-card,
    html[data-linsys-theme="dark"] .settings-tabbar,
    html[data-linsys-theme="dark"] .settings-tab,
    html[data-linsys-theme="dark"] .info-box {
        background: var(--ls-surface) !important;
        border-color: var(--ls-border-soft) !important;
        color: var(--ls-text) !important;
    }
    html[data-linsys-theme="dark"] .card-header,
    html[data-linsys-theme="dark"] .linsys-list-card-header,
    html[data-linsys-theme="dark"] .data-table thead th,
    html[data-linsys-theme="dark"] .toolbar,
    html[data-linsys-theme="dark"] .linsys-filter-row,
    html[data-linsys-theme="dark"] .modal-header,
    html[data-linsys-theme="dark"] .modal-footer,
    html[data-linsys-theme="dark"] .settings-tabbar {
        background: var(--ls-surface-soft) !important;
    }
    html[data-linsys-theme="dark"] .form-control,
    html[data-linsys-theme="dark"] input,
    html[data-linsys-theme="dark"] select,
    html[data-linsys-theme="dark"] textarea,
    html[data-linsys-theme="dark"] .search-box,
    html[data-linsys-theme="dark"] .search-box input,
    html[data-linsys-theme="dark"] .btn-secondary,
    html[data-linsys-theme="dark"] .btn-ghost,
    html[data-linsys-theme="dark"] .back-btn {
        background: var(--ls-surface-soft) !important;
        border-color: var(--ls-border-soft) !important;
        color: var(--ls-text) !important;
    }
    html[data-linsys-theme="dark"] .card-title,
    html[data-linsys-theme="dark"] .page-title,
    html[data-linsys-theme="dark"] .enquiry-kpi strong,
    html[data-linsys-theme="dark"] .work-inbox-item-main strong,
    html[data-linsys-theme="dark"] .enquiry-latest span,
    html[data-linsys-theme="dark"] .data-table tbody td,
    html[data-linsys-theme="dark"] .data-table td strong {
        color: var(--ls-text) !important;
    }
    html[data-linsys-theme="dark"] .page-subtitle,
    html[data-linsys-theme="dark"] .form-help,
    html[data-linsys-theme="dark"] .work-inbox-item-main p,
    html[data-linsys-theme="dark"] .work-inbox-item-main small,
    html[data-linsys-theme="dark"] .enquiry-kpi span,
    html[data-linsys-theme="dark"] .enquiry-kpi small {
        color: var(--ls-muted) !important;
    }
    html[data-linsys-theme="dark"] .topbar .linsys-topbar-account .user-info-button,
    html[data-linsys-theme="dark"] .account-dropdown,
    html[data-linsys-theme="dark"] .account-dropdown-head {
        background: var(--ls-surface) !important;
        border-color: var(--ls-border-soft) !important;
        color: var(--ls-text) !important;
    }
}


/* =========================================================
   Patch 32.2B — universal font/theme alignment + sidebar text overflow cleanup
   ========================================================= */
:root {
    --ls-font: Inter, Manrope, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: var(--ls-font);
}
body, input, select, textarea, button { font-family: var(--ls-font) !important; }
.sidebar.linsys-sidebar .nav-link.linsys-nav-link {
    display: flex !important;
    align-items: center !important;
    max-width: 100% !important;
    overflow: hidden !important;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link svg { flex: 0 0 19px !important; }
.sidebar.linsys-sidebar .nav-link.linsys-nav-link span {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link b,
.sidebar.linsys-sidebar .nav-link.linsys-nav-link small {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.sidebar.linsys-sidebar .nav-link.linsys-nav-link small { white-space: nowrap !important; }
.sidebar.linsys-sidebar .nav-link.linsys-nav-link.active::after { flex: 0 0 6px !important; }
.linsys-group-title { min-width:0 !important; }
.linsys-group-title span { min-width:0 !important; overflow:hidden !important; text-overflow:ellipsis !important; white-space:nowrap !important; }

/* Dashboard configurator now follows the universal theme attributes. */
html[data-linsys-theme="dark"] body.dashboard-configurator-page,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-wrapper,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-main {
    background: #0f1724 !important;
    color: #e5ecf6 !important;
}
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-topbar,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-sidebar,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-canvas,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-widget-card,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-widget-item,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-settings-content,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-grid {
    background: #111c2d !important;
    border-color: rgba(148,163,184,.18) !important;
    color: #e5ecf6 !important;
}
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-input,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-select {
    background: #0b1322 !important;
    color: #e5ecf6 !important;
    border-color: rgba(148,163,184,.24) !important;
}
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-btn-secondary,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-btn-icon {
    background: #16233a !important;
    color: #e5ecf6 !important;
    border-color: rgba(148,163,184,.20) !important;
}
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-page-title,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-sidebar h2,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-canvas h2,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-widget-title {
    color: #f8fafc !important;
    font-weight: 560 !important;
}

.profile-font-help { color: var(--gray-500); font-size:.75rem; display:block; margin-top:5px; line-height:1.35; }


/* =========================================================
   Patch 32.2B — enquiry boot, universal theme sync and cleaner workspace surfaces
   ========================================================= */
html[data-linsys-theme="light"] body.dashboard-configurator-page,
html[data-linsys-theme="light"] body.dashboard-configurator-page .dbc-wrapper,
html[data-linsys-theme="light"] body.dashboard-configurator-page .dbc-main {
    background: var(--ls-bg, #f6f7fb) !important;
    color: var(--ls-text, #1f2937) !important;
}
html[data-linsys-theme="light"] body.dashboard-configurator-page .dbc-topbar,
html[data-linsys-theme="light"] body.dashboard-configurator-page .dbc-sidebar,
html[data-linsys-theme="light"] body.dashboard-configurator-page .dbc-canvas,
html[data-linsys-theme="light"] body.dashboard-configurator-page .dbc-widget-card,
html[data-linsys-theme="light"] body.dashboard-configurator-page .dbc-widget-item,
html[data-linsys-theme="light"] body.dashboard-configurator-page .dbc-grid {
    background: var(--ls-surface, #fff) !important;
    border-color: var(--ls-border-soft, #e6eaf2) !important;
    color: var(--ls-text, #1f2937) !important;
}
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-modal-content,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-modal-header,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-modal-body,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-modal-footer,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-preview-frame,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-empty-state {
    background: #111c2d !important;
    border-color: rgba(148,163,184,.18) !important;
    color: #e5ecf6 !important;
}
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-widget-item:hover,
html[data-linsys-theme="dark"] body.dashboard-configurator-page .dbc-tab.active {
    background: #17243a !important;
    color: #fff !important;
}
html[data-linsys-theme="dark"] .linsys-enquiry-table tbody tr.row-clickable:hover {
    background: rgba(255,255,255,.045) !important;
}
.enquiry-boot-warning { padding: 14px; color: var(--ls-muted); }

/* =========================================================
   Patch 32.4 — Universal mobile UI, signature isolation and enquiry task polish
   ========================================================= */
:root{
    --linsys-mobile-nav-h: 72px;
    --linsys-signature-font: "Segoe Script", "Brush Script MT", "Lucida Handwriting", "Apple Chancery", cursive;
}
/* Universal app/document font must not flatten signatures. */
.linsys-script-signature .smart-esign-script-name,
.signature-preview-box strong,
.signature-live-card .sig-script-name,
.sig-script-name,
.ob3026-sign-preview strong,
.ob-sign-preview-box strong,
.ob-signature-preview-box strong,
.doc-esignature strong,
.lineo-signature-stack-in-footer .smart-esign-script-name{
    font-family: var(--linsys-signature-font) !important;
    font-weight: 400 !important;
    letter-spacing: .01em !important;
    font-style: italic !important;
    transform: rotate(-1deg);
}
.signature-preview-box.initial strong,
.ob3026-sign-preview.mini strong,
.ob-sign-preview-box.initial strong{
    font-family: var(--linsys-signature-font) !important;
    font-weight: 500 !important;
    letter-spacing: .03em !important;
}
.signature-live-card .sig-script-name,
.signature-preview-box strong{font-size: clamp(28px, 4vw, 44px); line-height:1.05;}
.signature-preview-box small,
.signature-preview-meta,
.smart-esign-script-meta{font-family: var(--ls-font, Inter, system-ui, sans-serif) !important; font-style: normal !important; transform:none !important;}

.enquiry-task-list{display:grid;gap:10px;}
.enquiry-task-item{border:1px solid var(--ls-border-soft,#e6eaf2);background:var(--ls-surface,#fff);border-radius:16px;padding:13px 14px;display:flex;justify-content:space-between;gap:14px;align-items:flex-start;}
.enquiry-task-item strong{display:block;color:var(--ls-text,#111827);font-weight:650;}
.enquiry-task-item p{margin:4px 0;color:var(--ls-muted,#64748b);font-size:.82rem;}
.enquiry-task-item small{display:block;color:var(--ls-muted,#64748b);line-height:1.35;}
.enquiry-task-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
.enquiry-task-item.status-completed{background:rgba(22,163,74,.08);border-color:rgba(22,163,74,.22);}
.enquiry-task-item.status-returned{background:rgba(245,158,11,.10);border-color:rgba(245,158,11,.28);}
.linsys-task-forward-shell{display:grid;gap:10px;text-align:left;margin-top:10px;}
.linsys-task-forward-shell .form-label{margin:4px 0 -4px;}

.linsys-mobile-bottom-nav,
.linsys-mobile-module-drawer{display:none;}

@media (max-width: 860px){
    html, body{max-width:100%;overflow-x:hidden;}
    body{padding-bottom:calc(var(--linsys-mobile-nav-h) + env(safe-area-inset-bottom, 0px));}
    .app-layout{display:block;min-width:0;}
    .main-content{margin-left:0!important;width:100%!important;min-width:0!important;padding-bottom:var(--linsys-mobile-nav-h);}
    .content-body{padding:14px!important;}
    .topbar{position:sticky;top:0;z-index:80;min-height:64px;padding:12px 14px!important;background:var(--ls-surface,#fff);border-bottom:1px solid var(--ls-border-soft,#e6eaf2);}
    .topbar-left{min-width:0;gap:8px;}
    .page-title{font-size:20px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:54vw;}
    .back-btn span{display:none;}
    .topbar .topbar-actions{gap:8px;margin-left:auto;}
    .topbar .linsys-topbar-account .user-meta,
    .topbar .linsys-topbar-account .account-caret{display:none!important;}
    .topbar .linsys-topbar-account .user-info-button{padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;}
    .topbar .user-avatar{width:42px!important;height:42px!important;border-radius:16px!important;}
    .sidebar.linsys-sidebar{display:none!important;}
    .sidebar-backdrop{display:none!important;}
    .linsys-mobile-bottom-nav{display:grid;position:fixed;left:0;right:0;bottom:0;height:calc(var(--linsys-mobile-nav-h) + env(safe-area-inset-bottom, 0px));padding:8px 10px calc(8px + env(safe-area-inset-bottom, 0px));background:rgba(255,255,255,.94);border-top:1px solid var(--ls-border-soft,#e6eaf2);box-shadow:0 -14px 30px rgba(15,23,42,.08);z-index:250;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;backdrop-filter:blur(16px);}
    html[data-linsys-theme="dark"] .linsys-mobile-bottom-nav{background:rgba(15,23,36,.94);border-color:rgba(148,163,184,.18);box-shadow:0 -18px 36px rgba(0,0,0,.22);}
    .linsys-mobile-bottom-nav a,
    .linsys-mobile-bottom-nav button{border:0;background:transparent;color:var(--ls-muted,#64748b);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:16px;font:600 11px/1.1 var(--ls-font,Inter,sans-serif);text-decoration:none;min-width:0;}
    .linsys-mobile-bottom-nav svg{width:21px;height:21px;}
    .linsys-mobile-bottom-nav span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
    .linsys-mobile-bottom-nav .active{background:var(--ls-accent-soft,rgba(99,102,241,.12));color:var(--ls-accent,#6c63ff);}
    .linsys-mobile-module-drawer{display:block;position:fixed;inset:0;background:rgba(15,23,42,.42);opacity:0;visibility:hidden;pointer-events:none;z-index:500;transition:.18s ease;}
    .linsys-mobile-module-drawer.open{opacity:1;visibility:visible;pointer-events:auto;}
    .linsys-mobile-module-sheet{position:absolute;left:0;right:0;bottom:0;max-height:88vh;background:var(--ls-surface,#fff);border-radius:26px 26px 0 0;box-shadow:0 -24px 60px rgba(15,23,42,.22);padding:16px;overflow:auto;transform:translateY(18px);transition:.2s ease;}
    .linsys-mobile-module-drawer.open .linsys-mobile-module-sheet{transform:translateY(0);}
    html[data-linsys-theme="dark"] .linsys-mobile-module-sheet{background:#111c2d;color:#e5ecf6;border:1px solid rgba(148,163,184,.18);}
    .linsys-mobile-module-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;}
    .linsys-mobile-module-head strong{font-size:18px;font-weight:650;color:var(--ls-text,#111827);}
    .linsys-mobile-module-head button{border:1px solid var(--ls-border-soft,#e6eaf2);background:var(--ls-surface-soft,#f8fafc);border-radius:14px;width:42px;height:42px;font-size:24px;color:var(--ls-text,#111827);}
    .linsys-mobile-module-search input{width:100%;height:46px;border:1px solid var(--ls-border-soft,#e6eaf2);border-radius:16px;padding:0 14px;background:var(--ls-surface-soft,#f8fafc);color:var(--ls-text,#111827);}
    .linsys-mobile-module-groups{display:grid;gap:14px;margin-top:16px;padding-bottom:18px;}
    .linsys-mobile-module-group h4{display:flex;align-items:center;gap:9px;margin:0 0 8px;color:var(--ls-muted,#64748b);font-size:12px;text-transform:uppercase;letter-spacing:.10em;}
    .linsys-mobile-module-group h4 svg{width:16px;height:16px;}
    .linsys-mobile-module-group a{display:block;padding:13px 14px;border:1px solid var(--ls-border-soft,#e6eaf2);border-radius:16px;margin-bottom:8px;text-decoration:none;background:var(--ls-surface-soft,#f8fafc);color:var(--ls-text,#111827);}
    .linsys-mobile-module-group a b{font-weight:620;display:block;}
    .linsys-mobile-module-group a small{display:block;color:var(--ls-muted,#64748b);font-size:12px;margin-top:3px;}

    .card,.linsys-page-card{border-radius:22px!important;overflow:hidden;}
    .card-header,.linsys-list-card-header{flex-direction:column!important;align-items:stretch!important;gap:14px!important;padding:16px!important;}
    .card-header .btn,.linsys-list-card-header .btn{width:100%;justify-content:center;min-height:44px;}
    .toolbar,.linsys-filter-row,.project-filter-bar{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;padding:12px!important;border-radius:18px!important;}
    .search-box,.form-control,select,input,textarea,.btn{min-height:44px;}
    .form-row,.form-row-2,.form-row-3,.form-row-4{grid-template-columns:1fr!important;gap:12px!important;}
    .modal{width:calc(100vw - 18px)!important;max-width:none!important;max-height:92vh!important;border-radius:24px!important;}
    .modal-body{max-height:calc(92vh - 128px);overflow:auto;}

    .linsys-mobile-card-table-wrap{overflow:visible!important;}
    .linsys-mobile-card-table-wrap .data-table{border-collapse:separate!important;border-spacing:0 12px!important;min-width:0!important;width:100%!important;}
    .linsys-mobile-card-table-wrap .data-table thead{display:none!important;}
    .linsys-mobile-card-table-wrap .data-table tbody{display:block!important;}
    .linsys-mobile-card-table-wrap .data-table tr{display:block!important;background:var(--ls-surface,#fff)!important;border:1px solid var(--ls-border-soft,#e6eaf2)!important;border-radius:20px!important;margin-bottom:12px!important;box-shadow:0 12px 28px rgba(15,23,42,.05)!important;overflow:hidden;}
    .linsys-mobile-card-table-wrap .data-table td{display:block!important;border:0!important;padding:10px 14px!important;color:var(--ls-text,#111827)!important;}
    .linsys-mobile-card-table-wrap .data-table td:first-child{padding-top:14px!important;}
    .linsys-mobile-card-table-wrap .data-table td:last-child{padding-bottom:14px!important;}
    .linsys-mobile-card-table-wrap .data-table td strong{display:block;font-weight:650;}
    .linsys-mobile-card-table-wrap .data-table td small{display:block;color:var(--ls-muted,#64748b);}
    .linsys-enquiry-table td:nth-child(1)::before{content:"Enquiry";}
    .linsys-enquiry-table td:nth-child(2)::before{content:"Client";}
    .linsys-enquiry-table td:nth-child(3)::before{content:"Assigned";}
    .linsys-enquiry-table td:nth-child(4)::before{content:"Priority";}
    .linsys-enquiry-table td:nth-child(5)::before{content:"Status";}
    .linsys-enquiry-table td:nth-child(6)::before{content:"Latest";}
    .linsys-enquiry-table td::before{display:block;margin-bottom:4px;color:var(--ls-muted,#64748b);font-size:11px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;}
    .enquiry-smart-btn{margin-top:8px;width:100%;justify-content:center;}
    .enquiry-kpis{grid-template-columns:1fr 1fr!important;gap:10px!important;}
    .enquiry-kpi{padding:13px!important;border-radius:18px!important;}
    .enquiry-kpi strong{font-size:18px!important;}
    .linsys-drawer{inset:0!important;z-index:420!important;}
    .linsys-drawer-panel,.enquiry-detail-panel{width:100%!important;max-width:none!important;height:100vh!important;border-radius:0!important;}
    .enquiry-drawer-actions,.enquiry-action-grid,.enquiry-task-actions{display:grid!important;grid-template-columns:1fr!important;}
    .enquiry-drawer-summary{grid-template-columns:1fr!important;}
    .enquiry-drawer-tabs{overflow-x:auto;white-space:nowrap;padding-bottom:4px;}
    .enquiry-task-item{display:grid;grid-template-columns:1fr;}

    .dashboard-grid,.stats-grid,.kpi-grid,.charts-grid{grid-template-columns:1fr!important;}
    canvas{max-width:100%!important;}
    .dashboard-configurator-page .dbc-shell,
    body.dashboard-configurator-page .dbc-wrapper,
    body.dashboard-configurator-page .dbc-main{grid-template-columns:1fr!important;}
    body.dashboard-configurator-page .dbc-sidebar{position:static!important;width:auto!important;max-height:none!important;}
    body.dashboard-configurator-page .dbc-settings-drawer{position:fixed!important;inset:auto 0 0 0!important;width:100%!important;max-height:78vh!important;border-radius:24px 24px 0 0!important;overflow:auto!important;}
    body.dashboard-configurator-page .dbc-grid{display:grid!important;grid-template-columns:1fr!important;}
}

/* Patch 32.4A — Smart task forwarding eligibility */
.task-eligibility-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px 14px;padding:12px;border:1px solid var(--ls-border, #e5e7eb);border-radius:14px;background:var(--ls-surface-muted, rgba(148,163,184,.08));}
.task-eligibility-grid label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500;color:var(--ls-text, #1f2937);}
.task-eligibility-grid input{width:16px;height:16px;accent-color:var(--ls-accent,#2563eb);}
.task-flag-line{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px;}
.task-forward-hint{display:block;margin:6px 0 10px;font-size:12px;color:var(--ls-muted,#64748b);line-height:1.4;}
.task-forward-hint.text-danger{color:#b91c1c;}
[data-theme="dark"] .task-forward-hint.text-danger{color:#fca5a5;}
.linsys-task-forward-shell .info-box.compact{margin-top:10px;padding:10px 12px;font-size:12px;border-radius:12px;}
