* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 80%;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
}

/* Delivery Form Utilities */
.form-grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.position-relative {
    position: relative;
}

.search-icon-absolute {
    position: absolute;
    right: 10px;
    top: 38px;
    color: #9ca3af;
}

.customer-info-box {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #6b7280;
    padding: 10px;
    background: #f9fafb;
    border-radius: 4px;
    display: none;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.badge-gray {
    background-color: #f3f4f6;
    color: #374151;
}

.badge-info {
    background-color: #eff6ff;
    color: #2563eb;
}

.col-orig-qty {
    text-align: center;
}

.col-rem-qty {
    text-align: center;
}

.customer-input-group {
    display: flex;
    gap: 10px;
}

.customer-input-wrapper {
    flex-grow: 1;
}

/* Modal adjustments */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content-lg {
    padding: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-grid-2-col {
        grid-template-columns: 1fr;
    }

    .customer-input-group {
        flex-direction: column;
    }
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

/* Base footer styles stay here */
.footer {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.2);
    margin-top: 30px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    color: #4a5568;
    margin-bottom: 10px;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.footer a:hover {
    color: #764ba2;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 15px 0;
}

/* =============================================================
   BUTTON DESIGN SYSTEM — Standard across all templates
   Usage: <button class="btn btn-primary">Label</button>
          <a href="..." class="btn btn-secondary btn-sm">...</a>
   HTMX: add hx-indicator="closest .btn" to show loading state
   ============================================================= */

/* --- Base --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    /* 14px */
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, opacity 150ms ease;
    user-select: none;
    vertical-align: middle;
}

.btn:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

/* Loading state — triggered by htmx-request class (HTMX adds this automatically) */
.btn.htmx-request,
.btn[aria-busy="true"],
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* Spinner shown during HTMX request */
.btn .btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

.btn.htmx-request .btn-spinner {
    display: inline-block;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Primary — main action (Save, Submit, Create) --- */
.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

/* --- Secondary — neutral / Cancel / Back --- */
.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

/* --- Success — positive confirmations (Approve, Complete, Mark Paid) --- */
.btn-success {
    background-color: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.btn-success:hover {
    background-color: #15803d;
    border-color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: none;
}

/* --- Danger — destructive actions (Delete, Cancel Record, Void) --- */
.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: none;
}

/* --- Warning — soft-warn actions (Mark Stale, Override, Expire) --- */
.btn-warning {
    background-color: #d97706;
    color: #ffffff;
    border-color: #d97706;
}

.btn-warning:hover {
    background-color: #b45309;
    border-color: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.btn-warning:active {
    transform: translateY(0);
    box-shadow: none;
}

.content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.3s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 15px;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    color: #2d3748;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
}

tr:hover {
    background: #f7fafc;
}

td {
    vertical-align: middle;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 2em;
    margin-bottom: 5px;
}

.stat-card p {
    opacity: 0.9;
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.page-title {
    color: #2d3748;
    margin-bottom: 25px;
}

.section-title {
    color: #2d3748;
    margin-top: 30px;
    margin-bottom: 15px;
}

.warning-box {
    background: #fed7d7;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f56565;
    margin-bottom: 25px;
}

.warning-box p {
    color: #742a2a;
    font-weight: 600;
}

.info-box {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.info-box p {
    margin-bottom: 8px;
}

.info-box strong {
    color: #2d3748;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.empty-state {
    text-align: center;
    color: #718096;
    padding: 40px;
}

.error-message {
    color: #f56565;
    margin-top: 5px;
    font-size: 14px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border: none;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.close-modal,
.close-supplier-modal,
.close-category-modal {
    color: #a0aec0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.3s;
}

.close-modal:hover,
.close-modal:focus,
.close-supplier-modal:hover,
.close-supplier-modal:focus,
.close-category-modal:hover,
.close-category-modal:focus {
    color: #2d3748;
}

.modal-errors {
    color: #f56565;
    background: #fed7d7;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

.modal-errors:not(:empty) {
    display: block;
}

#reader {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

/* --- Info — view / detail / navigate (View, Print, Export, Download) --- */
.btn-info {
    background-color: #0891b2;
    color: #ffffff;
    border-color: #0891b2;
}

.btn-info:hover {
    background-color: #0e7490;
    border-color: #0e7490;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.35);
}

.btn-info:active {
    transform: translateY(0);
    box-shadow: none;
}

/* --- Light — ghost / outline style for secondary list actions --- */
.btn-light {
    background-color: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
}

.btn-light:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.btn-light:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ---------------------------------------------------------------
   SIZE VARIANTS
   .btn-sm  — table row actions, secondary toolbars
   .btn-xs  — very tight spaces, icon + label combos in cells
   .btn-icon — square icon-only button
   --------------------------------------------------------------- */

/* Small: kept at readable size, used in most list-page toolbars */
.btn-sm {
    padding: 5px 12px;
    font-size: 0.8125rem;
    /* 13px */
    border-radius: 5px;
    gap: 5px;
}

/* Extra-small: tight table cells */
.btn-xs {
    padding: 3px 8px;
    font-size: 0.75rem;
    /* 12px */
    border-radius: 4px;
    gap: 4px;
}

/* Icon-only square button — 32px default, 26px for .btn-sm, 22px for .btn-xs */
.btn-icon {
    padding: 0;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 6px;
    gap: 0;
    font-size: 0.8125rem;
}

.btn-icon.btn-sm {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 0.75rem;
}

.btn-icon.btn-xs {
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 0.7rem;
}

/* Legacy Nav Styles Removed */

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .header {
        position: relative !important;
        padding-top: 60px !important;
    }

    #hamburger-btn {
        display: block !important;
    }

    /* Target by ID for higher specificity to override default flex */
    #nav-menu.nav-menu-container {
        display: none !important;
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 5px !important;
        margin-top: 20px !important;
    }

    #nav-menu.nav-menu-container.active {
        display: flex !important;
    }

    .nav-menu-container .btn,
    .nav-menu-container .dropdown {
        width: 100% !important;
        margin-bottom: 5px !important;
    }

    .nav-menu-container .dropdown button {
        width: 100% !important;
        text-align: left !important;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }

    /* Accordion logic: hide content by default on mobile */
    #nav-menu.nav-menu-container .dropdown .dropdown-content {
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        background-color: #f8fafc !important;
        display: none !important;
        padding-left: 20px !important;
        border: none !important;
        margin: 0 !important;
    }

    /* Show only when the parent dropdown is active */
    #nav-menu.nav-menu-container .dropdown.active .dropdown-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
    }

    /* Visual feedback: Darken button when active on mobile */
    #nav-menu.nav-menu-container .dropdown.active>button {
        background-color: #2d3748 !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    /* Rotate caret when active */
    #nav-menu.nav-menu-container .dropdown.active button .fa-caret-down {
        transform: rotate(180deg);
    }

    #nav-menu.nav-menu-container .dropdown button .fa-caret-down {
        transition: transform 0.3s ease;
    }

    /* Ensure desktop hover doesn't interfere */
    .dropdown:hover .dropdown-content {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .header h1 {
        font-size: 1.4em !important;
    }

    #hamburger-btn {
        right: 15px !important;
        top: 15px !important;
    }
}

