﻿/* Reset CSS */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        font-family: 'Quicksand', sans-serif;
    }

    /* Variables */
    :root {
        /* Màu chủ đạo - Blue Theme (mặc định) */
        --primary-color: #0F50AD;
        --primary-light: #5a91e0;
        --primary-dark: #0F50AD;
        --secondary-color: #FF70A6;
        --secondary-light: #FFC0DF;
        --accent-color: #4F8AFF;

        /* Gradients */
        --gradient-purple: linear-gradient(135deg, #e5a21b, #f3ca79);
        --gradient-blue: linear-gradient(135deg, #24aa7c, #7fd8b9);
        --gradient-red: linear-gradient(135deg, #E55A66, #f898a1);
        --gradient-green: linear-gradient(135deg, #0F50AD, #5a91e0);

        /* Màu trung tính */
        --bg-color: #F5F9FF;
        --text-color: #333;
        --card-bg: #FFFFFF;
        --border-color: #E0EAFF;
        --shadow-color: rgba(74, 144, 255, 0.1);

        /* Kích thước */
        --sidebar-width: 240px;
        --border-radius: 15px;
        --card-radius: 20px;
        --button-radius: 30px;
    }

    /* Theme Purple */
    .theme-purple {
        --primary-color: #864AFF;
        --primary-light: #C4A6FF;
        --primary-dark: #5D24FF;
        --secondary-color: #FF70A6;
        --secondary-light: #FFC0DF;
        --accent-color: #8A4FFF;
        --bg-color: #F8F5FF;
        --border-color: #E6E0FF;
        --shadow-color: rgba(134, 74, 255, 0.1);
    }

    /* Theme Green */
    .theme-green {
        --primary-color: #0F50AD;
        --primary-light: #A6FFCB;
        --primary-dark: #24FF70;
        --secondary-color: #864AFF;
        --secondary-light: #C4A6FF;
        --accent-color: #4FFF8A;
        --bg-color: #F5FFF9;
        --border-color: #E0FFE6;
        --shadow-color: rgba(75, 255, 134, 0.1);
    }

    /* Theme Orange */
    .theme-orange {
        --primary-color: #FF9F4A;
        --primary-light: #FFD1A6;
        --primary-dark: #FF7D24;
        --secondary-color: #864AFF;
        --secondary-light: #C4A6FF;
        --accent-color: #FFBB4F;
        --bg-color: #FFF9F5;
        --border-color: #FFE6E0;
        --shadow-color: rgba(255, 159, 74, 0.1);
    }

    /* General Styles */
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
        min-height: 100vh;
        overflow-x: hidden;
    }

    .app-container {
        display: flex;
        min-height: 100vh;
    }

    /* Sidebar */
    .sidebar {
        width: var(--sidebar-width);
        background: var(--primary-color);
        color: white;
        display: flex;
        flex-direction: column;
        position: fixed;
        height: 100vh;
        top: 0;
        left: 0;
        z-index: 100;
        transition: transform 0.3s ease, width 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar-header {
        padding: 20px;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: relative;
    }

    .sidebar-header h1 {
        font-size: 1.3rem;
        margin-top: 10px;
        letter-spacing: 1px;
        font-weight: 700;
        text-align: center;
    }

    #admin-sheet-link {
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }

    .logo {
        height: 40px;
        width: auto;
    }

    .sidebar-menu {
        list-style: none;
        padding: 20px 0;
        flex-grow: 1;
    }

    .sidebar-menu li {
        padding: 15px 25px;
        display: flex;
        align-items: center;
        cursor: pointer;
        transition: all 0.2s ease;
        margin-bottom: 5px;
        border-left: 4px solid transparent;
    }

    .sidebar-menu li i {
        margin-right: 15px;
        font-size: 1.1rem;
    }

    .sidebar-menu li:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .sidebar-menu li.active {
        background: rgba(255, 255, 255, 0.25);
        border-left: 4px solid white;
        font-weight: bold;
    }

    .sidebar-menu li.sidebar-hidden-item {
        display: none !important;
    }

    .expense-config-tabs {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 4px;
        margin: 0 0 14px;
        border-radius: 10px;
        background: #edf4ff;
        border: 1px solid #d9e7ff;
    }

    .expense-config-tab {
        border: 0;
        border-radius: 8px;
        padding: 9px 14px;
        background: transparent;
        color: #1853a4;
        font-weight: 700;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    .expense-config-tab.active {
        background: #1458b8;
        color: #fff;
        box-shadow: 0 6px 16px rgba(20, 88, 184, 0.2);
    }

    .account-owner-line {
        color: #4d5f7a;
        font-size: 0.82rem;
        margin-top: 2px;
    }

    .sidebar-footer {
        padding: 15px;
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.8rem;
    }

    .sidebar-footer i {
        color: #FF4B4B;
    }

    /* Main Content */
    .main-content {
        flex: 1;
        margin-left: var(--sidebar-width);
        transition: margin-left 0.3s ease;
    }

    .search-box {
        position: relative;
        margin-right: 20px;
    }

    .search-box input {
        padding: 10px 15px 10px 40px;
        border: 1px solid #0f50ad;
        background: var(--bg-color);
        border-radius: var(--button-radius);
        width: 420px;
        font-size: 0.9rem;
        outline: none;
    }

    .search-box.has-clear input {
        padding-right: 42px;
    }

    .search-box i {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--primary-color);
    }

    .search-clear-btn {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        border: 0;
        border-radius: 999px;
        background: #e5edf7;
        color: #475569;
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        font-weight: 900;
        line-height: 1;
        z-index: 2;
    }

    .search-box.has-value .search-clear-btn {
        display: inline-flex;
    }

    .search-clear-btn:hover {
        background: #dbeafe;
        color: var(--primary-color);
    }

    .user-info {
        display: flex;
        align-items: center;
    }

    .user-info i {
        font-size: 1.2rem;
        margin-right: 20px;
        color: var(--primary-color);
        cursor: pointer;
    }

    .avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        overflow: hidden;
        cursor: pointer;
    }

    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #menu-toggle {
        background: none;
        border: none;
        color: var(--primary-color);
        font-size: 1.5rem;
        cursor: pointer;
        display: none;
    }

    /* Content */


    .page-title {
        margin-bottom: 25px;
        font-size: 1.8rem;
        font-weight: 700;
        color: var(--primary-dark);
    }

    /* Cards */
    .summary-cards {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 30px;
        width: 100%;
    }

    .card {
        flex: 1 1 220px;
        min-width: 220px;
        background: white;
        border-radius: var(--card-radius);
        padding: 20px;
        display: flex;
        align-items: center;
        box-shadow: 0 5px 15px var(--shadow-color);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px var(--shadow-color);
    }

    .card-icon {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 15px;
        flex-shrink: 0;
    }

    .card-icon i {
        font-size: 1.5rem;
        color: white;
    }

    .card-info {
        flex-grow: 1;
    }

    .card-info h3 {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 5px;
        color: rgba(255, 255, 255, 0.9);
    }

    .card-info p {
        font-size: 1.2rem;
        font-weight: 700;
        color: white;
    }

    .gradient-purple {
        background: var(--gradient-purple);
    }

    .gradient-blue {
        background: var(--gradient-blue);
    }

    .gradient-red {
        background: var(--gradient-red);
    }

    .gradient-green {
        background: var(--gradient-green);
    }

    .gradient-teal {
        background: linear-gradient(135deg, #0891b2, #67e8f9);
    }

    /* Charts */
    .charts-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-bottom: 15px;
    }

    .chart-card {
        background: white;
        border-radius: var(--card-radius);
        padding: 20px;
        box-shadow: 0 5px 15px var(--shadow-color);
        height: 280px;
        margin-bottom: 15px;
        overflow: hidden;
    }

    .chart-card h3 {
        margin-bottom: 10px;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--primary-dark);
    }

    /* Recent Transactions */
    .recent-transactions {
        background: white;
        border-radius: var(--card-radius);
        padding: 20px;
        box-shadow: 0 5px 15px var(--shadow-color);
    }

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }

    .section-header h3 {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--primary-dark);
    }

    .view-all {
        color: var(--primary-color);
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .transactions-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .transaction-item {
        display: flex;
        align-items: center;
        padding: 8px 10px;
        border-radius: 10px;
        background: var(--bg-color);
        transition: transform 0.2s ease;
    }

    .transaction-item:hover {
        transform: translateX(3px);
    }

    .transaction-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: var(--primary-light);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .transaction-icon i {
        font-size: 0.9rem;
    }

    .transaction-icon.income {
        background: var(--gradient-green);
    }

    .transaction-icon.expense {
        background: var(--gradient-red);
    }

    .transaction-icon.transfer {
        background: var(--gradient-blue);
    }

    .transaction-info {
        flex-grow: 1;
        min-width: 0;
    }

    .transaction-info h4 {
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .transaction-info p {
        font-size: 0.75rem;
        color: #777;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .transaction-amount {
        font-weight: 700;
        font-size: 0.9rem;
        flex-shrink: 0;
        text-align: right;
    }

    .transaction-amount.income {
        color: #0F50AD;
    }

    .transaction-amount.expense {
        color: #FF4B4B;
    }

    .transaction-amount.transfer {
        color: #4A90FF;
    }

    /* Page Header with add button */
    .page-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
    }

    .add-button {
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: var(--button-radius);
        padding: 10px 20px;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        box-shadow: 0 4px 10px var(--shadow-color);
        transition: all 0.2s ease;
    }

    .add-button:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 6px 12px var(--shadow-color);
    }

    .add-button i {
        margin-right: 8px;
    }

    /* Bộ lọc */
    .filter-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
        background: #ffffff54;
        border-radius: var(--border-radius);
        padding: 8px;
        box-shadow: 0 2px 8px var(--shadow-color);
		
    }

    .filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        align-items: center;
    }

    .time-filter {
        display: flex;
        align-items: center;
        background: white;
        border-radius: 30px;
        box-shadow: 0 2px 8px var(--shadow-color);
        overflow: hidden;
        margin-right: 15px;
    }

    .time-filter-option {
        padding: 10px 15px;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
    }

    .time-filter-option:hover {
        background: var(--bg-color);
    }

    .time-filter-option.active {
        background: var(--primary-color);
        color: white;
    }

    .custom-date-range {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: 10px;
    }

    .date-picker {
        padding: 8px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 0.85rem;
    }

    .filter-item {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .filter-item label {
        font-size: 0.85rem;
        font-weight: 600;
        color: #666;
    }

    .filter-item input,
    .filter-item select {
        padding: 8px 12px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-color);
        font-size: 0.9rem;
    }

    .vn-date-picker-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
        width: 100%;
    }

    .vn-date-picker-wrap > input[placeholder="dd/mm/yyyy"] {
        width: 100%;
        padding-right: 38px !important;
    }

    .vn-date-picker-btn {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: var(--primary-color);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .vn-date-picker-btn:hover {
        background: rgba(74, 144, 255, 0.12);
    }

    .vn-date-picker-native {
        position: absolute;
        right: 4px;
        bottom: 0;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    .vn-date-picker-popover {
        position: fixed;
        z-index: 30000;
        width: 286px;
        padding: 12px;
        border: 1px solid #cfe0ff;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    }

    .vn-date-picker-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 10px;
    }

    .vn-date-picker-head button,
    .vn-date-picker-foot button,
    .vn-date-picker-grid button {
        border: 0;
        border-radius: 7px;
        background: transparent;
        color: #1f2937;
        cursor: pointer;
        font: inherit;
    }

    .vn-date-picker-head button {
        width: 34px;
        height: 34px;
        color: var(--primary-color);
    }

    .vn-date-picker-head button:hover,
    .vn-date-picker-foot button:hover,
    .vn-date-picker-grid button:hover {
        background: rgba(74, 144, 255, 0.12);
    }

    .vn-date-picker-week,
    .vn-date-picker-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }

    .vn-date-picker-week {
        margin-bottom: 5px;
        color: #64748b;
        font-size: 11px;
        font-weight: 800;
        text-align: center;
    }

    .vn-date-picker-grid button {
        height: 32px;
        font-size: 13px;
    }

    .vn-date-picker-grid button.muted {
        color: #94a3b8;
    }

    .vn-date-picker-grid button.today {
        outline: 1px solid #bfdbfe;
        color: var(--primary-dark);
        font-weight: 800;
    }

    .vn-date-picker-grid button.active {
        background: var(--primary-color);
        color: #fff;
        font-weight: 800;
    }

    .vn-date-picker-foot {
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;
    }

    .vn-date-picker-foot button {
        min-height: 32px;
        padding: 0 10px;
        color: var(--primary-color);
        font-weight: 800;
    }

    #orders-debt-panel .order-period-filter {
        display: none !important;
    }

    #orders-debt-panel .debt-as-of-filter {
        min-width: 170px;
        margin-right: 14px;
    }

    #orders-debt-panel .debt-as-of-filter label,
    #orders-debt-panel .debt-age-filter label {
        white-space: nowrap;
    }

    #orders-debt-panel .debt-age-filter {
        min-width: 190px;
        margin-left: 6px;
    }

    .transaction-search {
        flex-grow: 1;
        max-width: 400px;
        margin-left: auto;
    }

    .transaction-search input {
        width: 100%;
    }

    /* Phân trang */
    .pagination-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 20px;
        padding: 10px 0;
        margin-bottom: 15px;
    }

    .pagination {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .pagination-button {
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        padding: 8px 12px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .pagination-button:hover {
        background: var(--bg-color);
    }

    .pagination-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .pagination-numbers {
        display: flex;
        gap: 5px;
    }

    .page-number {
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        padding: 8px 12px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .page-number:hover {
        background: var(--bg-color);
    }

    .page-number.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .pagination-info {
        font-size: 0.9rem;
        color: #777;
    }

    .pagination-ellipsis {
        padding: 0 5px;
        font-weight: bold;
        color: #777;
    }

    /* Bảng */
    .table-container {
        overflow-x: scroll !important;
        /* Dùng scroll thay vì auto để luôn hiển thị thanh cuộn */
        max-width: 100% !important;
        width: 100% !important;
        display: block !important;
        /* Đảm bảo hiển thị dạng block */
        padding-bottom: 15px;
        /* Tạo không gian cho thanh cuộn */
    }


    .data-table {
        width: 100%;
        border-collapse: collapse;
    }

    .data-table th {
        padding: 4px 8px;
        text-align: left;
        font-weight: 600;
        font-size: 0.8rem;
        color: #555;
        border-bottom: 2px solid var(--border-color);
        white-space: nowrap;
    }

    .data-table td {
        padding: 4px 8px;
        font-size: 0.8rem;
        vertical-align: middle;
		border-bottom: 1px solid var(--border-color);
    }

    .data-table tbody tr:hover {
        background: var(--bg-color);
    }

    /* Fixed columns */
    .data-table th:first-child,
    .data-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
    }

    .data-table th:last-child,
    .data-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 10;
        border-left: 1px solid rgba(0, 0, 0, 0.05);
        /* Optional separator */
    }

    /* Update sticky background on hover */
    .data-table tbody tr:hover td:first-child,
    .data-table tbody tr:hover td:last-child {
        background-color: rgba(245, 249, 255, 0.9);
        /* var(--bg-color) approximation */
    }

    .orders-table th:first-child,
    .orders-table td:first-child,
    .orders-table th:last-child,
    .orders-table td:last-child {
        position: static;
        left: auto;
        right: auto;
        z-index: auto;
        border-left: 0;
    }

    .orders-table th.order-hidden-col,
    .orders-table td.order-hidden-col,
    #transactions-table th.order-hidden-col,
    #transactions-table td.order-hidden-col {
        display: none;
    }

    .orders-table th.order-pinned-col,
    .orders-table td.order-pinned-col,
    #transactions-table th.order-pinned-col,
    #transactions-table td.order-pinned-col {
        position: sticky;
        background: #fff;
        z-index: 12;
        box-shadow: 1px 0 0 rgba(0, 0, 0, 0.06);
    }

    .orders-table th.order-pinned-right-col,
    .orders-table td.order-pinned-right-col,
    #transactions-table th.order-pinned-right-col,
    #transactions-table td.order-pinned-right-col {
        position: sticky;
        background: #fff;
        z-index: 12;
        box-shadow: -1px 0 0 rgba(0, 0, 0, 0.06);
    }

    .orders-table th.order-pinned-col,
    .orders-table th.order-pinned-right-col,
    #transactions-table th.order-pinned-col,
    #transactions-table th.order-pinned-right-col {
        z-index: 18;
    }

    .orders-table tbody tr:hover td.order-pinned-col,
    .orders-table tbody tr:hover td.order-pinned-right-col,
    #transactions-table tbody tr:hover td.order-pinned-col,
    #transactions-table tbody tr:hover td.order-pinned-right-col {
        background: rgba(245, 249, 255, 0.96);
    }

    .orders-table th[data-order-col] {
        position: relative;
        user-select: none;
    }

    .orders-table th.order-pinned-col,
    .orders-table th.order-pinned-right-col {
        position: sticky;
    }

    .order-col-resizer {
        position: absolute;
        top: 0;
        right: 0;
        width: 7px;
        height: 100%;
        cursor: col-resize;
        z-index: 25;
    }

    .order-col-resizer:hover,
    body.resizing-order-column .order-col-resizer {
        background: rgba(21, 101, 192, 0.18);
    }

    body.resizing-order-column {
        cursor: col-resize;
        user-select: none;
    }

    .order-column-menu-wrap {
        position: relative;
        display: flex;
        align-items: flex-end;
    }

    .order-column-menu-btn {
        background: #4f80c9;
        height: 38px;
        min-width: 120px;
        justify-content: center;
        white-space: nowrap;
    }

    .order-column-menu {
        display: none;
        position: fixed;
        right: 0;
        top: calc(100% + 8px);
        width: 410px;
        max-height: 430px;
        overflow-y: auto;
        padding: 10px;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
        z-index: 200;
    }

    .order-column-menu.show {
        display: block;
    }

    .order-column-menu-title {
        font-weight: 700;
        color: #1f4e79;
        margin: 4px 0 8px;
    }

    .order-display-section {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding-bottom: 10px;
        margin-bottom: 8px;
        border-bottom: 1px solid #edf2f7;
    }

    .order-card-option {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.82rem;
        min-width: 0;
    }

    .order-card-option span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .order-column-option {
        display: grid;
        grid-template-columns: minmax(115px, 1fr) 58px 86px 86px;
        gap: 8px;
        align-items: center;
        padding: 7px 6px;
        border-bottom: 1px solid #edf2f7;
        font-size: 0.82rem;
    }

    .order-column-option:last-child {
        border-bottom: 0;
    }

    .order-column-option label {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
    }

    .order-column-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 10px;
    }

    .order-column-actions button {
        border: 0;
        border-radius: 6px;
        padding: 7px 10px;
        cursor: pointer;
        font-weight: 600;
    }

    .preferred-control {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-width: 44px;
    }

    .preferred-drag-handle {
        width: 14px;
        color: #8aa0bd;
        cursor: grab;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.15s ease, color 0.15s ease;
    }

    tr.preferred-sort-row .preferred-drag-handle {
        opacity: 1;
    }

    tr.preferred-sort-row {
        cursor: grab;
    }

    tr.preferred-sort-row.dragging {
        opacity: 0.55;
        background: #eaf2ff;
    }

    tr.preferred-sort-row:hover .preferred-drag-handle {
        color: var(--primary-color);
    }

    .preferred-checkbox {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 24px;
        cursor: pointer;
    }

    .preferred-checkbox input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .preferred-checkbox span {
        width: 18px;
        height: 18px;
        border: 1px solid #b9c8dd;
        border-radius: 5px;
        background: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.15s ease;
    }

    .preferred-checkbox input:checked + span {
        background: var(--primary-color);
        border-color: var(--primary-color);
    }

    .preferred-checkbox input:checked + span::after {
        content: "";
        width: 5px;
        height: 9px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
        margin-top: -2px;
    }

    .preferred-checkbox input:disabled + span {
        opacity: 0.6;
        cursor: wait;
    }

    .smart-suggest-preferred {
        color: var(--primary-color);
        margin-right: 4px;
    }

    .order-note-icon-cell {
        text-align: center;
    }

    .order-note-icon-btn {
        width: 30px;
        height: 30px;
        border: 1px solid #cfe0ff;
        border-radius: 8px;
        background: #eff6ff;
        color: var(--primary-color);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .order-note-icon-btn:hover {
        background: #dbeafe;
        border-color: #93c5fd;
    }

    .action-buttons {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }

    .edit-btn,
    .delete-btn,
    .view-btn,
    .pay-btn,
    .add-transaction-btn,
    .print-invoice-btn,
    .customer-quick-info-btn,
    .duplicate-order-btn,
    .order-actions-toggle-btn {
        background: none;
        border: none;
        font-size: 1rem;
        cursor: pointer;
        transition: color 0.2s ease;
        padding: 5px;
        border-radius: 5px;
    }

    .edit-btn {
        color: var(--primary-color);
    }

    .edit-btn:hover {
        color: var(--primary-dark);
        background: var(--primary-light);
    }

    .delete-btn {
        color: #FF4B4B;
    }

    .delete-btn:hover {
        color: #FF2929;
        background: #FFA6A6;
    }

    .view-btn {
        color: #4A90FF;
    }

    .view-btn:hover {
        color: #2470FF;
        background: #A6C4FF;
    }

    .print-invoice-btn {
        color: var(--primary-color);
    }

    .print-invoice-btn:hover {
        background: var(--primary-light);
    }

    .duplicate-order-btn {
        color: var(--primary-color);
    }

    .duplicate-order-btn:hover {
        color: var(--primary-dark);
        background: var(--primary-light);
    }

    .customer-quick-info-btn {
        color: #0f9f7a;
    }

    .customer-quick-info-btn:hover {
        background: #dcfce7;
        color: #047857;
    }

    .order-actions-toggle-btn {
        color: #64748b;
    }

    .order-actions-toggle-btn:hover {
        background: #e2e8f0;
        color: var(--primary-color);
    }

    .order-document-menu {
        display: none;
        position: fixed;
        min-width: 250px;
        max-width: 250px;
        padding: 4px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
        z-index: 10060;
    }

    .order-document-menu.show {
        display: grid;
        gap: 4px;
    }

    .order-document-menu button {
        width: 100%;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #0f172a;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 7px;
        padding: 7px 9px;
        text-align: left;
        font-size: 0.84rem;
        font-weight: 400;
        line-height: 1.25;
        white-space: nowrap;
    }

    .order-document-menu button i {
        width: 14px;
        font-size: 0.78rem;
        text-align: center;
        flex: 0 0 14px;
    }

    .order-document-menu button:hover {
        background: #eff6ff;
        color: var(--primary-color);
    }

    .pay-btn {
        color: #28a745;
    }

    .pay-btn:hover {
        color: #218838;
        background: none;
    }

    .add-transaction-btn {
        color: #864AFF;
    }

    .add-transaction-btn:hover {
        color: #5D24FF;
        background: #C4A6FF;
    }

    /* Danh sách tài khoản */
    .accounts-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .account-card {
        background: white;
        border-radius: var(--card-radius);
        padding: 20px;
        box-shadow: 0 5px 15px var(--shadow-color);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .account-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px var(--shadow-color);
    }

    .account-card-header {
        display: flex;
        align-items: center;
        margin-bottom: 15px;
    }

    .account-icon {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        background: var(--primary-light);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 12px;
        font-size: 1.5rem;
    }

    .account-info {
        flex-grow: 1;
    }

    .account-info h3 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 3px;
    }

    .account-info p {
        font-size: 0.85rem;
        color: #777;
    }

    .account-balances {
        margin: 10px 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .balance-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .balance-label {
        font-size: 0.85rem;
        color: #777;
    }

    .balance-value {
        font-weight: 700;
        color: var(--primary-dark);
    }

    .account-action-btn {
        flex: 1;
        padding: 8px 12px;
        border: none;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
    }

    .btn-primary {
        background: var(--primary-color);
        color: white;
    }

    .btn-primary:hover {
        background: var(--primary-dark);
    }

    .btn-secondary {
        background: var(--bg-color);
        color: var(--primary-color);
    }

    .btn-secondary:hover {
        background: var(--primary-light);
        color: white;
    }

    .btn-danger {
        background: #f8f8f8;
        color: #FF4B4B;
    }

    .btn-danger:hover {
        background: #FF4B4B;
        color: white;
    }

    /* Tabs */
    .tabs {
        display: flex;
        border-bottom: 2px solid var(--border-color);
        margin-bottom: 15px;
    }

    .tab {
        padding: 10px 20px;
        font-weight: 600;
        cursor: pointer;
        position: relative;
    }

    .tab.active {
        color: var(--primary-color);
    }

    .tab.active::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--primary-color);
    }

    .tab-content {
        margin-bottom: 30px;
    }

    .tab-pane {
        display: none;
    }

    .tab-pane.active {
        display: block;
    }

    /* Cards của danh mục */
    .categories-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .category-card {
        background: white;
        border-radius: var(--card-radius);
        padding: 15px;
        display: flex;
        align-items: flex-start;
        box-shadow: 0 5px 15px var(--shadow-color);
        transition: transform 0.3s ease;
    }

    .category-card:hover {
        transform: translateY(-3px);
    }

    .category-icon {
        width: 45px;
        height: 45px;
        border-radius: 12px;
        background: var(--primary-light);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 12px;
        font-size: 1.5rem;
    }

    .category-info {
        flex-grow: 1;
    }

    .category-info h3 {
        font-size: 1rem;
        font-weight: 600;
    }

    .category-info p {
        font-size: 0.85rem;
        color: #777;
    }

    .expense-group-chip {
        display: inline-flex;
        align-items: center;
        max-width: 150px;
        padding: 4px 8px;
        border-radius: 999px;
        background: #eef5ff;
        color: #315c9f;
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .supplier-tree-group td {
        background: #f8fbff;
        border-bottom: 1px solid var(--border-color);
        font-weight: 700;
    }

    .supplier-tree-parent td {
        background: #eef5ff;
    }

    .supplier-tree-child-group td {
        background: #f7fbff;
    }

    .supplier-tree-child-group {
        display: none;
    }

    .supplier-tree-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        max-width: 100%;
        border: 0;
        background: transparent;
        color: var(--text-color);
        font: inherit;
        font-weight: 700;
        cursor: pointer;
        text-align: left;
    }

    .supplier-tree-toggle i {
        color: var(--primary-color);
        width: 18px;
        flex: 0 0 auto;
    }

    .supplier-tree-toggle b {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 22px;
        padding: 0 7px;
        border-radius: 999px;
        background: var(--primary-color);
        color: #fff;
        font-size: 0.78rem;
    }

    .supplier-tree-child-toggle {
        margin-left: 24px;
    }

    .supplier-tree-line,
    .supplier-tree-branch {
        display: inline-block;
        width: 18px;
        height: 22px;
        border-left: 1px solid #c9daf7;
        border-bottom: 1px solid #c9daf7;
        flex: 0 0 auto;
    }

    .supplier-tree-item td {
        vertical-align: top;
    }

    .supplier-tree-name {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        min-width: 220px;
    }

    .supplier-tree-name strong {
        display: block;
        line-height: 1.25;
    }

    .supplier-tree-name small {
        display: block;
        max-width: 260px;
        margin-top: 3px;
        color: #777;
        font-size: 0.75rem;
        line-height: 1.25;
    }

    .supplier-info-cell {
        min-width: 150px;
        line-height: 1.35;
    }

    #transactions .transaction-filter-container .filter-row {
        align-items: flex-end;
    }

    #transaction-page-size {
        width: 92px;
    }

    #transactions .transaction-table-scroll {
        overflow: auto;
    }

    #transactions .pagination-container {
        margin-top: 12px;
    }

    .supplier-bulk-tools {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .supplier-bulk-tools select {
        min-width: 210px;
        height: 36px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #fff;
        padding: 0 10px;
    }

    .supplier-bulk-check {
        width: 14px;
        height: 14px;
        margin: 0 4px 0 0;
        flex: 0 0 auto;
    }

    .supplier-inline-group-select {
        width: 100%;
        max-width: 150px;
        min-height: 28px;
        border: 1px solid #bfdbfe;
        border-radius: 999px;
        background: #eef5ff;
        color: #315c9f;
        font-size: 12px;
        font-weight: 600;
        padding: 3px 8px;
    }

    .category-action {
        display: flex;
        gap: 20px;
        margin-left: 10px;
    }

    /* Báo cáo */

    .report-selector label {
        font-size: 0.9rem;
        font-weight: 600;
        color: #666;
        margin-bottom: 5px;
        display: block;
    }

    .report-selector select,
    .report-selector input {
        padding: 10px 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-color);
        font-size: 0.9rem;
    }

    #generate-report-btn:hover,
    #export-report-btn:hover {
        background: var(--primary-dark);
    }


    .report-summary .summary-item {
        flex: 1;
        min-width: 200px;
    }

    .report-summary .summary-item h4 {
        font-size: 0.9rem;
        color: #666;
        margin-bottom: 5px;
    }

    .report-summary .summary-item p {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary-dark);
    }

    .report-details h3 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 15px;
        color: var(--primary-dark);
    }

    /* Cài đặt */
    .settings-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
        gap: 16px;
        align-items: start;
    }

    .settings-card {
        background: white;
        border-radius: var(--card-radius);
        padding: 20px;
        box-shadow: 0 5px 15px var(--shadow-color);
        margin-bottom: 0;
    }

    .settings-card-business {
        grid-column: 1 / 2;
    }

    .settings-card-appearance {
        grid-column: 2 / 3;
    }

    .bridge-settings-card {
        grid-column: 1 / -1;
    }

    .settings-card h3 {
        margin-bottom: 15px;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--primary-dark);
    }

    .settings-form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(220px, 1fr));
        gap: 14px 18px;
        max-width: 760px;
    }

    .settings-wide-field {
        grid-column: 1 / -1;
    }

    .setting-item {
        display: flex;
        flex-direction: column;
        margin-bottom: 0;
    }

    .setting-item:last-child {
        margin-bottom: 0;
    }

    .setting-item label {
        margin-bottom: 8px;
        font-weight: 500;
    }

    .setting-item select,
    .setting-item input {
        padding: 10px 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-color);
        font-size: 0.9rem;
        width: 100%;
        max-width: 360px;
    }

    .settings-wide-field input {
        max-width: 100%;
    }

    .theme-colors {
        display: flex;
        gap: 15px;
    }

    .theme-color {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        transition: transform 0.2s ease;
        border: 2px solid transparent;
    }

    .bridge-settings-card {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .bridge-settings-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .bridge-settings-header h3 {
        margin-bottom: 0;
    }

    .bridge-settings-content {
        display: grid;
        grid-template-columns: minmax(280px, 420px) minmax(280px, 1fr);
        gap: 18px;
        align-items: start;
    }

    .bridge-settings-form {
        display: grid;
        gap: 12px;
    }

    .bridge-form-section h4 {
        margin: 0;
        color: var(--primary-dark);
        font-size: 0.95rem;
        font-weight: 700;
    }

    .bridge-form-section-spaced {
        border-top: 1px solid var(--border-color);
        margin-top: 4px;
        padding-top: 14px;
    }

    .bridge-settings-form .setting-item input {
        max-width: 100%;
    }

    .bridge-settings-form .setting-item input[readonly] {
        color: var(--text-light);
        background: #f8fafc;
    }

    .bridge-save-btn {
        width: fit-content;
        min-width: 160px;
    }

    .bridge-status-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .bridge-status-card {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 14px;
        background: var(--bg-color);
        min-height: 112px;
    }

    .bridge-status-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        font-weight: 700;
        margin-bottom: 8px;
    }

    .bridge-status-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border-radius: 999px;
        padding: 4px 9px;
        font-size: 0.78rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .bridge-status-badge.ok {
        color: #166534;
        background: #dcfce7;
    }

    .bridge-status-badge.warn {
        color: #92400e;
        background: #fef3c7;
    }

    .bridge-status-badge.error {
        color: #991b1b;
        background: #fee2e2;
    }

    .bridge-status-meta {
        display: flex;
        flex-direction: column;
        gap: 5px;
        color: var(--text-light);
        font-size: 0.86rem;
        line-height: 1.45;
    }

    .bridge-status-meta code,
    .bridge-status-meta span:last-child {
        display: none;
    }

    .bridge-status-meta code,
    .bridge-guide-list code {
        display: block;
        width: 100%;
        overflow-wrap: anywhere;
        border-radius: 6px;
        padding: 7px 9px;
        background: #f8fafc;
        color: #334155;
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .bridge-status-meta code,
    .bridge-status-meta span:last-child {
        display: none;
    }

    .bridge-status-loading {
        color: var(--text-light);
        padding: 12px;
    }

    @media (max-width: 980px) {
        .settings-layout,
        .bridge-settings-content {
            grid-template-columns: 1fr;
        }

        .settings-card-business,
        .settings-card-appearance,
        .bridge-settings-card {
            grid-column: 1 / -1;
        }
    }

    @media (max-width: 640px) {
        .settings-form-grid {
            grid-template-columns: 1fr;
        }

        .bridge-settings-header {
            align-items: flex-start;
            flex-direction: column;
        }
    }

    .bridge-setup-guide {
        border-top: 1px solid var(--border-color);
        padding-top: 14px;
    }

    .bridge-setup-guide h4 {
        margin: 0 0 10px;
        color: var(--primary-dark);
    }

    .bridge-guide-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 12px;
    }

    .bridge-guide-list > div {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .theme-color:hover {
        transform: scale(1.1);
    }

    .theme-color.active {
        border-color: #333;
    }

    .theme-color.blue {
        background: #4A90FF;
    }

    .theme-color.purple {
        background: #864AFF;
    }

    .theme-color.green {
        background: #0F50AD;
    }

    .theme-color.orange {
        background: #FF9F4A;
    }

    /* Modal */
    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        /* Center container items */
        display: none;
        /* Keep logic simple, it will be overridden by JS display style, but css class needs toggle */
        align-items: center;
        justify-content: center;
        /* Remove overflow-y from here so overlay doesn't scroll */
    }

    /* Override display: flex when shown via JS usually sets display: block. 
       We need to handle this. If JS sets style="display: block", flex alignment won't work easily 
       unless we force it or change JS. 
       Alternatively, we can use a wrapper or just use margin styling.
       
       However, the user wants "modal stands still, content scrolls". 
       Best way without changing JS too much:
       .modal { overflow: hidden; }
       .modal-content { max-height: 90vh; overflow-y: auto; }
       
       But if strict center is needed:
    */

    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        overflow: hidden;
        /* Prevent background scroll interaction */

        /* Flexbox for centering */
        /* display: flex; -> cannot use this directly if JS uses 'block' */
    }

    .modal.modal-stacked {
        z-index: 12000;
    }

    .modal.modal-stacked .modal-content {
        z-index: 12001;
    }

    /* We can style .modal-content to act as the scroll container if needed, 
       OR make .modal-content fixed height and scroll inside body.
       User said: "thêm con lăn trong model chứ không phải là di chuyển model"
       So:
    */

    .modal-content {
        background: white;
        border-radius: var(--card-radius);

        /* Centering */
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;

        width: 90%;
        max-width: 600px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
        animation: modal-appear 0.3s ease;
        max-height: 95vh;
        /* Limit height */
        display: flex;
        flex-direction: column;
        /* Stack header, body, footer */
        position: relative;
    }

    @keyframes modal-appear {
        from {
            opacity: 0;
            transform: translate(-50%, -60%);
        }

        to {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
    }

    .modal-header {
        padding: 10px;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modal-header h3 {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--primary-dark);
    }

    .close {
        font-size: 1.5rem;
        font-weight: 700;
        color: #777;
        cursor: pointer;
        transition: color 0.2s ease;
    }

    .close:hover {
        color: #FF4B4B;
    }

    .modal-body {
        padding: 20px;
        overflow-y: auto;
        /* Enable scrolling for body content */
        flex: 1;
        /* Take remaining space */
        max-height: calc(95vh - 60px);
        /* Fallback/Safety if flex fails, assuming header ~60px */
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
        font-size: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 8px 10px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-color);
    }

    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }

    .form-actions {
        display: flex;
        justify-content: flex-end;
        gap: 15px;
        margin-top: 30px;
        flex-wrap: wrap;
    }

    .cancel-btn,
    .submit-btn {
        padding: 10px 20px;
        border-radius: var(--button-radius);
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        border: none;
    }

    .cancel-btn {
        background: #f1f1f1;
        color: #666;
    }

    .cancel-btn:hover {
        background: #e1e1e1;
    }

    .submit-btn {
        background: var(--primary-color);
        color: white;
    }

    .submit-btn:hover {
        background: var(--primary-dark);
    }

    #order-form .order-duplicate-current-btn {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 38px;
        padding: 9px 16px;
        border: 1px solid #bfdbfe;
        border-radius: var(--button-radius);
        background: #f8fbff;
        color: var(--primary-color);
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    #order-form .order-duplicate-current-btn:hover:not(:disabled) {
        background: var(--primary-light);
        border-color: #93c5fd;
        color: var(--primary-dark);
    }

    #order-form .order-duplicate-current-btn:disabled {
        opacity: 0.65;
        cursor: wait;
    }

    .secondary-submit-btn {
        background: #2f6fd6;
    }

    .secondary-submit-btn:hover {
        background: #245ab0;
    }

    .entity-suggestions {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        display: none;
        max-height: 180px;
        overflow-y: auto;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        z-index: 10020;
    }

    .entity-suggestions.show {
        display: block;
    }

    .entity-suggestion-item {
        padding: 9px 12px;
        cursor: pointer;
        font-size: 0.9rem;
        border-bottom: 1px solid var(--border-color);
        background: #fff;
    }

    .entity-suggestion-item:last-child {
        border-bottom: none;
    }

    .entity-suggestion-item:hover {
        background: var(--bg-color);
    }

    .entity-suggestion-add {
        color: #0f4fb8;
        font-weight: 700;
        background: #f8fbff;
    }

    .entity-missing-warning {
        display: none;
        margin-top: 5px;
        color: #dc2626;
        font-size: 0.78rem;
        font-weight: 700;
    }

    .customer-form-section {
        margin: 12px 0;
        padding: 12px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #f8fbff;
    }

    .customer-form-section .section-title {
        margin-bottom: 10px;
        color: var(--primary-dark);
        font-weight: 800;
    }

    .customer-info-cell {
        min-width: 180px;
        line-height: 1.35;
    }

    .payment-action-buttons {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .quick-pay-btn {
        border: none;
        border-radius: 999px;
        padding: 5px 14px;
        background: #24aa7c;
        color: #fff;
        font-size: 0.85em;
        font-weight: 600;
        cursor: pointer;
    }

    .quick-pay-btn:hover {
        background: #1d8f68;
    }

    /* Entity Type Selector & Transaction Type Selector */
    .transaction-type-selector,
    .category-type-selector,
    .entity-type-selector {
        display: flex;
        gap: 10px;
        margin-top: 5px;
    }

    .type-option {
        flex: 1;
        padding: 12px 10px;
        border-radius: 8px;
        background: var(--bg-color);
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 2px solid transparent;
    }

    .type-option i {
        font-size: 1.1rem;
        margin-right: 5px;
    }

    .type-option:hover {
        background: #f1f1f1;
    }

    .type-option.active {
        border-color: var(--primary-color);
        background: var(--primary-light);
        color: var(--primary-dark);
    }

    /* Icon Selector */
    .icon-selector {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
        max-height: 190px;
        overflow-y: auto;
        padding-right: 4px;
    }

    .icon-option {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        border-radius: 8px;
        background: var(--bg-color);
        cursor: pointer;
        transition: all 0.2s ease;
        border: 2px solid transparent;
    }

    .icon-option:hover {
        background: #f1f1f1;
    }

    .icon-option.active {
        border-color: var(--primary-color);
        background: var(--primary-light);
    }

    /* Summary Bar */
    .summary-bar {
        /* background: white; */
        border-radius: var(--card-radius);
        padding: 20px;
        box-shadow: 0 5px 15px var(--shadow-color);
        margin-bottom: 15px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 20px;
    }

    .summary-item {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 150px;
    }

    .summary-label {
        font-size: 0.9rem;
        color: #777;
        margin-bottom: 5px;
    }

    .summary-value {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--primary-color);
    }

    .initial-balance {
        color: #000000 !important;
        font-weight: 600;
    }

    /* Thông báo */
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        padding: 15px 20px;
        border-radius: 8px;
        color: white;
        z-index: 9999;
        transform: translateX(120%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        max-width: 300px;
    }

    .notification.show {
        transform: translateX(0);
    }

    .notification.success {
        background: linear-gradient(135deg, #0F50AD, #32CD32);
    }

    .notification.error {
        background: linear-gradient(135deg, #FF4B4B, #DC143C);
    }

    .notification.info {
        background: linear-gradient(135deg, #4A90FF, #1E90FF);
    }

    .tech-new-order-alert-panel {
        position: fixed;
        right: 22px;
        bottom: 22px;
        z-index: 10020;
        display: none;
        width: min(360px, calc(100vw - 32px));
        border: 1px solid #bfdbfe;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
        overflow: hidden;
    }

    .tech-new-order-alert-panel.show {
        display: block;
    }

    .tech-alert-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
        background: #eff6ff;
        color: #0f50ad;
        font-weight: 900;
    }

    .tech-alert-head span {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .tech-alert-head button {
        width: 26px;
        height: 26px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #64748b;
        font-size: 20px;
        cursor: pointer;
    }

    .tech-alert-list {
        display: grid;
        gap: 6px;
        padding: 10px 14px;
        max-height: 190px;
        overflow-y: auto;
    }

    .tech-alert-item {
        display: grid;
        grid-template-columns: 90px 1fr;
        gap: 8px;
        align-items: center;
        min-height: 30px;
        color: #334155;
        font-size: 12px;
    }

    .tech-alert-item strong {
        color: #0f50ad;
        white-space: nowrap;
    }

    .tech-alert-item span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 800;
    }

    .tech-alert-more {
        color: #64748b;
        font-size: 12px;
        font-weight: 800;
    }

    .tech-alert-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        padding: 10px 14px 14px;
    }

    .tech-alert-actions button {
        min-height: 34px;
        padding: 0 12px;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        background: #fff;
        color: #0f50ad;
        font-family: inherit;
        font-weight: 900;
        cursor: pointer;
    }

    .tech-alert-actions button:last-child {
        border-color: #0f50ad;
        background: #0f50ad;
        color: #fff;
    }

    /* Data Common Styles */
    .no-data {
        text-align: center;
        padding: 15px;
        color: #777;
        font-style: italic;
        background: var(--bg-color);
        border-radius: 10px;
        margin: 10px 0;
    }

    .loading-text {
        text-align: center;
        padding: 20px;
        color: #777;
        font-style: italic;
    }

    /* Page Header with Filter */
    .page-header-with-filter {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
        flex-wrap: wrap;
        gap: 15px;
    }


    .asset-info-tooltip::after {
        content: '';
        position: absolute;
        bottom: -6px;
        left: 50%;
        transform: translateX(-50%);
        border-width: 6px 6px 0 6px;
        border-style: solid;
        border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    }

    /* Collapse Button for Sidebar */
    .collapse-btn {
        position: absolute;
        right: -15px;
        top: 64px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: white;
        border: 1px solid var(--border-color);
        color: var(--primary-color);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 101;
        transition: transform 0.3s ease;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .sidebar-collapsed .collapse-btn {
        transform: rotate(180deg);
    }

    /* Collapsed Sidebar Styles */
    .sidebar-collapsed {
        width: 60px;
    }

    .sidebar-collapsed .sidebar-header h1,
    .sidebar-collapsed .sidebar-menu span,
    .sidebar-collapsed .sidebar-footer {
        display: none;
    }

    .sidebar-collapsed .logo {
        width: 34px;
        height: 34px;
        margin: 0px 0px 0px -6px;
        display: block;
        object-fit: contain;
    }

    .sidebar-collapsed .sidebar-menu li {
        padding: 15px 0;
        justify-content: center;
    }

    .sidebar-collapsed .sidebar-menu li i {
        margin-right: 0;
        font-size: 1.3rem;
    }

    .main-content-expanded {
        margin-left: 60px;
    }

    .sidebar-collapsed .sidebar-menu li {
        position: relative;
    }

    .sidebar-collapsed .sidebar-menu li:hover::after {
        content: attr(data-title);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 0.8rem;
        white-space: nowrap;
        margin-left: 10px;
        z-index: 1000;
    }

    /* Responsive Media Queries */
    @media (max-width: 1200px) {
        .charts-container {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (max-width: 992px) {
        .charts-container {
            grid-template-columns: 1fr;
        }

        .accounts-container {
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        }
    }

    @media (max-width: 768px) {
        #menu-toggle {
            display: block;
        }

        .sidebar {
            transform: translateX(-100%);
        }

        .sidebar.active {
            transform: translateX(0);
        }

        .main-content {
            margin-left: 0;
        }

        .search-box input {
            width: 160px;
        }

        .account-action-btn {
            padding: 6px 8px;
            font-size: 0.8rem;
        }

        .page-header-with-filter {
            flex-direction: column;
            align-items: flex-start;
        }

        .time-filter {
            width: 100%;
            overflow-x: auto;
        }

        .custom-date-range {
            flex-wrap: wrap;
        }
    }

    @media (max-width: 576px) {
        .summary-cards {
            grid-template-columns: 1fr;
        }

        .summary-cards {
            flex-direction: column;
        }

        .card {
            width: 100%;
        }

        .search-box {
            display: none;
        }

        .accounts-container {
            grid-template-columns: 1fr;
        }

        .categories-container {
            grid-template-columns: 1fr;
        }

        .transaction-type-selector {
            flex-direction: column;
        }

        .form-actions {
            flex-direction: column;
            gap: 10px;
        }

        .form-actions button {
            width: 100%;
        }

        .report-selector {
            flex-direction: column;
            align-items: stretch;
        }
    }

    /* Loading Button */
    .button-loading {
        position: relative;
        color: transparent !important;
        pointer-events: none;
    }

    .button-loading::after {
        content: '';
        position: absolute;
        top: calc(50% - 10px);
        left: calc(50% - 10px);
        width: 20px;
        height: 20px;
        border: 2px solid rgba(255, 255, 255, 0.5);
        border-top-color: white;
        border-radius: 50%;
        animation: button-loading-spinner 0.8s ease infinite;
    }

    @keyframes button-loading-spinner {
        from {
            transform: rotate(0turn);
        }

        to {
            transform: rotate(1turn);
        }
    }

    /* Cải thiện nút trong danh mục */
    .category-card .category-action {
        display: flex;
        gap: 8px;
    }

    .category-card .category-action button {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        background: var(--bg-color);
        border: none;
        transition: all 0.2s ease;
        cursor: pointer;
    }

    .category-card .edit-category-btn {
        color: var(--primary-color);
    }

    .category-card .edit-category-btn:hover {
        background: var(--primary-light);
        color: white;
    }

    .category-card .delete-category-btn {
        color: #FF4B4B;
    }

    .category-card .delete-category-btn:hover {
        background: #FFCECE;
        color: #E00000;
    }

    /* Giúp biểu tượng nút hiển thị rõ ràng hơn */
    .category-card .category-action button i {
        font-size: 16px;
    }

    /* Cải thiện bố cục thẻ danh mục */
    .category-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 10px;
    }

    .category-card .category-info {
        flex: 1;
        margin: 0 15px;
    }

    /* Thêm CSS này vào Stylesheet.html */
    .transaction-type-selector {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 5px;
    }

    .transaction-type-selector .type-option {
        flex: 1;
        min-width: 100px;
        /* Đảm bảo kích thước hợp lý khi chỉ hiển thị 1 tab */
        max-width: 100%;
        /* Cho phép tab chiếm toàn bộ chiều rộng khi chỉ có 1 tab */
    }

    .form-group.flex-grow {
        flex-grow: 1;
        min-width: 0;
    }

    /* Điều chỉnh cho responsive */
    @media (max-width: 768px) {
        .form-row {
            flex-direction: column;
            gap: 20px;
        }

        .form-row .form-group {
            width: 100%;
        }
    }

    /* Style cho tab active trong entity-type-selector */
    .entity-type-selector .type-option.active {
        border-color: var(--primary-color);
        background: var(--primary-light);
        color: var(--primary-dark);
    }

    /* CSS cho thông tin ngân hàng */
    #bank-info-group {
        margin-top: 0;
        transition: all 0.3s ease;
    }

    #bank-info-group .checkbox-form-group {
        justify-content: flex-end;
        min-width: 230px;
    }

    #account-use-customer-transfer {
        accent-color: var(--primary-color);
    }

    .customer-transfer-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        width: fit-content;
        margin-top: 6px;
        padding: 4px 9px;
        border-radius: 999px;
        background: #e8f4ff;
        color: #0f4fb8;
        font-size: 0.78rem;
        font-weight: 700;
    }

    /* Format số dư dễ đọc hơn */
    #account-initial-balance {
        text-align: right;
        font-family: monospace;
        font-size: 1rem;
    }

    /* Thêm dấu phân tách hàng nghìn cho số tiền */
    .formatted-currency {
        text-align: right;
        font-weight: 600;
        color: var(--primary-dark);
    }

    /* CSS cho payable-type-selector */
    .payable-type-selector {
        display: flex;
        gap: 10px;
        margin-top: 5px;
        margin-bottom: 15px;
    }

    .payable-type-selector .type-option {
        flex: 1;
        padding: 12px;
        border-radius: 8px;
        background: var(--bg-color);
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        border: 2px solid transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .payable-type-selector .type-option i {
        margin-right: 8px;
        font-size: 1.1rem;
    }

    .payable-type-selector .type-option:hover {
        background: #f1f1f1;
    }

    .payable-type-selector .type-option.active {
        border-color: var(--primary-color);
        background: var(--primary-light);
        color: var(--primary-dark);
    }

    /* Cải thiện trường nhập số tiền */
    #payable-amount,
    #payable-paid-amount {
        text-align: right;
        font-family: monospace;
        font-size: 1rem;
    }

    /* Tab công nợ */
    .tab-content .summary-bar {
        margin-top: 15px;
    }

    /* CSS để hiển thị đúng khi chỉ có một tab */
    .entity-type-selector {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
        width: 100%;
    }

    .entity-type-selector .type-option {
        flex: 1;
        min-width: 180px;
        padding: 8px 10px;
        border-radius: 8px;
        text-align: center;
        cursor: pointer;
    }

    /* Khi chỉ có một tab hiển thị */
    .entity-type-selector .type-option:only-of-type {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Đặt width cho container chứa selector */
    .payable-form .form-group:first-child {
        width: 100%;
    }

    /* CSS cho trường bắt buộc */
    .required-field::after {
        content: " *";
        color: #FF4B4B;
        font-weight: bold;
    }

    /* CSS cho thông báo lỗi */
    .error-message {
        color: #FF4B4B;
        font-size: 0.8rem;
        margin-top: 5px;
    }

    .input-error {
        border-color: #FF4B4B !important;
        background-color: rgba(255, 75, 75, 0.05) !important;
    }

    /* Style cho phần công nợ trong form giao dịch */
    #debt-info-section {
        background-color: rgba(74, 144, 255, 0.05);
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
    }

    /* Style cho checkbox công nợ */
    #transaction-is-debt {
        width: 20px;
        height: 20px;
    }

    /* Style cho thanh tổng hợp công nợ */
    .debt-summary-bar {
        /* background: white; */
        border-radius: var(--card-radius);
        padding: 8px 12px;
        box-shadow: 0 5px 15px var(--shadow-color);
        margin-bottom: 15px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 20px;
    }

    /* Style cho màn hình nhỏ */
    @media (max-width: 768px) {
        .table-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        #transactions-table {
            min-width: 900px;
            /* Đảm bảo bảng có chiều rộng tối thiểu */
        }

        .debt-summary-bar {
            flex-direction: column;
            gap: 10px;
        }

        .debt-summary-bar .summary-item {
            width: 100%;
        }

        /* Cải thiện hiển thị bộ lọc trên mobile */
        .filter-container .filter-row {
            flex-direction: column;
            align-items: stretch;
        }

        .filter-container .filter-item {
            width: 100%;
            margin-bottom: 10px;
        }

        .time-filter {
            width: 100%;
            overflow-x: auto;
            justify-content: flex-start;
            margin-bottom: 10px;
        }

        .time-filter-option {
            flex: 0 0 auto;
        }
    }

    /* Style cho modal thanh toán */
    #payment-popup {
        z-index: 9999;
    }

    #payment-popup h3 {
        color: var(--primary-dark);
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    #payment-popup input,
    #payment-popup select {
        width: 100%;
        padding: 10px;
        border: 1px solid var(--border-color);
        border-radius: 5px;
    }

    #payment-popup button {
        transition: all 0.3s ease;
    }

    #payment-popup button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    /* Fix toàn diện cho vấn đề thanh cuộn ngang trong bảng giao dịch */

    /* 1. Đảm bảo tất cả các container cha đều cho phép cuộn ngang */
    .page#transactions {
        overflow: visible !important;
        width: 100% !important;
    }

    .content {
        overflow: visible !important;
        width: 100% !important;
		padding: 25px;
    }

    body.is-tech-page .content {
        padding: 0;
    }

    .main-content {
        overflow: visible !important;
        width: calc(100% - var(--sidebar-width)) !important;
    }


    #transactions-table th,
    #transactions-table td {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .transaction-table-scroll {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #transactions-table {
        table-layout: fixed;
        min-width: 1610px;
        border-collapse: separate;
        border-spacing: 0;
    }

    #transactions-table th[data-transaction-col],
    #transactions-table td[data-transaction-col] {
        position: relative;
        min-width: 90px;
        max-width: 240px;
    }

    #transactions-table [data-transaction-col="date"] { width: 100px; min-width: 100px; max-width: 100px; }
    #transactions-table [data-transaction-col="type"] { width: 110px; min-width: 110px; max-width: 110px; }
    #transactions-table [data-transaction-col="category"] { width: 175px; min-width: 175px; max-width: 175px; }
    #transactions-table [data-transaction-col="amount"] { width: 150px; min-width: 150px; max-width: 150px; }
    #transactions-table [data-transaction-col="account"] { width: 170px; min-width: 170px; max-width: 170px; }
    #transactions-table [data-transaction-col="entity"] { width: 230px; min-width: 230px; max-width: 230px; }
    #transactions-table [data-transaction-col="invoiceNumber"] { width: 120px; min-width: 120px; max-width: 120px; }
    #transactions-table [data-transaction-col="invoiceDate"] { width: 120px; min-width: 120px; max-width: 120px; }
    #transactions-table [data-transaction-col="paidAmount"] { width: 150px; min-width: 150px; max-width: 150px; }
    #transactions-table [data-transaction-col="remainingAmount"] { width: 150px; min-width: 150px; max-width: 150px; }
    #transactions-table [data-transaction-col="paymentStatus"] { width: 140px; min-width: 140px; max-width: 140px; }
    #transactions-table [data-transaction-col="note"] { width: 250px; min-width: 250px; max-width: 250px; }
    #transactions-table [data-transaction-col="employee"] { width: 150px; min-width: 150px; max-width: 150px; }
    #transactions-table [data-transaction-col="actions"] { width: 118px; min-width: 118px; max-width: 118px; }

    #transactions-table .action-buttons {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        white-space: nowrap;
        width: 100%;
    }

    #transactions-table tbody tr.selected td,
    #transactions-table tbody tr[aria-selected="true"] td {
        background: #fff7dd !important;
    }

    .payment-status {
        display: inline-block;
        padding: 3px 6px;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 500;
        text-align: center;
        margin-left: 5px;
    }

    .debt-checkbox-group {
        display: flex;
        align-items: center;
        margin-top: 32px !important;
    }

    .debt-checkbox-group input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        margin-right: 10px;
    }

    .payment-status.paid {
        background-color: rgba(75, 255, 134, 0.2);
        color: #24FF70;
        border: 1px solid rgba(75, 255, 134, 0.4);
    }

    .payment-status.unpaid {
        background-color: rgba(255, 75, 75, 0.1);
        color: #FF4B4B;
        border: 1px solid rgba(255, 75, 75, 0.2);
    }


    /* CSS Cải tiến cho form giao dịch */
    .transaction-type-selector {
        display: flex;
        gap: 20px;
        margin-top: 5px;
    }

    .transaction-type-selector .type-option {
        flex: 1;
        padding: 8px 10px;
        border-radius: 6px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid var(--border-color);
        background: var(--bg-color);
    }

    .transaction-type-selector .type-option:hover {
        background: #f1f1f1;
    }

    .transaction-type-selector .type-option.active {
        color: white;
    }

    .transaction-type-selector .type-option[data-type="Chi phí"].active {
        background: #FF4B4B;
        border-color: #FF4B4B;
    }

    .transaction-type-selector .type-option[data-type="Doanh thu"].active {
        background: #0F50AD;
        border-color: #0F50AD;
    }

    .transaction-type-selector .type-option[data-type="Chuyển khoản"].active {
        background: #4A90FF;
        border-color: #4A90FF;
    }

    .entity-type-selector {
        display: flex;
        gap: 20px;
        margin-top: 5px;
    }

    .entity-type-selector .type-option {
        flex: 1;
        padding: 8px 10px;
        border-radius: 6px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid var(--border-color);
        background: var(--bg-color);
    }

    .entity-type-selector .type-option:hover {
        background: #f1f1f1;
    }

    .entity-type-selector .type-option.active {
        background: var(--primary-light);
        border-color: var(--primary-color);
        color: var(--primary-dark);
    }

    #transaction-is-debt {
        width: 18px !important;
        height: 18px !important;
    }

    .form-row {
        display: flex;
        gap: 20px;
        margin-bottom: 15px;
    }

    .form-row .form-group {
        flex: 1;
        margin-bottom: 0;
    }

    #accounts-row {
        display: flex;
        gap: 15px;
    }

    /* Khi chọn chuyển khoản, cập nhật kiểu hiển thị của accounts-row */
    body.transfer-mode #accounts-row {
        display: flex;
        gap: 15px;
    }

    body.transfer-mode #source-account-group,
    body.transfer-mode #destination-account-group {
        flex: 1;
    }

    /* CSS cho card summary trong trang giao dịch */
    .debt-summary-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 20px;
    }

    .card-summary {
        flex: 1;
        min-width: 220px;
        background: white;
        border-radius: var(--card-radius);
        padding: 20px;
        display: flex;
        align-items: center;
        box-shadow: 0 5px 15px var(--shadow-color);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .card-summary:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px var(--shadow-color);
    }

    .card-summary .card-icon {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 15px;
        flex-shrink: 0;
    }

    .card-summary .card-icon i {
        font-size: 1.3rem;
        color: white;
    }

    .card-summary .card-icon.income {
        background: var(--gradient-green);
    }

    .card-summary .card-icon.expense {
        background: var(--gradient-red);
    }

    .card-summary .card-info {
        flex-grow: 1;
    }

    .card-summary .card-info h3 {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 5px;
        color: #555;
    }

    .card-summary .card-info p {
        font-size: 1.2rem;
        font-weight: 700;
    }

    .card-summary .card-info p.income {
        color: #0F50AD;
    }

    .card-summary .card-info p.expense {
        color: #FF4B4B;
    }

    /* Cải thiện hiển thị trên thiết bị di động */
    @media (max-width: 768px) {

        /* Cải thiện thẻ chỉ số */
        .summary-cards {
            flex-wrap: wrap;
            gap: 10px;
        }

        .card {
            flex: 1 1 100%;
            min-width: 100%;
        }

        /* Cải thiện biểu đồ */
        .charts-container {
            grid-template-columns: 1fr;
        }

        .chart-card {
            width: 100%;
            margin-bottom: 10px;
        }

        /* Sidebar thu gọn trên mobile */
        @media (max-width: 576px) {
            .sidebar:not(.active) {
                width: 0;
                overflow: hidden;
            }

            .main-content {
                margin-left: 0;
                width: 100% !important;
            }

            /* Bật menu toggle sẵn */
            #menu-toggle {
                display: block;
            }

            /* Căn giữa dữ liệu thẻ */
            .card {
                padding: 15px 10px;
            }

            .card-icon {
                width: 40px;
                height: 40px;
            }

            .card-info h3 {
                font-size: 0.8rem;
            }

            .card-info p {
                font-size: 1rem;
            }

            /* Điều chỉnh phân trang */
            .pagination-container {
                flex-direction: column;
                align-items: center;
                gap: 10px;
            }

            /* Bảng responsive */
            .table-container {
                margin: 0 -15px;
                width: calc(100% + 30px);
            }

            /* Fix các card trong trang giao dịch */
            .debt-summary-bar {
                flex-direction: column;
            }

            .card-summary {
                min-width: 100%;
                margin-bottom: 10px;
            }
        }

        /* Điều chỉnh width khi sidebar bị thu gọn */
        .sidebar-collapsed+.main-content {
            margin-left: 60px;
            width: calc(100% - 60px) !important;
        }

        /* Fix scroll ngang trong content */
        .content {
            overflow-x: hidden;
        }
    }

    /* ===== PHẦN ĐĂNG NHẬP ===== */
    #login-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    .login-modal-content {
        width: 100%;
        max-width: 380px;
        background: #333;
        border-radius: 15px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        overflow: hidden;
        animation: fadeIn 0.3s ease;
    }

    .modal-header h3 {
        color: #4A90FF;
        font-size: 1.4rem;
        margin: 0;
        text-align: center;
    }

    .modal-body {
        padding: 25px;
    }

    .login-logo {
        text-align: center;
        margin-bottom: 30px;
    }

    .login-logo img {
        width: 150px;
        height: auto;
    }

    #login-form .form-group {
        margin-bottom: 20px;
    }

    #login-form label {
        display: block;
        color: #4A90FF;
        margin-bottom: 8px;
        font-weight: 500;
    }

    #login-form input {
        width: 100%;
        padding: 12px 15px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.9);
        font-size: 16px;
        transition: border-color 0.3s;
    }

    #login-form input:focus {
        outline: none;
        border-color: #4A90FF;
    }

    #login-form .required-field::after {
        content: " *";
        color: #FF4B4B;
    }

    #login-error {
        color: #FF4B4B;
        text-align: center;
        margin: 10px 0;
        padding: 8px;
        background: rgba(255, 75, 75, 0.1);
        border-radius: 5px;
        font-size: 14px;
    }

    #login-button {
        width: 100%;
        padding: 12px;
        background: #4A90FF;
        color: white;
        border: none;
        border-radius: 30px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.3s;
    }

    #login-button:hover {
        background: #2470FF;
    }

    /* ===== PHẦN USER MENU ===== */
    #user-account-menu {
        position: relative;
        cursor: pointer;
        display: flex;
        align-items: center;
        padding: 15px 25px;
        background: rgba(255, 255, 255, 0.1);
        margin-top: 20px;
        border-radius: 8px;
        border-color: #fff2cc
    }

    #user-account-menu:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    #user-account-menu i {
        color: #ffe599;
        margin-right: 15px;
    }

    #user-display-name {
        color: #ffe599;
        font-weight: 600;
    }

    .user-info-wrapper {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .change-password-link {
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.8rem;
        cursor: pointer;
        transition: color 0.2s;
    }

    .change-password-link:hover {
        color: #ffffff;
        text-decoration: underline;
    }

    /* Password toggle eye icon */
    .password-input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
    }

    .password-input-wrapper input {
        flex: 1;
        padding-right: 40px;
    }

    .password-toggle {
        position: absolute;
        right: 12px;
        color: #999;
        cursor: pointer;
        font-size: 1rem;
        transition: color 0.2s;
    }

    .password-toggle:hover {
        color: #4A90FF;
    }

    .user-dropdown {
        position: absolute;
        bottom: 100%;
        left: 0;
        width: 100%;
        background: white;
        border-radius: 8px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        padding: 0;
        display: none;
        z-index: 1000;
        overflow: hidden;
    }

    .user-dropdown.show {
        display: block;
    }

    .user-dropdown-item {
        padding: 12px 15px;
        display: flex;
        align-items: center;
        cursor: pointer;
        transition: background 0.2s;
        color: #333;
    }

    .user-dropdown-item:hover {
        background: #f5f5f5;
    }

    .user-dropdown-item i {
        margin-right: 10px;
        color: #4A90FF !important;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Điều chỉnh blurred background */
    .requires-login .content {
        filter: blur(8px);
        pointer-events: none;
        user-select: none;
    }

    .requires-login .sidebar {
        filter: blur(8px);
        pointer-events: none;
    }


    /* Thêm đoạn này để đảm bảo form đăng nhập không bị ảnh hưởng bởi blur */
    #login-modal {
        pointer-events: auto !important;
    }

    #login-modal .modal-content,
    #login-modal .login-modal-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        margin: auto !important;
        filter: none !important;
        pointer-events: auto !important;
    }

    #login-form input,
    #login-form button {
        pointer-events: auto !important;
    }

    /* Thêm đoạn này vào phần cuối CSS */
    @media (max-width: 768px) {

        /* Đảm bảo hiển thị nút menu toggle */
        #menu-toggle {
            display: block !important;
            position: fixed;
            top: 10px;
            left: 10px;
            z-index: 1000;
            background: var(--primary-color);
            color: white;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            text-align: center;
            line-height: 40px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }

        /* Đảm bảo sidebar có thể hiển thị khi active */
        .sidebar {
            transform: translateX(-100%);
            transition: transform 0.3s ease;
            position: fixed;
            z-index: 999;
        }

    }

    /* Style cho summary-bar kích thước nhỏ */
    .summary-bar.small {
        padding: 10px 15px;
        margin-bottom: 12px;
        background-color: white;
        box-shadow: 0 2px 8px var(--shadow-color);
    }

    .summary-bar.small .summary-item {
        min-width: 0;
    }

    .summary-bar.small .summary-label {
        font-size: 1rem;
        display: flex;
        align-items: center;
    }

    .summary-bar.small .summary-label i {
        margin-right: 8px;
        color: var(--primary-color);
    }

    .summary-bar.small .summary-value {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .summary-bar.small .summary-value.income {
        color: #0F50AD;
    }

    .summary-bar.small .summary-value.expense {
        color: #FF4B4B;
    }

    /* Style cho dòng công nợ trong card */
    .card-info #total-revenue,
    .card-info #total-vat,
    .card-info #total-expense,
    .card-info #total-profit,
    .card-info #total-assets {
        font-size: 1.2rem;
        font-weight: 700;
        color: white;
        margin-bottom: 3px;
    }

    .debt-line {
        font-size: 0.8rem;
        font-weight: 500;
        color: white;
        opacity: 0.85;
    }

    /* Modal xác nhận xóa */
    #delete-confirm-modal .modal-content {
        max-width: 520px;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
        border: none;
        animation: modal-pop 0.22s ease-out;
    }

    #delete-confirm-modal .modal-header {
        background: #0F50AD;
        color: white;
        padding: 15px 20px;
        border-bottom: none;
    }

    #delete-confirm-modal .modal-header h3 {
        color: white;
        font-size: 1.3rem;
        margin: 0;
    }

    #delete-confirm-modal .modal-header .close {
        color: white;
        opacity: 0.8;
    }

    #delete-confirm-modal .modal-body {
        padding: 22px 28px 24px;
        background: white;
    }

    .delete-warning {
        text-align: center;
        padding: 8px 0 16px;
    }

    .delete-warning i {
        width: 52px;
        height: 52px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        background: #fff1f2;
        font-size: 30px;
        color: #FF4B4B;
        margin-bottom: 12px;
    }

    .delete-warning p {
        font-size: 1rem;
        margin-bottom: 8px;
        color: #333;
    }

    .delete-confirm-title {
        color: #334155 !important;
        font-weight: 600;
    }

    .delete-item-info {
        font-weight: 700;
        color: #0f172a;
        font-size: 1.05rem !important;
        line-height: 1.35;
        margin: 8px auto 12px !important;
        max-width: 420px;
        word-break: break-word;
    }

    .delete-detail-grid {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 8px 12px;
        margin: 12px 0;
        padding: 12px 14px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #f8fafc;
        text-align: left;
        color: #334155;
        font-size: 0.92rem;
    }

    .delete-detail-label {
        color: #64748b;
        font-weight: 600;
    }

    .delete-detail-value {
        min-width: 0;
        color: #111827;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .delete-note {
        margin: 10px auto 0 !important;
        padding: 9px 12px;
        border-radius: 8px;
        background: #fff7ed;
        color: #9a3412;
        font-size: 0.88rem !important;
        font-style: normal;
        line-height: 1.4;
    }

    .form-actions {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin-top: 15px;
    }

    #cancel-delete-btn {
        background: #f1f1f1;
        color: #555;
        border: none;
        padding: 12px 25px;
        border-radius: 30px;
        font-weight: 600;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    #cancel-delete-btn:hover {
        background: #e5e5e5;
    }

    #confirm-delete-btn {
        background: #FF4B4B;
        color: white;
        border: none;
        padding: 12px 25px;
        border-radius: 30px;
        font-weight: 600;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.2s;
        min-width: 120px;
    }

    #confirm-delete-btn:hover {
        background: #FF2929;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(255, 75, 75, 0.3);
    }

    .activity-mode-btn-active {
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), 0 6px 14px rgba(15, 80, 173, 0.18);
        filter: saturate(1.08);
    }

    .restore-record-btn {
        color: #16a34a;
    }

    .restore-record-btn:hover {
        color: #15803d;
        background: #dcfce7;
    }

    .hard-delete-record-btn {
        color: #dc2626;
    }

    .hard-delete-record-btn:hover {
        color: #b91c1c;
        background: #fee2e2;
    }

    @keyframes modal-pop {
        0% {
            opacity: 0;
            transform: scale(0.8);
        }

        100% {
            opacity: 1;
            transform: scale(1);
        }
    }

    /* Size Data Styles */
    .size-item {
        margin-bottom: 10px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
        background: var(--bg-color);
    }

    .size-row {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .size-row input {
        flex: 1;
        padding: 8px;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        font-size: 0.9rem;
        background: #FFFFFF;
    }

    .remove-size-btn {
        background: #FF4B4B;
        color: white;
        border: none;
        padding: 8px 12px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 0.8rem;
    }

    .remove-size-btn:hover {
        background: #FF2929;
    }

    .add-size-btn {
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 0.9rem;
        margin-top: 10px;
    }

    .add-size-btn:hover {
        background: var(--primary-dark);
    }

    #size-data-group {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        background: rgba(74, 144, 255, 0.05);
    }

    .account-actions {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        margin-top: 15px;
    }

    .account-action-btn {
        flex: 1;
        padding: 8px 0;
        /* Giảm padding ngang */
        border: none;
        border-radius: 8px;
        font-size: 1.1rem;
        /* Tăng size icon */
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 40px;
        /* Cố định chiều cao */
    }

    /* Màu sắc cho các nút */
    .btn-add-trans {
        color: #24aa7c;
    }

    .btn-add-trans:hover {
        background: #24aa7c;
        color: white;
    }

    .btn-details {
        color: var(--primary-color);
    }

    .btn-details:hover {
        background: var(--primary-color);
        color: white;
    }

    .btn-edit {
        color: #8e7cc3;
    }

    .btn-edit:hover {
        background: #8e7cc3;
        color: white;
    }

    .btn-delete {
        color: #FF4B4B;
    }

    .btn-delete:hover {
        background: #FF4B4B;
        color: white;
    }

    /* Debt clickable - Click để xem chi tiết công nợ */
    .debt-clickable {
        cursor: pointer;
        transition: all 0.2s ease;
        /* background-color removed */
        color: #d9534f;
        /* Red text to indicate debt/action */
        font-weight: bold;
        text-decoration: underline;
        /* Always underline to show it's a link */
    }

    .debt-clickable:hover {
        color: #c9302c;
    }

    .modal-large {
        max-width: 1240px;
        width: 97%;
    }

    .account-details-filters {
        background: white;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
    }

    .balance-summary {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #ddd;
        font-size: 1.1rem;
    }

    .balance-info strong {
        color: var(--primary-color);
        font-weight: 700;
    }

    .account-details-filters .filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        align-items: flex-end;
    }

    @media (max-width: 768px) {
        .size-row {
            flex-direction: column;
            gap: 8px;
        }

        .size-row input {
            width: 100%;
        }
    }

    .header-buttons {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .header-buttons .add-button {
        margin: 0;
    }

    .refresh-button {
        background: #0F50AD;
        color: #fff;
    }

    .refresh-button i {
        margin-right: 6px;
    }

    /* Permissions Table */
    .permissions-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 10px;
        background: var(--bg-color);
        border-radius: 8px;
        overflow: hidden;
    }

    .permissions-table th,
    .permissions-table td {
        padding: 10px 12px;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    .permissions-table th {
        background: var(--primary-color);
        color: white;
        font-weight: 600;
        font-size: 0.85rem;
    }

    .permissions-table th:first-child,
    .permissions-table td:first-child {
        text-align: left;
        font-weight: 500;
    }

    .permissions-table td {
        font-size: 0.9rem;
    }

    .permissions-table input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

    .permissions-table tbody tr:hover {
        background: white;
    }

    /* Permission hidden class */
    .permission-hidden {
        display: none !important;
    }

    /* Role badge styles */
    .role-badge {
        display: inline-block;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 0.8rem;
        font-weight: 600;
    }

    .role-badge.admin {
        background: var(--gradient-green);
        color: white;
    }

    .role-badge.user {
        background: var(--bg-color);
        color: var(--text-color);
        border: 1px solid var(--border-color);
    }

    /* Permission summary in table */
    .perm-summary {
        font-size: 0.85rem;
        color: #666;
        max-width: 300px;
    }

    .perm-tag.full {
        background: var(--primary-color);
        color: white;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 0.8rem;
        font-weight: 600;
    }

    /* Ensure password input is visible */
    #staff-password {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 0.9rem;
        background: white;
    }

    #staff-password:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(79, 138, 255, 0.1);
    }

    /* ========== PAYMENT STATUS STYLES ========== */
    .income {
        color: #24aa7c !important;
        font-weight: 600;
    }

    .expense {
        color: #E55A66 !important;
        font-weight: 600;
    }

    .partial {
        color: #e5a21b !important;
        font-weight: 600;
    }

    .transfer {
        color: #4F8AFF !important;
        font-weight: 600;
    }

    #transaction-modal .modal-content {
        max-width: 760px;
    }

    /* CRM final overrides: keep status stages balanced and CRM forms centered. */
    html body #crm .crm-status-strip {
        --crm-stage-width: 146px;
        display: flex !important;
        justify-content: center !important;
        align-items: stretch !important;
        width: fit-content !important;
        max-width: 100% !important;
        margin: 8px auto 16px !important;
        padding: 0 8px 10px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        border-bottom: 5px solid #cbd5e1 !important;
        scrollbar-gutter: stable;
    }

    html body #crm .crm-status-arrow {
        flex: 0 0 var(--crm-stage-width) !important;
        width: var(--crm-stage-width) !important;
        min-width: var(--crm-stage-width) !important;
        max-width: var(--crm-stage-width) !important;
        min-height: 42px !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 10px 22px 10px 18px !important;
        text-align: center !important;
        line-height: 1.15 !important;
        white-space: normal !important;
    }

    html body #crm .crm-status-arrow span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    html body #crm .crm-status-arrow.active {
        color: #fff !important;
        box-shadow: inset 0 -3px 0 rgba(15, 23, 42, .18), 0 6px 16px rgba(15, 23, 42, .16) !important;
    }

    html body #crm .crm-status-arrow:nth-child(1).active { background: #1d4ed8 !important; }
    html body #crm .crm-status-arrow:nth-child(2).active { background: #0284c7 !important; }
    html body #crm .crm-status-arrow:nth-child(3).active { background: #ca8a04 !important; }
    html body #crm .crm-status-arrow:nth-child(4).active { background: #db2777 !important; }
    html body #crm .crm-status-arrow:nth-child(5).active { background: #059669 !important; }
    html body #crm .crm-status-arrow:nth-child(6).active { background: #4f46e5 !important; }
    html body #crm .crm-status-arrow:nth-child(7).active { background: #0f766e !important; }
    html body #crm .crm-status-arrow:nth-child(8).active { background: #475569 !important; }
    html body #crm .crm-status-arrow:nth-child(9).active { background: #dc2626 !important; }
    html body #crm .crm-status-arrow:nth-child(10).active { background: #b91c1c !important; }

    html body #crm .crm-status-arrow.active b {
        color: #0f172a !important;
        background: #fff !important;
    }

    html body #crm-customer-modal.modal,
    html body #crm-care-modal.modal,
    html body #crm-reminder-modal.modal,
    html body #crm-link-modal.modal,
    html body #crm-catalog-modal.modal {
        align-items: center !important;
        justify-content: center !important;
        padding: 18px !important;
        overflow: hidden !important;
    }

    html body #crm-customer-modal.modal .crm-form-modal,
    html body #crm-care-modal.modal .crm-form-modal,
    html body #crm-reminder-modal.modal .crm-form-modal,
    html body #crm-link-modal.modal .crm-form-modal,
    html body #crm-catalog-modal.modal .crm-form-modal {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        margin: 0 !important;
        animation: none !important;
        max-height: calc(100vh - 36px) !important;
    }

    html body #crm .crm-detail-panel {
        max-height: calc(100vh - 250px);
        min-height: 420px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .crm-summary-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(160px, 1fr));
        gap: 12px;
        margin-bottom: 12px;
    }

    .crm-summary-grid-wide {
        grid-template-columns: repeat(6, minmax(160px, 1fr));
    }

    .crm-native-nav {
        width: max-content;
        max-width: 100%;
        margin: -4px auto 16px;
        padding: 5px;
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #fff;
        display: flex;
        align-items: center;
        gap: 6px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
        overflow-x: auto;
    }

    .crm-native-tab {
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #475569;
        padding: 10px 18px;
        font-weight: 800;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    .crm-native-tab.active {
        color: #fff;
        background: #2563eb;
        box-shadow: 0 8px 20px rgba(37, 99, 235, .28);
    }

    .crm-native-badge {
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #ef4444;
        color: #fff;
        font-size: 12px;
    }

    .crm-native-section {
        display: none;
    }

    .crm-native-section.active {
        display: block;
    }

    .crm-hero-panel {
        border-radius: 12px;
        padding: 24px;
        margin-bottom: 14px;
        background: linear-gradient(120deg, #101b3f, #2457d6 56%, #0891b2);
        color: #fff;
        display: flex;
        justify-content: space-between;
        gap: 14px;
        align-items: flex-start;
    }

    .crm-hero-panel h3 {
        margin: 0 0 10px;
        font-size: 24px;
    }

    .crm-hero-panel p {
        margin: 0;
        color: rgba(255, 255, 255, .86);
        font-weight: 600;
    }

    .crm-hero-actions {
        display: inline-flex;
        gap: 8px;
        align-items: center;
        white-space: nowrap;
    }

    .crm-hero-actions span,
    .crm-hero-actions button {
        border: 0;
        border-radius: 999px;
        background: rgba(255, 255, 255, .18);
        color: #fff;
        padding: 7px 10px;
        font-weight: 800;
    }

    .crm-hero-actions button {
        cursor: pointer;
    }

    .crm-summary-card {
        position: relative;
        overflow: hidden;
        background: #fff;
        border: 1px solid #dbeafe;
        border-top: 3px solid #059669;
        border-radius: 8px;
        padding: 14px 16px;
        box-shadow: 0 3px 10px rgba(15, 79, 184, .06);
    }

    .crm-summary-card::after {
        content: "";
        position: absolute;
        right: -18px;
        top: -22px;
        width: 74px;
        height: 74px;
        border-radius: 50%;
        background: rgba(16, 185, 129, .12);
    }

    .crm-summary-card span {
        display: block;
        color: #64748b;
        font-size: 13px;
        margin-bottom: 6px;
    }

    .crm-summary-card strong {
        color: #0f172a;
        font-size: 24px;
        line-height: 1;
    }

    .crm-summary-card small {
        display: block;
        margin-top: 8px;
        color: #047857;
        font-size: 12px;
        font-weight: 800;
    }

    .crm-summary-card.is-warning strong {
        color: #dc2626;
    }

    .crm-reminder-command-panel {
        border: 1px solid #dbeafe;
        border-top: 3px solid #2563eb;
        border-radius: 8px;
        background: #fff;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
    }

    .crm-command-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
    }

    .crm-command-head h3 {
        margin: 0;
        color: #0f172a;
        font-size: 16px;
    }

    .crm-command-head p {
        margin: 6px 0 0;
        color: #64748b;
        font-size: 13px;
        font-weight: 800;
    }

    .crm-command-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(150px, 1fr));
        gap: 10px;
        margin-bottom: 12px;
    }

    .crm-command-card {
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #f8fafc;
        padding: 12px;
        text-align: left;
        cursor: pointer;
        display: grid;
        gap: 6px;
    }

    .crm-command-card span {
        color: #64748b;
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .crm-command-card strong {
        color: #0f172a;
        font-size: 28px;
        line-height: 1;
    }

    .crm-command-card small {
        color: #475569;
        font-weight: 800;
    }

    .crm-command-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(15, 23, 42, .08);
    }

    .crm-command-card.danger {
        border-color: #fecaca;
        background: #fff1f2;
    }

    .crm-command-card.danger strong {
        color: #dc2626;
    }

    .crm-command-card.today {
        border-color: #fed7aa;
        background: #fff7ed;
    }

    .crm-command-card.today strong {
        color: #c2410c;
    }

    .crm-command-card.upcoming {
        border-color: #bae6fd;
        background: #f0f9ff;
    }

    .crm-command-card.upcoming strong {
        color: #0369a1;
    }

    .crm-command-card.done {
        border-color: #bbf7d0;
        background: #f0fdf4;
    }

    .crm-command-card.done strong {
        color: #047857;
    }

    .crm-command-body {
        display: grid;
        grid-template-columns: 1.2fr 1fr 1fr;
        gap: 12px;
    }

    .crm-command-list-card {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #f8fafc;
        padding: 12px;
        min-width: 0;
    }

    .crm-command-list-card h4 {
        margin: 0 0 10px;
        color: #0f4fb8;
        font-size: 14px;
    }

    .crm-command-list {
        display: grid;
        gap: 8px;
        max-height: 280px;
        overflow: auto;
        padding-right: 2px;
    }

    .crm-command-row,
    .crm-command-meter-row,
    .crm-command-empty {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #fff;
        padding: 9px;
    }

    .crm-command-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 10px;
        text-align: left;
        cursor: pointer;
    }

    .crm-command-row.is-overdue {
        border-color: #fecaca;
        background: #fff7f7;
    }

    .crm-command-row strong,
    .crm-command-row small,
    .crm-command-row i {
        display: block;
    }

    .crm-command-row strong {
        color: #0f172a;
    }

    .crm-command-row small,
    .crm-command-row i,
    .crm-command-empty {
        color: #64748b;
        font-size: 12px;
        font-style: normal;
        font-weight: 700;
    }

    .crm-command-row em {
        color: #dc2626;
        font-style: normal;
        font-weight: 900;
        white-space: nowrap;
    }

    .crm-command-row i {
        grid-column: 1 / 3;
    }

    .crm-command-meter-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .crm-command-meter-row strong,
    .crm-command-meter-row small {
        display: block;
    }

    .crm-command-meter-row strong {
        color: #0f172a;
    }

    .crm-command-meter-row small {
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
    }

    .crm-command-meter-row b {
        min-width: 34px;
        height: 34px;
        border-radius: 999px;
        background: #e0f2fe;
        color: #0369a1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
    }

    .crm-filter-container .filter-row {
        align-items: end;
        gap: 10px;
    }

    .crm-segment-panel {
        display: grid;
        grid-template-columns: repeat(8, minmax(130px, 1fr));
        gap: 8px;
        margin: 0 0 12px;
    }

    .crm-segment-card {
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
        padding: 10px;
        text-align: left;
        cursor: pointer;
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 4px 8px;
        align-items: center;
        box-shadow: 0 3px 10px rgba(15, 79, 184, .05);
    }

    .crm-segment-card i {
        color: #2563eb;
    }

    .crm-segment-card span {
        color: #334155;
        font-size: 12px;
        font-weight: 900;
    }

    .crm-segment-card strong {
        color: #0f172a;
        font-size: 18px;
    }

    .crm-segment-card small {
        grid-column: 2 / 4;
        color: #64748b;
        font-weight: 700;
    }

    .crm-segment-card.active {
        border-color: #2563eb;
        background: #eff6ff;
        box-shadow: inset 0 0 0 1px #2563eb;
    }

    .crm-status-strip {
        display: flex;
        gap: 0;
        justify-content: center;
        width: max-content;
        max-width: 100%;
        margin: 6px auto 14px;
        padding: 0 6px 10px;
        overflow-x: auto;
        border-bottom: 6px solid #e2e8f0;
    }

    .crm-status-arrow {
        position: relative;
        min-width: 150px;
        border: 0;
        background: #eef6ff;
        color: #0f172a;
        padding: 13px 22px 13px 18px;
        font-weight: 800;
        display: inline-flex;
        justify-content: center;
        gap: 10px;
        cursor: pointer;
        clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%);
        margin-left: -10px;
    }

    .crm-status-arrow:nth-child(2) { background: #e0f2fe; }
    .crm-status-arrow:nth-child(3) { background: #fef3c7; }
    .crm-status-arrow:nth-child(4) { background: #fce7f3; }
    .crm-status-arrow:nth-child(5) { background: #dff7ec; }
    .crm-status-arrow:nth-child(6) { background: #e0e7ff; }
    .crm-status-arrow:nth-child(7) { background: #dff7f7; }
    .crm-status-arrow:nth-child(8) { background: #f1f5f9; }
    .crm-status-arrow:nth-child(9) { background: #fee2e2; }

    .crm-status-arrow:first-child {
        margin-left: 0;
        clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
    }

    .crm-status-arrow.active {
        background: #2563eb !important;
        color: #fff;
    }

    .crm-status-arrow:nth-child(2).active { background: #0284c7 !important; }
    .crm-status-arrow:nth-child(3).active { background: #ca8a04 !important; }
    .crm-status-arrow:nth-child(4).active { background: #db2777 !important; }
    .crm-status-arrow:nth-child(5).active { background: #059669 !important; }
    .crm-status-arrow:nth-child(6).active { background: #4f46e5 !important; }
    .crm-status-arrow:nth-child(7).active { background: #0f766e !important; }
    .crm-status-arrow:nth-child(8).active { background: #475569 !important; }
    .crm-status-arrow:nth-child(9).active { background: #dc2626 !important; }

    .crm-status-arrow b {
        min-width: 24px;
        height: 24px;
        border-radius: 999px;
        background: #fff;
        color: #0f172a;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
    }

    .crm-phone-filter {
        min-width: 46px;
        height: 38px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        color: #2563eb;
        background: #fff;
    }

    .crm-column-button {
        background: #fff !important;
        color: #475569 !important;
        border: 1px solid #dbeafe !important;
        box-shadow: none !important;
    }

    .crm-report-strip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

    .crm-report-card {
        background: #fff;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        padding: 12px;
    }

    .crm-report-card h3 {
        color: #0f4fb8;
        font-size: 15px;
        margin: 0 0 10px;
    }

    .crm-report-list {
        display: grid;
        gap: 7px;
    }

    .crm-report-row {
        position: relative;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #f8fafc;
        padding: 8px 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        color: #0f172a;
    }

    .crm-report-row span,
    .crm-report-row strong {
        position: relative;
        z-index: 1;
    }

    .crm-report-row i {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        background: rgba(15, 79, 184, .1);
        z-index: 0;
    }

    .crm-report-row:hover {
        border-color: #93c5fd;
        background: #eff6ff;
    }

    .crm-strategy-panel {
        border-top: 3px solid #059669;
        border-radius: 8px;
        background: #fff;
        padding: 14px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
        margin-bottom: 12px;
    }

    .crm-strategy-panel h3 {
        margin: 0;
        color: #0f172a;
        font-size: 16px;
    }

    .crm-strategy-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
    }

    .crm-strategy-head p {
        margin: 6px 0 0;
        color: #64748b;
        font-size: 13px;
        font-weight: 700;
    }

    .crm-sync-orders-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        background: #0f766e;
    }

    .crm-sync-orders-btn:disabled {
        opacity: .75;
        cursor: wait;
    }

    .crm-strategy-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(220px, 1fr));
        gap: 12px;
    }

    .crm-strategy-card {
        border: 1px solid #dbeafe;
        border-radius: 8px;
        padding: 12px;
        background: #f8fafc;
    }

    .crm-strategy-card h4 {
        margin: 0 0 10px;
        color: #0f4fb8;
        font-size: 14px;
    }

    .crm-strategy-list {
        display: grid;
        gap: 8px;
    }

    .crm-strategy-row {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #fff;
        padding: 9px;
    }

    .crm-strategy-row strong,
    .crm-strategy-row span {
        display: block;
    }

    .crm-strategy-row span {
        margin-top: 3px;
        color: #64748b;
        font-size: 12px;
    }

    .crm-strategy-row em {
        display: inline-flex;
        margin: 6px 5px 0 0;
        padding: 3px 7px;
        border-radius: 999px;
        background: #ecfdf5;
        color: #047857;
        font-style: normal;
        font-weight: 800;
        font-size: 11px;
    }

    .crm-search {
        min-width: 280px;
        flex: 1 1 320px;
    }

    .crm-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 14px;
        min-height: 520px;
    }

    .crm-table-wrap {
        min-height: 520px;
        overflow: auto;
    }

    .crm-table {
        min-width: 960px;
    }

    .crm-table td strong,
    .crm-table td small {
        display: block;
    }

    .crm-table td small {
        color: #64748b;
        margin-top: 3px;
        line-height: 1.35;
    }

    .crm-customer-row {
        cursor: pointer;
    }

    .crm-customer-row.selected td {
        background: #eff6ff !important;
    }

    .crm-status-pill {
        display: inline-flex;
        align-items: center;
        max-width: 100%;
        min-height: 26px;
        padding: 4px 9px;
        border-radius: 999px;
        background: #e0f2fe;
        color: #075985;
        font-weight: 700;
        font-size: 12px;
        white-space: normal;
    }

    .crm-linked-cell strong {
        color: #0f4fb8;
    }

    .crm-muted {
        color: #94a3b8;
        font-style: italic;
    }

    .crm-detail-panel {
        background: #fff;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        padding: 14px;
        min-height: 520px;
        overflow: auto;
    }

    .crm-empty-detail {
        min-height: 260px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: #64748b;
        gap: 8px;
    }

    .crm-empty-detail i {
        color: #0f4fb8;
        font-size: 28px;
    }

    .crm-empty-detail strong {
        color: #0f172a;
    }

    .crm-detail-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        padding-bottom: 12px;
        border-bottom: 1px solid #e2e8f0;
    }

    .crm-detail-header strong,
    .crm-detail-header span {
        display: block;
    }

    .crm-detail-header > div > strong {
        color: #0f172a;
        font-size: 18px;
    }

    .crm-detail-header > div > span {
        color: #64748b;
        margin-top: 4px;
    }

    .crm-detail-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 12px 0;
    }

    .crm-detail-meta div {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 9px;
        background: #f8fafc;
    }

    .crm-detail-meta b,
    .crm-detail-meta span {
        display: block;
    }

    .crm-detail-meta b {
        color: #64748b;
        font-size: 12px;
        margin-bottom: 4px;
    }

    .crm-detail-note {
        padding: 10px;
        border-radius: 8px;
        background: #fff7ed;
        color: #9a3412;
        line-height: 1.45;
        margin-bottom: 12px;
    }

    .crm-detail-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 12px 0;
    }

    .crm-detail-actions button {
        border-radius: 8px;
        min-height: 34px;
        padding: 7px 10px;
        font-size: 13px;
    }

    .crm-stage-quick {
        margin: 12px 0;
        padding: 10px;
        border: 1px dashed #bfdbfe;
        border-radius: 8px;
        background: #f8fbff;
    }

    .crm-stage-quick > b {
        display: block;
        margin-bottom: 8px;
        color: #0f4fb8;
        font-size: 13px;
    }

    .crm-stage-quick > div {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .crm-stage-quick select {
        width: 100%;
        height: 38px;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        background: #fff;
        padding: 0 10px;
        font-weight: 900;
        cursor: pointer;
    }

    .crm-detail-section {
        border-top: 1px solid #e2e8f0;
        padding-top: 12px;
        margin-top: 12px;
    }

    .crm-detail-section h4 {
        color: #0f4fb8;
        font-size: 15px;
        margin: 0 0 10px;
    }

    .crm-customer-strategy-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 10px;
    }

    .crm-customer-strategy-grid div {
        border: 1px solid #dbeafe;
        border-radius: 8px;
        padding: 9px;
        background: #f8fafc;
    }

    .crm-customer-strategy-grid b,
    .crm-customer-strategy-grid span {
        display: block;
    }

    .crm-customer-strategy-grid b {
        color: #0f172a;
    }

    .crm-customer-strategy-grid span,
    .crm-cycle-line {
        color: #64748b;
        font-size: 12px;
    }

    .crm-product-mix {
        list-style: none;
        display: grid;
        gap: 6px;
        margin: 10px 0;
        padding: 0;
    }

    .crm-product-mix li {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 6px;
        color: #0f172a;
    }

    .crm-recommendation {
        display: flex;
        gap: 8px;
        align-items: flex-start;
        border-radius: 8px;
        background: #fff7ed;
        color: #9a3412;
        padding: 8px;
        margin-top: 6px;
        font-weight: 700;
        font-size: 13px;
    }

    .crm-mini-row {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 9px;
        margin-bottom: 8px;
        background: #fff;
    }

    .crm-mini-row-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 4px;
    }

    .crm-mini-row strong,
    .crm-mini-row span,
    .crm-mini-row small {
        display: block;
    }

    .crm-mini-row strong {
        color: #0f172a;
        margin-bottom: 4px;
    }

    .crm-mini-row span,
    .crm-mini-row small,
    .crm-mini-empty {
        color: #64748b;
    }

    .crm-mini-actions {
        display: inline-flex !important;
        align-items: center;
        gap: 5px;
    }

    .crm-mini-action {
        width: 26px;
        height: 26px;
        min-width: 26px;
        border: 1px solid #bfdbfe;
        border-radius: 7px;
        background: #eff6ff;
        color: #0f4fb8;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .crm-mini-action:hover {
        background: #dbeafe;
    }

    .crm-form-modal {
        width: min(820px, calc(100vw - 32px));
        max-width: 820px;
        margin: auto;
        transform: none;
    }

    #crm-customer-modal,
    #crm-care-modal,
    #crm-reminder-modal,
    #crm-link-modal,
    #crm-catalog-modal {
        align-items: center;
        justify-content: center;
        padding: 18px;
        overflow: hidden;
    }

    #crm-customer-modal .crm-form-modal,
    #crm-care-modal .crm-form-modal,
    #crm-reminder-modal .crm-form-modal,
    #crm-link-modal .crm-form-modal,
    #crm-catalog-modal .crm-form-modal {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0;
        max-height: calc(100vh - 36px);
    }

    .crm-form-modal .modal-body {
        padding: 18px;
    }

    .crm-form-modal textarea {
        width: 100%;
        resize: vertical;
        min-height: 90px;
    }

    .crm-form-modal .form-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 14px;
    }

    .crm-form-section-title {
        margin: 4px 0 12px;
        padding: 10px 12px;
        border-radius: 8px;
        background: #eff6ff;
        color: #0f4fb8;
        font-weight: 900;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .crm-customer-lookup {
        display: none;
        position: absolute;
        z-index: 14020;
        left: 0;
        right: 0;
        top: calc(100% + 4px);
        max-height: 260px;
        overflow: auto;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 14px 30px rgba(15, 23, 42, .14);
        padding: 6px;
    }

    .crm-customer-lookup.show {
        display: grid;
        gap: 5px;
    }

    #crm-customer-modal .form-group {
        position: relative;
    }

    .crm-customer-lookup-item {
        border: 1px solid transparent;
        border-radius: 7px;
        background: #fff;
        padding: 8px;
        text-align: left;
        cursor: pointer;
    }

    .crm-customer-create-new {
        width: 100%;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        background: #f8fbff;
        color: #0f50ad;
        padding: 10px 12px;
        text-align: left;
        font: inherit;
        font-weight: 800;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .crm-customer-lookup-item:hover {
        border-color: #93c5fd;
        background: #eff6ff;
    }

    .crm-customer-create-new:hover {
        border-color: #60a5fa;
        background: #eff6ff;
    }

    .crm-customer-lookup-item strong,
    .crm-customer-lookup-item span {
        display: block;
    }

    .crm-customer-lookup-item span,
    .crm-customer-lookup-empty {
        color: #64748b;
        font-size: 12px;
    }

    .crm-customer-lookup-empty {
        padding: 8px;
        font-style: italic;
    }

    .crm-sales-goal-card {
        border: 1px solid #bfdbfe;
        border-top: 3px solid #2563eb;
        border-radius: 8px;
        background: #fff;
        padding: 14px;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
    }

    .crm-sales-goal-card h3 {
        margin: 0 0 6px;
        color: #0f172a;
        font-size: 16px;
    }

    .crm-sales-goal-card p {
        margin: 0;
        color: #475569;
        font-weight: 700;
    }

    .crm-sales-goal-card form {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 360px;
    }

    .crm-sales-goal-card input {
        min-width: 180px;
        height: 38px;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        padding: 0 12px;
        text-align: right;
        font-weight: 800;
    }

    .crm-link-results {
        display: grid;
        gap: 8px;
        max-height: 420px;
        overflow: auto;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 8px;
        background: #f8fafc;
    }

    .crm-link-result {
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
        padding: 10px;
        text-align: left;
        cursor: pointer;
    }

    .crm-link-result:hover {
        border-color: #0f4fb8;
        background: #eff6ff;
    }

    .crm-link-result strong,
    .crm-link-result span {
        display: block;
    }

    .crm-link-result span {
        color: #64748b;
        font-size: 13px;
        margin-top: 4px;
    }

    .crm-report-filter-bar,
    .crm-reminder-toolbar,
    .crm-history-toolbar {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        padding: 12px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
        margin-bottom: 14px;
    }

    .crm-report-filter-bar label,
    .crm-reminder-toolbar label,
    .crm-history-toolbar label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-weight: 800;
        color: #0f172a;
    }

    .crm-report-filter-bar input,
    .crm-report-filter-bar select,
    .crm-reminder-toolbar input,
    .crm-reminder-toolbar select,
    .crm-history-toolbar input,
    .crm-history-toolbar select {
        height: 38px;
        border: 1px solid #cfe0fa;
        border-radius: 8px;
        padding: 0 12px;
        background: #fff;
    }

    .crm-reminder-toolbar input[type="text"],
    .crm-history-toolbar input[type="text"] {
        flex: 1 1 320px;
    }

    .crm-report-kpi-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(160px, 1fr));
        gap: 14px;
        margin-bottom: 16px;
    }

    .crm-report-kpi {
        min-height: 78px;
        border-left: 4px solid #2563eb;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
        display: grid;
        grid-template-columns: 42px 1fr;
        column-gap: 10px;
        align-items: center;
        padding: 12px;
    }

    .crm-report-kpi i {
        width: 38px;
        height: 38px;
        border-radius: 999px;
        background: #eef2ff;
        color: #2563eb;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        grid-row: span 2;
    }

    .crm-report-kpi strong,
    .crm-report-kpi span {
        display: block;
    }

    .crm-chart-grid,
    .crm-settings-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(220px, 1fr));
        gap: 14px;
    }

    .crm-chart-card,
    .crm-settings-card,
    .crm-settings-quick {
        background: #fff;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        padding: 14px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
    }

    .crm-chart-card h3,
    .crm-settings-card h3,
    .crm-settings-quick h3 {
        margin: 0 0 12px;
        color: #0f172a;
        font-size: 15px;
    }

    .crm-settings-quick {
        border-top: 3px solid #059669;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .crm-settings-list {
        display: grid;
        gap: 8px;
        margin-bottom: 12px;
        max-height: 360px;
        overflow: auto;
    }

    .crm-settings-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .crm-settings-row span {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        line-height: 1.35;
    }

    .crm-settings-row span strong {
        font-weight: 800;
    }

    .crm-settings-row small {
        color: #64748b;
    }

    .crm-settings-dot {
        width: 14px;
        height: 14px;
        min-width: 14px;
        border-radius: 50%;
        box-shadow: 0 0 0 3px rgba(15, 23, 42, .04);
    }

    .crm-settings-row b {
        display: inline-flex;
        gap: 10px;
        color: #64748b;
    }

    .crm-settings-row button {
        width: 26px;
        height: 26px;
        border: 0;
        background: transparent;
        color: #64748b;
        cursor: pointer;
    }

    .crm-settings-row button:hover {
        color: #0f4fb8;
    }

    .crm-catalog-extra {
        display: none;
    }

    .crm-history-action {
        display: inline-flex;
        min-height: 24px;
        align-items: center;
        border-radius: 999px;
        padding: 3px 9px;
        background: #eff6ff;
        color: #1d4ed8;
        font-weight: 800;
        font-size: 12px;
    }

    .crm-reminder-tabs {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin: 0 0 14px;
    }

    .crm-reminder-tabs button {
        border: 1px solid #dbeafe;
        border-radius: 999px;
        background: #fff;
        padding: 9px 18px;
        color: #475569;
        font-weight: 800;
        cursor: pointer;
    }

    .crm-reminder-tabs button.active {
        color: #fff;
        background: #2563eb;
        border-color: #2563eb;
    }

    .crm-reminder-tabs span {
        min-width: 22px;
        height: 22px;
        margin-left: 6px;
        border-radius: 999px;
        background: #fff;
        color: #0f172a;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .crm-reminder-suggestions {
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
        padding: 10px 12px;
        margin-bottom: 10px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
    }

    .crm-reminder-suggestion-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }

    .crm-reminder-suggestion-actions {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }

    .crm-reminder-suggestion-head h3 {
        margin: 0;
        font-size: 16px;
        color: #0f172a;
    }

    .crm-reminder-suggestion-head p {
        margin: 3px 0 0;
        color: #64748b;
        font-size: 13px;
    }

    .crm-reminder-suggestion-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(260px, 1fr));
        gap: 8px;
    }

    .crm-reminder-suggestions:not(.is-expanded) .crm-reminder-suggestion-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .crm-reminder-suggestion-card {
        border: 1px solid #dbeafe;
        border-left: 4px solid #2563eb;
        border-radius: 8px;
        background: #f8fbff;
        padding: 9px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
    }

    .crm-reminder-suggestions:not(.is-expanded) .crm-reminder-suggestion-card {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .crm-reminder-suggestion-card.suggestion-debt {
        border-left-color: #ef4444;
    }

    .crm-reminder-suggestion-card.suggestion-reorder {
        border-left-color: #0ea5e9;
    }

    .crm-reminder-suggestion-card.suggestion-drop {
        border-left-color: #f59e0b;
    }

    .crm-reminder-suggestion-card.suggestion-vip {
        border-left-color: #8b5cf6;
    }

    .crm-reminder-suggestion-card strong,
    .crm-reminder-suggestion-card span,
    .crm-reminder-suggestion-card em {
        display: block;
        min-width: 0;
    }

    .crm-reminder-suggestion-card strong {
        color: #0f172a;
        line-height: 1.25;
    }

    .crm-reminder-suggestion-card span {
        color: #475569;
        font-size: 12px;
        margin-top: 2px;
    }

    .crm-reminder-suggestion-card em {
        color: #0f50ad;
        font-style: normal;
        font-weight: 800;
        font-size: 12px;
        margin-top: 4px;
    }

    .crm-reminder-suggestions:not(.is-expanded) .crm-reminder-suggestion-card strong,
    .crm-reminder-suggestions:not(.is-expanded) .crm-reminder-suggestion-card span {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        -webkit-line-clamp: 2;
    }

    .crm-reminder-suggestions:not(.is-expanded) .crm-reminder-suggestion-card .add-button {
        width: 100%;
        justify-content: center;
        min-height: 34px;
        padding: 7px 10px;
    }

    .crm-reminder-workspace {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 14px;
        align-items: start;
    }

    .crm-reminder-detail {
        position: sticky;
        top: 76px;
        max-height: calc(100vh - 120px);
        overflow: auto;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
        padding: 14px;
    }

    .crm-reminder-detail-head,
    .crm-reminder-detail-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .crm-reminder-detail h3 {
        margin: 12px 0;
        color: #0f172a;
        line-height: 1.35;
    }

    .crm-reminder-detail-meta {
        display: grid;
        gap: 7px;
        margin-bottom: 12px;
    }

    .crm-reminder-detail-meta span {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: #475569;
        font-weight: 700;
        font-size: 13px;
    }

    .crm-reminder-context-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 12px 0;
    }

    .crm-reminder-context-grid div {
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #f8fbff;
        padding: 10px;
        display: grid;
        gap: 3px;
    }

    .crm-reminder-context-grid small,
    .crm-reminder-context-grid span {
        color: #64748b;
        font-size: 12px;
    }

    .crm-reminder-context-grid strong {
        color: #0f50ad;
    }

    .crm-reminder-note-box {
        white-space: pre-wrap;
        border-radius: 8px;
        background: #fff7ed;
        color: #9a3412;
        padding: 10px;
        margin: 10px 0;
        line-height: 1.45;
    }

    .crm-reminder-status-select {
        height: 32px;
        min-width: 128px;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        background: #fff;
        color: #0f172a;
        font-weight: 800;
        padding: 0 8px;
    }

    .crm-reminder-row.status-overdue td {
        background: #fff1f2 !important;
    }

    .crm-reminder-table td strong,
    .crm-reminder-table td small {
        display: block;
    }

    .crm-reminder-repeat-line {
        margin-top: 5px;
        color: #7c3aed;
        font-weight: 800;
    }

    .crm-reminder-repeat-line i {
        margin-right: 4px;
    }

    .crm-priority,
    .crm-reminder-status {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 24px;
        border-radius: 999px;
        padding: 3px 9px;
        font-weight: 800;
        font-size: 12px;
        background: #e5e7eb;
        color: #374151;
    }

    .crm-priority.high {
        background: #ef4444;
        color: #fff;
    }

    .crm-priority.important {
        background: #fef3c7;
        color: #92400e;
    }

    .crm-priority.follow {
        background: #e0f2fe;
        color: #0369a1;
    }

    .crm-reminder-link-cell {
        display: grid;
        gap: 4px;
        min-width: 190px;
    }

    .crm-reminder-link-cell span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #0f50ad;
        font-weight: 800;
        line-height: 1.25;
    }

    .crm-reminder-link-cell small {
        color: #94a3b8;
    }

    #crm-reminder-modal .form-group {
        position: relative;
    }

    .crm-reminder-order-suggestions {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 4px);
        z-index: 14030;
        max-height: 260px;
        overflow: auto;
    }

    .crm-reminder-status.overdue {
        background: #fee2e2;
        color: #dc2626;
    }

    .crm-reminder-status.today {
        background: #fef3c7;
        color: #b45309;
    }

    .crm-reminder-status.upcoming {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .crm-reminder-status.done {
        background: #dcfce7;
        color: #15803d;
    }

    .crm-reminder-status.cancelled {
        background: #e5e7eb;
        color: #4b5563;
    }

    #crm-pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 0 4px;
    }

    @media (max-width: 1180px) {
        .crm-layout {
            grid-template-columns: 1fr;
        }

        .crm-detail-panel {
            min-height: 260px;
        }

        .crm-reminder-workspace {
            grid-template-columns: 1fr;
        }

        .crm-reminder-suggestion-grid {
            grid-template-columns: 1fr;
        }

        .crm-reminder-suggestions:not(.is-expanded) .crm-reminder-suggestion-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .crm-reminder-detail {
            position: static;
            max-height: none;
        }

        .crm-chart-grid,
        .crm-settings-grid,
        .crm-command-body,
        .crm-strategy-grid {
            grid-template-columns: repeat(2, minmax(220px, 1fr));
        }

        .crm-summary-grid-wide {
            grid-template-columns: repeat(3, minmax(180px, 1fr));
        }

        .crm-command-grid {
            grid-template-columns: repeat(2, minmax(180px, 1fr));
        }

        .crm-segment-panel {
            grid-template-columns: repeat(4, minmax(130px, 1fr));
        }
    }

    @media (max-width: 760px) {
        .crm-strategy-head {
            flex-direction: column;
        }

        .crm-sync-orders-btn {
            width: 100%;
            justify-content: center;
        }

        .crm-summary-grid {
            grid-template-columns: 1fr 1fr;
        }

        .crm-report-kpi-grid,
        .crm-chart-grid,
        .crm-settings-grid,
        .crm-command-grid,
        .crm-command-body,
        .crm-summary-grid-wide,
        .crm-segment-panel,
        .crm-strategy-grid {
            grid-template-columns: 1fr;
        }

        .crm-reminder-suggestions:not(.is-expanded) .crm-reminder-suggestion-grid {
            grid-template-columns: 1fr;
        }

        .crm-hero-panel,
        .crm-command-head,
        .crm-sales-goal-card,
        .crm-settings-quick {
            flex-direction: column;
        }

        .crm-sales-goal-card form {
            min-width: 0;
            width: 100%;
            flex-direction: column;
            align-items: stretch;
        }

        .crm-report-strip {
            grid-template-columns: 1fr;
        }

        .crm-filter-container .filter-row {
            display: grid;
            grid-template-columns: 1fr;
        }

        .crm-search {
            min-width: 0;
        }
    }

    #transaction-modal .modal-body {
        padding-top: 10px;
    }

    .transaction-form-shell {
        display: grid;
        gap: 10px;
    }

    .transaction-form-panel {
        border: 1px solid #dbe7ff;
        border-radius: 8px;
        background: #fbfdff;
        padding: 12px;
    }

    .transaction-panel-title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        color: #0f4fb8;
        font-weight: 800;
        font-size: 0.95rem;
    }

    .transaction-panel-title i {
        width: 18px;
        text-align: center;
    }

    #transaction-modal .form-group {
        margin-bottom: 10px;
    }

    #transaction-modal .form-row {
        gap: 12px;
        margin-bottom: 10px;
    }

    #transaction-modal label {
        margin-bottom: 5px;
    }

    #transaction-modal input,
    #transaction-modal select {
        min-height: 36px;
    }

    #transaction-modal .transaction-type-selector {
        gap: 8px;
    }

    #transaction-modal .transaction-type-selector .type-option {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 8px;
        font-weight: 700;
    }

    .transaction-link-panel {
        background: #ffffff;
    }

    .linked-order-card {
        padding: 10px;
        border: 1px dashed #b7cff8;
        border-radius: 8px;
        background: #f6faff;
    }

    #transaction-linked-order[data-order-id] {
        color: #0b57d0;
        font-weight: 700;
    }

    /* Payment info section in transaction form */
    .payment-info-section {
        margin-bottom: 0 !important;
    }

    .payment-info-section .payment-summary-box {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #f8fbff;
        padding: 10px !important;
    }

    .payment-compact-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
        align-items: stretch;
        gap: 8px;
    }

    .payment-compact-grid:not(.has-actions) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .payment-metric {
        min-width: 0;
        padding: 8px 10px;
        border: 1px solid #dbe7ff;
        border-radius: 8px;
        background: #fff;
    }

    .payment-metric span {
        display: block;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 700;
    }

    .payment-metric strong {
        display: block;
        font-size: 0.95rem;
        line-height: 1.2;
        word-break: break-word;
    }

    .payment-status-metric strong {
        font-size: 0.9rem;
    }

    #transaction-modal .payment-action-buttons {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 7px;
        min-width: 145px;
    }

    #transaction-modal .payment-action-buttons button {
        width: 100%;
        min-height: 32px;
        padding: 6px 10px !important;
        border-radius: 8px !important;
        font-size: 0.84rem !important;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        line-height: 1.15;
    }

    #transaction-modal .payment-action-buttons button i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 14px;
        height: 14px;
        line-height: 1;
        margin: 0;
        flex: 0 0 auto;
    }

    #transaction-modal .payment-action-buttons:empty,
    #transaction-modal .payment-action-buttons.no-actions {
        display: none;
    }

    #form-payment-list {
        display: none;
        max-height: 96px !important;
        overflow-y: auto;
        margin-top: 8px;
    }

    #form-payment-list.has-payments {
        display: block;
    }

    #form-payment-list .no-data {
        margin: 0 !important;
        padding: 6px 0 !important;
    }

    @media (max-width: 720px) {
        .payment-compact-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        #transaction-modal .payment-action-buttons {
            grid-column: 1 / -1;
            flex-direction: row;
            min-width: 0;
        }
    }

    #transaction-category.is-readonly,
    #transaction-category:disabled {
        background: #f1f5f9;
        color: #475569;
        cursor: not-allowed;
    }

    /* Pay button style */
    .pay-btn {
        background: none;
        color: linear-gradient(135deg, #24aa7c, #7fd8b9);
        border: none;
        padding: 6px 10px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .pay-btn:hover {
        background: #33d771;
        color: white;
    }

    /* Payment history table */
    .payment-history-table {
        border-collapse: collapse;
    }

    .payment-history-table th {
        background: var(--bg-color);
        padding: 8px;
        text-align: left;
        font-weight: 600;
    }

    .payment-history-table td {
        padding: 8px;
        border-bottom: 1px solid var(--border-color);
    }

    .payment-history-table tr:hover {
        background: var(--bg-color);
    }
    /* Order management */
    .orders-table th,
    .orders-table td,
    .orders-debt-table th,
    .orders-debt-table td {
        white-space: nowrap;
    }

    .orders-table th,
    .orders-table td {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .orders-table .action-buttons {
        overflow: visible;
        text-overflow: clip;
    }

    .orders-table .order-action-menu {
        position: relative;
        justify-content: flex-end;
        gap: 4px;
        min-width: 58px;
    }

    .orders-table .order-extra-actions {
        display: none;
        align-items: center;
        gap: 4px;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .orders-table .order-action-menu.expanded .order-extra-actions {
        display: flex;
    }

    .fast-print-stats-panel {
        margin: 12px 0;
        padding: 12px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #f8fbff;
    }

    .fast-print-stats-head {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 14px;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }

    .fast-print-stats-head h3 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        color: var(--primary-color);
        font-size: 16px;
    }

    .fast-print-stats-head p {
        margin: 3px 0 0;
        color: #64748b;
        font-size: 12px;
        font-weight: 600;
    }

    .fast-print-stats-controls {
        display: flex;
        align-items: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }

    .fast-print-stats-controls .filter-item {
        min-width: 130px;
        margin: 0;
    }

    .fast-print-stats-controls #fast-print-stats-search {
        min-width: 180px;
    }

    .fast-print-refresh-btn {
        min-height: 36px;
        padding: 0 14px;
        border-radius: 8px;
        gap: 6px;
        align-self: flex-end;
    }

    .fast-print-stats-summary {
        display: grid;
        grid-template-columns: repeat(4, minmax(130px, 1fr));
        gap: 8px;
        margin-bottom: 10px;
    }

    .fast-print-stat-card {
        padding: 8px 10px;
        border: 1px solid #e0eaff;
        border-radius: 7px;
        background: #fff;
    }

    .fast-print-stat-card span {
        display: block;
        color: #64748b;
        font-size: 11px;
        font-weight: 700;
    }

    .fast-print-stat-card strong {
        display: block;
        margin-top: 2px;
        color: #0f50ad;
        font-size: 16px;
        font-weight: 900;
    }

    .fast-print-stats-table-wrap {
        max-height: calc(100vh - 320px);
        min-height: 320px;
        overflow: auto;
        border-radius: 7px;
    }

    .fast-print-stats-table {
        table-layout: fixed;
        min-width: 1180px;
    }

    .fast-print-col-customer { width: 34%; }
    .fast-print-col-code { width: 8%; }
    .fast-print-col-month { width: 8%; }
    .fast-print-col-orders { width: 7%; }
    .fast-print-col-units { width: 11%; }
    .fast-print-col-amount { width: 13%; }
    .fast-print-col-last { width: 14%; }
    .fast-print-col-action { width: 5%; }

    .fast-print-stats-table th,
    .fast-print-stats-table td {
        padding: 8px 10px;
        white-space: nowrap;
        vertical-align: middle;
    }

    .fast-print-stats-table th:nth-child(4),
    .fast-print-stats-table th:nth-child(5),
    .fast-print-stats-table th:nth-child(6) {
        text-align: right;
    }

    .fast-print-stats-table th:nth-child(8),
    .fast-print-stats-table td:nth-child(8) {
        text-align: center;
    }

    .fast-print-stats-table .num {
        text-align: right;
        font-weight: 800;
    }

    .fast-print-customer-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        max-width: 100%;
        padding: 4px 8px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #0f50ad;
        font-weight: 800;
        text-align: left;
        cursor: pointer;
    }

    .fast-print-customer-toggle:hover {
        background: #eaf2ff;
    }

    .fast-print-customer-toggle span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fast-print-detail-row td {
        padding: 0 10px 12px;
        background: #f8fbff;
    }

    .fast-print-detail-box {
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
    }

    .fast-print-detail-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 12px;
        color: #334155;
        background: #eff6ff;
        font-size: 12px;
        font-weight: 800;
    }

    .fast-print-detail-title strong {
        color: #0f50ad;
    }

    .fast-print-detail-table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
        font-size: 12px;
    }

    .fast-print-detail-col-date { width: 10%; }
    .fast-print-detail-col-id { width: 10%; }
    .fast-print-detail-col-po { width: 10%; }
    .fast-print-detail-col-name { width: 38%; }
    .fast-print-detail-col-units { width: 10%; }
    .fast-print-detail-col-amount { width: 11%; }
    .fast-print-detail-col-status { width: 8%; }
    .fast-print-detail-col-action { width: 3%; }

    .fast-print-detail-table th,
    .fast-print-detail-table td {
        padding: 8px 10px;
        border-bottom: 1px solid #e5edff;
        white-space: nowrap;
        text-align: left;
        vertical-align: middle;
    }

    .fast-print-detail-table th {
        color: #475569;
        background: #f8fafc;
        font-weight: 800;
    }

    .fast-print-detail-table th:nth-child(4),
    .fast-print-detail-table td:nth-child(4) {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .fast-print-detail-table th:nth-child(5),
    .fast-print-detail-table th:nth-child(6),
    .fast-print-detail-table td:nth-child(5),
    .fast-print-detail-table td:nth-child(6) {
        text-align: right;
    }

    .fast-print-detail-table th:nth-child(8),
    .fast-print-detail-table td:nth-child(8) {
        text-align: center;
        padding-left: 6px;
        padding-right: 6px;
    }

    .fast-print-open-order {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 7px;
    }

    .order-customer-info-content {
        max-width: 560px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .order-customer-info-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
        padding: 8px 10px;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        background: #f8fafc;
        font-size: 12px;
    }

    .order-customer-info-summary span {
        color: #64748b;
        font-weight: 700;
    }

    .order-customer-info-summary strong {
        color: var(--primary-dark);
        text-align: right;
    }

    .order-customer-info-table {
        display: grid;
        grid-template-columns: 1fr;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        overflow: hidden;
    }

    .order-customer-info-section {
        padding: 8px 10px;
        background: #0f50ad;
        color: #ffffff;
        font-size: 12px;
        font-weight: 700;
    }

    .order-customer-info-table label {
        display: grid;
        grid-template-columns: 160px minmax(0, 1fr);
        font-size: 12px;
        font-weight: 700;
        color: #475569;
        border-top: 1px solid var(--border-color);
    }

    .order-customer-info-table label span {
        padding: 8px 10px;
        background: #f8fafc;
    }

    .order-customer-info-table label > input {
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        border: 0;
        border-left: 1px solid var(--border-color);
        background: #fff;
        font-size: 13px;
    }

    .order-customer-info-actions {
        margin-top: 14px;
    }

    #orders .orders-table th[data-order-col="note"],
    #orders .orders-table td[data-order-col="note"] {
        width: 64px;
        min-width: 64px;
        max-width: 64px;
        text-align: center;
    }

    .order-subtabs {
        display: flex;
        gap: 8px;
        margin: 0 0 12px;
        border-bottom: 1px solid var(--border-color);
    }

    .order-subtab {
        border: none;
        background: transparent;
        color: #64748b;
        padding: 10px 14px;
        font-weight: 700;
        cursor: pointer;
        border-bottom: 3px solid transparent;
    }

    .order-subtab.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

    .role-quick-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }

    #orders .order-subtabs {
        margin-top: 0;
        flex: 0 0 auto;
    }

    #orders {
        height: calc(100vh - 50px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #orders .order-tab-panel.active {
        flex: 1 1 auto;
        min-height: 0;
        display: flex !important;
        flex-direction: column;
    }

    #orders .orders-top-actions {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 10px;
        margin: 0;
        margin-left: auto;
    }

    #orders .orders-top-actions .add-button {
        min-height: 44px;
        white-space: nowrap;
    }

    #orders .orders-toolbar-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 0 10px;
    }

    #orders .order-filter-container {
        flex: 0 0 auto;
        margin-bottom: 8px;
    }

    #orders .orders-summary-compact {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: repeat(6, minmax(145px, 1fr));
        gap: 10px;
        padding: 8px 10px;
        margin: 0 0 8px;
        box-shadow: 0 4px 12px rgba(74, 144, 255, 0.08);
        background: transparent;
    }

    #orders .orders-summary-compact .card-summary {
        min-width: 0;
        padding: 10px 12px;
        border-radius: 14px;
        box-shadow: 0 4px 12px rgba(74, 144, 255, 0.08);
        gap: 10px;
        cursor: pointer;
    }

    #orders .orders-summary-compact .card-summary:hover {
        transform: none;
    }

    #orders .orders-summary-compact .card-summary.order-filter-active {
        border: 2px solid var(--primary-color);
        box-shadow: 0 8px 18px rgba(15, 80, 173, 0.16);
    }

    #orders .orders-summary-compact .card-summary .card-icon {
        width: 38px;
        height: 38px;
        margin-right: 8px;
    }

    #orders .orders-summary-compact .card-summary .card-icon i {
        font-size: 1rem;
    }

    #orders .orders-summary-compact .card-summary .card-info h3 {
        font-size: 0.78rem;
        margin-bottom: 2px;
    }

    #orders .orders-summary-compact .card-summary .card-info p {
        font-size: 1rem;
        line-height: 1.25;
    }

    #orders .order-workflow-bar {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
        gap: 8px;
        margin: 0 10px 8px;
        padding: 10px;
        border: 1px solid #dbeafe;
        border-radius: 14px;
        background: #f8fbff;
        overflow-x: auto;
    }

    #orders .order-workflow-step {
        position: relative;
        display: grid;
        grid-template-columns: 10px 1fr auto;
        align-items: center;
        gap: 8px;
        min-height: 46px;
        padding: 7px 10px;
        border: 1px solid var(--workflow-border, #d7e6ff);
        border-radius: 12px;
        background: var(--workflow-bg, #fff);
        color: var(--workflow-fg, #1f3f68);
        cursor: pointer;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
        font-family: inherit;
        min-width: 0;
    }

    #orders .order-workflow-step:not(:last-child)::after {
        content: "";
        position: absolute;
        right: -8px;
        top: 50%;
        width: 8px;
        height: 1px;
        background: #bfdbfe;
    }

    #orders .order-workflow-step:hover,
    #orders .order-workflow-step.active {
        border-color: var(--workflow-strong, #1d4ed8);
        box-shadow: 0 6px 14px var(--workflow-shadow, rgba(37, 99, 235, 0.14));
        transform: translateY(-1px);
    }

    #orders .order-workflow-step.active {
        outline: 2px solid var(--workflow-ring, rgba(37, 99, 235, 0.16));
        outline-offset: 1px;
    }

    #orders .workflow-dot {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: var(--workflow-strong, #1d4ed8);
    }

    #orders .workflow-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 700;
        font-size: 0.84rem;
    }

    #orders .workflow-count {
        min-width: 48px;
        padding: 3px 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--workflow-strong, #0f4fb8);
        font-weight: 800;
        text-align: center;
        font-size: 0.8rem;
    }

    #orders .order-workflow-step[data-status="Chờ xử lý"] {
        --workflow-bg: #fff7ed;
        --workflow-border: #fdba74;
        --workflow-fg: #9a3412;
        --workflow-strong: #ea580c;
        --workflow-ring: rgba(234, 88, 12, 0.18);
        --workflow-shadow: rgba(234, 88, 12, 0.14);
    }

    #orders .order-workflow-step[data-status="Đơn mới"] {
        --workflow-bg: #fffbeb;
        --workflow-border: #fde68a;
        --workflow-fg: #78350f;
        --workflow-strong: #d97706;
        --workflow-ring: rgba(217, 119, 6, 0.18);
        --workflow-shadow: rgba(217, 119, 6, 0.14);
    }

    #orders .order-workflow-step[data-status="Đang in"] {
        --workflow-bg: #eff6ff;
        --workflow-border: #bfdbfe;
        --workflow-fg: #1e3a8a;
        --workflow-strong: #2563eb;
        --workflow-ring: rgba(37, 99, 235, 0.18);
        --workflow-shadow: rgba(37, 99, 235, 0.14);
    }

    #orders .order-workflow-step[data-status="Đã in xong"] {
        --workflow-bg: #eef2ff;
        --workflow-border: #c7d2fe;
        --workflow-fg: #312e81;
        --workflow-strong: #4f46e5;
        --workflow-ring: rgba(79, 70, 229, 0.18);
        --workflow-shadow: rgba(79, 70, 229, 0.14);
    }

    #orders .order-workflow-step[data-status="Gia công"] {
        --workflow-bg: #fff7ed;
        --workflow-border: #fed7aa;
        --workflow-fg: #7c2d12;
        --workflow-strong: #f97316;
        --workflow-ring: rgba(249, 115, 22, 0.18);
        --workflow-shadow: rgba(249, 115, 22, 0.14);
    }

    #orders .order-workflow-step[data-status="Chờ giao"] {
        --workflow-bg: #fdf2f8;
        --workflow-border: #fbcfe8;
        --workflow-fg: #831843;
        --workflow-strong: #db2777;
        --workflow-ring: rgba(219, 39, 119, 0.18);
        --workflow-shadow: rgba(219, 39, 119, 0.14);
    }

    #orders .order-workflow-step[data-status="Đã giao"] {
        --workflow-bg: #eefdf3;
        --workflow-border: #86efac;
        --workflow-fg: #14532d;
        --workflow-strong: #16a34a;
        --workflow-ring: rgba(22, 163, 74, 0.18);
        --workflow-shadow: rgba(22, 163, 74, 0.14);
    }

    #orders .order-workflow-step[data-status="Hoàn thành"] {
        --workflow-bg: #f5f3ff;
        --workflow-border: #c4b5fd;
        --workflow-fg: #4c1d95;
        --workflow-strong: #7c3aed;
        --workflow-ring: rgba(124, 58, 237, 0.18);
        --workflow-shadow: rgba(124, 58, 237, 0.14);
    }

    #tech-work .tech-workflow-bar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
        gap: 8px;
        margin: 0 0 12px;
        padding: 10px;
        border: 1px solid #dbeafe;
        border-radius: 14px;
        background: #ffffff54;
        overflow-x: auto;
    }

    #tech-work .tech-sticky-top {
        position: sticky;
        top: 0;
        z-index: 90;
        padding: 10px 20px 10px;
        margin: 0 -20px 10px;
        background: inherit;
        backdrop-filter: blur(10px);
        box-shadow: 0 8px 18px rgba(15, 80, 173, 0.08);
    }

    body.is-tech-page .content #tech-work .tech-sticky-top {
        margin: 0 0 10px;
    }

    #tech-work .filter-row {
        align-items: end;
    }

    #tech-work .tech-filter-actions {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
        white-space: nowrap;
    }

    #tech-work.pof-bg--ocean {
        background:
            radial-gradient(1200px 520px at 18% 8%, rgba(14, 165, 233, 0.18), transparent 62%),
            radial-gradient(900px 520px at 82% 18%, rgba(37, 99, 235, 0.14), transparent 56%),
            linear-gradient(180deg, #eff6ff, #ecfeff);
        background-attachment: fixed;
		    padding: 15px;
    }

    #tech-work.pof-bg--sunset {
        background:
            radial-gradient(1100px 500px at 18% 8%, rgba(249, 115, 22, 0.18), transparent 62%),
            radial-gradient(900px 520px at 82% 18%, rgba(244, 63, 94, 0.12), transparent 56%),
            linear-gradient(180deg, #fff7ed, #fff1f2);
        background-attachment: fixed;
		    padding: 15px;
    }

    #tech-work.pof-bg--violet {
        background:
            radial-gradient(1200px 500px at 20% 10%, rgba(139, 92, 246, 0.18), transparent 60%),
            radial-gradient(900px 500px at 80% 20%, rgba(59, 130, 246, 0.14), transparent 55%),
            linear-gradient(180deg, #f5f3ff, #eff6ff);
        background-attachment: fixed;
		    padding: 15px;
    }

    #tech-work.pof-bg--mint {
        background:
            radial-gradient(1100px 520px at 16% 8%, rgba(16, 185, 129, 0.16), transparent 62%),
            radial-gradient(900px 520px at 84% 18%, rgba(20, 184, 166, 0.13), transparent 56%),
            linear-gradient(180deg, #ecfdf5, #f0fdfa);
        background-attachment: fixed;
		    padding: 15px;
    }

    #tech-work.pof-bg--rose {
        background:
            radial-gradient(1100px 520px at 18% 8%, rgba(244, 63, 94, 0.14), transparent 62%),
            radial-gradient(900px 520px at 84% 18%, rgba(236, 72, 153, 0.12), transparent 56%),
            linear-gradient(180deg, #fff1f2, #fdf2f8);
        background-attachment: fixed;
		    padding: 15px;
    }

    #tech-work.pof-bg--amber {
        background:
            radial-gradient(1100px 520px at 16% 8%, rgba(245, 158, 11, 0.16), transparent 62%),
            radial-gradient(900px 520px at 84% 18%, rgba(234, 88, 12, 0.10), transparent 56%),
            linear-gradient(180deg, #fffbeb, #fff7ed);
        background-attachment: fixed;
		    padding: 15px;
    }

    #tech-work.pof-bg--sky {
        background:
            radial-gradient(1200px 520px at 16% 8%, rgba(56, 189, 248, 0.16), transparent 62%),
            radial-gradient(900px 520px at 84% 18%, rgba(99, 102, 241, 0.11), transparent 56%),
            linear-gradient(180deg, #f0f9ff, #eef2ff);
        background-attachment: fixed;
		    padding: 15px;
    }

    #tech-work.pof-bg--graphite {
        background:
            radial-gradient(1200px 520px at 18% 8%, rgba(71, 85, 105, 0.18), transparent 62%),
            radial-gradient(900px 520px at 82% 18%, rgba(15, 23, 42, 0.12), transparent 56%),
            linear-gradient(180deg, #f8fafc, #e2e8f0);
        background-attachment: fixed;
		    padding: 15px;
    }

    #tech-work.pof-bg--paper {
        background:
            radial-gradient(1000px 480px at 18% 8%, rgba(148, 163, 184, 0.12), transparent 60%),
            radial-gradient(820px 480px at 82% 18%, rgba(59, 130, 246, 0.08), transparent 56%),
            linear-gradient(180deg, #f8fafc, #f1f5f9);
        background-attachment: fixed;
		    padding: 15px;
    }

    .tech-bg-theme-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tech-bg-theme-option {
        gap: 8px;
    }

    .tech-bg-swatch {
        width: 28px;
        height: 18px;
        border: 1px solid #cbd5e1;
        border-radius: 5px;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    }

    .tech-bg-swatch.pof-bg--ocean {
        background: linear-gradient(135deg, #38bdf8, #2563eb);
    }

    .tech-bg-swatch.pof-bg--sunset {
        background: linear-gradient(135deg, #fb923c, #f43f5e);
    }

    .tech-bg-swatch.pof-bg--violet {
        background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    }

    .tech-bg-swatch.pof-bg--mint {
        background: linear-gradient(135deg, #34d399, #14b8a6);
    }

    .tech-bg-swatch.pof-bg--rose {
        background: linear-gradient(135deg, #fb7185, #ec4899);
    }

    .tech-bg-swatch.pof-bg--amber {
        background: linear-gradient(135deg, #fbbf24, #f97316);
    }

    .tech-bg-swatch.pof-bg--sky {
        background: linear-gradient(135deg, #7dd3fc, #6366f1);
    }

    .tech-bg-swatch.pof-bg--graphite {
        background: linear-gradient(135deg, #64748b, #0f172a);
    }

    .tech-bg-swatch.pof-bg--paper {
        background: linear-gradient(135deg, #e2e8f0, #f8fafc);
    }

    #tech-work .order-workflow-step {
        position: relative;
        display: grid;
        grid-template-columns: 10px 1fr auto;
        align-items: center;
        gap: 8px;
        min-height: 46px;
        padding: 7px 10px;
        border: 1px solid var(--workflow-border, #d7e6ff);
        border-radius: 12px;
        background: var(--workflow-bg, #fff);
        color: var(--workflow-fg, #1f3f68);
        cursor: pointer;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
        font-family: inherit;
        min-width: 0;
    }

    #tech-work .order-workflow-step:hover,
    #tech-work .order-workflow-step.active {
        border-color: var(--workflow-strong, #1d4ed8);
        box-shadow: 0 6px 14px var(--workflow-shadow, rgba(37, 99, 235, 0.14));
        transform: translateY(-1px);
    }

    #tech-work .order-workflow-step.active {
        outline: 2px solid var(--workflow-ring, rgba(37, 99, 235, 0.16));
        outline-offset: 1px;
    }

    #tech-work .workflow-dot {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: var(--workflow-strong, #1d4ed8);
    }

    #tech-work .workflow-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 700;
        font-size: 0.84rem;
    }

    #tech-work .workflow-count {
        min-width: 48px;
        padding: 3px 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--workflow-strong, #0f4fb8);
        font-weight: 800;
        text-align: center;
        font-size: 0.8rem;
    }

    #tech-work .order-workflow-step[data-status="Chờ xử lý"] {
        --workflow-bg: #fff7ed;
        --workflow-border: #fdba74;
        --workflow-fg: #9a3412;
        --workflow-strong: #ea580c;
        --workflow-ring: rgba(234, 88, 12, 0.18);
        --workflow-shadow: rgba(234, 88, 12, 0.14);
    }

    #tech-work .order-workflow-step[data-status="Đơn mới"] {
        --workflow-bg: #fffbeb;
        --workflow-border: #fde68a;
        --workflow-fg: #78350f;
        --workflow-strong: #d97706;
        --workflow-ring: rgba(217, 119, 6, 0.18);
        --workflow-shadow: rgba(217, 119, 6, 0.14);
    }

    #tech-work .order-workflow-step[data-status="Đang in"] {
        --workflow-bg: #eff6ff;
        --workflow-border: #bfdbfe;
        --workflow-fg: #1e3a8a;
        --workflow-strong: #2563eb;
        --workflow-ring: rgba(37, 99, 235, 0.18);
        --workflow-shadow: rgba(37, 99, 235, 0.14);
    }

    #tech-work .order-workflow-step[data-status="Đã in xong"] {
        --workflow-bg: #eef2ff;
        --workflow-border: #c7d2fe;
        --workflow-fg: #312e81;
        --workflow-strong: #4f46e5;
        --workflow-ring: rgba(79, 70, 229, 0.18);
        --workflow-shadow: rgba(79, 70, 229, 0.14);
    }

    #tech-work .order-workflow-step[data-status="Gia công"] {
        --workflow-bg: #fff7ed;
        --workflow-border: #fed7aa;
        --workflow-fg: #7c2d12;
        --workflow-strong: #f97316;
        --workflow-ring: rgba(249, 115, 22, 0.18);
        --workflow-shadow: rgba(249, 115, 22, 0.14);
    }

    #tech-work .order-workflow-step[data-status="Chờ giao"] {
        --workflow-bg: #fdf2f8;
        --workflow-border: #fbcfe8;
        --workflow-fg: #831843;
        --workflow-strong: #db2777;
        --workflow-ring: rgba(219, 39, 119, 0.18);
        --workflow-shadow: rgba(219, 39, 119, 0.14);
    }

    #tech-work .order-workflow-step[data-status="Đã giao"] {
        --workflow-bg: #eefdf3;
        --workflow-border: #86efac;
        --workflow-fg: #14532d;
        --workflow-strong: #16a34a;
        --workflow-ring: rgba(22, 163, 74, 0.18);
        --workflow-shadow: rgba(22, 163, 74, 0.14);
    }

    #tech-work .order-workflow-step[data-status="Hoàn thành"] {
        --workflow-bg: #f5f3ff;
        --workflow-border: #c4b5fd;
        --workflow-fg: #4c1d95;
        --workflow-strong: #7c3aed;
        --workflow-ring: rgba(124, 58, 237, 0.18);
        --workflow-shadow: rgba(124, 58, 237, 0.14);
    }

    #tech-work .order-workflow-step[data-status="Đã hủy"] {
        --workflow-bg: #fef2f2;
        --workflow-border: #fecaca;
        --workflow-fg: #7f1d1d;
        --workflow-strong: #dc2626;
        --workflow-ring: rgba(220, 38, 38, 0.18);
        --workflow-shadow: rgba(220, 38, 38, 0.14);
    }

    #tech-work .tech-workflow-step.has-alert[data-status="Chờ xử lý"] .workflow-dot {
        animation: techNewOrderPulse 1.05s ease-in-out infinite;
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.45);
    }

    @keyframes techNewOrderPulse {
        0% {
            transform: translateX(0) scale(1);
            box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.45);
        }
        50% {
            transform: translateX(4px) scale(1.2);
            box-shadow: 0 0 0 7px rgba(234, 88, 12, 0);
        }
        100% {
            transform: translateX(0) scale(1);
            box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
        }
    }

    #pending-orders .pending-page-header {
        align-items: center;
    }

    #pending-orders .pending-page-subtitle {
        margin-top: -16px;
        color: #64748b;
        font-size: 0.92rem;
        line-height: 1.45;
    }

    #pending-orders .pending-top-actions {
        margin-left: auto;
        justify-content: flex-end;
    }

    #pending-orders .pending-summary-bar {
        grid-template-columns: repeat(5, minmax(150px, 1fr));
        margin-bottom: 10px;
    }

    #pending-orders .pending-orders-table {
        width: 100%;
    }

    #pending-orders .pending-orders-table thead {
        display: none;
    }

    #pending-orders .pending-orders-table,
    #pending-orders .pending-orders-table tbody,
    #pending-orders .pending-orders-table tr,
    #pending-orders .pending-orders-table td {
        display: block;
        width: 100%;
    }

    #pending-orders .pending-draft-row td {
        padding: 0;
        border: 0;
        background: transparent;
    }

    #pending-orders .pending-draft-card {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        margin-bottom: 8px;
        padding: 10px 12px;
        border: 1px solid #dbeafe;
        border-left: 4px solid var(--primary-color);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    }

    #pending-orders .pending-draft-card.fresh {
        border-left-color: #2563eb;
        background: #ffffff;
    }

    #pending-orders .pending-draft-card.warning {
        border-left-color: #f59e0b;
        background: #fffdf3;
    }

    #pending-orders .pending-draft-card.urgent {
        border-left-color: #f97316;
        background: #fff7ed;
    }

    #pending-orders .pending-draft-card.danger {
        border-left-color: #ef4444;
        background: #fff5f5;
    }

    #pending-orders .pending-draft-card.ready {
        border-left-color: #16a34a;
        background: #f6fff8;
    }

    #pending-orders .pending-draft-index {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #eff6ff;
        color: var(--primary-color);
        font-weight: 900;
    }

    #pending-orders .pending-draft-main {
        min-width: 0;
    }

    #pending-orders .pending-draft-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    #pending-orders .pending-draft-customer {
        color: #0f172a;
        font-weight: 900;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #pending-orders .pending-draft-content {
        margin-top: 2px;
        color: #334155;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #pending-orders .pending-draft-note {
        margin-top: 6px;
        padding: 6px 9px;
        border-radius: 8px;
        background: #fff7ed;
        color: #9a3412;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #pending-orders .pending-draft-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 14px;
        margin-top: 6px;
        color: #64748b;
        font-size: 0.82rem;
    }

    #pending-orders .pending-draft-meta span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    #pending-orders .pending-draft-tags {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 5px;
        max-width: 360px;
    }

    #pending-orders .pending-draft-tag {
        display: inline-flex;
        align-items: center;
        min-height: 24px;
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 12px;
        border: 1px solid transparent;
        white-space: nowrap;
    }

    #pending-orders .pending-draft-tag.success {
        color: #166534;
        background: #dcfce7;
        border-color: #86efac;
    }

    #pending-orders .pending-draft-tag.warning {
        color: #92400e;
        background: #fef3c7;
        border-color: #fde68a;
    }

    #pending-orders .pending-draft-tag.neutral {
        color: #475569;
        background: #f1f5f9;
        border-color: #e2e8f0;
    }

    #pending-orders .pending-draft-tag.danger {
        color: #991b1b;
        background: #fee2e2;
        border-color: #fecaca;
    }

    #pending-orders .pending-draft-muted {
        color: #94a3b8;
        font-weight: 650;
    }

    #pending-orders .pending-main-text {
        font-weight: 700;
        color: #1f3f68;
    }

    #pending-orders .pending-subtext {
        margin-top: 3px;
        font-size: 0.78rem;
        font-weight: 700;
    }

    #pending-orders .pending-note-cell {
        max-width: 260px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #pending-orders .pending-action-buttons {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    #pending-orders .secondary-action-btn {
        min-height: 32px;
        padding: 7px 10px;
        border: 1px solid #bbf7d0;
        border-radius: 8px;
        background: #f0fdf4;
        color: #15803d;
        font-weight: 900;
        cursor: pointer;
    }

    #pending-orders .secondary-action-btn:hover {
        background: #dcfce7;
    }

    #pending-orders .pending-file-link {
        color: var(--primary-color);
        font-weight: 700;
        text-decoration: none;
    }

    #pending-orders .pending-file-link:hover {
        text-decoration: underline;
    }

    @media (max-width: 900px) {
        #pending-orders .pending-draft-card {
            grid-template-columns: 1fr;
        }

        #pending-orders .pending-draft-index {
            display: none;
        }

        #pending-orders .pending-draft-top,
        #pending-orders .pending-action-buttons {
            justify-content: flex-start;
        }

        #pending-orders .pending-draft-tags {
            justify-content: flex-start;
            max-width: none;
        }
    }

    #pending-order-modal .pending-order-help {
        margin-top: 6px;
        padding: 10px 12px;
        border: 1px solid #fed7aa;
        border-radius: 10px;
        background: #fff7ed;
        color: #9a3412;
        font-size: 0.92rem;
        line-height: 1.5;
    }

    #pending-order-modal .autocomplete-wrap {
        position: relative;
    }

    .role-quick-btn {
        border: 1px solid var(--border-color);
        background: #fff;
        color: var(--primary-dark);
        border-radius: 8px;
        padding: 11px 16px;
        cursor: pointer;
        font-weight: 700;
        min-height: 44px;
        min-width: 112px;
    }

    .role-quick-btn:hover {
        background: #edf4ff;
        border-color: var(--primary-light);
    }

    .role-quick-btn.active {
        background: var(--primary-color);
        color: #fff;
        border-color: var(--primary-color);
    }

    .role-quick-btn i {
        margin-right: 6px;
    }

    .role-quick-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 22px;
        padding: 0 7px;
        margin-left: 8px;
        border-radius: 999px;
        background: rgba(15, 80, 173, 0.12);
        color: inherit;
        font-weight: 900;
    }

    .tech-status-filter[data-status="Đơn mới"] {
        border-color: #f5d000;
        background: #fffbe6;
    }

    .tech-status-filter[data-status="Đang in"] {
        border-color: #8fd19e;
        background: #effaf2;
    }

    .tech-status-filter[data-status="Đã in xong"] {
        border-color: #c7d2fe;
        background: #eef2ff;
    }

    .tech-status-filter[data-status="Chờ giao"] {
        border-color: #fbcfe8;
        background: #fdf2f8;
    }

    .tech-status-filter[data-status="Hoàn thành"] {
        border-color: #00b050;
        background: #e8f7ed;
    }

    .tech-status-filter.active {
        box-shadow: inset 0 -3px 0 var(--primary-color);
    }

    .order-tab-panel {
        display: none;
    }

    .order-tab-panel.active {
        display: block;
    }

    .orders-debt-table tbody tr {
        transition: background-color 0.16s ease, box-shadow 0.16s ease;
    }

    .orders-debt-table tbody tr:nth-child(even):not(.debt-customer-row) td {
        background: #fbfdff;
    }

    .orders-debt-table tbody tr:nth-child(odd):not(.debt-customer-row) td {
        background: #ffffff;
    }

    .debt-customer-row td {
        background: #f4f8ff;
        font-weight: 700;
        color: var(--primary-dark);
        border-top: 1px solid #cfe0ff;
        border-bottom: 1px solid #cfe0ff;
    }

    .debt-customer-row td:nth-child(n+6):nth-child(-n+8) {
        background: #eef5ff;
    }

    .orders-debt-table tbody tr:hover td,
    .orders-debt-table tbody tr:hover td:nth-child(n) {
        background: #fff7d6 !important;
    }

    .orders-debt-table tbody tr:hover {
        box-shadow: inset 4px 0 0 var(--primary-color);
    }

    .orders-debt-table tbody tr:hover .transaction-amount {
        color: #0f4fb8 !important;
    }

    .debt-toggle-btn {
        border: 1px solid var(--primary-light);
        background: #fff;
        color: var(--primary-dark);
        border-radius: 4px;
        width: 24px;
        height: 24px;
        margin-right: 8px;
        cursor: pointer;
        font-weight: 800;
        line-height: 20px;
    }

    .debt-customer-name-btn {
        border: none;
        background: transparent;
        color: inherit;
        font: inherit;
        cursor: pointer;
        padding: 0;
        text-align: left;
    }

    .debt-customer-name-btn:hover {
        text-decoration: underline;
    }

    .debt-order-row td:first-child {
        padding-left: 26px;
    }

    .debt-order-row td:nth-child(n+6):nth-child(-n+8) {
        background: #f7fbff;
    }

    .orders-table tbody tr.selected td,
    .orders-table tbody tr.is-selected td,
    .orders-table tbody tr[aria-selected="true"] td,
    .orders-table tbody tr.selected td.order-pinned-col,
    .orders-table tbody tr.selected td.order-pinned-right-col,
    .orders-table tbody tr[aria-selected="true"] td.order-pinned-col,
    .orders-table tbody tr[aria-selected="true"] td.order-pinned-right-col,
    .orders-debt-table tbody tr.selected td,
    .orders-debt-table tbody tr.is-selected td,
    .orders-debt-table tbody tr[aria-selected="true"] td,
    .debt-order-row.selected td,
    .debt-order-row.is-selected td,
    .debt-order-row[aria-selected="true"] td,
    .collect-order-table tbody tr.selected td,
    .collect-order-table tbody tr.is-selected td,
    .collect-order-table tbody tr[aria-selected="true"] td,
    .collect-order-table tbody tr:has(.collect-order-checkbox:checked) td {
        background: #fffaea !important;
    }

    .collect-debt-btn {
        background: #0f50ad;
        color: #fff;
        border: none;
        border-radius: 6px;
        padding: 6px 10px;
        cursor: pointer;
        font-weight: 700;
    }

    .debt-bill-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #eef6ff;
        color: #075985;
        border: 1px solid #93c5fd;
    }

    .debt-group-bill-btn {
        background: #fff7ed;
        color: #c2410c;
        border-color: #fdba74;
    }

    .debt-order-open-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #f8fafc;
        color: #334155;
        border: 1px solid #cbd5e1;
    }

    .debt-more-btn {
        background: #f8fafc;
        color: #334155;
        border: 1px solid #cbd5e1;
    }

    .collect-customer-debt-btn {
        background: #0f50ad;
    }

    .collect-debt-btn.icon-only {
        width: 30px;
        height: 30px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 6px;
    }

    .collect-debt-btn:hover {
        background: #5a91e0;
    }

    .collect-debt-btn.debt-bill-btn:hover {
        background: #dbeafe;
        color: #0f50ad;
    }

    .collect-debt-btn.debt-group-bill-btn:hover {
        background: #ffedd5;
        color: #9a3412;
    }

    .collect-debt-btn.debt-order-open-btn:hover {
        background: #e2e8f0;
        color: #0f172a;
    }

    .collect-debt-btn.debt-more-btn:hover {
        background: #e2e8f0;
        color: #0f172a;
    }

    .debt-action-menu-portal {
        position: fixed;
        z-index: 10060;
        display: none;
        min-width: 170px;
        padding: 7px;
        border: 1px solid #dbeafe;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    }

    .debt-action-menu-portal.show {
        display: grid;
        gap: 4px;
    }

    .debt-action-menu-portal button {
        display: grid;
        grid-template-columns: 18px 1fr;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 9px 10px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #0f172a;
        text-align: left;
        font-family: inherit;
        font-weight: 800;
        cursor: pointer;
    }

    .debt-action-menu-portal button:hover {
        background: #eff6ff;
        color: #0f50ad;
    }

    .collect-customer-debt-btn:hover {
        background: #0b4598;
    }

    .debt-row-actions {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }

    .debt-order-bill-btn {
        padding: 6px 8px;
    }

    .collect-debt-modal-content {
        max-width: 760px !important;
        width: min(760px, calc(100vw - 32px)) !important;
    }

    .collect-debt-info-grid,
    .collect-payment-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        align-items: end;
    }

    .collect-payment-grid {
        grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr);
    }

    .collect-debt-modal-content .modal-body {
        padding: 14px 16px;
    }

    .collect-debt-modal-content .form-group {
        margin-bottom: 8px;
    }

    .collect-debt-modal-content label {
        margin-bottom: 4px;
    }

    .collect-customer-field {
        grid-column: span 1;
    }

    .collect-order-list {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        max-height: 320px;
        overflow-y: auto;
        background: #fff;
    }

    .collect-order-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 0.84rem;
    }

    .collect-order-table th,
    .collect-order-table td {
        padding: 5px 10px;
        border-bottom: 1px solid var(--border-color);
        vertical-align: middle;
        line-height: 1.25;
    }

    .collect-order-table th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #f8fbff;
        color: #1f4f9f;
        font-weight: 700;
        text-align: left;
    }

    .collect-order-table th:nth-child(1),
    .collect-order-table td:nth-child(1) {
        width: 104px;
    }

    .collect-order-table th:nth-child(2),
    .collect-order-table td:nth-child(2) {
        width: 96px;
    }

    .collect-order-table th:nth-child(4),
    .collect-order-table td:nth-child(4) {
        width: 124px;
        text-align: right;
    }

    .collect-order-table th:nth-child(5),
    .collect-order-table td:nth-child(5) {
        width: 54px;
        text-align: center;
    }

    .collect-check-cell input,
    .collect-order-check-all {
        width: 16px;
        height: 16px;
        cursor: pointer;
    }

    .collect-row-unpaid {
        color: #94a3b8;
        background: #f8fafc;
    }

    .collect-row-paid {
        background: #f0fdf4;
    }

    .collect-row-partial {
        background: #fff7ed;
    }

    .collect-row-disabled {
        color: #94a3b8;
        background: #f8fafc;
    }

    .collect-allocation-note {
        min-height: 14px;
        margin-top: 2px;
        color: #c2410c;
        font-size: 0.72rem;
        font-weight: 700;
    }

    .collect-total-line {
        margin-top: 6px;
        text-align: right;
        font-weight: 700;
        color: var(--primary-dark);
    }

    .collect-note-group {
        margin-top: 2px;
    }

    .collect-debt-modal-content .form-actions {
        margin-top: 8px;
        padding-top: 0;
    }

    @media (max-width: 760px) {
        .collect-debt-info-grid,
        .collect-payment-grid {
            grid-template-columns: 1fr;
        }
    }

    .debt-bill-modal-content {
        max-width: 960px !important;
        width: min(960px, calc(100vw - 32px)) !important;
    }

    .debt-bill-modal-content .modal-body {
        padding: 14px 16px 16px;
    }

    .debt-action-date-range-content {
        max-width: 560px !important;
        width: min(560px, calc(100vw - 32px)) !important;
    }

    .debt-action-date-range-content .modal-body {
        padding: 18px 22px 22px;
    }

    .debt-action-date-card {
        display: grid;
        gap: 14px;
        padding: 18px;
        border: 1px solid #dbe7ff;
        border-radius: 10px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        box-shadow: 0 8px 22px rgba(15, 80, 173, 0.08);
    }

    .debt-action-period-row,
    .debt-action-date-row {
        display: grid;
        gap: 12px;
    }

    .debt-action-date-row {
        grid-template-columns: 1fr 1fr;
    }

    .debt-action-field {
        display: grid;
        gap: 7px;
        min-width: 0;
    }

    .debt-action-field label {
        color: #475569;
        font-size: 0.85rem;
        font-weight: 700;
    }

    .debt-action-field input,
    .debt-action-field select {
        width: 100%;
        min-height: 42px;
        border: 1px solid #cfe0ff;
        border-radius: 8px;
        background: #f8fbff;
        color: #1f2937;
        font: inherit;
        padding: 0 12px;
        outline: none;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    .debt-action-field input:focus,
    .debt-action-field select:focus {
        border-color: var(--primary-color);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(74, 144, 255, 0.14);
    }

    .debt-action-footer {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
        padding-top: 2px;
    }

    .debt-action-loading-status {
        min-height: 18px;
        color: var(--primary-dark);
        font-size: 0.86rem;
        font-weight: 700;
    }

    #debt-action-date-range-modal.is-working .debt-action-date-card {
        border-color: #bfdbfe;
        box-shadow: 0 10px 28px rgba(15, 80, 173, 0.14);
    }

    #debt-action-date-range-modal.is-working .debt-action-field input,
    #debt-action-date-range-modal.is-working .debt-action-field select {
        opacity: 0.72;
        cursor: wait;
    }

    .debt-action-cancel-btn,
    .debt-action-apply-btn {
        min-height: 38px;
        border-radius: 8px;
        border: 1px solid transparent;
        padding: 0 16px;
        font-weight: 700;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    .debt-action-cancel-btn:disabled,
    .debt-action-apply-btn:disabled {
        cursor: wait;
        opacity: 0.82;
        transform: none;
    }

    .debt-action-cancel-btn {
        background: #f1f5f9;
        border-color: #e2e8f0;
        color: #475569;
    }

    .debt-action-apply-btn {
        background: var(--primary-color);
        color: #fff;
        box-shadow: 0 8px 16px rgba(15, 80, 173, 0.18);
    }

    .debt-action-cancel-btn:hover,
    .debt-action-apply-btn:hover {
        transform: translateY(-1px);
    }

    #orders-debt-panel {
        position: relative;
    }

    #orders-debt-panel.is-soft-loading::after {
        content: "Đang cập nhật công nợ...";
        position: absolute;
        top: 10px;
        right: 14px;
        z-index: 20;
        padding: 8px 12px;
        border: 1px solid #bfdbfe;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.96);
        color: var(--primary-dark);
        font-size: 0.86rem;
        font-weight: 700;
        box-shadow: 0 8px 22px rgba(15, 80, 173, 0.14);
    }

    @media (max-width: 620px) {
        .debt-action-date-row {
            grid-template-columns: 1fr;
        }
    }

    .debt-bill-toolbar {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
        margin-bottom: 12px;
    }

    .debt-bill-paper-field {
        min-width: 180px;
        margin-bottom: 0;
    }

    .debt-bill-paper-select {
        width: 100%;
    }

    .debt-bill-vat-toggle {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        background: #eff6ff;
        color: #0f4fb8;
        font-weight: 700;
        cursor: pointer;
        user-select: none;
    }

    .debt-bill-vat-toggle input {
        width: 16px;
        height: 16px;
        accent-color: var(--primary-color);
    }

    .debt-bill-summary {
        flex: 1;
        min-width: 260px;
        padding: 10px 12px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #f8fbff;
        color: #0f4fb8;
        font-weight: 600;
        line-height: 1.45;
    }

    .debt-bill-actions {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 10px;
    }

    .debt-bill-group-btn,
    .debt-bill-send-btn {
        border: 0;
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 0.92rem;
        font-weight: 600;
        cursor: pointer;
        color: #fff;
        background: #16a34a;
        transition: background 0.2s ease, transform 0.2s ease;
    }

    .debt-bill-group-btn {
        background: var(--primary-color);
    }

    .debt-bill-group-btn:hover {
        background: var(--primary-dark);
    }

    .debt-bill-send-btn:hover {
        background: #12813b;
    }

    .debt-bill-list {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
        max-height: 360px;
        overflow-y: auto;
    }

    .debt-bill-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
        border-bottom: 1px solid #eef2f7;
    }

    .debt-bill-item.is-highlight {
        background: #eff6ff;
        box-shadow: inset 3px 0 0 #0b57d0;
    }

    .transaction-linked-order {
        margin-top: 3px;
        color: #0b57d0;
        font-size: 0.82rem;
        font-weight: 600;
    }

    #transaction-linked-order-group {
        position: relative;
    }

    .transaction-linked-order-input-wrap {
        position: relative;
    }

    .transaction-linked-order-input-wrap input {
        padding-right: 34px;
    }

    .clear-linked-order-btn {
        display: none;
        position: absolute;
        right: 9px;
        top: 50%;
        transform: translateY(-50%);
        width: 22px;
        height: 22px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #94a3b8;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
    }

    .clear-linked-order-btn:hover {
        background: #e2e8f0;
        color: #0f172a;
    }

    .transaction-order-suggestions {
        display: none;
        position: absolute;
        z-index: 10020;
        left: 0;
        right: 0;
        top: calc(100% + 4px);
        max-height: 260px;
        overflow-y: auto;
        background: #fff;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
    }

    .transaction-order-suggestions.show {
        display: block;
    }

    .transaction-order-suggestion-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 120px;
        gap: 12px;
        align-items: center;
        padding: 9px 12px;
        cursor: pointer;
        border-bottom: 1px solid #eef2f7;
    }

    .transaction-order-suggestion-row:last-child {
        border-bottom: 0;
    }

    .transaction-order-suggestion-row:hover {
        background: #eff6ff;
    }

    .transaction-order-suggestion-main {
        min-width: 0;
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .transaction-order-suggestion-sub {
        margin-top: 2px;
        color: #64748b;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .transaction-order-suggestion-amount {
        text-align: right;
        color: #16a34a;
        font-weight: 700;
        white-space: nowrap;
    }

    .debt-bill-item:last-child {
        border-bottom: 0;
    }

    .debt-bill-item-main {
        min-width: 0;
        flex: 1;
    }

    .debt-bill-item-title {
        font-weight: 700;
        color: #0f172a;
        line-height: 1.35;
    }

    .debt-bill-item-sub {
        margin-top: 3px;
        color: #64748b;
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .debt-bill-item-amount {
        color: #16a34a;
        font-weight: 700;
        white-space: nowrap;
    }

    .debt-bill-item-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    @media (max-width: 768px) {
        .debt-bill-item {
            flex-direction: column;
            align-items: stretch;
        }

        .debt-bill-item-actions {
            justify-content: flex-end;
        }
    }

    .delivery-cell {
        min-width: 118px;
    }

    .delivery-date-line {
        color: #1f2937;
		font-weight: 600;
    }

    .delivery-date-muted {
        color: #64748b;
        font-size: 11px;
        font-weight: 600;
    }

    .delivery-alert {
        display: inline-block;
        margin-top: 3px;
        padding: 2px 6px;
        border-radius: 999px;
    }

    .delivery-alert.ok {
        background: #dcfce7;
        color: #166534;
    }

    .delivery-alert.soon {
        background: #fef9c3;
        color: #854d0e;
    }

    .delivery-alert.due {
        background: #ffedd5;
        color: #9a3412;
    }

    .delivery-alert.overdue {
        background: #fee2e2;
        color: #991b1b;
		    font-weight: normal;
    font-size: 11px;
    }

    .delivery-alert.empty {
        background: #e5e7eb;
        color: #475569;
    }

    .delivery-alert.delivered {
        color: #15803d;
		font-size: 11px;
        font-weight: 700;
    }

    .debt-age {
        display: inline-block;
        margin-top: 3px;
        padding: 2px 6px;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 800;
    }

    .debt-age.ok {
        background: #dcfce7;
        color: #166534;
    }

    .debt-age.soon {
        background: #fef9c3;
        color: #854d0e;
    }

    .debt-age.overdue {
        background: #fee2e2;
        color: #991b1b;
    }

    .debt-age.neutral {
        background: #e5e7eb;
        color: #475569;
    }

    .debt-order-subline {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 3px;
    }

    .debt-order-item {
        max-width: min(520px, 100%);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #64748b;
    }

    .debt-delivery-time {
        color: #334155;
        font-size: 0.76rem;
        font-weight: 800;
    }

    .orders-debt-table .delivery-alert,
    .orders-debt-table .debt-age {
        margin-top: 0;
        white-space: nowrap;
    }

    .tech-table-layout {
        display: grid;
        grid-template-columns: minmax(720px, 1fr) 360px;
        gap: 12px;
        align-items: start;
    }

    .tech-table-list {
        min-width: 0;
        margin: 0;
    }

    .tech-detail-sidebar {
        position: sticky;
        top: 226px;
        min-height: 300px;
        max-height: calc(100vh - 238px);
        overflow: auto;
        overscroll-behavior: contain;
        border: 0;
        border-radius: 8px;
        background: transparent;
    }

    .tech-detail-empty {
        min-height: 280px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 24px;
        border: 1px dashed #bfdbfe;
        border-radius: 8px;
        background: #f8fbff;
        text-align: center;
        color: #64748b;
    }

    .tech-detail-empty i {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: #eff6ff;
        color: var(--primary-color);
        font-size: 18px;
    }

    .tech-detail-empty strong {
        color: #0f172a;
        font-size: 1rem;
    }

    .tech-panel-card {
        display: grid;
        gap: 8px;
        padding: 12px;
        border: 1px solid #dbe3ef;
        border-left: 4px solid var(--primary-color);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    }

    .tech-panel-top,
    .tech-panel-meta,
    .tech-panel-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .tech-panel-top strong {
        color: var(--primary-dark);
        font-size: 0.92rem;
    }

    .tech-panel-customer {
        color: #0f172a;
        font-weight: 900;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tech-panel-item {
        color: #334155;
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .tech-panel-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
        color: #475569;
        font-size: 0.78rem;
        font-weight: 800;
    }

    .tech-panel-meta span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    .tech-panel-delivery .delivery-date-line {
        display: none;
    }

    .tech-panel-delivery .delivery-alert {
        margin-top: 0;
    }

    .tech-panel-more {
        color: #334155;
        font-size: 0.84rem;
    }

    .tech-panel-more summary {
        color: var(--primary-color);
        cursor: pointer;
        font-weight: 900;
    }

    .tech-panel-more ul {
        margin: 6px 0 0;
        padding-left: 18px;
    }

    .tech-panel-note {
        padding: 7px 8px;
        border-radius: 6px;
        background: #fff7ed;
        color: #9a3412;
        font-size: 0.82rem;
        font-weight: 800;
        line-height: 1.35;
    }

    .tech-panel-note summary {
        display: flex;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        color: #9a3412;
    }

    .tech-panel-note div {
        margin-top: 6px;
    color: #000000;
    white-space: pre-wrap;
    font-size: 12px;
    font-weight: normal;
    }

    .tech-panel-file {
        display: grid;
        grid-template-columns: 16px minmax(0, 1fr) auto;
        align-items: center;
        gap: 7px;
        color: #475569;
        font-size: 0.82rem;
    }

    .tech-panel-file strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #0f50ad;
        font-size: 0.82rem;
    }

    .tech-panel-actions {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid #e5edf7;
    }

    .tech-panel-view-btn,
    .tech-panel-icon-btn,
    .tech-panel-primary-btn {
        min-height: 34px;
        border-radius: 6px;
        font-family: inherit;
        font-weight: 900;
        cursor: pointer;
    }

    .tech-panel-view-btn {
        padding: 0 14px;
        border: 1px solid #bfdbfe;
        background: #fff;
        color: var(--primary-color);
    }

    .tech-panel-icon-btn {
        width: 38px;
        border: 1px solid #bfdbfe;
        background: #fff;
        color: var(--primary-color);
    }

    .tech-panel-primary-btn {
        padding: 0 14px;
        border: 1px solid var(--primary-color);
        background: var(--primary-color);
        color: #fff;
    }

    .tech-detail-side-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 16px;
        border-bottom: 1px solid #e5eefc;
        background: #f8fbff;
    }

    .tech-detail-side-head span:first-child {
        display: block;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 800;
    }

    .tech-detail-side-head h3 {
        margin: 0;
        color: #0f172a;
        font-size: 1.1rem;
        font-weight: 900;
    }

    .tech-detail-side-section {
        padding: 14px 16px;
        border-bottom: 1px solid #eef2f7;
    }

    .tech-detail-side-section h4 {
        margin: 0 0 9px;
        color: var(--primary-dark);
        font-size: 0.9rem;
        font-weight: 900;
    }

    .tech-detail-muted {
        color: #64748b;
        font-size: 0.84rem;
        line-height: 1.4;
    }

    .tech-detail-side-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 14px 16px;
        border-bottom: 1px solid #eef2f7;
    }

    .tech-detail-side-grid > div {
        min-width: 0;
        padding: 9px;
        border: 1px solid #e5eefc;
        border-radius: 8px;
        background: #f8fbff;
    }

    .tech-detail-side-grid span {
        display: block;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
    }

    .tech-detail-side-grid strong {
        display: block;
        color: #0f172a;
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .tech-detail-items {
        display: grid;
        gap: 8px;
    }

    .tech-detail-item {
        display: grid;
        gap: 3px;
        padding: 10px;
        border: 1px solid #e5eefc;
        border-radius: 8px;
        background: #f8fbff;
    }

    .tech-detail-item b {
        color: var(--primary-color);
        font-size: 0.78rem;
    }

    .tech-detail-item span {
        color: #0f172a;
        font-weight: 800;
        line-height: 1.35;
    }

    .tech-detail-item em {
        color: #64748b;
        font-style: normal;
        font-size: 0.82rem;
        font-weight: 700;
    }

    .tech-detail-note {
        min-height: 42px;
        padding: 10px;
        border-radius: 8px;
        background: #fff7ed;
        color: #8b1a1a;
        font-weight: 700;
        line-height: 1.45;
        white-space: pre-wrap;
    }

    .tech-detail-file {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 6px 8px;
        align-items: center;
        margin-top: 10px;
    }

    .tech-detail-file span {
        grid-column: 1 / -1;
        color: #64748b;
        font-size: 0.76rem;
        font-weight: 800;
    }

    .tech-detail-file strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #0f50ad;
        font-size: 0.84rem;
    }

    .tech-main-row {
        cursor: pointer;
    }

    .tech-main-row td {
        vertical-align: middle;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .tech-main-row:hover td {
        background: #f1f7ff;
    }

    .tech-main-row.selected td {
        background: #dceaff;
        box-shadow: none;
    }

    .tech-main-row.selected td:first-child {
        box-shadow: inset 4px 0 0 var(--primary-color);
    }

    .tech-date-chip {
        font-weight: 800;
        color: #334155;
        white-space: nowrap;
    }

    .tech-customer-cell {
        max-width: 330px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #334155;
        font-weight: 600;
    }

    .tech-item-cell {
        min-width: 260px;
        max-width: 520px;
    }

    .tech-item-main {
        color: #0f172a;
        font-weight: 800;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tech-item-sub {
        margin-top: 2px;
        color: #64748b;
        font-size: 11px;
        font-weight: 700;
    }

    .tech-note-cell {
        max-width: 180px;
        min-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #8b1a1a;
        font-weight: 700;
    }

    .tech-note-text {
        color: #8b1a1a;
        font-weight: 700;
        white-space: pre-wrap;
    }

    .tech-table-status,
    .tech-status-picker {
        position: relative;
        display: inline-grid;
        grid-template-columns: 10px minmax(118px, 1fr) 18px;
        align-items: center;
        gap: 8px;
        min-width: 166px;
        min-height: 36px;
        padding: 0 10px;
        border: 1px solid #bfdbfe;
        border-radius: 9px;
        background: #f8fbff;
        color: var(--primary-color);
        box-shadow: 0 2px 8px rgba(15, 80, 173, 0.08);
        font-family: inherit;
        cursor: default;
    }

    .tech-table-status {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 96px;
        min-height: 30px;
        padding: 0 8px;
        box-shadow: none;
        font-size: 12px;
        font-weight: 900;
    }

    .tech-status-cell {
        white-space: nowrap;
    }

    .tech-status-picker i {
        grid-column: 3;
        grid-row: 1;
        font-size: 11px;
        color: currentColor;
        pointer-events: none;
        opacity: 0.85;
    }

    .tech-status-picker span:not(.tech-status-dot) {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: currentColor;
        font-size: 12px;
        font-weight: 900;
        text-align: left;
    }

    .tech-status-dot {
        grid-column: 1;
        grid-row: 1;
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: currentColor;
        box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 15%, transparent);
        pointer-events: none;
    }

    .tech-table-status.order-status-pending,
    .tech-status-picker.order-status-pending {
        background: #fffbeb;
        border-color: #fde68a;
        color: #d97706;
    }

    .tech-table-status.order-status-working,
    .tech-table-status.order-status-printed,
    .tech-status-picker.order-status-working,
    .tech-status-picker.order-status-printed {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #2563eb;
    }

    .tech-table-status.order-status-processing,
    .tech-status-picker.order-status-processing {
        background: #fff7ed;
        border-color: #fed7aa;
        color: #f97316;
    }

    .tech-table-status.order-status-ready,
    .tech-status-picker.order-status-ready {
        background: #fdf2f8;
        border-color: #fbcfe8;
        color: #db2777;
    }

    .tech-table-status.order-status-shipping,
    .tech-status-picker.order-status-shipping {
        background: #ecfeff;
        border-color: #67e8f9;
        color: #0891b2;
    }

    .tech-table-status.order-status-delivered,
    .tech-status-picker.order-status-delivered {
        background: #e7f8ef;
        border-color: #86efac;
        color: #166534;
    }

    .tech-table-status.order-status-completed,
    .tech-status-picker.order-status-completed {
        background: #f5f3ff;
        border-color: #c4b5fd;
        color: #7c3aed;
    }

    .tech-table-status.order-status-cancelled,
    .tech-status-picker.order-status-cancelled {
        background: #fef2f2;
        border-color: #fecaca;
        color: #dc2626;
    }

    .tech-status-picker:hover,
    .tech-status-picker:focus-visible {
        outline: 3px solid color-mix(in srgb, currentColor 18%, transparent);
        outline-offset: 1px;
    }

    .tech-status-cell {
        width: 112px;
        min-width: 112px;
        max-width: 122px;
    }

    #tech-work-table-wrap table th:last-child,
    #tech-work-table-wrap table td:last-child {
        width: 118px;
        min-width: 118px;
        max-width: 118px;
    }

    .tech-file-line {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
        max-width: 100%;
    }

    .tech-file-path {
        display: inline-block;
        max-width: 420px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #0f50ad;
        font-weight: 700;
    }

    .copy-file-btn {
        position: relative;
        border: 1px solid var(--border-color);
        background: #fff;
        color: var(--primary-color);
        border-radius: 6px;
        padding: 5px 8px;
        cursor: pointer;
    }

    .copy-file-btn.copied::after,
    .tech-card-icon-btn.copy-file-btn.copied::after {
        content: "\2713";
        position: absolute;
        top: -6px;
        right: -5px;
        width: 14px;
        height: 14px;
        border-radius: 999px;
        background: #16a34a;
        border: 2px solid #fff;
        box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25);
        color: #fff;
        font-size: 9px;
        font-weight: 900;
        line-height: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }

    .tech-detail-delivery .delivery-alert {
        margin-top: 0;
    }

    .tech-detail-delivery .delivery-date-line {
        margin-bottom: 3px;
    }

    @media (max-width: 1280px) {
        .tech-table-layout {
            grid-template-columns: minmax(680px, 1fr) 320px;
        }
    }

    @media (max-width: 1024px) {
        .tech-table-layout {
            grid-template-columns: 1fr;
        }

        .tech-detail-sidebar {
            position: static;
            max-height: none;
        }

        .tech-board {
            height: auto;
            min-height: 0;
            max-height: none;
            overflow-y: visible;
        }

        .tech-board-column {
            height: auto;
            max-height: none;
            overflow: visible;
        }

        .tech-card-list {
            overflow: visible;
        }
    }

    .tech-board {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 14px;
        margin: 0 0 14px;
        align-items: stretch;
        padding-bottom: 8px;
        scrollbar-gutter: stable;
        height: calc(100dvh - 148px);
        min-height: 420px;
        overscroll-behavior: contain;
    }

    #tech-work .tech-view-toggle {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px;
        border: 1px solid #cfe0ff;
        border-radius: 999px;
        background: #f8fbff;
    }

    #tech-work .tech-view-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 34px;
        padding: 0 12px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #0f4fb8;
        font-weight: 800;
        cursor: pointer;
    }

    #tech-work .tech-view-btn.active {
        background: #0f4fb8;
        color: #fff;
        box-shadow: 0 4px 10px rgba(15, 79, 184, 0.2);
    }

    #tech-work.tech-view-board #tech-work-table-wrap,
    #tech-work.tech-view-board #tech-work-table-wrap[hidden] {
        display: none !important;
    }

    #tech-work.tech-view-table #tech-work-board,
    #tech-work.tech-view-table #tech-work-board[hidden] {
        display: none !important;
    }

    .tech-board-loading {
        flex: 1 0 100%;
        padding: 22px;
        border: 1px dashed #bfdbfe;
        border-radius: 8px;
        background: #f8fbff;
        color: #64748b;
        text-align: center;
        font-weight: 800;
    }

    .tech-board-loading.error {
        border-color: #fecaca;
        background: #fef2f2;
        color: #991b1b;
    }

    .tech-board-column {
        flex: 1 0 260px;
        min-width: 260px;
        min-height: 180px;
        height: 100%;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        overscroll-behavior: contain;
        border: 1px solid #dbeafe;
        border-top: 4px solid var(--workflow-strong, var(--primary-color));
        border-radius: 8px;
        background: #f8fbff;
        padding: 10px;
    }

    .tech-board-column[data-status="Đơn mới"] {
        --workflow-strong: #d97706;
        background: #fffbeb;
    }

    .tech-board-column[data-status="Đang in"] {
        --workflow-strong: #2563eb;
        background: #eff6ff;
    }

    .tech-board-column[data-status="Đã in xong"] {
        --workflow-strong: #4f46e5;
        background: #eef2ff;
    }

    .tech-board-column[data-status="Gia công"] {
        --workflow-strong: #f97316;
        background: #fff7ed;
    }

    .tech-board-column[data-status="Chờ giao"] {
        --workflow-strong: #db2777;
        background: #fdf2f8;
    }

    .tech-board-column[data-status="Đã giao"] {
        --workflow-strong: #16a34a;
        background: #eefdf3;
    }

    .tech-board-column[data-status="Hoàn thành"] {
        --workflow-strong: #7c3aed;
        background: #f5f3ff;
    }

    .tech-board-column[data-status="Đã hủy"] {
        --workflow-strong: #dc2626;
        background: #fef2f2;
    }

    .tech-board-column-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 4px 2px 9px;
        border-bottom: 1px solid color-mix(in srgb, var(--workflow-strong) 38%, transparent);
        color: #0f172a;
        font-weight: 900;
    }

    .tech-board-column-head b {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 24px;
        border-radius: 999px;
        background: var(--workflow-strong);
        color: #fff;
        font-size: 12px;
    }

    .tech-board-column-actions {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .tech-board-quick-add {
        width: 24px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid color-mix(in srgb, var(--workflow-strong) 34%, #ffffff);
        border-radius: 999px;
        background: #ffffff;
        color: var(--workflow-strong);
        cursor: pointer;
        font-size: 10px;
        box-shadow: 0 2px 7px rgba(15, 23, 42, 0.12);
    }

    .tech-board-quick-add:hover {
        background: var(--workflow-strong);
        color: #ffffff;
    }

    .tech-card-list {
        display: grid;
        align-content: start;
        gap: 10px;
        padding-top: 10px;
        min-height: 0;
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .tech-board-show-more {
        width: 100%;
        margin-top: 10px;
        min-height: 34px;
        border: 1px dashed color-mix(in srgb, var(--workflow-strong) 55%, #cbd5e1);
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--workflow-strong);
        font-family: inherit;
        font-weight: 900;
        cursor: pointer;
    }

    .tech-board-show-more:hover {
        background: #fff;
    }

    .tech-work-card {
        display: grid;
        gap: 8px;
        padding: 11px;
        border: 1px solid #dbe3ef;
        border-left: 4px solid var(--workflow-strong, var(--primary-color));
        border-radius: 7px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    }

    .tech-card-top,
    .tech-card-meta,
    .tech-card-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .tech-card-top strong {
        color: var(--primary-dark);
        font-size: 13px;
    }

    .tech-card-code-group {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        flex-wrap: wrap;
        padding-left: 6px;
    }

    .tech-card-customer {
        color: #334155;
        font-weight: 800;
        font-size: 13px;
        line-height: 1.2;
        padding-left: 8px;
    }

    .tech-card-item {
        color: #0f172a;
        font-size: 12px;
        line-height: 1.25;
        padding-left: 8px;
    }

    .tech-card-item strong {
        font-weight: 900;
    }

    .tech-card-line-title {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .tech-card-line-title strong {
        min-width: 0;
    }

    .tech-line-done-badge {
        flex: 0 0 auto;
        padding: 1px 6px;
        border: 1px solid #bbf7d0;
        border-radius: 999px;
        background: #dcfce7;
        color: #15803d;
        font-size: 10px;
        font-weight: 800;
        line-height: 1.4;
    }

    .tech-line-done-btn {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #bfdbfe;
        border-radius: 5px;
        background: #eff6ff;
        color: transparent;
        cursor: pointer;
        font-size: 10px;
        transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }

    .tech-line-done-btn:hover {
        border-color: #22c55e;
        background: #f0fdf4;
        color: #22c55e;
    }

    .tech-line-done-btn.is-done {
        border-color: #16a34a;
        background: #dcfce7;
        color: #15803d;
    }

    .tech-card-item.is-done,
    .tech-card-line-other.is-done {
        border-radius: 6px;
        background: #f0fdf4;
    }

    .tech-card-line-title.is-done strong {
        color: #15803d;
        text-decoration: line-through;
        text-decoration-thickness: 1px;
        text-decoration-color: #86efac;
    }

    .tech-card-item-meta {
        display: grid;
        gap: 3px;
        margin-top: 3px;
        padding-left: 8px;
        color: #475569;
        font-size: 11px;
        line-height: 1.25;
    }

    .tech-card-item-meta span {
        display: flex;
        align-items: flex-start;
        gap: 5px;
        min-width: 0;
    }

    .tech-card-item-meta i {
        width: 13px;
        margin-top: 2px;
        color: #0f4fb8;
        text-align: center;
    }

    .tech-card-item-meta .tech-card-finishing-line,
    .tech-card-item-meta .tech-card-finishing-line i {
        color: #475569;
    }

    .tech-card-item-meta .tech-card-finishing-line.tech-card-finishing-line-highlight {
        width: fit-content;
        padding: 2px 6px;
        border: 1px solid #fecaca;
        border-radius: 6px;
        background: #fff1f2;
        color: #b91c1c;
    }

    .tech-card-item-meta .tech-card-finishing-line.tech-card-finishing-line-highlight i {
        color: #dc2626;
    }

    .tech-card-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
        color: #475569;
        font-size: 11px;
    }

    .tech-card-meta span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
    }

    .tech-card-delivery .delivery-date-line {
        display: none;
    }

    .tech-card-delivery .delivery-alert,
    .tech-card-delivery-inline .delivery-alert {
        margin-top: 0;
    }

    .tech-card-delivery-inline .delivery-date-line {
        display: none;
    }

    .tech-card-note {
        padding: 6px 8px;
        border-radius: 5px;
        background: #fff7ed;
        color: #9a3412;
        font-size: 12px;
        font-weight: 800;
    }

    .tech-card-note summary {
        cursor: pointer;
        color: #9a3412;
    }

    .tech-card-note div {
        margin-top: 5px;
        line-height: 1.35;
		font-weight: normal;
		color: #111827;
    }

    .tech-card-urgent-badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        width: fit-content;
        padding: 4px 8px;
        border-radius: 999px;
        background: #fee2e2;
        color: #b91c1c;
        font-size: 12px;
        font-weight: 900;
    }

    .tech-card-urgent-badge.compact {
        min-width: 28px;
        min-height: 24px;
        padding: 4px 7px;
    }

    .tech-card-urgent-badge.sticker-online {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .tech-card-urgent-badge.sticker-online .urgent-pulse-dot {
        background: #2563eb;
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.65);
        animation-name: sticker-online-pulse;
    }

    .urgent-pulse-dot {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: #ef4444;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.65);
        animation: urgent-pulse 1.1s ease-out infinite;
    }

    @keyframes urgent-pulse {
        0% {
            box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.65);
            opacity: 1;
        }
        70% {
            box-shadow: 0 0 0 7px rgba(239, 68, 68, 0);
            opacity: 0.75;
        }
        100% {
            box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
            opacity: 1;
        }
    }

    .tech-card-icon-btn.tech-image-note-btn {
        position: relative;
        color: #0f50ad;
        background: #eff6ff;
    }

    .tech-card-icon-btn.tech-image-note-btn span {
        position: absolute;
        top: -6px;
        right: -6px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: 10px;
        font-weight: 900;
        line-height: 16px;
    }

    .order-lines-table .order-line-image-col {
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        text-align: center;
    }

    .order-line-image-note-btn {
        width: 32px;
        min-width: 32px;
        height: 32px;
        margin: 0 auto;
        border: 1px solid #bfdbfe;
    }

    .order-line-image-note-btn:not(.has-images) span {
        display: none;
    }

    .order-line-image-note-content {
        max-width: 760px;
        border-radius: 12px;
        overflow: hidden;
    }

    .order-line-image-note-name {
        margin-bottom: 10px;
        padding: 9px 11px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #f8fbff;
        color: #0f172a;
        font-size: 13px;
        font-weight: 800;
        line-height: 1.35;
    }

    .tech-table-image-note-btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
        margin-left: 6px;
        border: 1px solid #bfdbfe;
    }

    .tech-card-lines {
        font-size: 12px;
        color: #334155;
    }

    .tech-card-lines summary {
        cursor: pointer;
        font-weight: 800;
        color: var(--primary-color);
    }

    .tech-card-lines-toggle {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--primary-color);
        font: inherit;
        font-weight: 800;
        cursor: pointer;
    }

    .tech-card-lines ul,
    .tech-card-lines-list {
        margin: 6px 0 0;
        padding-left: 0;
    }

    .tech-card-lines-list.is-hidden {
        display: none;
    }

    .tech-card-lines li,
    .tech-card-line-other {
        margin-left: 12px;
        margin-bottom: 3px;
        line-height: 1.35;
    }

    .tech-card-lines li .tech-card-item-meta,
    .tech-card-line-other .tech-card-item-meta {
        margin-top: 2px;
    }

    .tech-card-lines li strong,
    .tech-card-lines li small,
    .tech-card-line-other strong,
    .tech-card-line-other small {
        display: block;
    }

    .tech-card-lines li small,
    .tech-card-line-other small {
        margin-top: 2px;
        color: #475569;
        font-size: 11px;
        line-height: 1.3;
    }

    .tech-card-actions {
        justify-content: flex-end;
        padding-top: 4px;
        border-top: 1px solid #e5edf7;
    }

    .tech-status-menu-portal {
        position: fixed;
        z-index: 10050;
        display: none;
        min-width: 172px;
        padding: 7px;
        border: 1px solid #dbeafe;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    }

    .tech-status-menu-portal.show {
        display: grid;
        gap: 4px;
    }

    .tech-status-menu-portal button {
        display: grid;
        grid-template-columns: 18px 1fr;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 9px 10px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #0f172a;
        text-align: left;
        font-weight: 800;
        cursor: pointer;
        font-family: inherit;
    }

    .tech-status-menu-portal button.order-status-pending {
        color: #d97706;
    }

    .tech-status-menu-portal button.order-status-working,
    .tech-status-menu-portal button.order-status-printed {
        color: #2563eb;
    }

    .tech-status-menu-portal button.order-status-processing {
        color: #f97316;
    }

    .tech-status-menu-portal button.order-status-ready {
        color: #db2777;
    }

    .tech-status-menu-portal button.order-status-shipping {
        color: #0891b2;
    }

    .tech-status-menu-portal button.order-status-delivered {
        color: #16a34a;
    }

    .tech-status-menu-portal button.order-status-completed {
        color: #7c3aed;
    }

    .tech-status-menu-portal button:hover {
        background: #eff6ff;
        color: var(--primary-color);
    }

    .tech-status-menu-portal button[data-next-status="Đã hủy"] {
        color: #b91c1c;
    }

    .tech-status-menu-portal button[data-next-status="Đã hủy"]:hover {
        background: #fef2f2;
    }

    .tech-order-summary-content {
        max-width: 820px;
        border-radius: 12px;
        overflow: hidden;
    }

    .tech-image-note-content {
        max-width: 920px;
        border-radius: 12px;
        overflow: hidden;
    }

    .tech-image-note-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 14px;
    }

    .tech-image-note-item {
        margin: 0;
        border: 1px solid #dbeafe;
        border-radius: 10px;
        overflow: hidden;
        background: #f8fbff;
    }

    .tech-image-note-item img {
        display: block;
        width: 100%;
        max-height: 520px;
        object-fit: contain;
        background: #fff;
    }

    .tech-image-note-item figcaption {
        padding: 8px 10px;
        color: #475569;
        font-size: 12px;
        font-weight: 800;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
    }

    .tech-image-note-item figcaption strong,
    .tech-image-note-item figcaption span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tech-image-note-item figcaption strong {
        color: #0f50ad;
    }

    .tech-order-summary-content .modal-header {
        padding: 16px 22px 10px;
        background: #f8fbff;
    }

    .tech-order-summary-content .modal-header h3 {
        color: #111827;
        font-size: 1.1rem;
        font-weight: 900;
    }

    .tech-summary-hero {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin: -4px 0 14px;
        padding: 16px 18px;
        border: 1px solid #dbeafe;
        border-radius: 12px;
        background: linear-gradient(135deg, #eff6ff, #f8fbff);
    }

    .tech-summary-kicker {
        color: #2563eb;
        font-size: 0.78rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .tech-summary-code {
        margin-top: 4px;
        color: #0f172a;
        font-size: 1.35rem;
        font-weight: 900;
    }

    .tech-summary-metrics {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 18px;
    }

    .tech-summary-metrics div {
        padding: 11px 12px;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        background: #fff;
    }

    .tech-summary-metrics span,
    .tech-summary-metrics strong {
        display: block;
    }

    .tech-summary-metrics span {
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 800;
    }

    .tech-summary-metrics strong {
        margin-top: 4px;
        color: #0f172a;
        font-size: 0.95rem;
        font-weight: 900;
    }

    .tech-summary-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(260px, 1fr));
        gap: 20px 28px;
        padding: 4px 0 12px;
    }

    .tech-summary-section {
        min-width: 0;
        padding: 14px;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background: #fff;
    }

    .tech-summary-section-wide {
        grid-column: 1 / -1;
    }

    .tech-summary-section h4 {
        margin: 0 0 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e5e7eb;
        color: #374151;
        font-size: 0.96rem;
        font-weight: 900;
    }

    .tech-summary-row {
        display: grid;
        grid-template-columns: 115px minmax(0, 1fr);
        gap: 12px;
        margin: 6px 0;
        color: #4b5563;
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .tech-summary-row span {
        color: #111827;
        font-weight: 800;
    }

    .tech-summary-row strong {
        min-width: 0;
        color: #4b5563;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .tech-summary-lines {
        display: grid;
        gap: 8px;
    }

    .tech-summary-line {
        display: grid;
        grid-template-columns: minmax(210px, 1fr) 90px minmax(110px, 0.7fr) minmax(150px, 0.7fr);
        gap: 12px;
        align-items: center;
        padding: 8px 10px;
        border: 1px solid #dbeafe;
        border-radius: 10px;
        background: linear-gradient(180deg, #ffffff, #f8fbff);
        color: #374151;
        font-size: 0.88rem;
    }

    .tech-summary-line-main strong,
    .tech-summary-line-main span {
        display: block;
    }

    .tech-summary-line-main span {
        margin-top: 3px;
        color: #64748b;
        font-size: 0.82rem;
        font-weight: 700;
    }

    .tech-summary-line-qty {
        display: inline-flex;
        align-items: baseline;
        gap: 4px;
        justify-content: center;
        min-height: 34px;
        border-radius: 8px;
        background: #eff6ff;
        color: #0f50ad;
        font-size: 1.02rem;
        font-weight: 900;
    }

    .tech-summary-line-qty small {
        color: #475569;
        font-size: 0.76rem;
        font-weight: 800;
    }

    .tech-summary-line-material {
        color: #475569;
        font-weight: 800;
        overflow-wrap: anywhere;
    }

    .tech-summary-line-spec {
        color: #111827;
        font-size: 0.82rem;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .tech-summary-empty {
        color: #64748b;
        font-weight: 700;
    }

    .tech-summary-file {
        display: inline-block;
        max-width: 100%;
        color: var(--primary-color);
        overflow-wrap: anywhere;
    }

    .tech-summary-muted {
        color: #94a3b8;
        font-weight: 800;
    }

    @media (max-width: 760px) {
        .tech-summary-metrics {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .tech-summary-grid {
            grid-template-columns: 1fr;
            gap: 24px;
        }

        .tech-summary-line {
            grid-template-columns: 1fr;
            gap: 6px;
        }

        .tech-summary-row {
            grid-template-columns: 105px minmax(0, 1fr);
        }
    }

    .tech-card-primary-btn,
    .tech-card-secondary-btn,
    .tech-card-icon-btn {
        border-radius: 5px;
        font-size: 12px;
        font-weight: 900;
        cursor: pointer;
        padding: 7px 10px;
    }

    .tech-card-primary-btn {
        border: 1px solid var(--primary-color);
        background: var(--primary-color);
        color: #fff;
    }

    .tech-card-secondary-btn,
    .tech-card-icon-btn {
        border: 1px solid #bfdbfe;
        background: #fff;
        color: var(--primary-color);
    }

    .tech-empty-card {
        padding: 14px;
        border: 1px dashed #cbd5e1;
        border-radius: 7px;
        color: #64748b;
        text-align: center;
        font-weight: 700;
        background: rgba(255, 255, 255, 0.6);
    }

    .order-search {
        flex-grow: 1;
        min-width: 300px;
        max-width: 480px;
        margin-left: auto;
        height: 38px;
        align-self: flex-end;
    }

    .order-search input {
        width: 100%;
        height: 38px;
    }

    .order-filter-container .filter-row {
        align-items: flex-end;
        gap: 14px;
    }

    .order-filter-container .filter-item {
        gap: 6px;
    }

    .order-filter-container .filter-item input,
    .order-filter-container .filter-item select {
        height: 38px;
    }

    #orders .orders-table-scroll {
        flex: 1 1 auto;
        min-height: 160px;
        height: auto;
        overflow: auto !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        padding-bottom: 0;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        border-radius: 10px;
    }

    #orders .orders-table-scroll .data-table thead th {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 20;
    }

    #orders .orders-table-scroll .orders-table th.order-pinned-col {
        z-index: 28;
    }

    #orders .orders-table-scroll .orders-table th.order-pinned-right-col {
        z-index: 28;
    }

    #orders .orders-table-scroll .orders-table th.order-pinned-right-col,
    #orders .orders-table-scroll .orders-table td.order-pinned-right-col {
        z-index: 22;
    }

    #orders .orders-table-scroll .orders-table th.order-pinned-right-col {
        z-index: 30;
    }

    #orders .pagination-container {
        flex: 0 0 auto;
        margin-top: 8px;
        padding-bottom: 0;
    }

    @media (max-width: 1500px) {
        #orders .orders-summary-compact {
            grid-template-columns: repeat(3, minmax(160px, 1fr));
        }
    }

    @media (max-width: 1200px) {
        #orders .orders-top-actions {
            margin-left: 0;
            width: 100%;
            justify-content: flex-end;
        }

        #orders .orders-table-scroll {
            min-height: 220px;
        }

        #orders .orders-summary-compact {
            grid-template-columns: repeat(2, minmax(160px, 1fr));
        }

        #orders .order-workflow-step::after {
            display: none;
        }

        #orders .orders-toolbar-row {
            flex-direction: column;
            align-items: stretch;
        }
    }

    .order-status {
        display: inline-block;
        min-width: 92px;
        padding: 4px 9px;
        border-radius: 5px;
        font-weight: bold;
        text-align: center;
        font-size: 11px;
        border: 1px solid transparent;
    }

    .order-status-quick-select {
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
        height: 28px;
        padding: 4px 22px 4px 9px;
        background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
        background-position: calc(100% - 12px) 11px, calc(100% - 7px) 11px;
        background-size: 5px 5px, 5px 5px;
        background-repeat: no-repeat;
        font-family: inherit;
    }

    .order-status-quick-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 108px;
        line-height: 1;
        white-space: nowrap;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    }

    .order-status-quick-btn i {
        font-size: 9px;
        opacity: 0.8;
    }

    .order-status-quick-btn:hover,
    .order-status-quick-btn:focus-visible {
        filter: saturate(1.06);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
        outline: none;
    }

    .order-status-quick-select:disabled {
        opacity: 0.65;
        cursor: wait;
    }

    .order-status-delivered {
        background: #e7f8ef;
        color: #166534;
        border-color: #86efac;
    }

    .order-status-completed {
        background: #f5f3ff;
        color: #5b21b6;
        border-color: #c4b5fd;
    }

    .order-status-working {
        background: #e0f2fe;
        color: #075985;
        border-color: #bae6fd;
    }

    .order-status-ready {
        background: #fce7f3;
        color: #be185d;
        border-color: #fbcfe8;
    }

    .order-status-printed {
        background: #e0e7ff;
        color: #4338ca;
        border-color: #c7d2fe;
    }

    .order-status-processing {
        background: #ffedd5;
        color: #9a3412;
        border-color: #fed7aa;
    }

    .order-status-shipping {
        background: #ecfeff;
        color: #155e75;
        border-color: #67e8f9;
    }

    .order-status-pending {
        background: #fef9c3;
        color: #854d0e;
        border-color: #fde68a;
    }

    .order-status-cancelled {
        background: #fee2e2;
        color: #991b1b;
        border-color: #fecaca;
    }

    .order-status-quick-select {
        background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
        background-position: calc(100% - 12px) 11px, calc(100% - 7px) 11px;
        background-size: 5px 5px, 5px 5px;
        background-repeat: no-repeat;
    }

    .order-status-quick-btn {
        background-image: none;
        padding-right: 10px;
    }

    .order-status-menu-portal {
        position: fixed;
        z-index: 10080;
        width: 168px;
        padding: 6px;
        border: 1px solid #d6e4ff;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
        display: none;
    }

    .order-status-menu-portal.show {
        display: grid;
        gap: 4px;
    }

    .order-status-menu-portal button {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 8px;
        border: 1px solid transparent;
        background: transparent;
        font: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        text-align: left;
    }

    .order-status-menu-portal button:hover,
    .order-status-menu-portal button.is-active {
        border-color: currentColor;
        filter: saturate(1.08);
    }

    .order-status-menu-portal button i {
        font-size: 11px;
    }

    .invoice-status-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 48px;
        height: 24px;
        border-radius: 7px;
        font-size: 11px;
        font-weight: bold;
        cursor: pointer;
        border: 1px solid transparent;
        transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
    }

    .invoice-chip-check {
        font-size: 9px;
        line-height: 1;
    }

    .invoice-status-actions {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
    }

    .invoice-chip-misa.is-done {
        background: #5cc4f3;
        color: #ffffff;
    }

    .invoice-chip-misa.is-missing {
        background: #eff6ff;
        color: #1d4ed8;
        border-color: #bfdbfe;
    }

    .invoice-chip-hd.is-done {
        background: #63c386;
        color: #ffffff;
    }

    .invoice-chip-hd.is-missing {
        background: #fff7ed;
        color: #c2410c;
        border-color: #fdba74;
    }

    .invoice-chip-aff.is-done {
        background: #faf5ff;
        color: #7c3aed;
        border-color: #ddd6fe;
    }

    .invoice-chip-aff .order-aff-added-check {
        margin-right: 2px;
    }

    .invoice-chip-aff .order-aff-linked-check {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 14px;
        height: 14px;
        margin-right: 2px;
        border-radius: 999px;
        background: #7c3aed;
        color: #ffffff;
        font-size: 9px;
        line-height: 1;
        flex: 0 0 auto;
    }

    .invoice-chip-aff.is-linked {
        background: #faf5ff;
        color: #7c3aed;
        border-color: #ddd6fe;
    }

    .invoice-chip-aff.is-missing {
        background: #faf5ff;
        color: #7c3aed;
        border-color: #ddd6fe;
    }

    .invoice-done {
        background: #dcfce7;
        color: #166534;
        border-color: #86efac;
    }

    .invoice-partial {
        background: #e0f2fe;
        color: #075985;
        border-color: #7dd3fc;
    }

    .invoice-missing {
        background: #fff7ed;
        color: #9a3412;
        border-color: #fed7aa;
    }

    .invoice-status-chip:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
        filter: saturate(1.08);
    }

    .invoice-status-chip:disabled {
        cursor: wait;
        opacity: 0.65;
        transform: none;
        box-shadow: none;
    }

    .aff-quick-add-btn {
        background: #7c3aed !important;
    }

    .aff-quick-modal .modal-content {
        max-width: 980px;
        width: min(980px, calc(100vw - 28px));
        padding: 0;
        overflow: visible;
    }

    .aff-quick-card {
        border-radius: 12px;
        box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
    }

    .aff-quick-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 16px 20px 12px;
        border-bottom: 1px solid #e2e8f0;
    }

    .aff-quick-head h3 {
        margin: 0;
        font-size: 22px;
        line-height: 1.2;
        color: #0f172a;
    }

    .aff-quick-head-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
    }

    .aff-quick-close-btn {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0px solid #dbeafe;
        border-radius: 999px;
        background: #fff;
        color: #64748b;
        cursor: pointer;
    }

    .aff-quick-close-btn:hover {
        background: #eff6ff;
        color: #0f4fb8;
    }

    .aff-quick-context {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 12px 20px 0;
        padding: 9px 10px;
        border: 1px solid #e9d5ff;
        border-radius: 8px;
        background: #faf5ff;
        color: #4c1d95;
        font-size: 12px;
    }

    .aff-quick-context.is-existing-aff {
        grid-template-columns: minmax(240px, 1.4fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(150px, 0.8fr);
        border-color: #86efac;
        background: #f0fdf4;
        color: #166534;
    }

    .aff-quick-context.is-existing-aff b {
        color: #14532d;
    }

    .aff-woo-status-badge {
        display: inline-flex;
        align-items: center;
        width: fit-content;
        min-height: 22px;
        padding: 3px 9px;
        border-radius: 999px;
        border: 1px solid #dbe7fb;
        background: #f8fafc;
        color: #475569;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.2;
    }

    .aff-woo-status-badge.is-pending {
        background: #fff7ed;
        border-color: #fed7aa;
        color: #c2410c;
    }

    .aff-woo-status-badge.is-processing {
        background: #e0f2fe;
        border-color: #7dd3fc;
        color: #0369a1;
    }

    .aff-woo-status-badge.is-completed {
        background: #dcfce7;
        border-color: #86efac;
        color: #166534;
    }

    .aff-woo-status-badge.is-on-hold {
        background: #fef9c3;
        border-color: #fde68a;
        color: #854d0e;
    }

    .aff-woo-status-badge.is-cancelled {
        background: #fee2e2;
        border-color: #fecaca;
        color: #b91c1c;
    }

    .aff-quick-context b {
        display: block;
        color: #312e81;
        font-size: 11px;
        margin-bottom: 3px;
    }

    .aff-quick-grid {
        display: grid;
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
        gap: 16px;
        padding: 16px 20px 18px;
    }

    .aff-quick-grid .form-group {
        margin-bottom: 0;
    }

    .aff-quick-grid input,
    .aff-quick-grid select,
    .aff-quick-grid textarea {
        border-radius: 8px;
        min-height: 38px;
        border-color: #cfe0ff;
        background: #f8fbff;
    }

    .aff-quick-grid textarea {
        min-height: 86px;
    }

    .aff-quick-grid .full-width {
        grid-column: 1 / -1;
    }

    .aff-user-search-wrap {
        position: relative;
    }

    .aff-user-clear-btn {
        position: absolute;
        top: 50%;
        right: 8px;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: #94a3b8;
        cursor: pointer;
        font-size: 22px;
        line-height: 1;
    }

    .aff-user-clear-btn:hover {
        background: #e2e8f0;
        color: #475569;
    }

    .aff-user-results {
        position: absolute;
        z-index: 30;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        max-height: 190px;
        overflow: auto;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
        display: none;
    }

    .aff-user-results.show {
        display: block;
    }

    .aff-user-result-item {
        width: 100%;
        text-align: left;
        background: #fff;
        padding: 8px 10px;
        cursor: pointer;
        border: 0;
        border-bottom: 1px solid #eff6ff;
    }

    .aff-user-result-item:hover {
        background: #eff6ff;
    }

    .aff-user-result-item strong {
        display: block;
        color: #0f172a;
        font-size: 13px;
    }

    .aff-user-result-item span {
        display: block;
        color: #64748b;
        font-size: 11px;
        margin-top: 2px;
    }

    .aff-picked-user {
        margin-top: 8px;
        padding: 9px 11px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #eaf6ff;
        color: #000000;
        font-size: 13px;
        line-height: 1.45;
    }

    .aff-picked-user b {
        color: #1e293b;
    }

    .aff-quick-suggestions {
        margin-top: 8px;
        padding: 8px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #f8fbff;
    }

    .aff-suggestion-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 6px;
    }

    .aff-suggestion-head b {
        display: block;
        color: #0f172a;
        font-size: 12px;
        line-height: 1.2;
    }

    .aff-suggestion-head span {
        display: block;
        color: #64748b;
        font-size: 11px;
        margin-top: 1px;
    }

    .aff-suggestion-head button {
        height: 28px;
        padding: 0 9px;
        border: 1px solid #bfdbfe;
        border-radius: 8px;
        background: #0f62c9;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
    }

    .aff-suggestion-head button:disabled {
        background: #e2e8f0;
        color: #64748b;
        cursor: not-allowed;
        box-shadow: none;
    }

    .aff-suggestion-list {
        display: grid;
        gap: 3px;
        max-height: 128px;
        overflow: auto;
    }

    .aff-suggestion-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 118px 34px;
        align-items: start;
        gap: 5px;
        margin: 0;
        padding: 4px 7px;
        border: 1px solid #dbeafe;
        border-radius: 7px;
        background: #ffffff;
        cursor: pointer;
    }

    .aff-suggestion-item.is-disabled {
        opacity: 0.52;
        cursor: not-allowed;
        background: #f1f5f9;
    }

    .aff-suggestion-item input {
        width: 14px;
        height: 14px;
        min-height: 14px;
        margin: 0;
        flex: 0 0 auto;
    }

    .aff-suggestion-status-select {
        width: 118px;
        justify-self: end;
        min-height: 24px;
        padding: 2px 5px;
        border: 1px solid #bfdbfe;
        border-radius: 6px;
        background: #ffffff;
        color: #0f4fb8;
        font-size: 12px !important;
        font-weight: 500;
    }

    .aff-suggestion-item.is-disabled .aff-suggestion-status-select {
        background: #e2e8f0;
        color: #94a3b8;
    }

    .aff-suggestion-main {
        min-width: 0;
    }

    .aff-suggestion-title {
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: 0;
        max-width: 100%;
        white-space: nowrap;
    }

    .aff-suggestion-order-link {
        border: 0;
        background: transparent;
        color: #0f4fb8;
        font-size: 12px;
        font-weight: 800;
        line-height: 1.15;
        padding: 0;
        cursor: pointer;
    }

    .aff-suggestion-order-link:hover {
        text-decoration: underline;
    }

    .aff-suggestion-status-badge {
        min-height: 17px;
        padding: 1px 5px;
        font-size: 9px;
        border-radius: 999px;
        flex: 0 0 auto;
    }

    .aff-suggestion-main small b {
        flex: 0 0 auto;
        margin-left: 8px;
        color: #0f4fb8;
        font-size: 12px;
        line-height: 1.15;
        text-align: right;
    }

    .aff-suggestion-main small {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
        color: #64748b;
        font-size: 10.5px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .aff-suggestion-main small span {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .aff-suggestion-main small::before {
        content: "";
    }

    .aff-suggestion-state {
        min-width: 34px;
        text-align: right;
        color: #64748b;
        font-size: 10.5px;
        font-weight: 700;
    }

    .aff-suggestion-state.is-loading {
        color: #2563eb;
    }

    .aff-suggestion-state.is-success {
        color: #059669;
    }

    .aff-suggestion-state.is-error {
        color: #dc2626;
    }

    .aff-status-group {
        margin-top: 10px;
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .aff-status-group label {
        font-size: 13px;
    }

    .aff-status-group select {
        min-height: 36px;
        font-size: 13px;
    }

    .aff-quick-advanced-row {
        margin: 8px 0 0;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        border: 1px dashed #c7d2fe;
        border-radius: 999px;
        background: #f8fafc;
        color: #475569;
        font-size: 12px;
        cursor: pointer;
    }

    .aff-quick-advanced-row input {
        width: 14px;
        height: 14px;
        min-height: 14px;
        margin: 0;
    }

    .aff-quick-right-col label:not(:first-child) {
        margin-top: 10px;
    }

    .aff-quick-hidden-order-code {
        display: none !important;
    }

    .aff-quick-commission {
        margin-top: 8px;
        padding: 10px 12px;
        border: 1px dashed #bfdbfe;
        border-radius: 8px;
        background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
        color: #1d4ed8;
        font-size: 14px;
        line-height: 1.45;
    }

    .aff-quick-commission b {
        color: #dc2626;
        font-size: 12px;
    }
    .aff-quick-hint {
        margin-top: 6px;
        color: #64748b;
        font-size: 12px;
    }

    .aff-quick-notify {
        margin-top: 12px;
        display: grid;
        gap: 6px;
        color: #334155;
    }

    .aff-quick-switch {
        width: fit-content;
        min-width: 88px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border: none;
        background: transparent;
        color: #334155;
        cursor: pointer;
        padding: 0;
        font-weight: 700;
    }

    .aff-quick-switch span {
        position: relative;
        width: 56px;
        height: 30px;
        border-radius: 999px;
        background: #cbd5e1;
        transition: background 0.18s ease;
    }

    .aff-quick-switch span::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
        transition: transform 0.18s ease;
    }

    .aff-quick-switch.is-on span {
        background: #2563eb;
    }

    .aff-quick-switch.is-on span::after {
        transform: translateX(26px);
    }

    .aff-quick-notify small {
        color: #64748b;
    }

    .aff-quick-result {
        margin: 12px 0 0;
        padding: 12px;
        border: 1px solid #bbf7d0;
        border-radius: 8px;
        background: #f0fdf4;
        color: #14532d;
        font-size: 13px;
    }

    .aff-quick-result a {
        color: #0f62c9;
        font-weight: 700;
    }

    .aff-quick-result-lines {
        margin-top: 6px;
    }

    .aff-result-summary {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 14px;
        margin-bottom: 7px;
    }

    .aff-result-list {
        display: grid;
        gap: 4px;
    }

    .aff-result-row {
        display: grid;
        grid-template-columns: 80px 86px 92px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        padding: 5px 7px;
        border: 1px solid #bbf7d0;
        border-radius: 6px;
        background: #ffffff;
        color: #14532d;
    }

    .aff-result-row span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .aff-result-row.is-error {
        border-color: #fecaca;
        background: #fff1f2;
        color: #991b1b;
    }

    #aff-quick-create-btn.aff-quick-submit {
        margin-top: 12px;
        min-width: 118px;
        height: 38px;
        padding: 0 18px;
        border: none;
        border-radius: 9px;
        background: #0f62c9;
        color: #fff;
        font-weight: 700;
        box-shadow: 0 8px 16px rgba(15, 98, 201, 0.18);
    }

    #aff-quick-create-btn.aff-quick-submit:hover {
        background: #0b55b4;
    }

    #aff-quick-create-btn.aff-quick-submit:disabled,
    #aff-quick-create-btn.aff-quick-submit.is-disabled {
        background: #dbe5f2;
        color: #7b8da8;
        cursor: not-allowed;
        opacity: 0.68;
        box-shadow: none;
        transform: none;
    }

    #aff-quick-create-btn.aff-quick-submit:disabled:hover,
    #aff-quick-create-btn.aff-quick-submit.is-disabled:hover {
        background: #dbe5f2;
    }

    .aff-quick-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 14px;
    }

    @media (max-width: 760px) {
        .aff-quick-context,
        .aff-quick-grid {
            grid-template-columns: 1fr;
        }

        .aff-quick-head {
            align-items: flex-start;
            flex-direction: column;
        }
    }

    #invoice-confirm-modal {
        align-items: center !important;
        justify-content: center !important;
        padding: 18px;
        z-index: 5000;
    }

    .invoice-confirm-content {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: min(420px, calc(100vw - 36px));
        max-width: 420px;
        margin: 0 !important;
        border-radius: 12px;
        overflow: hidden;
        transform: translate(-50%, -50%) !important;
        animation: none !important;
        box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
    }

    #invoice-confirm-modal .modal-body {
        flex: initial;
        max-height: none;
        overflow: visible;
    }

    .invoice-confirm-message {
        margin: 0 0 22px;
        line-height: 1.5;
        color: #334155;
    }

    .invoice-confirm-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }

    .invoice-confirm-actions .save-button,
    .invoice-confirm-actions .cancel-button {
        min-width: 82px;
        height: 36px;
        padding: 0 16px;
        border-radius: 18px;
        font-weight: 700;
        cursor: pointer;
    }

    .invoice-confirm-actions .save-button {
        border: 1px solid var(--primary-color);
        background: var(--primary-color);
        color: #fff;
    }

    .invoice-confirm-actions .cancel-button {
        border: 1px solid #cbd5e1;
        background: #f8fafc;
        color: #334155;
    }

    .invoice-bank-account-content {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        max-width: 520px;
        width: min(520px, calc(100vw - 36px));
        border-radius: 14px;
        animation: none !important;
    }

    .invoice-bank-order {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        margin-bottom: 12px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #f8fbff;
        color: #1e3a8a;
        font-size: 0.92rem;
    }

    .invoice-bank-order span {
        color: #475569;
        text-align: right;
    }

    .invoice-bank-list {
        display: grid;
        gap: 8px;
    }

    .invoice-bank-option {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
    }

    .invoice-bank-option:hover {
        border-color: var(--primary-color);
        background: #f8fbff;
    }

    .invoice-bank-option input {
        width: 16px;
        height: 16px;
        flex: 0 0 auto;
    }

    .invoice-bank-main {
        min-width: 0;
        display: grid;
        gap: 3px;
    }

    .invoice-bank-name {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 700;
        color: #0f172a;
    }

    .invoice-bank-meta {
        color: #64748b;
        font-size: 0.85rem;
        overflow-wrap: anywhere;
    }

    .invoice-bank-preferred {
        padding: 2px 7px;
        border-radius: 999px;
        background: #dcfce7;
        color: #166534;
        font-size: 0.72rem;
        font-weight: 700;
    }

    .invoice-bank-empty {
        padding: 12px;
        border: 1px dashed #f59e0b;
        border-radius: 8px;
        background: #fffbeb;
        color: #92400e;
        line-height: 1.45;
    }

    .product-search {
        flex-grow: 1;
        max-width: 520px;
        margin-left: auto;
    }

    .product-search input {
        width: 100%;
    }

    .product-count-info {
        justify-content: flex-start;
        margin-top: 10px;
    }

    .section-header.compact {
        margin-bottom: 10px;
    }

    .section-header.compact h3 {
        font-size: 1rem;
        margin: 0;
    }

    .order-items-section {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px 12px;
        background: rgba(74, 144, 255, 0.05);
        overflow: visible;
    }

    #order-modal .modal-header {
        padding: 12px 20px;
    }

    #order-modal .modal-body {
        position: relative;
        padding: 16px 24px 12px;
        overflow-x: hidden;
    }

    #order-modal .modal-content {
        max-height: 92vh;
        width: min(98vw, 1280px);
        max-width: 1280px;
    }

    #order-form {
        display: grid;
        gap: 10px;
    }

    #order-modal.order-loading-mode #order-form {
        filter: saturate(0.92);
    }

    .order-modal-loading {
        position: absolute;
        inset: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px;
        background: rgba(248, 251, 255, 0.72);
        pointer-events: auto;
    }

    .order-modal-loading[hidden] {
        display: none;
    }

    .order-modal-loading-box {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 36px;
        padding: 8px 12px;
        border: 1px solid #bfdbfe;
        border-radius: 999px;
        background: #fff;
        color: #0f4fb8;
        font-size: 13px;
        font-weight: 900;
        box-shadow: 0 8px 22px rgba(15, 79, 184, 0.12);
    }

    .order-action-menu .edit-btn.is-loading {
        opacity: 0.75;
        cursor: wait;
    }

    #order-form .form-row {
        margin-bottom: 0;
        gap: 10px;
    }

    #order-form .form-group {
        margin-bottom: 0;
    }

    #order-form label {
        margin-bottom: 5px;
        color: #374151;
        font-size: 0.86rem;
    }

    #order-form input,
    #order-form select {
        min-height: 34px;
        padding: 7px 10px;
    }

    #order-form .order-top-grid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 10px;
        align-items: end;
        padding: 10px;
        border: 1px solid #dbeafe;
        border-radius: 10px;
        background: #f8fbff;
    }

    #order-form .order-customer-field {
        grid-column: span 6;
    }

    #order-form .order-customer-id-field {
        grid-column: span 2;
    }

    #order-form .order-date-field {
        grid-column: span 2;
    }

    #order-form .order-employee-field {
        grid-column: span 2;
    }

    #order-form .order-aff-buyer-field {
        grid-column: span 3;
    }

    #order-form .order-aff-buyer-display {
        min-height: 34px;
        width: 100%;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 7px 10px;
        border: 1px solid #d8b4fe;
        border-radius: 8px;
        background: #faf5ff;
        color: #6d28d9;
        font-size: 13px;
        font-weight: 700;
        max-width: 100%;
        min-width: 0;
    }

    #order-form .order-aff-buyer-display span:not(.order-aff-added-check) {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .order-aff-added-check {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-width: 14px;
        height: 18px;
        padding: 0 7px;
        border-radius: 999px;
        color: #15803d;
        background: #dcfce7;
        border: 1px solid #86efac;
        font-size: 11px;
        font-weight: 800;
        line-height: 1;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .order-aff-connection-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: max-content;
        height: 18px;
        padding: 0 7px;
        border-radius: 999px;
        font-size: 10.5px;
        font-weight: 800;
        line-height: 1;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .order-aff-connection-badge.is-connected {
        color: #15803d;
        background: #dcfce7;
        border: 1px solid #86efac;
    }

    .order-aff-connection-badge.is-checking {
        color: #1d4ed8;
        background: #dbeafe;
        border: 1px solid #93c5fd;
    }

    .order-aff-connection-badge.is-disconnected {
        color: #b91c1c;
        background: #fee2e2;
        border: 1px solid #fecaca;
    }

    #order-form .order-po-field,
    #order-form .order-id-field {
        grid-column: span 2;
    }

    #order-form .order-delivery-field {
        grid-column: span 7;
    }

    .order-customer-label-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 5px;
    }

    #order-form .order-customer-label-row label {
        margin-bottom: 0;
    }

    .delivery-time-picker {
        position: relative;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .delivery-date-control,
    .delivery-time-control {
        display: grid;
        align-items: center;
        height: 36px;
    }

    .delivery-date-control {
        grid-template-columns: minmax(130px, 1fr) 38px;
        flex: 0 0 178px;
    }

    .delivery-time-control {
        position: relative;
        flex: 0 0 104px;
    }

    .delivery-picker-btn {
        height: 36px;
        border: 1px solid var(--border-color);
        border-left: 0;
        border-radius: 0 8px 8px 0;
        background: #f8fbff;
        color: #0f50ad;
        cursor: pointer;
    }

    #order-delivery-display,
    #pending-order-delivery-display {
        border-radius: 8px 0 0 8px;
        cursor: pointer;
        height: 36px;
        width: 100%;
    }

    #order-delivery-time-select,
    #pending-order-delivery-time-select {
        width: 100%;
        height: 36px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: #fff;
        padding: 0 30px 0 9px;
        color: var(--text-color);
        font-family: inherit;
        appearance: none;
        cursor: pointer;
    }

    .delivery-time-control i {
        position: absolute;
        right: 9px;
        color: #4b5563;
        pointer-events: none;
    }

    .delivery-quick-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .delivery-quick-actions button {
        height: 34px !important;
        border: 1px solid var(--primary-color);
        border-radius: 4px;
        background: #fff;
        color: var(--primary-color);
        padding: 0 12px !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        cursor: pointer;
    }

    .material-stock-inline {
        color: #64748b;
        font-weight: 500;
    }

    .delivery-quick-actions button:hover {
        background: #edf4ff;
    }

    .delivery-picker-popover {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        max-width: calc(100vw - 28px);
        background: #fff;
        border: 1px solid #cfe0f8;
        border-radius: 8px;
        box-shadow: 0 16px 34px rgba(15, 80, 173, 0.18);
        padding: 10px;
        z-index: 2500;
    }

    .delivery-picker-popover.show {
        display: grid;
        grid-template-columns: minmax(220px, 1fr);
        gap: 8px;
    }

    .delivery-picker-popover.align-left {
        right: auto;
        left: 0;
    }

    .delivery-calendar-head {
        grid-column: 1 / 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
    }

    .delivery-calendar-head button {
        border: 0;
        background: transparent;
        color: #0f50ad;
        cursor: pointer;
        font-size: 1rem;
    }

    .delivery-calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 3px;
    }

    .delivery-calendar-grid span,
    .delivery-calendar-grid button {
        min-height: 28px;
        border: 0;
        border-radius: 5px;
        background: transparent;
        font-size: 0.78rem;
    }

    .delivery-calendar-grid span {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #334155;
        font-weight: 700;
    }

    .delivery-calendar-grid button {
        cursor: pointer;
        color: #111827;
    }

    .delivery-calendar-grid button.muted {
        color: #94a3b8;
    }

    .delivery-calendar-grid button.active {
        background: var(--primary-color);
        color: #fff;
        font-weight: 700;
    }

    .delivery-calendar-grid button.today:not(.active) {
        background: #dbeafe;
        color: var(--primary-color);
        font-weight: 700;
        box-shadow: inset 0 0 0 1px rgba(15, 80, 173, 0.25);
    }

    #order-form .order-money-row {
        display: grid;
        grid-template-columns: 170px;
        gap: 8px;
        justify-content: end;
        padding: 0;
        background: #f8fbff;
        border: 0;
        border-radius: 0;
    }

    #order-form .order-totals-stack {
        display: grid;
        justify-content: end;
        justify-items: end;
        gap: 6px;
        min-width: 0;
        width: auto;
        margin-left: auto;
    }

    #order-form .order-vat-row {
        display: grid;
        grid-template-columns: 170px 105px 135px 160px;
        gap: 8px;
        justify-content: end;
        align-items: end;
    }

    #order-form .order-payment-row {
        display: grid;
        grid-template-columns: 170px 160px 170px;
        gap: 8px;
        justify-content: end;
        align-items: end;
    }

    #order-form .order-money-row .form-group,
    #order-form .order-vat-row .form-group,
    #order-form .order-payment-row .form-group {
        width: 100%;
    }

    #order-form .order-money-row label,
    #order-form .order-vat-row label,
    #order-form .order-payment-row label {
        display: block;
        text-align: right;
    }

    #order-form .order-money-row input,
    #order-form .order-vat-row input,
    #order-form .order-vat-row select,
    #order-form .order-payment-row input,
    .order-lines-table .order-line-price,
    .order-lines-table .order-line-amount {
        text-align: right;
    }

    #order-form .order-vat-rate-wrap {
        position: relative;
    }

    #order-form .order-vat-rate-wrap input {
        padding-right: 30px;
    }

    #order-form .order-vat-rate-wrap .clear-input-btn {
        display: inline-flex;
    }

    #order-form .order-grand-total-field input {
        color: #0f172a;
        font-weight: 900;
    }

    #order-form .order-flags-row {
        display: grid;
        grid-template-columns: minmax(230px, 0.8fr) minmax(240px, 1fr);
        gap: 10px;
        align-items: end;
        padding: 10px 12px;
        background: #fbf7ff;
        border: 1px solid #e6d7ff;
        border-radius: 8px;
    }

    #order-form .order-aff-panel-row {
        align-items: stretch;
    }

    #order-form #order-aff-ctv-group {
        margin: 0;
    }

    #order-form .order-aff-select-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 34px 34px;
        gap: 8px;
        align-items: center;
    }

    #order-form .order-aff-toggle-add,
    #order-form .order-aff-delete {
        width: 34px;
        height: 34px;
        border-radius: 999px;
        border: 1px solid #c8a7ff;
        background: #ffffff;
        color: #6d28d9;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 1px 3px rgba(109, 40, 217, 0.12);
    }

    #order-form .order-aff-toggle-add:hover,
    #order-form .order-aff-toggle-add.active {
        background: #7c3aed;
        border-color: #7c3aed;
        color: #fff;
    }

    #order-form .order-aff-delete {
        border-color: #fecaca;
        color: #dc2626;
    }

    #order-form .order-aff-delete:hover:not(:disabled) {
        background: #dc2626;
        border-color: #dc2626;
        color: #fff;
    }

    #order-form .order-aff-delete:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        box-shadow: none;
    }

    #order-form .order-aff-add-row {
        display: grid;
        grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.65fr) auto;
        gap: 8px;
        margin-top: 8px;
        align-items: center;
    }

    #order-form .order-aff-add-row[hidden] {
        display: none;
    }

    #order-form .order-aff-add-row input {
        height: 34px;
        min-width: 0;
    }

    #order-form .order-aff-wp-search {
        position: relative;
        min-width: 0;
    }

    #order-form .order-aff-wp-search input {
        width: 100%;
        padding-right: 32px;
    }

    #order-form .order-aff-wp-clear {
        position: absolute;
        top: 50%;
        right: 8px;
        width: 22px;
        height: 22px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #94a3b8;
        font-size: 18px;
        line-height: 20px;
        transform: translateY(-50%);
        cursor: pointer;
    }

    #order-form .order-aff-wp-clear:hover {
        background: #ede9fe;
        color: #6d28d9;
    }

    #order-form .order-aff-wp-results {
        left: 0;
        right: 0;
        top: calc(100% + 4px);
        z-index: 10020;
    }

    #order-form .order-aff-add-row .secondary-btn {
        height: 34px;
        padding: 0 12px;
        white-space: nowrap;
        border-color: #b7d3ff;
        background: #ffffff;
        color: #6d28d9;
    }

    #order-form #order-aff-ctv-empty {
        margin-top: 5px;
        color: #c2410c;
    }

    .order-customer-name-main {
        line-height: 1.25;
    }

    .order-aff-buyer-line {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-top: 4px;
        padding: 2px 7px;
        border-radius: 999px;
        background: #f3e8ff;
        color: #6d28d9;
        font-size: 11px;
        font-weight: 600;
        max-width: 100%;
    }

    .order-aff-buyer-line .order-aff-added-check {
        margin-left: 2px;
    }

    .order-advanced-panel {
        border: 1px solid #dbe7fb;
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
    }

    .order-advanced-toggle {
        width: 100%;
        border: 0;
        background: #f8fbff;
        color: #1956a8;
        padding: 10px 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        font-weight: 700;
        text-align: left;
    }

    #order-form .order-advanced-panel {
        border: 0;
        background: transparent;
    }

    #order-form .order-advanced-content {
        padding: 0;
    }

    #order-form .order-advanced-panel.collapsed .order-advanced-content {
        display: none;
    }

    .order-advanced-toggle .toggle-icon {
        margin-left: auto;
        transition: transform 0.18s ease;
    }

    .order-advanced-panel:not(.collapsed) .order-advanced-toggle .toggle-icon {
        transform: rotate(180deg);
    }

    .order-advanced-content {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .order-advanced-panel.collapsed .order-advanced-content {
        display: none;
    }

    #order-form .order-status-row,
    #order-form .order-accounting-row,
    #order-form .order-note-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(180px, 1fr));
        gap: 10px;
    }

    #order-form .order-status-row {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    #order-form .order-note-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .printed-a3-content {
        max-width: 760px;
    }

    .printed-a3-note {
        margin-bottom: 12px;
        padding: 10px 12px;
        border: 1px solid #fed7aa;
        border-radius: 8px;
        background: #fff7ed;
        color: #9a3412;
        font-weight: 700;
    }

    .printed-a3-table-wrap {
        overflow-x: auto;
        border: 1px solid #dbeafe;
        border-radius: 8px;
    }

    .printed-a3-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 620px;
    }

    .printed-a3-table th,
    .printed-a3-table td {
        padding: 9px 10px;
        border-bottom: 1px solid #e5edf8;
        text-align: left;
        vertical-align: middle;
    }

    .printed-a3-table th {
        background: #f8fbff;
        color: #0f4fb8;
        font-weight: 800;
    }

    .printed-a3-input {
        width: 130px;
        min-height: 36px;
        border: 1px solid #bfdbfe;
        border-radius: 7px;
        padding: 0 9px;
        font-weight: 700;
    }

    #order-form #order-note {
        min-height: 56px;
        resize: vertical;
        line-height: 1.45;
		background-color: #fbf6f6;
    }

    #order-form .order-urgent-option {
        min-height: 28px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 0px 9px;
        border-radius: 8px;
        background: #fff7ed;
        color: #b91c1c;
        cursor: pointer;
    }

    #order-form .order-delivery-label-row {
        display: block;
        margin-bottom: 6px;
    }

    #order-form .order-delivery-label-row label:first-child {
        margin: 0;
    }

    #order-form .order-urgent-inline {
        flex: 0 0 auto;
        width: fit-content;
        margin: 0;
        min-height: 36px;
        white-space: nowrap;
    }

    #order-form .order-urgent-option input {
        width: 14px;
        height: 14px;
        accent-color: #dc2626;
    }

    #order-form .order-file-row {
        margin-top: -2px;
        display: grid;
        grid-template-columns: 120px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
    }

    #order-form .order-file-row label {
        margin: 0;
    }

    #order-form .order-file-input-wrap {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px;
        align-items: center;
        gap: 6px;
    }

    #order-form .order-file-copy-btn {
        width: 38px;
        height: 34px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: #fff;
        color: var(--primary-color);
        cursor: pointer;
    }

    #order-form .order-file-copy-btn:hover {
        background: #eff6ff;
        border-color: var(--primary-color);
    }

    #order-form .checkbox-form-group {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 16px;
    }

    #order-form .checkbox-form-group label {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        margin: 0;
        min-height: 34px;
    }

    #order-form .checkbox-form-group .inline-input {
        min-height: 34px;
    }

    #order-form .checkbox-form-group .inline-input input {
        max-width: 72px;
    }

    .order-lines-container {
        margin: 0;
        padding-bottom: 2px;
        overflow-x: auto;
        overflow-y: visible;
    }

    .order-line-integrity-warning {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        margin: 0 0 8px;
        padding: 9px 11px;
        border: 1px solid #fecaca;
        border-radius: 6px;
        background: #fff1f2;
        color: #991b1b;
        font-size: 0.86rem;
        line-height: 1.35;
    }

    .order-line-integrity-warning[hidden] {
        display: none;
    }

    .order-line-integrity-warning i {
        margin-top: 2px;
        color: #dc2626;
    }

    .order-line-actions {
        display: grid;
        grid-template-columns: auto minmax(520px, 1fr);
        align-items: end;
        gap: 12px;
        margin-top: 8px;
    }

    #order-modal.order-readonly-mode input:disabled,
    #order-modal.order-readonly-mode select:disabled,
    #order-modal.order-readonly-mode textarea:disabled {
        color: #0f172a;
        background: #f8fbff;
        opacity: 1;
        cursor: default;
    }

    #order-modal.order-readonly-mode .form-actions {
        justify-content: center;
    }

    #order-modal.order-readonly-mode .order-line-actions {
        grid-template-columns: 1fr;
    }

    #order-modal.order-readonly-mode .order-totals-stack {
        justify-self: end;
    }

    .order-lines-table input,
    .order-lines-table select {
        width: 100%;
        min-width: 72px;
        min-height: 31px;
        padding: 5px 8px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: #fff;
        font-size: 0.85rem;
    }

    .order-lines-table .order-line-finishing-btn {
        font-size: 0.78rem;
        margin: 0 auto;
    }

    .order-lines-table th {
        padding: 5px 8px;
        font-size: 0.82rem;
    }

    .order-lines-table td {
        padding: 3px 8px;
    }

    .order-lines-table.hide-in-nhanh-fields .order-paper-col,
    .order-lines-table.hide-in-nhanh-fields .order-print-qty-col {
        display: none;
    }

    .order-lines-table .order-line-name {
        min-width: 210px;
    }

    #order-form .order-po-field {
        display: none;
    }

    .order-lines-table .order-paper-col {
        min-width: 170px;
    }

    .order-lines-table .order-line-unit {
        min-width: 58px;
        max-width: 64px;
    }

    .order-lines-table .order-line-quantity {
        min-width: 72px;
        max-width: 82px;
    }

    .order-lines-table .order-line-print-quantity {
        min-width: 72px;
        max-width: 82px;
    }

    .order-lines-table .order-finishing-col {
        width: 76px;
        min-width: 76px;
        max-width: 76px;
    }

    .order-lines-table .order-print-spec-col {
        width: 112px;
        min-width: 112px;
        max-width: 112px;
        text-align: center;
    }

    .order-lines-table .order-line-stt-col {
        width: 42px;
        min-width: 42px;
        text-align: center;
    }

    .order-line-stt {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 999px;
        background: #eff6ff;
        color: #0f4fb8;
        font-size: 12px;
        font-weight: 900;
    }

    .order-lines-table .order-line-stt-col {
        display: none;
    }

    .order-line-finishing-btn {
        position: relative;
        width: 42px;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: 1px solid #bfdbfe;
        border-radius: 7px;
        background: #eff6ff;
        color: #0f4fb8;
        font-weight: 800;
        cursor: pointer;
        white-space: nowrap;
    }

    .order-line-finishing-btn:not(.has-finishing) {
        width: 76px;
    }

    .order-line-finishing-btn .finishing-count-badge,
    .order-line-print-spec-btn .finishing-count-badge {
        position: absolute;
        top: -5px;
        right: -7px;
        min-width: 16px;
        height: 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: 11px;
        font-weight: 900;
        line-height: 1;
        box-shadow: 0 0 0 2px #fff
		}

    .order-line-finishing-btn.has-finishing {
        border-color: #fdba74;
        background: #fff7ed;
        color: #c2410c;
    }

    .order-line-print-spec-btn {
        position: relative;
        width: 104px;
        min-height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 4px 7px;
        border: 1px solid #cfe0fb;
        border-radius: 7px;
        background: #fff;
        color: #0f4fb8;
        font-size: 0.76rem;
        font-weight: 800;
        cursor: pointer;
    }

    .order-line-print-spec-btn .line-note-indicator {
        position: absolute;
        right: -5px;
        bottom: -5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        color: #7c3aed;
        font-size: 10px;
        line-height: 1;
        pointer-events: none;
    }

    .order-line-print-spec-btn .print-spec-mini {
        display: grid;
        gap: 2px;
        min-width: 0;
        line-height: 1.05;
        text-align: center;
    }

    .order-line-print-spec-btn .print-spec-mini.text-only {
        display: inline-block;
        color: #0f4fb8;
        font-size: 12px;
        font-weight: 900;
        line-height: 1;
    }

    .order-line-print-spec-btn.finishing-only {
        min-height: 32px;
    }

    .order-line-print-spec-btn .print-spec-mini span,
    .order-line-print-spec-btn .print-spec-mini strong {
        display: block;
        max-width: 82px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .order-line-print-spec-btn .print-spec-mini span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        color: #475569;
        font-size: 10px;
        font-weight: 800;
    }

    .order-line-print-spec-btn .print-spec-mini strong {
        color: #0f4fb8;
        font-size: 11px;
        font-weight: 950;
    }

    .order-line-print-spec-btn .print-color-dots {
        display: inline-block;
        width: 22px;
        height: 8px;
        vertical-align: middle;
    }

    .order-line-print-spec-btn .print-color-dots.black {
        background: #111827;
    }

    .order-line-print-spec-btn .print-color-dots.full {
        background: linear-gradient(90deg, #00aeef 0 25%, #ec008c 25% 50%, #fff200 50% 75%, #111827 75% 100%);
        box-shadow: inset 0 0 0 1px rgba(15, 79, 184, 0.18);
    }

    .order-line-print-spec-btn.has-print-specs {
        border-color: #93c5fd;
        background: #eff6ff;
    }

    .order-lines-table .order-line-note-row[hidden] {
        display: none;
    }

    .order-lines-table .order-line-note-row td {
        padding: 0 8px 7px 150px;
        border-top: 0;
        background: #f8fbff;
    }

    .order-line-inline-meta {
	border-left: 2px solid #0f4fb8;
	    padding: 0px 0px 0px 3px;
        width: max-content;
        max-width: none;
        overflow: visible;
        color: #475569;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.25;
        white-space: nowrap;
    }

    .order-line-inline-meta[hidden] {
        display: none;
    }

    .order-print-spec-content {
        max-width: 880px;
    }

    #order-print-spec-item-title {
        display: inline-block;
        max-width: 520px;
        margin-left: 10px;
        color: #334155;
        font-size: 15px;
        font-weight: 800;
        vertical-align: baseline;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .order-print-spec-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(120px, 1fr));
        gap: 8px;
        margin-bottom: 10px;
    }

    .order-print-spec-modal.finishing-only-mode .order-print-spec-grid {
        display: none;
    }

    .order-print-spec-modal.finishing-only-mode .order-print-spec-finishing {
        margin-top: 0;
    }

    .order-print-spec-section {
        padding: 8px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
    }

    .order-print-spec-section h4 {
        margin: 0 0 6px;
        color: #0f4fb8;
        font-size: 14px;
        font-weight: 900;
    }

    .order-print-spec-options {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .order-print-spec-option {
        display: inline-flex;
        align-items: center;
        min-height: 34px;
        padding: 6px 8px;
        border: 1px solid #dbeafe;
        border-radius: 5px;
        background: #fff;
        color: #334155;
        font-weight: 800;
        cursor: pointer;
		font-size: 14px;
    }

    .order-print-spec-option input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .order-print-spec-option.active,
    .order-print-spec-option:has(input:checked) {
        border-color: #0f4fb8;
        background: #eff6ff;
        color: #0f4fb8;
    }

    .order-print-spec-finishing {
        display: grid;
        gap: 8px;
        padding: 10px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
    }

    .order-print-spec-finishing h4 {
        margin: 0;
        color: #0f4fb8;
        font-size: 14px;
        font-weight: 900;
    }

    .order-print-spec-finishing-row {
        display: grid;
        grid-template-columns: 76px max-content max-content;
        gap: 6px;
        align-items: center;
    }

    .order-print-spec-finishing-row.wide {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .order-print-spec-finishing-row.order-cut-die-row {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .order-print-spec-finishing-row.order-cut-die-row .order-finishing-segment {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .order-print-spec-finishing-row > span {
        color: #334155;
        font-size: 13px;
        font-weight: 900;
    }

    .order-print-spec-finishing .order-finishing-segment.compact label {
        min-height: 30px;
        padding: 5px 9px;
        font-size: 12px;
    }

    .order-print-spec-finishing .order-lamination-sides {
        margin-top: 0;
        padding-top: 0;
        padding-left: 8px;
        border-top: 0;
        border-left: 1px dashed #bfdbfe;
    }

    .order-print-spec-finishing-row:first-of-type {
        align-items: center;
    }

    .order-print-spec-finishing-row:first-of-type .order-finishing-segment {
        width: fit-content;
    }

    .order-print-spec-finishing .order-finishing-check-grid.compact {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .order-print-spec-finishing .order-finishing-option {
        min-height: 30px;
        padding: 5px 8px;
        font-size: 12px;
    }

    #order-print-spec-finishing-note {
        width: 100%;
        min-height: 56px;
        padding: 8px 10px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        resize: vertical;
    }

    #order-print-spec-default {
        min-height: 36px;
        padding: 8px 14px;
        border: 1px solid #cfe0fb;
        border-radius: 999px;
        background: #fff;
        color: #334155;
        font-weight: 800;
    }

    .order-line-note-summary {
        margin-top: -4px;
    }

    .order-line-note-summary label {
        display: block;
        margin-bottom: 5px;
        color: #0f4fb8;
        font-weight: 900;
    }

    .order-line-note-summary pre {
        margin: 0;
        padding: 9px 11px;
        border: 1px dashed #bfdbfe;
        border-radius: 8px;
        background: #f8fbff;
        color: #334155;
        font-family: inherit;
        font-size: 13px;
        line-height: 1.45;
        white-space: pre-wrap;
    }

    @media (max-width: 640px) {
        .order-print-spec-grid {
            grid-template-columns: 1fr;
        }

        .order-print-spec-finishing-row,
        .order-print-spec-finishing-row.wide {
            grid-template-columns: 1fr;
        }
    }

    @keyframes sticker-online-pulse {
        0% {
            box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.65);
            opacity: 1;
        }
        70% {
            box-shadow: 0 0 0 7px rgba(37, 99, 235, 0);
            opacity: 0.75;
        }
        100% {
            box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
            opacity: 1;
        }
    }

    .order-finishing-content {
        max-width: 780px;
    }

    .order-finishing-sections {
        display: grid;
        grid-template-columns: repeat(2, minmax(260px, 1fr));
        gap: 10px;
        margin-bottom: 14px;
    }

    .order-finishing-section {
        padding: 10px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
    }

    .order-finishing-section-wide {
        grid-column: 1 / -1;
    }

    .order-finishing-section h4 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 8px;
        color: #0f4fb8;
        font-size: 14px;
        font-weight: 900;
    }

    .order-finishing-segment,
    .order-finishing-check-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
    }

    .order-finishing-check-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .order-finishing-section-products {
        background: #fff;
        border-color: #bfdbfe;
    }

    .order-finishing-section-products .order-finishing-check-grid {
        grid-template-columns: repeat(4, minmax(130px, 1fr));
        gap: 8px;
    }

    .order-finishing-check-grid.compact {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .order-lamination-sides {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed #bfdbfe;
    }

    .order-finishing-segment label {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 34px;
        padding: 7px 10px;
        border: 1px solid #cfe0fb;
        border-radius: 999px;
        background: #fff;
        font-weight: 800;
        cursor: pointer;
    }

    .order-finishing-segment label:has(input:checked) {
        border-color: #0f4fb8;
        background: #eaf2ff;
        color: #0f4fb8;
    }

    .order-finishing-segment label.disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

    .order-finishing-option {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 36px;
        padding: 8px 10px;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        background: #fff;
        font-weight: 700;
        cursor: pointer;
        transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    }

    .order-finishing-option:has(input:checked) {
        border-color: #0f4fb8;
        background: #eff6ff;
        color: #0f4fb8;
    }

    .order-finishing-option input,
    .order-finishing-segment input {
        width: 16px;
        height: 16px;
        accent-color: #0f4fb8;
    }

    #order-finishing-modal.decal-material-mode .order-lamination-sides {
        display: none;
    }

    .order-finishing-note-highlight {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: fit-content;
        margin-top: 8px;
        padding: 7px 10px;
        border: 1px solid #fecaca;
        border-radius: 8px;
        background: #fff7f7;
        color: #991b1b;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
    }

    .order-finishing-note-highlight input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: #dc2626;
    }

    #order-finishing-clear {
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        background: #fff;
        color: #334155;
        font-weight: 800;
    }

    .tech-finishing-tags {
        display: inline-flex;
        width: fit-content;
        max-width: 100%;
        padding: 3px 7px;
        border-radius: 999px;
        background: #fef3c7;
        color: #92400e;
        font-size: 11px;
        font-weight: 900;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tech-card-finishing-note {
        margin-top: 5px;
        padding-top: 5px;
        border-top: 1px dashed #fed7aa;
        color: #475569;
    }

    .tech-card-finishing-note strong {
        color: #7c2d12;
        font-weight: 800;
    }

    .tech-card-finishing-note.is-highlight {
        padding: 6px 8px;
        border-top: 0;
        border: 1px solid #fecaca;
        border-radius: 6px;
        background: #fff1f2;
        color: #991b1b;
        font-weight: 800;
    }

    .tech-card-line-note {
        color: #9a3412;
        font-weight: 700;
    }

    .tech-card-note-paper {
        color: #111827;
        font-weight: 400;
    }

    .order-lines-table .order-line-code {
        min-width: 110px;
    }

    .order-lines-table .order-line-price,
    .order-lines-table .order-line-amount {
        min-width: 84px;
    }

    .order-lines-table .order-line-material {
        min-width: 190px;
    }

    .order-lines-table .order-print-qty-header {
        color: #dc2626;
    }

    .order-lines-table .order-line-print-quantity {
        color: #b91c1c;
        background: #fff1f2;
        border-color: #fecdd3;
    }

    .order-lines-table .order-line-quantity::-webkit-outer-spin-button,
    .order-lines-table .order-line-quantity::-webkit-inner-spin-button,
    .order-lines-table .order-line-print-quantity::-webkit-outer-spin-button,
    .order-lines-table .order-line-print-quantity::-webkit-inner-spin-button {
        margin: 0;
        -webkit-appearance: none;
    }

    .order-lines-table .order-line-quantity,
    .order-lines-table .order-line-print-quantity {
        appearance: textfield;
        -moz-appearance: textfield;
    }

    .order-inline-sub-label {
        display: block;
        margin-top: 8px;
        color: #64748b;
    }

    #order-display-id {
        background: #f8fafc;
        color: #475569;
    }

    .aff-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px 7px;
        border-radius: 999px;
        background: #fff7ed;
        color: #ea580c;
        border: 1px solid #fed7aa;
        font-size: 0.75rem;
        font-weight: 800;
        vertical-align: middle;
    }

    .order-aff-customer-badge {
        margin-top: 0;
    }

    .order-line-material-wrap {
        position: relative;
        width: 100%;
    }

    .order-line-material-wrap .order-line-material {
        padding-right: 28px;
    }

    .order-line-material-wrap.disabled .order-line-material,
    .order-line-material:disabled {
        background: #f1f5f9;
        color: #94a3b8;
        border-color: #e2e8f0;
        cursor: not-allowed;
    }

    .order-line-material-wrap.disabled .order-line-clear-material {
        display: none;
    }

    .order-line-clear-material {
        position: absolute;
        top: 50%;
        right: 7px;
        transform: translateY(-50%);
        z-index: 2;
        width: 18px;
        height: 18px;
        border: 0;
        border-radius: 999px;
        background: #ffffff;
        color: #ef4444;
        font-size: 18px;
        font-weight: 900;
        line-height: 16px;
        cursor: pointer;
    }

    .order-line-clear-material:hover {
        background: #fee2e2;
    }

    .material-usage-container {
        margin-bottom: 12px;
    }

    .secondary-role-filters {
        margin-top: -4px;
    }

    .order-image-note-row {
        margin-top: 2px;
    }

    .order-image-note-drop {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 54px;
        padding: 8px 10px;
        border: 1px dashed #93c5fd;
        border-radius: 8px;
        background: #f8fbff;
        color: #33537a;
        font-weight: 800;
        cursor: text;
    }

    .order-image-note-drop.dragover,
    .order-image-note-drop:focus {
        outline: none;
        border-color: var(--primary-color);
        background: #eff6ff;
        box-shadow: 0 0 0 3px rgba(15, 80, 173, 0.08);
    }

    .order-image-note-drop i {
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        border-radius: 7px;
        background: #e0edff;
        color: var(--primary-color);
        font-size: 14px;
    }

    .order-image-note-drop span {
        min-width: 0;
        color: #475569;
        font-size: 12px;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .order-image-note-drop .secondary-btn {
        min-height: 30px;
        padding: 0 10px;
        border: 1px solid #bfdbfe;
        border-radius: 7px;
        background: #fff;
        color: var(--primary-color);
        font-weight: 900;
        cursor: pointer;
    }

    .order-image-note-preview {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px;
        max-height: 170px;
        overflow-y: auto;
    }

    .order-image-note-thumb {
        position: relative;
        flex: 0 0 118px;
        width: 118px;
        min-height: 104px;
        border: 1px solid #dbeafe;
        border-radius: 7px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    }

    .order-image-note-thumb img {
        width: 100% !important;
        height: 72px !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: cover;
        display: block;
    }

    .order-image-note-caption {
        width: calc(100% - 10px);
        height: 24px;
        margin: 4px 5px 5px;
        border: 1px solid #dbeafe;
        border-radius: 5px;
        padding: 0 6px;
        font-size: 11px;
        outline: none;
    }

    .order-image-note-caption:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(74, 144, 255, 0.12);
    }

    .order-image-note-thumb button {
        position: absolute;
        top: 3px;
        right: 3px;
        width: 18px;
        height: 18px;
        border: 0;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.78);
        color: #fff;
        cursor: pointer;
        font-size: 12px;
        line-height: 18px;
    }

    @media (max-width: 900px) {
        #order-form .order-top-grid,
        #order-form .order-money-row,
        #order-form .order-vat-row,
        #order-form .order-payment-row,
        #order-form .order-flags-row,
        #order-form .order-status-row,
        #order-form .order-note-row {
            grid-template-columns: 1fr;
        }

        #order-form .order-aff-add-row {
            grid-template-columns: 1fr;
        }

        #order-form .order-customer-field,
        #order-form .order-customer-id-field,
        #order-form .order-date-field,
        #order-form .order-employee-field,
        #order-form .order-aff-buyer-field,
        #order-form .order-po-field,
        #order-form .order-id-field,
        #order-form .order-delivery-field {
            grid-column: span 1;
        }

        #order-form .order-file-row {
            grid-template-columns: 1fr;
            gap: 5px;
        }

        .delivery-time-picker,
        .delivery-quick-actions {
            flex-wrap: wrap;
        }

        .order-line-actions {
            grid-template-columns: 1fr;
        }

        #order-form .order-totals-stack,
        #order-form .order-money-row,
        #order-form .order-vat-row,
        #order-form .order-payment-row {
            justify-content: stretch;
        }

        .order-image-note-row {
            margin-top: 8px;
        }

        .order-image-note-drop {
            display: flex;
            align-items: center;
            gap: 10px;
            min-height: 48px;
            padding: 10px 12px;
            border: 1px dashed #93c5fd;
            border-radius: 8px;
            background: #f8fbff;
            color: #33537a;
            font-weight: 800;
            cursor: text;
        }

        .order-image-note-drop.dragover,
        .order-image-note-drop:focus {
            outline: none;
            border-color: var(--primary-color);
            background: #eff6ff;
        }

        .order-image-note-drop i {
            color: var(--primary-color);
            font-size: 18px;
        }

        .order-image-note-drop span {
            flex: 1 1 auto;
            min-width: 0;
            font-size: 13px;
        }

        .order-image-note-preview {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }

        .order-image-note-thumb {
            position: relative;
            width: 86px;
            height: 68px;
            border: 1px solid #dbeafe;
            border-radius: 7px;
            overflow: hidden;
            background: #fff;
        }

        .order-image-note-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .order-image-note-thumb button {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 20px;
            height: 20px;
            border: 0;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.78);
            color: #fff;
            cursor: pointer;
            font-size: 13px;
            line-height: 20px;
        }
    }

    .autocomplete-wrap {
        position: relative;
        width: 100%;
    }

    .clearable-input-wrap input {
        padding-right: 30px;
    }

    .clear-input-btn,
    .order-line-clear-code {
        position: absolute;
        right: 7px;
        top: 50%;
        transform: translateY(-50%);
        width: 22px;
        height: 22px;
        border: 0;
        border-radius: 50%;
        background: #ffffff;
        color: #ef4444;
        font-size: 1.3rem;
        line-height: 1;
        font-weight: 700;
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }

    .clearable-input-wrap.has-value .clear-input-btn,
    .order-line-code-wrap.has-value .order-line-clear-code {
        display: inline-flex;
    }

    .clear-input-btn:hover,
    .order-line-clear-code:hover {
        background: #fee2e2;
    }

    .smart-suggest-list {
        display: none;
        position: absolute;
        left: 0;
        top: calc(100% + 4px);
        width: min(430px, 100%);
        max-height: 260px;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 12px 28px rgba(15, 80, 173, 0.18);
        z-index: 10001;
        padding: 4px 0;
    }

    .smart-suggest-list.show {
        display: block;
    }

    .smart-suggest-item {
        position: relative;
        padding: 8px 10px;
        cursor: pointer;
        line-height: 1.35;
        border-bottom: 1px solid rgba(224, 234, 255, 0.65);
    }

    .smart-suggest-item .smart-suggest-content {
        min-width: 0;
        padding-right: 34px;
    }

    .smart-suggest-action {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 26px;
        height: 26px;
        border: 1px solid #bfdbfe;
        border-radius: 7px;
        background: #f8fbff;
        color: #0f50ad;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .smart-suggest-action:hover {
        background: #dbeafe;
        border-color: #60a5fa;
    }

    .smart-suggest-item:last-child {
        border-bottom: none;
    }

    .smart-suggest-item:hover,
    .smart-suggest-item.active {
        background: #edf4ff;
    }

    .smart-suggest-add {
        color: #0f50ad;
        font-weight: 700;
        background: #f8fbff;
    }

    .smart-suggest-add i {
        margin-right: 6px;
    }

    .smart-suggest-main {
        color: #1f2937;
        font-size: 0.86rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .smart-suggest-sub {
        color: #64748b;
        font-size: 0.76rem;
        margin-top: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .order-line-code-wrap {
        position: relative;
        min-width: 120px;
    }

    .order-line-code-wrap .order-line-code {
        padding-right: 28px;
    }

    .smart-suggest-filter-bar {
        display: flex;
        gap: 5px;
        padding: 5px 7px;
        border-bottom: 1px solid rgba(224, 234, 255, 0.85);
        background: #f8fbff;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .smart-suggest-filter-bar button {
        height: 24px;
        min-width: 34px;
        border: 1px solid #cfe0f8;
        border-radius: 5px;
        background: #fff;
        color: var(--primary-color);
        font-size: 0.72rem;
        font-weight: 700;
        cursor: pointer;
    }

    .smart-suggest-filter-bar button.has-results:not(.active) {
        background: #e7f2ff;
        border-color: #7fb5ff;
        color: #1458b8;
        box-shadow: inset 0 0 0 1px rgba(20, 88, 184, 0.08);
    }

    .smart-suggest-filter-bar button.no-results:not(.active) {
        opacity: 0.46;
        background: #f5f7fb;
        color: #8ca0bd;
    }

    .smart-suggest-filter-bar button.active,
    .smart-suggest-filter-bar button:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: #fff;
    }

    .order-line-code-wrap .smart-suggest-list,
    .order-line-material-wrap .smart-suggest-list {
        position: fixed;
        width: 330px;
        max-height: 245px;
        z-index: 10050;
    }

    .secondary-submit-btn {
        background: #24a86f;
        color: #fff;
        border: none;
    }

    .secondary-submit-btn:hover {
        background: #1d8f5e;
    }

    .checkbox-form-group label {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .checkbox-form-group input[type="checkbox"] {
        width: 16px;
        height: 16px;
        flex: 0 0 auto;
    }

    .inline-input {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .inline-input input {
        max-width: 90px;
    }

    .muted-line {
        color: #777;
        font-size: 0.75rem;
        margin-top: 2px;
    }

    @media (max-width: 768px) {
        .smart-suggest-list,
        .order-line-code-wrap .smart-suggest-list {
            width: min(360px, calc(100vw - 48px));
            max-height: 220px;
        }
    }

    /* Final override: keep Orders table as the scroll target. */
    #orders {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #orders .order-tab-panel.active {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #orders .orders-table-scroll {
        display: block !important;
        min-height: 160px !important;
        height: 320px;
        max-height: 320px;
        overflow: auto !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        overscroll-behavior: contain !important;
        touch-action: pan-x pan-y;
    }

    #orders .orders-table-scroll .data-table {
        min-width: max-content;
    }

    /* Mobile viewport lock and compact layout */
    @media (max-width: 768px) {
        html,
        body {
            width: 100%;
            max-width: 100%;
            overflow-x: hidden !important;
            overscroll-behavior-x: none;
        }

        body {
            position: relative;
        }

        .app-container {
            width: 100%;
            max-width: 100%;
            overflow-x: hidden !important;
        }

        .sidebar {
            width: 60px !important;
            min-width: 60px !important;
            transform: translateX(0) !important;
            overflow-x: hidden;
        }

        .sidebar.active {
            width: min(240px, 82vw) !important;
            transform: translateX(0) !important;
            box-shadow: 8px 0 24px rgba(15, 80, 173, 0.22);
        }

        .sidebar .sidebar-header {
            padding: 12px 6px;
        }

        .sidebar:not(.active) .sidebar-header h1,
        .sidebar:not(.active) .sidebar-menu span,
        .sidebar:not(.active) .sidebar-footer {
            display: none !important;
        }

        .sidebar:not(.active) .logo {
            height: 32px;
            max-width: 44px;
            object-fit: contain;
        }

        .sidebar-menu {
            padding: 10px 0;
            overflow-y: auto;
            overflow-x: hidden;
        }

        .sidebar-menu li {
            height: 54px;
            padding: 0 !important;
            justify-content: center;
            margin-bottom: 2px;
            border-left-width: 3px;
        }

        .sidebar-menu li i {
            margin-right: 0 !important;
            font-size: 1.2rem;
        }

        .main-content,
        .main-content-expanded,
        .sidebar-collapsed + .main-content {
            margin-left: 60px !important;
            width: calc(100vw - 60px) !important;
            max-width: calc(100vw - 60px) !important;
            overflow-x: hidden !important;
        }

        .content {
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            overflow-x: hidden !important;
            padding: 14px 10px 90px;
        }

        .page,
        .page.active,
        #dashboard,
        #transactions,
        #orders,
        #sale-work,
        #tech-work,
        #activity-log,
        #products,
        #materials,
        #accounts,
        #categories,
        #customers,
        #suppliers,
        #staff {
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            overflow-x: hidden !important;
            height: auto !important;
        }

        .page-header,
        .page-header-with-filter,
        #orders .orders-quick-row,
        #sale-work .page-header,
        #tech-work .page-header {
            display: flex;
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 10px;
            width: 100%;
            max-width: 100%;
            margin-bottom: 12px;
        }

        .page-title {
            font-size: clamp(1.35rem, 8vw, 2rem);
            line-height: 1.12;
            margin: 0 0 8px;
            overflow-wrap: anywhere;
        }

        .add-button,
        .refresh-button,
        #orders .orders-top-actions .add-button {
            min-height: 42px;
            padding: 10px 14px;
            border-radius: 22px;
            font-size: 0.95rem;
            white-space: normal;
        }

        .page-header-with-filter > .add-button,
        .page-header > .add-button,
        .page-header > .refresh-button,
        #orders .orders-top-actions {
            width: 100%;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
            margin-left: 0 !important;
        }

        .page-header-with-filter > .add-button,
        .page-header > .add-button,
        .page-header > .refresh-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .time-filter,
        .order-subtabs,
        #orders .order-subtabs {
            width: 100% !important;
            max-width: 100% !important;
            overflow-x: auto !important;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior-x: contain;
            justify-content: flex-start !important;
            padding-bottom: 2px;
        }

        .time-filter-option,
        .order-subtab {
            flex: 0 0 auto;
            white-space: nowrap;
        }

        .filter-container,
        .order-filter-container,
        .filter-row,
        .order-filter-container .filter-row {
            width: 100% !important;
            max-width: 100% !important;
            overflow-x: hidden !important;
        }

        .filter-row,
        .order-filter-container .filter-row {
            display: grid !important;
            grid-template-columns: 1fr !important;
            gap: 10px !important;
        }

        .filter-item,
        .order-filter-container .filter-item,
        .order-search {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            margin-left: 0 !important;
        }

        .summary-cards,
        .debt-summary-bar,
        #orders .orders-summary-compact {
            display: grid !important;
            grid-template-columns: 1fr !important;
            width: 100% !important;
            max-width: 100% !important;
            gap: 12px !important;
            padding: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            overflow-x: hidden !important;
        }

        .card,
        .card-summary,
        #orders .orders-summary-compact .card-summary {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            padding: 14px;
            border-radius: 16px;
            transform: none !important;
        }

        .card-icon,
        .card-summary .card-icon,
        #orders .orders-summary-compact .card-summary .card-icon {
            width: 46px;
            height: 46px;
            margin-right: 12px;
        }

        .card-info,
        .card-summary .card-info {
            min-width: 0;
        }

        .card-info h3,
        .card-summary .card-info h3 {
            font-size: 0.95rem;
            line-height: 1.25;
        }

        .card-info p,
        .card-summary .card-info p,
        #orders .orders-summary-compact .card-summary .card-info p {
            font-size: 1.08rem;
            line-height: 1.25;
            overflow-wrap: anywhere;
        }

        .charts-container {
            grid-template-columns: 1fr !important;
            width: 100% !important;
            max-width: 100% !important;
            overflow-x: hidden !important;
        }

        .chart-card {
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            overflow: hidden;
            padding: 14px 10px;
        }

        .chart-card canvas {
            max-width: 100% !important;
        }

        #orders .order-workflow-bar,
        #tech-work .tech-workflow-bar,
        .role-quick-filters,
        .secondary-role-filters {
            display: grid !important;
            grid-template-columns: repeat(9, minmax(110px, 1fr)) !important;
            width: 100% !important;
            max-width: 100% !important;
            gap: 8px !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            padding: 8px !important;
            overflow-x: auto !important;
        }

        #orders .order-workflow-step,
        #tech-work .order-workflow-step,
        .role-quick-btn {
            min-width: 0 !important;
            width: 100% !important;
            min-height: 44px;
            padding: 8px 9px;
            transform: none !important;
        }

        #orders .workflow-label,
        #tech-work .workflow-label,
        .role-quick-btn {
            white-space: nowrap;
            overflow-wrap: normal;
            line-height: 1.2;
        }

        #orders .order-workflow-step::after {
            display: none !important;
        }

        .table-container,
        #orders .orders-table-scroll,
        .order-lines-container,
        .material-usage-container {
            width: 100% !important;
            max-width: 100% !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            overflow-x: auto !important;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
        }

        #orders .orders-table-scroll {
            height: auto !important;
            max-height: 58vh !important;
            min-height: 180px !important;
        }

        .data-table,
        #transactions-table,
        .orders-table,
        .orders-debt-table,
        .products-table,
        .payment-history-table {
            width: max-content !important;
            min-width: 720px;
        }

        #sale-work .orders-table,
        #tech-work .orders-table {
            min-width: 760px;
        }

        .recent-transactions,
        #recent-transactions,
        .transaction-list {
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
        }

        .transaction-item,
        .recent-transaction-item {
            max-width: 100%;
            min-width: 0;
        }
    }

    @media (max-width: 420px) {
        .content {
            padding-left: 8px;
            padding-right: 8px;
        }

        .page-title {
            font-size: clamp(1.25rem, 7vw, 1.65rem);
        }

        .page-header-with-filter > .add-button,
        .page-header > .add-button,
        .page-header > .refresh-button,
        #orders .orders-top-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
        }

        #orders .order-workflow-bar,
        #tech-work .tech-workflow-bar,
        .role-quick-filters,
        .secondary-role-filters {
            grid-template-columns: repeat(9, minmax(110px, 1fr)) !important;
        }
    }

    .top-notification-center {
        position: fixed;
        top: 13px;
        right: 14px;
        z-index: 1200;
    }

    .page-header,
    .page-header-with-filter {
        padding-right: 64px;
    }

    .requires-login .top-notification-center {
        display: none;
    }

    .notification-bell-button {
        position: relative;
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 50%;
        background: #ffffff;
        color: var(--primary-color);
        box-shadow: 0 8px 24px rgba(15, 80, 173, 0.18);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }

    .notification-bell-button:hover {
        background: #eff6ff;
    }

    .notification-bell-button.has-unread i {
        transform-origin: 50% 0;
        animation: notificationBellSoftRing 1.8s ease-in-out infinite;
    }

    .notification-bell-button.bell-ring-once i {
        animation: notificationBellRingOnce 0.7s ease-in-out 1;
    }

    .notification-unread-badge {
        position: absolute;
        top: -5px;
        right: -4px;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 10px;
        background: #dc2626;
        color: #fff;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 20px;
        text-align: center;
        box-shadow: 0 0 0 2px #fff;
    }

    .notification-dropdown {
        display: none;
        position: absolute;
        top: 50px;
        right: 0;
        width: min(380px, calc(100vw - 28px));
        max-height: 520px;
        background: #ffffff;
        border: 1px solid #dbeafe;
        border-radius: 8px;
        box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
        overflow: hidden;
    }

    .notification-dropdown.show {
        display: block;
    }

    .notification-dropdown-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        border-bottom: 1px solid #e2e8f0;
        color: #0f172a;
    }

    .notification-dropdown-header button {
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 6px;
        background: #eff6ff;
        color: var(--primary-color);
        cursor: pointer;
    }

    .notification-dropdown-list {
        max-height: 460px;
        overflow-y: auto;
    }

    .notification-empty {
        padding: 18px;
        color: #64748b;
        text-align: center;
        font-size: 0.9rem;
    }

    .notification-mini-item {
        width: 100%;
        border: 0;
        border-bottom: 1px solid #edf2f7;
        background: #fff;
        display: grid;
        grid-template-columns: 10px 1fr;
        gap: 10px;
        padding: 12px 14px;
        text-align: left;
        cursor: pointer;
    }

    .notification-mini-item:hover,
    .notification-mini-item.unread {
        background: #eff6ff;
    }

    .notification-mini-dot {
        width: 8px;
        height: 8px;
        margin-top: 5px;
        border-radius: 50%;
        background: #0284c7;
    }

    .notification-mini-dot.success {
        background: #16a34a;
    }

    .notification-mini-dot.warning {
        background: #f59e0b;
    }

    .notification-mini-dot.error {
        background: #dc2626;
    }

    .notification-mini-content {
        min-width: 0;
        display: grid;
        gap: 3px;
        color: #0f172a;
        font-size: 0.86rem;
        line-height: 1.35;
    }

    .notification-mini-content strong {
        font-size: 0.92rem;
    }

    .notification-mini-content span,
    .notification-mini-body {
        color: #64748b;
        font-weight: 400;
    }

    .notification-view-all-btn {
        width: 100%;
        border: 0;
        background: #f8fbff;
        color: var(--primary-color);
        color: var(--primary-color);
        font-weight: 700;
        padding: 12px 14px;
        cursor: pointer;
        border-top: 1px solid #e2e8f0;
        text-align: center;
    }

    .notification-view-all-btn:hover {
        background: #eff6ff;
    }

    @keyframes notificationBellSoftRing {
        0%, 78%, 100% { transform: rotate(0deg); }
        82% { transform: rotate(12deg); }
        86% { transform: rotate(-10deg); }
        90% { transform: rotate(8deg); }
        94% { transform: rotate(-5deg); }
    }

    @keyframes notificationBellRingOnce {
        0% { transform: rotate(0deg) scale(1); }
        20% { transform: rotate(16deg) scale(1.05); }
        40% { transform: rotate(-14deg) scale(1.05); }
        60% { transform: rotate(10deg) scale(1.03); }
        80% { transform: rotate(-6deg) scale(1.02); }
        100% { transform: rotate(0deg) scale(1); }
    }

    .notification-unread-row {
        background: #eff6ff;
        font-weight: 600;
    }

    .notification-body,
    .notification-entity-id {
        margin-top: 4px;
        color: #64748b;
        font-size: 0.85rem;
        font-weight: 400;
        line-height: 1.35;
    }

    .notification-severity,
    .notification-status {
        display: inline-flex;
        align-items: center;
        min-height: 24px;
        padding: 3px 8px;
        border-radius: 999px;
        font-size: 0.78rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .notification-severity.info {
        background: #e0f2fe;
        color: #0369a1;
    }

    .notification-severity.success {
        background: #dcfce7;
        color: #15803d;
    }

    .notification-severity.warning {
        background: #fef3c7;
        color: #92400e;
    }

    .notification-severity.error {
        background: #fee2e2;
        color: #b91c1c;
    }

    .notification-status.unread {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .notification-status.read {
        background: #f1f5f9;
        color: #475569;
    }

    /* Login modal must not inherit the generic .modal-content centering offsets. */
    html body.requires-login #login-modal.modal {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        display: grid !important;
        place-items: center !important;
        padding: 24px !important;
        overflow: hidden !important;
    }

    html body:not(.requires-login) #login-modal.modal {
        display: none !important;
    }

    html body #login-modal.modal > .modal-content.login-modal-content {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        width: min(380px, calc(100vw - 48px)) !important;
        max-width: 380px !important;
        max-height: calc(100vh - 72px) !important;
    }
    body.is-orders-page .content {
        padding: 8px 10px;
    }

    body.is-orders-page #orders {
        height: calc(100dvh - 16px) !important;
        min-height: 0;
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        overflow: hidden;
    }

    body.is-orders-page #orders .order-subtabs {
        min-height: 60px;
        margin: 0;
        padding: 0 2px;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    body.is-orders-page #orders .order-subtab {
        padding: 8px 14px;
    }

    body.is-orders-page #orders .order-subtab-group {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    body.is-orders-page #orders-list-panel.order-tab-panel.active {
        flex: 1 1 auto;
        min-height: 0;
        display: flex !important;
        flex-direction: column;
        gap: 6px;
    }

    body.is-orders-page #orders .orders-toolbar-row {
        flex: 0 0 auto;
        margin: 0;
        min-height: 40px;
        gap: 8px;
    }

    body.is-orders-page #orders .orders-top-actions {
        margin-left: auto;
        gap: 8px;
        flex: 0 0 auto;
    margin-right: 58px;
        width: auto;
    }

    body.is-orders-page #orders .orders-top-actions .add-button {
        min-height: 38px;
        height: 38px;
        padding: 0 16px;
        border-radius: 18px;
    }

    body.is-orders-page #orders .orders-summary-compact {
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        overflow-x: visible !important;
        overflow-y: hidden !important;
        gap: 8px;
        margin: 0;
        padding: 4px 2px 6px;
        background: transparent;
        box-shadow: none;
        scrollbar-width: thin;
        flex: 0 0 auto;
    }

    body.is-orders-page #orders .orders-summary-compact .card-summary {
        flex: none;
        min-width: 0;
        min-height: 52px;
        padding: 8px 12px;
        border-radius: 12px;
    }

    body.is-orders-page #orders .orders-summary-compact .card-summary .card-icon {
        width: 32px;
        height: 32px;
        margin-right: 8px;
    }

    body.is-orders-page #orders .orders-summary-compact .card-summary .card-info h3 {
        font-size: 0.76rem;
        margin-bottom: 1px;
    }

    body.is-orders-page #orders .orders-summary-compact .card-summary .card-info p {
        font-size: 0.92rem;
        line-height: 1.15;
    }

    body.is-orders-page #orders .order-workflow-bar {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        overflow-x: visible !important;
        overflow-y: hidden !important;
        gap: 8px;
        margin: 0;
        padding: 8px;
        border-radius: 12px;
        scrollbar-width: thin;
        flex: 0 0 auto;
    }

    body.is-orders-page #orders .order-workflow-step {
        flex: none;
        width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 6px 10px;
    }

    body.is-orders-page #orders .order-workflow-step::after {
        display: none;
    }

    body.is-orders-page #orders .workflow-count {
        min-width: 42px;
        padding: 2px 7px;
    }

    body.is-orders-page #orders .order-filter-container {
        margin: 0;
        padding: 8px;
        border-radius: 12px;
        flex: 0 0 auto;
    }

    body.is-orders-page #orders .order-filter-container .filter-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: flex-end;
        gap: 8px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    body.is-orders-page #orders .order-filter-container .filter-item {
        flex: 0 0 146px;
        min-width: 146px;
    }

    body.is-orders-page #orders .order-filter-container .filter-item.order-period-filter {
        flex-basis: 130px;
        min-width: 130px;
    }

    body.is-orders-page #orders .order-filter-container .filter-item input,
    body.is-orders-page #orders .order-filter-container .filter-item select {
        height: 36px;
    }

    body.is-orders-page #orders .order-search {
        flex: 0 0 430px;
        min-width: 280px;
        max-width: none;
        margin-left: auto;
    }

    body.is-orders-page #orders .order-search input {
        height: 36px;
    }

    body.is-orders-page #orders .order-column-menu-wrap {
        flex: 0 0 auto;
    }

    body.is-orders-page #orders .order-column-menu-btn {
        height: 36px;
        min-height: 36px;
        padding: 0 18px;
        border-radius: 18px;
    }

    body.is-orders-page #orders .orders-table-scroll {
        flex: 1 1 auto;
        min-height: 260px;
        height: auto !important;
        max-height: none !important;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.72);
    }

    body.is-transactions-page .content {
        padding: 8px 10px;
    }

    body.is-transactions-page #transactions {
        height: calc(100dvh - 16px) !important;
        min-height: 0;
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        overflow: hidden !important;
    }

    body.is-transactions-page #transactions .page-header-with-filter,
    body.is-transactions-page #transactions .summary-container,
    body.is-transactions-page #transactions .transaction-filter-container,
    body.is-transactions-page #transactions .pagination-container {
        flex: 0 0 auto;
    }

    body.is-transactions-page #transactions .summary-container {
        margin: 0;
    }

    body.is-transactions-page #transactions .transaction-filter-container {
        margin: 0;
        padding: 8px;
        border-radius: 12px;
    }

    body.is-transactions-page #transactions .transaction-filter-container .filter-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: flex-end;
        gap: 8px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    body.is-transactions-page #transactions .transaction-filter-container .filter-item {
        flex: 0 0 146px;
        min-width: 146px;
    }

    body.is-transactions-page #transactions .transaction-filter-container .filter-item.order-period-filter {
        flex-basis: 130px;
        min-width: 130px;
    }

    body.is-transactions-page #transactions .transaction-search {
        flex: 0 0 430px;
        min-width: 280px;
        max-width: none;
        margin-left: auto;
    }

    body.is-transactions-page #transactions .transaction-table-scroll {
        flex: 1 1 auto;
        min-height: 240px;
        height: auto !important;
        max-height: none !important;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.72);
        overflow: auto !important;
    }

    body.is-transactions-page #transactions .transaction-table-scroll .data-table thead th {
        position: sticky;
        top: 0;
        z-index: 16;
        background: #f8fbff;
    }

    body.is-transactions-page #transactions .pagination-container {
        margin-top: 0;
    }

    body.is-orders-page #orders .orders-table-scroll .data-table thead th {
        position: sticky;
        top: 0;
        z-index: 35;
        background: #f8fbff;
    }

    body.is-orders-page #orders .pagination-container {
        flex: 0 0 auto;
        margin-top: 4px;
        padding: 6px 0 0;
    }

    @media (max-width: 1280px) {
        body.is-orders-page .content {
            padding: 4px 6px;
        }

        body.is-orders-page #orders {
            height: calc(100dvh - 8px);
        }

        body.is-orders-page #orders .orders-toolbar-row {
            justify-content: flex-end;
        }

        body.is-orders-page #orders .orders-top-actions {
            width: auto;
            justify-content: flex-end;
        }

        body.is-orders-page #orders .orders-summary-compact {
            grid-template-columns: repeat(6, minmax(0, 1fr));
        }

        body.is-orders-page #orders .order-workflow-bar {
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        }

        body.is-orders-page #orders .order-filter-container .filter-item {
            flex-basis: 138px;
            min-width: 138px;
        }

        body.is-orders-page #orders .order-search {
            flex-basis: 340px;
            margin-left: 0;
        }
    }

    @media (max-width: 900px) {
        body.is-orders-page #orders {
            height: calc(100dvh - 8px) !important;
            overflow: hidden !important;
        }

        body.is-orders-page #orders-list-panel.order-tab-panel.active {
            min-height: 0 !important;
        }

        body.is-orders-page #orders .orders-top-actions .add-button {
            padding: 0 12px;
        }

        body.is-orders-page #orders .orders-summary-compact {
            display: flex !important;
            flex-wrap: nowrap !important;
            overflow-x: auto !important;
            overflow-y: hidden !important;
            width: 100% !important;
            max-width: 100% !important;
            padding: 4px 2px 6px !important;
        }

        body.is-orders-page #orders .orders-summary-compact .card-summary {
            flex: 0 0 188px !important;
            width: auto !important;
            max-width: none !important;
            min-height: 50px;
            padding: 8px 10px;
        }

        body.is-orders-page #orders .order-workflow-bar {
            display: flex !important;
            grid-template-columns: none !important;
            flex-wrap: nowrap !important;
            overflow-x: auto !important;
            overflow-y: hidden !important;
        }

        body.is-orders-page #orders .order-workflow-step {
            flex: 0 0 148px !important;
            width: auto !important;
        }

        body.is-orders-page #orders .order-filter-container .filter-row {
            display: flex !important;
            grid-template-columns: none !important;
            flex-wrap: nowrap !important;
            overflow-x: auto !important;
            overflow-y: hidden !important;
        }

        body.is-orders-page #orders .order-filter-container .filter-item,
        body.is-orders-page #orders .order-search {
            width: auto !important;
            max-width: none !important;
            margin-left: 0 !important;
        }

        body.is-orders-page #orders .order-search {
            flex: 0 0 300px !important;
        }

        body.is-orders-page #orders .orders-summary-compact,
        body.is-orders-page #orders .order-workflow-bar,
        body.is-orders-page #orders .order-filter-container {
            margin-left: 0;
            margin-right: 0;
        }

        body.is-orders-page #orders .orders-table-scroll {
            flex: 1 1 auto !important;
            min-height: 260px !important;
            max-height: none !important;
        }
    }

    #orders .orders-table tbody tr.selected td,
    #orders .orders-table tbody tr.is-selected td,
    #orders .orders-table tbody tr.active td,
    #orders .orders-table tbody tr.is-active td,
    #orders .orders-table tbody tr[aria-selected="true"] td,
    #orders .orders-debt-table tbody tr.selected td,
    #orders .orders-debt-table tbody tr.is-selected td,
    #orders .orders-debt-table tbody tr.active td,
    #orders .orders-debt-table tbody tr.is-active td,
    #orders .orders-debt-table tbody tr[aria-selected="true"] td,
    #orders .collect-order-table tbody tr.selected td,
    #orders .collect-order-table tbody tr.is-selected td,
    #orders .collect-order-table tbody tr.active td,
    #orders .collect-order-table tbody tr.is-active td,
    #orders .collect-order-table tbody tr[aria-selected="true"] td,
    .orders-table tbody tr.selected td,
    .orders-table tbody tr.is-selected td,
    .orders-table tbody tr.active td,
    .orders-table tbody tr.is-active td,
    .orders-table tbody tr[aria-selected="true"] td,
    .orders-debt-table tbody tr.selected td,
    .orders-debt-table tbody tr.is-selected td,
    .orders-debt-table tbody tr.active td,
    .orders-debt-table tbody tr.is-active td,
    .orders-debt-table tbody tr[aria-selected="true"] td,
    .collect-order-table tbody tr.selected td,
    .collect-order-table tbody tr.is-selected td,
    .collect-order-table tbody tr.active td,
    .collect-order-table tbody tr.is-active td,
    .collect-order-table tbody tr[aria-selected="true"] td {
        background: #fff7dd !important;
    }

    /* Mobile hotfix: keep tabs, action buttons and dense data separated. */
    @media (max-width: 768px) {
        body.is-orders-page .content,
        body.is-transactions-page .content {
            padding: 12px 10px calc(96px + env(safe-area-inset-bottom, 0px)) !important;
        }

        body.is-orders-page #orders,
        body.is-transactions-page #transactions {
            height: auto !important;
            min-height: 0 !important;
            overflow: visible !important;
            gap: 10px !important;
        }

        body.is-orders-page #orders .order-subtabs {
            min-height: 0 !important;
            height: auto !important;
            display: flex !important;
            flex-direction: column !important;
            align-items: stretch !important;
            justify-content: flex-start !important;
            gap: 8px !important;
            margin: 0 0 10px !important;
            padding: 0 0 8px !important;
            overflow: visible !important;
            border-bottom: 1px solid #dbeafe;
        }

        body.is-orders-page #orders .order-subtab-group {
            display: flex !important;
            width: 100% !important;
            min-width: 0 !important;
            gap: 6px !important;
            overflow-x: auto !important;
            overflow-y: hidden !important;
            scrollbar-width: none;
        }

        body.is-orders-page #orders .order-subtab-group::-webkit-scrollbar {
            display: none;
        }

        body.is-orders-page #orders .order-subtab {
            flex: 0 0 auto !important;
            min-width: 86px !important;
            padding: 8px 10px !important;
            font-size: 0.84rem !important;
            text-align: center !important;
            white-space: nowrap !important;
        }

        body.is-orders-page #orders .orders-top-actions,
        body.is-transactions-page #transactions .page-header > div,
        #pending-orders .pending-top-actions,
        #activity-log .page-header > div {
            display: grid !important;
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            width: 100% !important;
            max-width: 100% !important;
            gap: 8px !important;
            margin: 0 !important;
            padding-right: 48px !important;
            justify-content: stretch !important;
        }

        body.is-orders-page #orders .orders-top-actions .add-button,
        body.is-transactions-page #transactions .page-header .add-button,
        #pending-orders .pending-top-actions .add-button,
        #activity-log .page-header .add-button {
            min-width: 0 !important;
            width: 100% !important;
            height: auto !important;
            min-height: 38px !important;
            padding: 8px 8px !important;
            border-radius: 16px !important;
            font-size: 0.82rem !important;
            line-height: 1.12 !important;
            white-space: normal !important;
        }

        #materials .header-actions {
            display: grid !important;
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            width: min(100%, 320px) !important;
            max-width: 100% !important;
            gap: 8px !important;
            margin: 0 !important;
            padding-right: 48px !important;
            justify-content: end !important;
        }

        #materials .header-actions .add-button {
            min-width: 0 !important;
            width: 100% !important;
            height: 40px !important;
            padding: 8px 10px !important;
            border-radius: 16px !important;
            font-size: 0.82rem !important;
            line-height: 1.12 !important;
            white-space: nowrap !important;
            justify-content: center !important;
        }

        #quick-aff-order-btn,
        #add-order-btn,
        #add-pending-order-btn,
        #add-transaction-btn {
            grid-column: auto !important;
        }

        body.is-orders-page #orders .orders-summary-compact,
        #pending-orders .pending-summary-bar,
        #materials-summary {
            display: grid !important;
            grid-template-columns: 1fr !important;
            overflow: visible !important;
            gap: 9px !important;
            padding: 0 !important;
            margin: 0 0 12px !important;
        }

        body.is-orders-page #orders .orders-summary-compact .card-summary,
        #pending-orders .pending-summary-bar .card-summary,
        #materials-summary .summary-item,
        #materials-summary .card-summary {
            flex: none !important;
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            min-height: 78px !important;
            padding: 12px 14px !important;
        }

        body.is-orders-page #orders .order-filter-container .filter-row,
        body.is-transactions-page #transactions .transaction-filter-container .filter-row,
        #activity-log .filter-row,
        #pending-orders .pending-filter-container .filter-row {
            display: grid !important;
            grid-template-columns: 1fr !important;
            overflow: visible !important;
            gap: 9px !important;
            padding-bottom: 0 !important;
        }

        body.is-orders-page #orders .order-filter-container .filter-item,
        body.is-orders-page #orders .order-search,
        body.is-transactions-page #transactions .transaction-filter-container .filter-item,
        body.is-transactions-page #transactions .transaction-search,
        #activity-log .filter-item,
        #pending-orders .pending-filter-container .filter-item {
            flex: none !important;
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            margin: 0 !important;
        }

        body.is-orders-page #orders .order-filter-container {
            padding: 12px !important;
            margin: 0 0 12px !important;
        }

        body.is-orders-page #orders .orders-table-scroll,
        body.is-transactions-page #transactions .transaction-table-scroll,
        #activity-log .table-container,
        #products .table-container,
        #materials .table-container,
        #categories .table-container,
        #customers .table-container,
        #staff .table-container {
            height: auto !important;
            min-height: 220px !important;
            max-height: none !important;
            overflow-x: auto !important;
            overflow-y: auto !important;
        }

        #tech-work .tech-sticky-top {
            overflow: visible !important;
        }

        #tech-work .tech-filter-actions {
            padding-right: 0 !important;
        }

        #tech-work-board {
            width: 100% !important;
            max-width: 100% !important;
            overflow-x: auto !important;
            overflow-y: visible !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
        }

        #tech-work-board .tech-board-column {
            flex: 0 0 calc(100vw - var(--mobile-sidebar-width, 56px) - 32px) !important;
            min-width: calc(100vw - var(--mobile-sidebar-width, 56px) - 32px) !important;
            max-width: calc(100vw - var(--mobile-sidebar-width, 56px) - 32px) !important;
        }

        #tech-work-board .tech-work-card {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            overflow: hidden !important;
        }

        .top-notification-center {
            top: 16px !important;
            right: 14px !important;
        }

        .notification-bell-button {
            width: 38px !important;
            height: 38px !important;
            min-width: 38px !important;
        }
    }