/* Sortable Table Headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sortable-header:hover {
    opacity: 0.8;
}

th .sortable-header {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
}

@media (max-width: 640px) {
    .header h1 {
        font-size: 1.4em !important;
    }

    #hamburger-btn {
        right: 15px !important;
        top: 15px !important;
    }
}

/* Styles from home.html moved here */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

.close-stock-scanner,
.close-cart-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-stock-scanner:hover,
.close-stock-scanner:focus,
.close-cart-modal:hover,
.close-cart-modal:focus {
    color: black;
}

.stock-input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

#stock-reader {
    border-radius: 8px;
    overflow: hidden;
}

#scan-feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#scan-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.feedback-highlight {
    background-color: #d4edda;
    transition: background-color 0.3s ease;
}

/* .btn-icon is now defined in the Button Design System section above.
   This placeholder comment prevents old overrides from being added here. */

/* Sortable table headers (overriding previous definitions if any) */
.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

#product-table th {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    vertical-align: middle;
}

#product-table {
    table-layout: auto !important;
    width: 100% !important;
}

#product-table td {
    vertical-align: middle;
    padding: 12px 15px;
}

/* Enforce column widths for consistency */
#product-table th:nth-child(1) {
    width: 8%;
}

/* SKU */
#product-table th:nth-child(2) {
    width: 10%;
}

/* Name — wider so long names have room */
#product-table th:nth-child(3) {
    width: 30%;
}

/* Allow name column to wrap instead of truncate */
#product-table td.col-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
    line-height: 1.4;
}

/* Actions */
#product-table th:last-child,
#product-table td:last-child {
    text-align: center;
    width: auto;
    min-width: 180px;
}

.actions-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.sortable:hover {
    background-color: #f3f4f6;
}

.sortable i {
    margin-left: 5px;
    opacity: 0.5;
    font-size: 0.75rem;
}

.sortable.asc i::before {
    content: "\f0de";
}

.sortable.desc i::before {
    content: "\f0dd";
}

.sortable.asc i,
.sortable.desc i {
    opacity: 1;
}

/* Header Utility Classes */
.bg-indigo {
    background-color: #6366f1;
}

.bg-gray-dark {
    background-color: #4b5563;
}

.btn-user-dropdown {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.dropdown-header-label {
    padding: 8px 16px;
    font-weight: bold;
    color: #374151;
    background: #f3f4f6;
    font-size: 0.85em;
    text-transform: uppercase;
}

.btn-signout {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
}


/* Dashboard Utility Classes */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-page-title {
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-stat-number {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: #4f46e5;
}

.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-indigo-light {
    background: #e0e7ff;
    color: #4f46e5;
}

.bg-blue-light {
    background: #dbeafe;
    color: #2563eb;
}

.bg-green-light {
    background: #dcfce7;
    color: #16a34a;
}

.card-title-text {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.1rem;
}

.card-subtitle-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.quick-actions-section {
    margin-top: 3rem;
}

.quick-actions-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

.quick-actions-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-action-lg {
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}



/* Invoice Form Utilities */
.invoice-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.form-grid-col-gap {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vat-mode-flex {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.vat-mode-btn {
    flex: 1;
}

.vat-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.table-action-btn {
    margin-top: 10px;
}

.text-red {
    color: #dc2626;
}

.text-gray-sm {
    color: #6b7280;
}

.bg-readonly {
    background-color: #f9fafb;
    font-weight: 600;
}

.font-bold {
    font-weight: 600;
}

.text-center {
    text-align: center;
}

/* Responsive adjustments for invoice grid */
@media (max-width: 768px) {

    .invoice-form-grid,
    .vat-breakdown-grid,
    .reference-grid {
        grid-template-columns: 1fr;
    }
}


/* Selection Summary Bar */
.selection-summary-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease-out;
}

.selection-summary-bar .btn {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

/* Modal Enhancements */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #ffffff;
    margin: 10vh auto;
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-modal {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #94a3b8;
    text-shadow: 0 1px 0 #fff;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #1e293b;
}

/* Button State Classes */
.opacity-50 {
    opacity: 0.5;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.bg-emerald-600 {
    background-color: #059669;
}

.bg-emerald-600:hover {
    background-color: #047857;
}

/* View Page Layouts */
.view-layout-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .view-layout-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }
}

.info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Entity Display */
.entity-avatar-large {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.entity-header-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.data-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.data-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
}

.data-row {
    margin-bottom: 1.25rem;
}

.data-row:last-child {
    margin-bottom: 0;
}

.data-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.data-value {
    font-size: 1rem;
    color: #334155;
    font-weight: 500;
    word-break: break-word;
}

.data-value-lg {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

/* Contact/Bank Items */
.sub-item-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.sub-item-card:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
    transform: translateY(-2px);
}

.primary-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 700;
}

.comm-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #475569;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.comm-link:hover {
    color: #6366f1;
}

.comm-link i {
    width: 20px;
    color: #94a3b8;
}

/* Invoice Specific Styles */
.summary-highlight-card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    border: none;
}

.summary-highlight-card .data-card-title {
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.1);
}

.summary-highlight-card .data-label {
    color: #94a3b8;
}

.summary-highlight-card .data-value {
    color: #f8fafc;
}

.total-amount-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
    margin-top: 0.5rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-draft {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.status-sent {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.status-paid {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.status-cancelled {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fee2e2;
}

/* --- Design System Utilities (Tailwind Replacement) --- */

/* Layout & Flexbox */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1 1 0%;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.justify-start {
    justify-content: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.shrink-0 {
    flex-shrink: 0;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:flex-row {
        flex-direction: row;
    }

    .md\:items-center {
        align-items: center;
    }

    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:col-span-2 {
        grid-column: span 2 / span 2;
    }
}

/* Spacing */
.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.m-0 {
    margin: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

.py-0\.5 {
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.-mx-6 {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
}

/* Typography */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.font-black {
    font-weight: 900;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.uppercase {
    text-transform: uppercase;
}

.italic {
    font-style: italic;
}

.tracking-tight {
    letter-spacing: -0.025em;
}

.tracking-tighter {
    letter-spacing: -0.05em;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.leading-tight {
    line-height: 1.25;
}

.leading-relaxed {
    line-height: 1.625;
}

.whitespace-pre-line {
    white-space: pre-line;
}

/* Colors - Backgrounds */
.bg-white {
    background-color: #ffffff;
}

.bg-white\/10 {
    background-color: rgba(255, 255, 255, 0.1);
}

.bg-slate-50 {
    background-color: #f8fafc;
}

.bg-slate-100 {
    background-color: #f1f5f9;
}

.bg-gray-50 {
    background-color: #f9fafb;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-indigo-50 {
    background-color: #eef2ff;
}

.bg-indigo-100 {
    background-color: #e0e7ff;
}

.bg-indigo-600 {
    background-color: #4f46e5;
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.bg-green-50 {
    background-color: #f0fdf4;
}

.bg-orange-50\/30 {
    background-color: rgba(255, 247, 237, 0.3);
}

.bg-emerald-100 {
    background-color: #d1fae5;
}

/* Colors - Text */
.text-white {
    color: #ffffff;
}

.text-white\/40 {
    color: rgba(255, 255, 255, 0.4);
}

.text-white\/60 {
    color: rgba(255, 255, 255, 0.6);
}

.text-slate-400 {
    color: #94a3b8;
}

.text-slate-500 {
    color: #64748b;
}

.text-slate-600 {
    color: #475569;
}

.text-slate-700 {
    color: #334155;
}

.text-slate-800 {
    color: #1e293b;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-900 {
    color: #111827;
}

.text-indigo-500 {
    color: #6366f1;
}

.text-indigo-600 {
    color: #4f46e5;
}

.text-indigo-700 {
    color: #4338ca;
}

.text-blue-800 {
    color: #1e40af;
}

.text-green-600 {
    color: #16a34a;
}

.text-emerald-400 {
    color: #34d399;
}

.text-emerald-600 {
    color: #059669;
}

.text-orange-400 {
    color: #fb923c;
}

.text-orange-600 {
    color: #ea580c;
}

.text-red-600 {
    color: #dc2626;
}

/* Borders */
.border {
    border-width: 1px;
}

.border-b {
    border-bottom-width: 1px;
}

.border-t {
    border-top-width: 1px;
}

.border-0 {
    border-width: 0;
}

.border-slate-50 {
    border-color: #f8fafc;
}

.border-slate-100 {
    border-color: #f1f5f9;
}

.border-slate-200 {
    border-color: #e2e8f0;
}

.border-slate-300 {
    border-color: #cbd5e1;
}

.border-gray-100 {
    border-color: #f3f4f6;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

.border-gray-300 {
    border-color: #d1d5db;
}

.border-blue-200 {
    border-color: #bfdbfe;
}

.border-indigo-100 {
    border-color: #e0e7ff;
}

.border-green-100 {
    border-color: #dcfce7;
}

.border-orange-100 {
    border-color: #ffedd5;
}

.border-orange-200 {
    border-color: #fed7aa;
}

.border-white\/5 {
    border-color: rgba(255, 255, 255, 0.05);
}

.border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1);
}

.border-white\/20 {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Effects */
.rounded {
    border-radius: 0.25rem;
}

.rounded-md {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.shadow-green-500\/20 {
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.2);
}

/* States */
.hover\:bg-slate-100:hover {
    background-color: #f1f5f9;
}

.hover\:bg-slate-50\/50:hover {
    background-color: rgba(248, 250, 252, 0.5);
}

.hover\:bg-gray-50:hover {
    background-color: #f9fafb;
}

.hover\:bg-gray-900:hover {
    background-color: #111827;
}

.hover\:bg-indigo-700:hover {
    background-color: #4338ca;
}

.hover\:text-indigo-600:hover {
    color: #4f46e5;
}

.hover\:text-indigo-700:hover {
    color: #4338ca;
}

.hover\:text-emerald-800:hover {
    color: #065f46;
}

/* Transitions & Animations */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke, text-decoration-color, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.duration-300 {
    transition-duration: 300ms;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

/* Mixed/Special Utilities */
.opacity-40 {
    opacity: 0.4;
}

.hidden {
    display: none;
}

.z-50 {
    z-index: 50;
}

.fixed {
    position: fixed;
}

.bottom-0 {
    bottom: 0;
}

.left-0 {
    left: 0;
}

.right-0 {
    right: 0;
}

.translate-y-full {
    transform: translateY(100%);
}

.transform {
    transform: var(--tw-transform);
}

.cursor-pointer {
    cursor: pointer;
}

.divide-y>*+* {
    border-top-width: 1px;
}

.divide-slate-50>*+* {
    border-color: #f8fafc;
}

.divide-gray-100>*+* {
    border-color: #f3f4f6;
}