/* =========================================================
   GLOBAL
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", sans-serif;
    background: #eef2f7;
    color: #334155;
}

body {
    overflow-x: hidden;
}

.container-fluid {
    padding: 0;
}

.row {
    margin: 0;
}


/* =========================================================
   HEADER
========================================================= */

.custom-header {
    height: 80px;
    padding: 0 20px;
    background: #1e293b;
    border: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
}

.logo {
    height: 58px;
    max-width: 180px;
    object-fit: contain;
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 8px;
}

.header-link {
    color: #ffffff;
    text-decoration: none;
    margin-left: 25px;
    transition: 0.25s ease;
}

.header-link:hover {
    color: #38bdf8;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    background: #1e293b;
    min-height: calc(100vh - 80px);
    padding: 0;
    margin: 0;
}

.sidebar ul {
    padding: 12px 8px;
    margin: 0;
}

.sidebar li {
    list-style: none;
    margin-bottom: 4px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    color: #cbd5e1;
    padding: 11px 14px;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-size: 14px;
}

.sidebar .nav-link i {
    width: 22px;
    margin-right: 8px;
    font-size: 17px;
}

.sidebar .nav-link:hover {
    background: #2563eb;
    color: #ffffff;
    transform: translateX(2px);
}

.active-menu {
    background: #2563eb !important;
    color: #ffffff !important;
}


/* =========================================================
   MAIN CONTENT
========================================================= */

.content {
    padding: 30px;
    min-width: 0;
}


/* =========================================================
   COMMON CARD
========================================================= */

.category-card,
.buyer-card,
.item-card,
.form-card {
    width: 100%;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
    border: 1px solid #e5e7eb;
}


/* =========================================================
   COMMON PAGE HEADERS
========================================================= */

.category-header,
.buyer-header,
.item-header,
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.category-header,
.buyer-header,
.item-header {
    margin-bottom: 20px;
}

.category-header h2,
.buyer-header h2,
.item-header h2,
.form-header h2 {
    margin: 0;
    color: #1e293b;
    font-size: 27px;
    font-weight: 700;
}

.page-subtitle,
.category-header .page-subtitle,
.buyer-header .page-subtitle,
.item-header .page-subtitle,
.form-header .page-subtitle {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 14px;
}


/* =========================================================
   ADD BUTTON
========================================================= */

.category-header .btn-add,
.buyer-header .btn-add,
.item-header .btn-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 11px 20px;

    background: #2563eb;
    color: #ffffff;

    text-decoration: none;
    border: none;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    transition: all 0.25s ease;
}

.category-header .btn-add:hover,
.buyer-header .btn-add:hover,
.item-header .btn-add:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.category-header .btn-add i,
.buyer-header .btn-add i,
.item-header .btn-add i {
    font-size: 16px;
}


/* =========================================================
   CATEGORY PAGE
========================================================= */

.category-card {
    padding: 18px;
}

#categoryTable_wrapper {
    width: 100%;
    max-width: 100%;
}
.buyer-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 27px;
    font-weight: 700;
    color: #162d4d;
}

.buyer-header h2 i {
    font-size: 25px;
}

/* =========================================================
   BUYER PAGE
========================================================= */

.buyer-table-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 28px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

#buyerTable_wrapper {
    width: 100%;
    overflow: hidden;
}

/* =========================================================
   BUYER ADD BUTTON
   SAME COLOR AS TABLE HEADER
========================================================= */

.buyer-header .btn-add {
    display: inline-flex !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 8px !important;

    height: 44px !important;

    padding: 0 20px !important;

    background: #00516b !important;

    color: #ffffff !important;

    border: none !important;

    border-radius: 7px !important;

    text-decoration: none !important;

    font-size: 14px !important;

    font-weight: 600 !important;

    line-height: 1 !important;

    white-space: nowrap !important;

    cursor: pointer !important;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.20) !important;

    transition: all 0.25s ease !important;
}


/* PLUS ICON */

.buyer-header .btn-add i {
    color: #ffffff !important;

    font-size: 17px !important;

    line-height: 1 !important;
}


/* HOVER */

.buyer-header .btn-add:hover {
    background: #003f52 !important;

    color: #ffffff !important;

    transform: translateY(-1px) !important;

    box-shadow: 0 5px 12px rgba(0, 81, 107, 0.28) !important;
}


/* ACTIVE */

.buyer-header .btn-add:active {
    transform: translateY(0) !important;
}


/* =========================================================
   ITEM REGISTRATION PAGE
========================================================= */

.item-card {
    padding: 18px;
}

#itemTable_wrapper {
    width: 100%;
    overflow: hidden;
}
/* =========================================================
   ITEM LIST HEADER - OUTSIDE WHITE BOX
========================================================= */

.item-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

/* Add Item button same color as table header */

.item-header .btn-add {
    background: #00516b !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 7px;
    padding: 11px 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.20);
}

.item-header .btn-add:hover {
    background: #003f52 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.item-header .btn-add i {
    font-size: 17px;
}
/* =========================================================
   ITEM ADD BUTTON
   SAME COLOR AS TABLE HEADER
========================================================= */

.item-header .btn-add {
    display: inline-flex !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 8px !important;

    height: 44px !important;

    padding: 0 20px !important;

    background: #00516b !important;

    color: #ffffff !important;

    border: none !important;

    border-radius: 7px !important;

    text-decoration: none !important;

    font-size: 14px !important;

    font-weight: 600 !important;

    line-height: 1 !important;

    white-space: nowrap !important;

    cursor: pointer !important;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.20) !important;

    transition: all 0.25s ease !important;
}


/* PLUS ICON */

.item-header .btn-add i {
    color: #ffffff !important;

    font-size: 17px !important;

    line-height: 1 !important;
}


/* HOVER */

.item-header .btn-add:hover {
    background: #003f52 !important;

    color: #ffffff !important;

    transform: translateY(-1px) !important;

    box-shadow: 0 5px 12px rgba(0, 81, 107, 0.28) !important;
}


/* ACTIVE */

.item-header .btn-add:active {
    transform: translateY(0) !important;
}



/* =========================================================
   DATATABLE TOP CONTROLS - DATATABLES 2
========================================================= */

#categoryTable_wrapper .dt-layout-row,
#buyerTable_wrapper .dt-layout-row,
#itemTable_wrapper .dt-layout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 14px;
}


/* =========================================================
   DATATABLE LENGTH
========================================================= */

#categoryTable_wrapper .dt-length,
#buyerTable_wrapper .dt-length,
#itemTable_wrapper .dt-length,
#categoryTable_wrapper .dataTables_length,
#buyerTable_wrapper .dataTables_length,
#itemTable_wrapper .dataTables_length {
    color: #475569;
    font-size: 14px;
    white-space: nowrap;
}

#categoryTable_wrapper .dt-length select,
#buyerTable_wrapper .dt-length select,
#itemTable_wrapper .dt-length select,
#categoryTable_wrapper .dataTables_length select,
#buyerTable_wrapper .dataTables_length select,
#itemTable_wrapper .dataTables_length select {
    height: 36px;
    padding: 5px 28px 5px 9px;
    margin: 0 5px;

    border: 1px solid #cbd5e1;
    border-radius: 6px;

    background: #ffffff;
    color: #334155;

    outline: none;
}


/* =========================================================
   DATATABLE SEARCH
========================================================= */

#categoryTable_wrapper .dt-search,
#buyerTable_wrapper .dt-search,
#itemTable_wrapper .dt-search,
#categoryTable_wrapper .dataTables_filter,
#buyerTable_wrapper .dataTables_filter,
#itemTable_wrapper .dataTables_filter {
    color: #475569;
    font-size: 14px;
}

#categoryTable_wrapper .dt-search input,
#buyerTable_wrapper .dt-search input,
#itemTable_wrapper .dt-search input,
#categoryTable_wrapper .dataTables_filter input,
#buyerTable_wrapper .dataTables_filter input,
#itemTable_wrapper .dataTables_filter input {
    width: 220px;
    height: 36px;

    padding: 6px 11px;
    margin-left: 7px;

    border: 1px solid #cbd5e1;
    border-radius: 6px;

    background: #ffffff;
    color: #334155;

    outline: none;
    transition: 0.2s ease;
}

#categoryTable_wrapper .dt-search input:focus,
#buyerTable_wrapper .dt-search input:focus,
#itemTable_wrapper .dt-search input:focus,
#categoryTable_wrapper .dataTables_filter input:focus,
#buyerTable_wrapper .dataTables_filter input:focus,
#itemTable_wrapper .dataTables_filter input:focus {
    border-color: #00516b;
    box-shadow: 0 0 0 3px rgba(0, 81, 107, 0.09);
}


/* =========================================================
   ALL TABLES
========================================================= */

.category-table,
.buyer-table,
.item-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    table-layout: auto !important;
}

.category-table thead th,
.buyer-table thead th,
.item-table thead th {
    height: 48px;

    padding: 11px 8px !important;

    background: #00516b !important;
    color: #ffffff !important;

    text-align: center !important;
    vertical-align: middle;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;

    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.category-table tbody td,
.buyer-table tbody td,
.item-table tbody td {
    min-height: 45px;

    padding: 10px 8px !important;

    color: #374151;

    text-align: center;
    vertical-align: middle;

    font-size: 13px;

    white-space: nowrap;

    border: none !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.category-table tbody tr:nth-child(even),
.buyer-table tbody tr:nth-child(even),
.item-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.category-table tbody tr:hover,
.buyer-table tbody tr:hover,
.item-table tbody tr:hover {
    background: #eaf4f8 !important;
}


/* =========================================================
   CATEGORY TABLE COLUMNS
========================================================= */

.category-table th:first-child,
.category-table td:first-child {
    min-width: 180px;
    text-align: left !important;
    padding-left: 12px !important;
}

.category-table th.action-column,
.category-table td.action-column {
    width: 75px !important;
    min-width: 75px !important;
    max-width: 75px !important;
}


/* =========================================================
   BUYER TABLE
========================================================= */

.buyer-table {
    min-width: 1100px !important;
}

.buyer-table th:nth-child(1),
.buyer-table td:nth-child(1) {
    min-width: 180px;
    text-align: left;
    padding-left: 12px !important;
}

.buyer-table th:nth-child(2),
.buyer-table td:nth-child(2) {
    min-width: 130px;
}

.buyer-table th:nth-child(3),
.buyer-table td:nth-child(3) {
    min-width: 190px;
}

.buyer-table th:nth-child(4),
.buyer-table td:nth-child(4) {
    min-width: 110px;
}

.buyer-table th:nth-child(5),
.buyer-table td:nth-child(5) {
    min-width: 125px;
}

.buyer-table th:nth-child(6),
.buyer-table td:nth-child(6) {
    min-width: 145px;
}

.buyer-table th:nth-child(7),
.buyer-table td:nth-child(7) {
    min-width: 130px;
}

.buyer-table th:nth-child(8),
.buyer-table td:nth-child(8) {
    min-width: 120px;
}

.buyer-table td.owner-name {
    font-weight: 600;
    color: #1e293b;
}

.buyer-table th.action-column,
.buyer-table td.action-column {
    width: 75px !important;
    min-width: 75px !important;
    max-width: 75px !important;
}


/* =========================================================
   ITEM TABLE
========================================================= */

.item-table {
    min-width: 1050px !important;
}

/* Date */
.item-table th:nth-child(1),
.item-table td:nth-child(1) {
    min-width: 100px;
}

/* Manual Item Code */
.item-table th:nth-child(2),
.item-table td:nth-child(2) {
    min-width: 115px;
}

/* Item Title */
.item-table th:nth-child(3),
.item-table td:nth-child(3) {
    min-width: 180px;
    text-align: left;
    padding-left: 12px !important;
}

/* Category */
.item-table th:nth-child(4),
.item-table td:nth-child(4) {
    min-width: 120px;
}

/* HS Code */
.item-table th:nth-child(5),
.item-table td:nth-child(5) {
    min-width: 100px;
}

/* UOM */
.item-table th:nth-child(6),
.item-table td:nth-child(6) {
    min-width: 70px;
}

/* Retail Price */
.item-table th:nth-child(7),
.item-table td:nth-child(7) {
    min-width: 125px;
}

/* Purchase Rate */
.item-table th:nth-child(8),
.item-table td:nth-child(8) {
    min-width: 115px;
}

/* Sale Rate */
.item-table th:nth-child(9),
.item-table td:nth-child(9) {
    min-width: 100px;
}

.item-table th.action-column,
.item-table td.action-column {
    width: 75px !important;
    min-width: 75px !important;
    max-width: 75px !important;
}


/* =========================================================
   ACTION BUTTONS
========================================================= */

.category-table .action-btn,
.buyer-table .action-btn,
.item-table .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin: 0 2px;

    border-radius: 5px;

    color: #ffffff;
    text-decoration: none;

    transition: all 0.2s ease;
}

.category-table .action-btn i,
.buyer-table .action-btn i,
.item-table .action-btn i {
    font-size: 14px;
}


/* EDIT */

.category-table .edit-btn,
.buyer-table .edit-btn,
.item-table .edit-btn {
    background: #0d6efd;
}

.category-table .edit-btn:hover,
.buyer-table .edit-btn:hover,
.item-table .edit-btn:hover {
    background: #0b5ed7;
    color: #ffffff;
    transform: translateY(-1px);
}


/* DELETE */

.category-table .delete-btn,
.buyer-table .delete-btn,
.item-table .delete-btn {
    background: #dc3545;
}

.category-table .delete-btn:hover,
.buyer-table .delete-btn:hover,
.item-table .delete-btn:hover {
    background: #bb2d3b;
    color: #ffffff;
    transform: translateY(-1px);
}


/* =========================================================
   NO DATA
========================================================= */

.category-table .no-data,
.buyer-table .no-data,
.item-table .no-data {
    padding: 30px !important;

    text-align: center !important;

    color: #64748b !important;

    font-size: 14px !important;
}


/* =========================================================
   DATATABLE BOTTOM INFO
========================================================= */

#categoryTable_wrapper .dt-info,
#buyerTable_wrapper .dt-info,
#itemTable_wrapper .dt-info,
#categoryTable_wrapper .dataTables_info,
#buyerTable_wrapper .dataTables_info,
#itemTable_wrapper .dataTables_info {
    padding-top: 12px;

    color: #475569;
    font-size: 13px;
}


/* =========================================================
   DATATABLE PAGINATION
========================================================= */

#categoryTable_wrapper .dt-paging,
#buyerTable_wrapper .dt-paging,
#itemTable_wrapper .dt-paging,
#categoryTable_wrapper .dataTables_paginate,
#buyerTable_wrapper .dataTables_paginate,
#itemTable_wrapper .dataTables_paginate {
    padding-top: 8px;
}

#categoryTable_wrapper .dt-paging-button,
#buyerTable_wrapper .dt-paging-button,
#itemTable_wrapper .dt-paging-button,
#categoryTable_wrapper .dataTables_paginate .paginate_button,
#buyerTable_wrapper .dataTables_paginate .paginate_button,
#itemTable_wrapper .dataTables_paginate .paginate_button {
    min-width: 34px !important;
    height: 32px;

    padding: 5px 9px !important;
    margin: 2px !important;

    border: none !important;
    border-radius: 5px !important;

    background: transparent !important;

    color: #475569 !important;

    box-shadow: none !important;

    cursor: pointer;
}

#categoryTable_wrapper .dt-paging-button:hover,
#buyerTable_wrapper .dt-paging-button:hover,
#itemTable_wrapper .dt-paging-button:hover,
#categoryTable_wrapper .dataTables_paginate .paginate_button:hover,
#buyerTable_wrapper .dataTables_paginate .paginate_button:hover,
#itemTable_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

#categoryTable_wrapper .dt-paging-button.current,
#buyerTable_wrapper .dt-paging-button.current,
#itemTable_wrapper .dt-paging-button.current,
#categoryTable_wrapper .dataTables_paginate .paginate_button.current,
#buyerTable_wrapper .dataTables_paginate .paginate_button.current,
#itemTable_wrapper .dataTables_paginate .paginate_button.current {
    background: #2563eb !important;
    color: #ffffff !important;
}

#categoryTable_wrapper .dt-paging-button.disabled,
#buyerTable_wrapper .dt-paging-button.disabled,
#itemTable_wrapper .dt-paging-button.disabled,
#categoryTable_wrapper .dataTables_paginate .paginate_button.disabled,
#buyerTable_wrapper .dataTables_paginate .paginate_button.disabled,
#itemTable_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #94a3b8 !important;
}


/* =========================================================
   REMOVE DATATABLE HEADER BACKGROUND IMAGE
========================================================= */

#categoryTable_wrapper table.dataTable thead th,
#buyerTable_wrapper table.dataTable thead th,
#itemTable_wrapper table.dataTable thead th {
    background-image: none !important;
}


/* =========================================================
   HORIZONTAL SCROLL
========================================================= */

#categoryTable_wrapper .dataTables_scrollBody,
#buyerTable_wrapper .dataTables_scrollBody,
#itemTable_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

#categoryTable_wrapper .dataTables_scrollBody::-webkit-scrollbar,
#buyerTable_wrapper .dataTables_scrollBody::-webkit-scrollbar,
#itemTable_wrapper .dataTables_scrollBody::-webkit-scrollbar {
    height: 8px;
}

#categoryTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-track,
#buyerTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-track,
#itemTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-track {
    background: #edf1f4;
    border-radius: 10px;
}

#categoryTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb,
#buyerTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb,
#itemTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: #a6b4bb;
    border-radius: 10px;
}

#categoryTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb:hover,
#buyerTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb:hover,
#itemTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: #00516b;
}


/* =========================================================
   FORM PAGE
========================================================= */

.form-page {
    width: 100%;
    padding: 0;
}

.form-card {
    padding: 28px;
}

.form-header {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}


/* =========================================================
   FORM GRID
========================================================= */

.item-form-grid,
.buyer-form-grid,
.category-form-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
    width: 100%;
}


/* Category form single column */

.category-form-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 700px;
}


/* =========================================================
   FORM GROUP
========================================================= */

.form-group {
    width: 100%;
    margin-bottom: 0;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: #334155;

    font-size: 13px;
    font-weight: 600;
}

.required,
.form-group label .required {
    color: #dc3545;
    margin-left: 3px;
}


/* =========================================================
   FORM INPUTS
========================================================= */

.form-group input,
.form-group select,
.form-group textarea,
.form-control,
input.form-control,
select.form-control,
textarea.form-control {
    width: 100%;

    min-height: 42px;

    padding: 9px 12px;

    border: 1px solid #cbd5e1;
    border-radius: 7px;

    background: #ffffff;

    color: #334155;

    font-family: "Segoe UI", sans-serif;
    font-size: 14px;

    outline: none;

    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


/* =========================================================
   FORM HOVER
========================================================= */

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.form-control:hover {
    border-color: #94a3b8;
}


/* =========================================================
   FORM FOCUS
========================================================= */

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    border-color: #00516b;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(0, 81, 107, 0.10);
}


/* =========================================================
   TEXTAREA
========================================================= */

.form-group textarea,
textarea.form-control {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}


/* =========================================================
   SELECT
========================================================= */

.form-group select,
select.form-control {
    cursor: pointer;
}


/* =========================================================
   PLACEHOLDER
========================================================= */

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}


/* =========================================================
   DISABLED / READONLY
========================================================= */

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled,
.form-control:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.form-group input[readonly],
.form-group select[readonly],
.form-group textarea[readonly],
.form-control[readonly] {
    background: #f8fafc;
}


/* =========================================================
   FULL WIDTH
========================================================= */

.form-group.full-width {
    grid-column: 1 / -1;
}


/* =========================================================
   HELP TEXT
========================================================= */

.form-group .help-text,
.form-help,
.helptext {
    display: block;

    margin-top: 5px;

    color: #64748b;

    font-size: 12px;
    line-height: 1.4;
}


/* =========================================================
   DJANGO ERROR
========================================================= */

.form-group .errorlist,
.form-card .errorlist {
    margin: 5px 0 0;
    padding: 0;

    list-style: none;

    color: #dc3545;

    font-size: 12px;
}

.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
    border-color: #dc3545;

    box-shadow:
        0 0 0 3px rgba(220, 53, 69, 0.08);
}


/* =========================================================
   FORM SECTION
========================================================= */

.form-section {
    margin-bottom: 28px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-bottom: 18px;
    padding-bottom: 10px;

    border-bottom: 1px solid #e5e7eb;

    color: #1e293b;

    font-size: 16px;
    font-weight: 700;
}

.form-section-title i {
    color: #00516b;
    font-size: 17px;
}


/* =========================================================
   INPUT ICON
========================================================= */

.input-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-wrapper i {
    position: absolute;

    left: 12px;
    top: 50%;

    transform: translateY(-50%);

    color: #64748b;

    font-size: 14px;

    pointer-events: none;
}

.input-icon-wrapper input,
.input-icon-wrapper select {
    padding-left: 36px;
}


/* =========================================================
   PRICE
========================================================= */

.price-field input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}


/* =========================================================
   NUMBER
========================================================= */

.form-group input[type="number"] {
    font-variant-numeric: tabular-nums;
}


/* =========================================================
   DATE
========================================================= */

.form-group input[type="date"] {
    cursor: pointer;
}


/* =========================================================
   CHECKBOX
========================================================= */

.form-group input[type="checkbox"] {
    width: 17px;
    min-height: 17px;

    accent-color: #2563eb;

    cursor: pointer;
}


/* =========================================================
   RADIO
========================================================= */

.form-group input[type="radio"] {
    width: 16px;
    min-height: 16px;

    accent-color: #2563eb;

    cursor: pointer;
}


/* =========================================================
   FORM DIVIDER
========================================================= */

.form-divider {
    width: 100%;
    height: 1px;

    background: #e5e7eb;

    margin: 22px 0;
}


/* =========================================================
   SMALL LABEL
========================================================= */

.form-label-small {
    display: block;

    margin-bottom: 6px;

    color: #64748b;

    font-size: 12px;
    font-weight: 500;
}


/* =========================================================
   FORM BUTTON AREA
========================================================= */

.form-buttons {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 28px;
    padding-top: 20px;

    border-top: 1px solid #e5e7eb;
}


/* =========================================================
   SAVE BUTTON
========================================================= */

.save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;

    padding: 10px 22px;

    background: #2563eb;
    color: #ffffff;

    border: none;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    text-decoration: none;

    transition: all 0.2s ease;
}

.save-btn:hover {
    background: #1d4ed8;
    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(37, 99, 235, 0.20);
}


/* =========================================================
   RESET BUTTON
========================================================= */

.reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;

    padding: 10px 20px;

    background: #64748b;
    color: #ffffff;

    border: none;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: #475569;
    color: #ffffff;

    transform: translateY(-1px);
}


/* =========================================================
   BACK BUTTON
========================================================= */

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;

    padding: 10px 20px;

    background: #f1f5f9;
    color: #334155;

    border: 1px solid #cbd5e1;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #e2e8f0;
    color: #1e293b;

    transform: translateY(-1px);
}


/* =========================================================
   CANCEL BUTTON
========================================================= */

.cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;

    padding: 10px 20px;

    background: #ffffff;
    color: #64748b;

    border: 1px solid #cbd5e1;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #f8fafc;
    color: #334155;
    border-color: #94a3b8;
}


/* =========================================================
   FORM CARD HOVER
========================================================= */

.form-card:hover {
    box-shadow:
        0 6px 22px rgba(15, 23, 42, 0.10);
}


/* =========================================================
   SUCCESS MESSAGE
========================================================= */

.form-success {
    padding: 11px 14px;
    margin-bottom: 20px;

    border-radius: 7px;

    background: #ecfdf5;
    border: 1px solid #a7f3d0;

    color: #047857;

    font-size: 13px;
}


/* =========================================================
   ERROR MESSAGE
========================================================= */

.form-error {
    padding: 11px 14px;
    margin-bottom: 20px;

    border-radius: 7px;

    background: #fef2f2;
    border: 1px solid #fecaca;

    color: #b91c1c;

    font-size: 13px;
}


/* =========================================================
   MOBILE - 768px
========================================================= */

@media (max-width: 768px) {

    .custom-header {
        height: 70px;
        padding: 0 12px;
    }

    .logo {
        height: 50px;
    }

    .sidebar {
        min-height: auto;
    }

    .content {
        padding: 15px;
    }

    .category-card,
    .buyer-card,
    .item-card {
        padding: 12px;
    }

    .category-header,
    .buyer-header,
    .item-header,
    .form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .category-header .btn-add,
    .buyer-header .btn-add,
    .item-header .btn-add {
        width: 100%;
    }

    .category-header h2,
    .buyer-header h2,
    .item-header h2 {
        font-size: 24px;
    }

    #categoryTable_wrapper .dt-layout-row,
    #buyerTable_wrapper .dt-layout-row,
    #itemTable_wrapper .dt-layout-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #categoryTable_wrapper .dt-search,
    #buyerTable_wrapper .dt-search,
    #itemTable_wrapper .dt-search,
    #categoryTable_wrapper .dataTables_filter,
    #buyerTable_wrapper .dataTables_filter,
    #itemTable_wrapper .dataTables_filter {
        width: 100%;
        text-align: left;
    }

    #categoryTable_wrapper .dt-search input,
    #buyerTable_wrapper .dt-search input,
    #itemTable_wrapper .dt-search input,
    #categoryTable_wrapper .dataTables_filter input,
    #buyerTable_wrapper .dataTables_filter input,
    #itemTable_wrapper .dataTables_filter input {
        width: 180px;
    }

    .item-table,
    .buyer-table {
        min-width: 1050px !important;
    }

    .form-card {
        padding: 18px;
        border-radius: 10px;
    }

    .form-header {
        margin-bottom: 20px;
    }

    .form-header h2 {
        font-size: 23px;
    }

    .item-form-grid,
    .buyer-form-grid,
    .category-form-grid,
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-group.full-width {
        grid-column: auto;
    }

    .form-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .save-btn,
    .reset-btn,
    .back-btn,
    .cancel-btn {
        min-width: 110px;
    }
}


/* =========================================================
   SMALL SCREEN - 480px
========================================================= */

@media (max-width: 480px) {

    .content {
        padding: 10px;
    }

    .form-card {
        padding: 14px;
    }

    .category-card,
    .buyer-card,
    .item-card {
        padding: 10px;
    }

    .category-header h2,
    .buyer-header h2,
    .item-header h2 {
        font-size: 21px;
    }

    #categoryTable_wrapper .dt-search input,
    #buyerTable_wrapper .dt-search input,
    #itemTable_wrapper .dt-search input,
    #categoryTable_wrapper .dataTables_filter input,
    #buyerTable_wrapper .dataTables_filter input,
    #itemTable_wrapper .dataTables_filter input {
        width: 160px;
    }
}
/* =========================================================
   BUYER ADD / EDIT FORM
   ========================================================= */

/* ---------------------------------------------------------
   PAGE HEADER
   --------------------------------------------------------- */

.buyer-form-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    margin-bottom: 22px;
    padding-bottom: 18px;

    border-bottom: 1px solid #e5e7eb;
}

.buyer-title-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.buyer-title-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #00516b;
    color: #ffffff;

    border-radius: 9px;

    font-size: 20px;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.18);
}

.buyer-title-area h2 {
    margin: 0;

    color: #1e293b;

    font-size: 27px;
    font-weight: 700;
}

.buyer-title-area .page-subtitle {
    margin: 5px 0 0;

    color: #64748b;

    font-size: 14px;
}


/* ---------------------------------------------------------
   BACK BUTTON
   --------------------------------------------------------- */

.buyer-back-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 40px;

    padding: 9px 17px;

    background: #f1f5f9;

    color: #334155;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition: all 0.2s ease;
}

.buyer-back-btn:hover {
    background: #e2e8f0;

    color: #1e293b;

    transform: translateY(-1px);
}


/* ---------------------------------------------------------
   FORM CARD
   --------------------------------------------------------- */

.buyer-form-card {
    width: 100%;

    background: #ffffff;

    border-radius: 10px;

    padding: 26px;

    box-sizing: border-box;

    border: 1px solid #e5e7eb;

    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}


/* ---------------------------------------------------------
   SECTION HEADING
   --------------------------------------------------------- */

.buyer-section-heading {
    display: flex;

    align-items: flex-start;

    gap: 12px;

    margin-top: 6px;
    margin-bottom: 20px;

    padding-bottom: 12px;

    border-bottom: 1px solid #e5e7eb;
}

.buyer-section-line {
    width: 4px;

    min-width: 4px;

    height: 42px;

    background: #00516b;

    border-radius: 4px;
}

.buyer-section-heading h3 {
    margin: 0;

    color: #1e293b;

    font-size: 17px;

    font-weight: 700;
}

.buyer-section-heading h3 i {
    margin-right: 7px;

    color: #00516b;

    font-size: 16px;
}

.buyer-section-heading span {
    display: block;

    margin-top: 4px;

    color: #64748b;

    font-size: 12px;
}


/* ---------------------------------------------------------
   FORM GRID
   --------------------------------------------------------- */

.buyer-form-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px 24px;

    margin-bottom: 28px;
}


/* ---------------------------------------------------------
   FORM FIELD
   --------------------------------------------------------- */

.buyer-field {
    width: 100%;

    box-sizing: border-box;
}

.buyer-field.buyer-full {
    grid-column: 1 / -1;
}


/* ---------------------------------------------------------
   LABEL
   --------------------------------------------------------- */

.buyer-field label {
    display: block;

    margin-bottom: 7px;

    color: #334155;

    font-size: 13px;

    font-weight: 600;
}

.buyer-field label i {
    margin-right: 5px;

    color: #00516b;

    font-size: 13px;
}


/* ---------------------------------------------------------
   INPUT + SELECT
   --------------------------------------------------------- */

.buyer-input {
    width: 100%;

    min-height: 42px;

    padding: 9px 12px;

    box-sizing: border-box;

    background: #ffffff;

    color: #334155;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    outline: none;

    font-family: 'Segoe UI', sans-serif;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


/* ---------------------------------------------------------
   INPUT HOVER
   --------------------------------------------------------- */

.buyer-input:hover {
    border-color: #94a3b8;
}


/* ---------------------------------------------------------
   INPUT FOCUS
   --------------------------------------------------------- */

.buyer-input:focus {
    border-color: #00516b;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(0, 81, 107, 0.10);
}


/* ---------------------------------------------------------
   PLACEHOLDER
   --------------------------------------------------------- */

.buyer-input::placeholder {
    color: #94a3b8;

    opacity: 1;
}


/* ---------------------------------------------------------
   SELECT
   --------------------------------------------------------- */

select.buyer-input {
    cursor: pointer;

    appearance: auto;
}


/* ---------------------------------------------------------
   FORM BUTTON AREA
   --------------------------------------------------------- */

.buyer-form-buttons {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 5px;

    padding-top: 20px;

    border-top: 1px solid #e5e7eb;
}


/* ---------------------------------------------------------
   SAVE BUTTON
   --------------------------------------------------------- */

.buyer-save-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 10px 21px;

    background: #2563eb;

    color: #ffffff;

    border: none;

    border-radius: 7px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.buyer-save-btn:hover {
    background: #1d4ed8;

    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(37, 99, 235, 0.20);
}


/* ---------------------------------------------------------
   RESET BUTTON
   --------------------------------------------------------- */

.buyer-reset-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 10px 20px;

    background: #64748b;

    color: #ffffff;

    border: none;

    border-radius: 7px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.buyer-reset-btn:hover {
    background: #475569;

    color: #ffffff;

    transform: translateY(-1px);
}


/* ---------------------------------------------------------
   CANCEL BUTTON
   --------------------------------------------------------- */

.buyer-cancel-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 10px 20px;

    background: #f1f5f9;

    color: #334155;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

    transition: all 0.2s ease;
}

.buyer-cancel-btn:hover {
    background: #e2e8f0;

    color: #1e293b;

    transform: translateY(-1px);
}


/* ---------------------------------------------------------
   BUTTON ICONS
   --------------------------------------------------------- */

.buyer-form-buttons i {
    font-size: 14px;
}


/* ---------------------------------------------------------
   FORM CARD HOVER
   --------------------------------------------------------- */

.buyer-form-card {
    transition: box-shadow 0.2s ease;
}

.buyer-form-card:hover {
    box-shadow:
        0 6px 22px rgba(15, 23, 42, 0.10);
}


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 768px) {

    .buyer-form-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 14px;
    }

    .buyer-back-btn {
        width: auto;
    }

    .buyer-form-card {
        padding: 18px;
    }

    .buyer-form-grid {
        grid-template-columns: 1fr;

        gap: 16px;
    }

    .buyer-field.buyer-full {
        grid-column: auto;
    }

    .buyer-form-buttons {
        flex-wrap: wrap;
    }

    .buyer-save-btn,
    .buyer-reset-btn,
    .buyer-cancel-btn {
        min-width: 110px;
    }
}


/* ---------------------------------------------------------
   SMALL SCREEN
   --------------------------------------------------------- */

@media (max-width: 480px) {

    .buyer-title-area {
        gap: 10px;
    }

    .buyer-title-icon {
        width: 42px;
        height: 42px;

        font-size: 17px;
    }

    .buyer-title-area h2 {
        font-size: 23px;
    }

    .buyer-form-card {
        padding: 14px;
    }

    .buyer-form-buttons {
        flex-direction: column;

        align-items: stretch;
    }

    .buyer-save-btn,
    .buyer-reset-btn,
    .buyer-cancel-btn {
        width: 100%;
    }
}
/* =========================================================
   ITEM FORM — BUYER STYLE BLUE THEME
   ========================================================= */

/* ---------------------------------------------------------
   ITEM FORM HEADER
   --------------------------------------------------------- */

.form-header {
    width: 100%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-bottom: 22px;
    padding-bottom: 18px;

    border-bottom: 1px solid #e5e7eb;
}

.form-header h2 {
    margin: 0;

    display: flex;
    align-items: center;
    gap: 10px;

    color: #1e293b;

    font-size: 27px;
    font-weight: 700;
}

.form-header h2 i {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 43px;
    height: 43px;

    background: #00516b;

    color: #ffffff;

    border-radius: 8px;

    font-size: 19px;

    box-shadow:
        0 3px 8px rgba(0, 81, 107, 0.18);
}

.form-header .page-subtitle {
    margin: 5px 0 0 53px;

    color: #64748b;

    font-size: 14px;
}


/* ---------------------------------------------------------
   BACK TO ITEMS
   --------------------------------------------------------- */

.form-header .back-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 40px;

    padding: 9px 17px;

    background: #f1f5f9;

    color: #334155;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

    transition: all 0.2s ease;
}

.form-header .back-btn:hover {
    background: #e2e8f0;

    color: #1e293b;

    transform: translateY(-1px);
}


/* ---------------------------------------------------------
   FORM MAIN AREA
   --------------------------------------------------------- */

form {
    width: 100%;
}


/* ---------------------------------------------------------
   FORM SECTION
   --------------------------------------------------------- */

.form-section {
    width: 100%;

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 10px;

    padding: 24px;

    margin-bottom: 22px;

    box-sizing: border-box;

    box-shadow:
        0 4px 16px rgba(15, 23, 42, 0.07);

    transition: box-shadow 0.2s ease;
}

.form-section:hover {
    box-shadow:
        0 6px 22px rgba(15, 23, 42, 0.10);
}


/* ---------------------------------------------------------
   SECTION TITLE
   --------------------------------------------------------- */

.form-section-title {
    display: flex;

    align-items: center;

    gap: 9px;

    margin: 0 0 20px;

    padding-bottom: 13px;

    color: #1e293b;

    font-size: 17px;

    font-weight: 700;

    border-bottom: 1px solid #e5e7eb;

    position: relative;
}


/* BLUE LINE — BUYER STYLE */

.form-section-title::before {
    content: "";

    width: 4px;

    height: 30px;

    background: #00516b;

    border-radius: 4px;

    display: inline-block;
}

.form-section-title i {
    color: #00516b;

    font-size: 17px;
}


/* ---------------------------------------------------------
   ITEM GRID
   --------------------------------------------------------- */

.item-form-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px 24px;

    margin: 0;
}


/* ---------------------------------------------------------
   FORM GROUP
   --------------------------------------------------------- */

.form-group {
    width: 100%;

    margin: 0;

    box-sizing: border-box;
}


/* ---------------------------------------------------------
   LABEL
   --------------------------------------------------------- */

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: #334155;

    font-size: 13px;

    font-weight: 600;
}

.form-group label i {
    color: #00516b;

    margin-right: 5px;

    font-size: 13px;
}


/* ---------------------------------------------------------
   DJANGO INPUTS
   --------------------------------------------------------- */

.form-group input,
.form-group select,
.form-group textarea,

.form-group .form-control,

.form-group input.form-control,
.form-group select.form-control,
.form-group textarea.form-control {

    width: 100%;

    min-height: 42px;

    padding: 9px 12px;

    box-sizing: border-box;

    background: #ffffff;

    color: #334155;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    outline: none;

    font-family: 'Segoe UI', sans-serif;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


/* ---------------------------------------------------------
   INPUT HOVER
   --------------------------------------------------------- */

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.form-group .form-control:hover {
    border-color: #94a3b8;
}


/* ---------------------------------------------------------
   INPUT FOCUS — BLUE TOUCH
   --------------------------------------------------------- */

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-group .form-control:focus {

    border-color: #00516b !important;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(0, 81, 107, 0.10) !important;

    outline: none;
}


/* ---------------------------------------------------------
   PLACEHOLDER
   --------------------------------------------------------- */

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-group .form-control::placeholder {
    color: #94a3b8;

    opacity: 1;
}


/* ---------------------------------------------------------
   SELECT
   --------------------------------------------------------- */

.form-group select {
    cursor: pointer;

    appearance: auto;
}


/* ---------------------------------------------------------
   INPUT ICON WRAPPER
   --------------------------------------------------------- */

.input-icon {
    position: relative;

    width: 100%;
}


/* ICON INSIDE INPUT */

.input-icon > i {
    position: absolute;

    left: 12px;

    top: 50%;

    transform: translateY(-50%);

    color: #00516b;

    font-size: 14px;

    pointer-events: none;

    z-index: 2;
}


/* INPUT WITH ICON */

.input-icon input,
.input-icon select,
.input-icon textarea,
.input-icon .form-control {

    padding-left: 36px !important;
}


/* ---------------------------------------------------------
   PRICE INPUTS
   --------------------------------------------------------- */

#id_purchase_rate,
#id_fnv_retail_price,
#id_sale_rate {
    text-align: right;

    font-variant-numeric: tabular-nums;
}


/* ---------------------------------------------------------
   NUMBER INPUT
   --------------------------------------------------------- */

.form-group input[type="number"] {
    font-variant-numeric: tabular-nums;
}


/* ---------------------------------------------------------
   DATE INPUT
   --------------------------------------------------------- */

.form-group input[type="date"] {
    cursor: pointer;
}


/* ---------------------------------------------------------
   ERROR MESSAGE
   --------------------------------------------------------- */

.form-group .errorlist {
    margin: 5px 0 0;

    padding: 0;

    list-style: none;

    color: #dc3545;

    font-size: 12px;
}


/* ---------------------------------------------------------
   BUTTON AREA
   --------------------------------------------------------- */

.form-buttons {

    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 4px;

    padding-top: 20px;

    border-top: 1px solid #e5e7eb;
}


/* ---------------------------------------------------------
   SAVE BUTTON — BLUE
   --------------------------------------------------------- */

.form-buttons .save-btn {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 10px 21px;

    background: #2563eb;

    color: #ffffff;

    border: none;

    border-radius: 7px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.form-buttons .save-btn:hover {

    background: #1d4ed8;

    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(37, 99, 235, 0.20);
}


/* ---------------------------------------------------------
   RESET BUTTON
   --------------------------------------------------------- */

.form-buttons .reset-btn {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 10px 20px;

    background: #64748b;

    color: #ffffff;

    border: none;

    border-radius: 7px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.form-buttons .reset-btn:hover {

    background: #475569;

    color: #ffffff;

    transform: translateY(-1px);
}


/* ---------------------------------------------------------
   CANCEL / BACK BUTTON
   --------------------------------------------------------- */

.form-buttons .back-btn {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 10px 20px;

    background: #f1f5f9;

    color: #334155;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

    transition: all 0.2s ease;
}

.form-buttons .back-btn:hover {

    background: #e2e8f0;

    color: #1e293b;

    transform: translateY(-1px);
}


/* ---------------------------------------------------------
   BUTTON ICONS
   --------------------------------------------------------- */

.form-buttons i {
    font-size: 14px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .form-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 14px;
    }

    .form-header h2 {
        font-size: 23px;
    }

    .form-header .page-subtitle {
        margin-left: 0;
    }

    .form-header .back-btn {
        width: auto;
    }

    .form-section {
        padding: 18px;
    }

    .item-form-grid {
        grid-template-columns: 1fr;

        gap: 16px;
    }

    .form-buttons {
        flex-wrap: wrap;
    }

    .form-buttons .save-btn,
    .form-buttons .reset-btn,
    .form-buttons .back-btn {
        min-width: 110px;
    }
}


/* =========================================================
   SMALL SCREEN
   ========================================================= */

@media (max-width: 480px) {

    .form-section {
        padding: 14px;
    }

    .form-header h2 i {
        width: 40px;
        height: 40px;

        font-size: 17px;
    }

    .form-header h2 {
        font-size: 22px;
    }

    .form-buttons {
        flex-direction: column;

        align-items: stretch;
    }

    .form-buttons .save-btn,
    .form-buttons .reset-btn,
    .form-buttons .back-btn {
        width: 100%;
    }
}
/* =========================================
   ITEM FORM INPUT ALIGNMENT
========================================= */

.item-form-grid .form-group input,
.item-form-grid .form-group select,
.item-form-grid .form-group textarea {
    text-align: left !important;
    direction: ltr !important;
}

/* Placeholder bhi left side par */
.item-form-grid .form-group input::placeholder,
.item-form-grid .form-group textarea::placeholder {
    text-align: left !important;
    direction: ltr !important;
}

/* Number inputs ke text ko bhi left rakho */
.item-form-grid .form-group input[type="number"] {
    text-align: left !important;
}

/* Select text left */
.item-form-grid .form-group select {
    text-align: left !important;
}
/* =========================================
   CATEGORY FORM
========================================= */

.category-form-card {
    max-width: 100%;
}

/* CATEGORY TITLE */

.category-form-card .form-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-form-card .form-header h2 i {
    color: #00516b;
    font-size: 25px;
}


/* =========================================
   SECTION TITLE
========================================= */

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;

    background: #00516b;
    color: #ffffff;

    padding: 13px 16px;

    border-radius: 7px;

    margin-bottom: 22px;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.18);
}

.section-title .section-icon {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255,255,255,0.15);

    border-radius: 6px;
}

.section-title .section-icon i {
    font-size: 17px;
}

.section-title h3 {
    margin: 0;

    font-size: 16px;
    font-weight: 600;

    color: #ffffff;
}

.section-title p {
    margin: 2px 0 0;

    font-size: 12px;

    color: rgba(255,255,255,0.80);
}


/* =========================================
   CATEGORY GRID
========================================= */

.category-form-grid {
    display: grid;

    grid-template-columns: minmax(0, 1fr);

    gap: 18px;
}


/* =========================================
   CATEGORY FIELD
========================================= */

.category-field {
    max-width: 100%;
}

.category-field label {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 8px;

    font-size: 14px;
    font-weight: 600;

    color: #334155;
}

.category-field label i {
    color: #00516b;
    font-size: 14px;
}


/* =========================================
   CATEGORY INPUT
========================================= */

.category-field input,
.category-field select,
.category-field textarea {

    width: 100% !important;

    height: 44px;

    padding: 9px 13px;

    background: #ffffff;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    color: #334155;

    font-size: 14px;

    text-align: left !important;

    direction: ltr !important;

    outline: none;

    box-sizing: border-box;

    transition: all 0.2s ease;
}


/* PLACEHOLDER */

.category-field input::placeholder {
    color: #94a3b8;

    text-align: left !important;
}


/* FOCUS */

.category-field input:focus,
.category-field select:focus,
.category-field textarea:focus {

    border-color: #00516b;

    box-shadow:
        0 0 0 3px rgba(0, 81, 107, 0.10);

    background: #ffffff;
}


/* =========================================
   FORM ERROR
========================================= */

.form-error {
    margin-top: 6px;

    color: #dc3545;

    font-size: 12px;
}


/* =========================================
   SAVE BUTTON
========================================= */

.category-form-card .save-btn {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-width: 145px;

    height: 42px;

    padding: 9px 18px;

    background: #00516b;

    color: #ffffff;

    border: none;

    border-radius: 7px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.category-form-card .save-btn:hover {

    background: #003f52;

    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(0, 81, 107, 0.22);
}


/* =========================================
   BACK BUTTON
========================================= */

.category-form-card .back-btn {

    height: 42px;

    padding: 9px 18px;

    background: #64748b;

    border-radius: 7px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    font-size: 14px;

    font-weight: 600;

    color: #ffffff;

    text-decoration: none;

    transition: all 0.2s ease;
}

.category-form-card .back-btn:hover {

    background: #475569;

    color: #ffffff;

    transform: translateY(-1px);
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 768px) {

    .category-form-card {
        padding: 16px;
    }

    .category-form-card .form-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 12px;
    }

    .category-form-card .form-header .back-btn {
        width: 100%;
    }

    .category-form-card .form-buttons {
        flex-wrap: wrap;
    }

    .category-form-card .save-btn,
    .category-form-card .form-buttons .back-btn {
        width: 100%;
    }

}
/* =========================================
   CATEGORY SECTION ICON FIX
========================================= */

.category-form-card .section-title .section-icon {
    width: 38px !important;
    height: 38px !important;

    min-width: 38px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: rgba(255, 255, 255, 0.18) !important;

    border-radius: 7px !important;
}

.category-form-card .section-title .section-icon i.bi {
    display: inline-block !important;

    color: #ffffff !important;

    font-size: 19px !important;

    line-height: 1 !important;

    visibility: visible !important;

    opacity: 1 !important;
}
/* =========================================================
   CATEGORY ADD BUTTON
   SAME COLOR AS TABLE HEADER
========================================================= */

.category-header .btn-add {
    display: inline-flex !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 8px !important;

    height: 44px !important;

    padding: 0 20px !important;

    background: #00516b !important;

    color: #ffffff !important;

    border: none !important;

    border-radius: 7px !important;

    text-decoration: none !important;

    font-size: 14px !important;

    font-weight: 600 !important;

    line-height: 1 !important;

    white-space: nowrap !important;

    cursor: pointer !important;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.20) !important;

    transition: all 0.25s ease !important;
}


/* ICON */

.category-header .btn-add i {
    color: #ffffff !important;

    font-size: 17px !important;

    line-height: 1 !important;
}


/* HOVER */

.category-header .btn-add:hover {
    background: #003f52 !important;

    color: #ffffff !important;

    transform: translateY(-1px) !important;

    box-shadow: 0 5px 12px rgba(0, 81, 107, 0.28) !important;
}


/* ACTIVE */

.category-header .btn-add:active {
    transform: translateY(0) !important;
}



/* =========================================================
   CATEGORY FORM HEADER
========================================================= */

.category-form-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 24px;
    padding: 0 2px;

    box-sizing: border-box;
}

.category-form-header h2 {
    margin: 0;

    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 28px;
    font-weight: 700;

    color: #1e293b;
}

.category-form-header h2 i {
    color: #00516b;
    font-size: 27px;
}

.category-form-header .page-subtitle {
    margin: 6px 0 0 0;

    color: #64748b;
    font-size: 14px;
}


/* =========================================================
   TOP BACK BUTTON
========================================================= */

.category-back-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 10px 18px;

    background: #64748b;
    color: #ffffff;

    text-decoration: none;

    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    transition: all 0.2s ease;
}

.category-back-btn i {
    font-size: 15px;
}

.category-back-btn:hover {
    background: #475569;
    color: #ffffff;

    transform: translateY(-1px);
}


/* =========================================================
   FORM CARD
========================================================= */

.category-form-card {
    width: 100%;

    background: #ffffff;

    border-radius: 10px;

    padding: 25px;

    box-sizing: border-box;

    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);

    border-top: 4px solid #00516b;
}


/* =========================================================
   SECTION TITLE
========================================================= */

.category-section-title {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 24px;

    padding-bottom: 12px;

    border-bottom: 1px solid #e5e7eb;

    color: #00516b;

    font-size: 17px;
    font-weight: 700;
}

.category-section-title i {
    font-size: 18px;
}


/* =========================================================
   INPUT GROUP
========================================================= */

.category-input-group {
    width: 100%;

    max-width: 100%;

    margin-bottom: 5px;
}

.category-input-group label {
    display: block;

    margin-bottom: 8px;

    color: #334155;

    font-size: 14px;
    font-weight: 600;
}


/* =========================================================
   CATEGORY INPUT
========================================================= */

.category-input-group input,
.category-input-group .form-control {
    display: block;

    width: 100% !important;

    height: 44px;

    padding: 9px 13px;

    box-sizing: border-box;

    border: 1px solid #cbd5e1;

    border-radius: 7px;

    background: #ffffff;

    color: #334155;

    font-size: 14px;

    outline: none;

    transition: all 0.2s ease;
}


/* INPUT FOCUS */

.category-input-group input:focus,
.category-input-group .form-control:focus {
    border-color: #00516b;

    box-shadow:
        0 0 0 3px rgba(0, 81, 107, 0.10);

    background: #ffffff;
}


/* PLACEHOLDER */

.category-input-group input::placeholder {
    color: #94a3b8;
}


/* =========================================================
   ERROR
========================================================= */

.form-error {
    margin-top: 7px;

    color: #dc3545;

    font-size: 13px;
}


/* =========================================================
   SAVE BUTTON
========================================================= */

.category-form-buttons {
    display: flex;

    align-items: center;

    margin-top: 25px;

    padding-top: 18px;

    border-top: 1px solid #e5e7eb;
}

.category-save-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-width: 150px;

    height: 42px;

    padding: 9px 20px;

    background: #00516b;

    color: #ffffff;

    border: none;

    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.category-save-btn i {
    font-size: 16px;
}

.category-save-btn:hover {
    background: #003f52;

    color: #ffffff;

    transform: translateY(-1px);

    box-shadow: 0 4px 10px rgba(0, 81, 107, 0.20);
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .category-form-page {
        padding-top: 5px;
    }

    .category-form-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 14px;
    }

    .category-form-header h2 {
        font-size: 24px;
    }

    .category-back-btn {
        width: auto;
    }

    .category-form-card {
        padding: 18px;
    }

}
/* =========================================
ITEM FORM PAGE HEADER
========================================= */

.item-form-header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;


margin-bottom: 20px;
box-sizing: border-box;


}

/* TITLE */

.item-form-title {
display: flex;
align-items: center;
gap: 14px;
}

/* BLUE ICON BOX */

.item-title-icon {
width: 48px;
height: 48px;

display: flex;
align-items: center;
justify-content: center;

background: #00516b;
color: #ffffff;

border-radius: 10px;

font-size: 21px;

box-shadow: 0 4px 10px rgba(0, 81, 107, 0.18);


}

.item-form-title h2 {
margin: 0;


font-size: 28px;
font-weight: 700;

color: #1e293b;


}

.item-form-title .page-subtitle {
margin: 5px 0 0;


color: #64748b;

font-size: 14px;


}

/* =========================================
BACK BUTTON
========================================= */

.item-back-btn {
display: inline-flex;

align-items: center;
justify-content: center;

gap: 8px;

padding: 10px 18px;

background: #00516b;
color: #ffffff;

text-decoration: none;

border-radius: 7px;

font-size: 14px;
font-weight: 600;

transition: all 0.2s ease;


}

.item-back-btn i {
font-size: 16px;
}

.item-back-btn:hover {
background: #003f52;
color: #ffffff;

transform: translateY(-1px);

box-shadow: 0 4px 10px rgba(0, 81, 107, 0.20);

}

/* =========================================
SECTION TITLE
========================================= */

.section-title {
display: flex;
align-items: center;

gap: 12px;

margin-bottom: 20px;

padding-bottom: 12px;

border-bottom: 1px solid #e2e8f0;

}

.section-title-icon {
width: 36px;
height: 36px;

display: flex;
align-items: center;
justify-content: center;

background: #00516b;
color: #ffffff;

border-radius: 7px;

font-size: 16px;

}

.section-title h3 {
margin: 0;

color: #1e293b;

font-size: 18px;
font-weight: 700;

}

.section-title p {
margin: 3px 0 0;

color: #64748b;

font-size: 12px;

}

/* =========================================
WHITE FORM CARD
========================================= */

.form-card {
width: 100%;

background: #ffffff;

border-radius: 10px;

padding: 25px;

box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.08);

box-sizing: border-box;

}

/* =========================================
MOBILE
========================================= */

@media (max-width: 768px) {

.item-form-header {
    flex-direction: column;
    align-items: flex-start;

    gap: 14px;
}

.item-back-btn {
    width: auto;
}

.item-form-title h2 {
    font-size: 24px;
}

.form-card {
    padding: 18px;
}

}

/* =========================================================
   SALE INVOICE PAGE
========================================================= */

.invoice-page {
    width: 100%;
}


/* =========================================================
   INVOICE HEADER
========================================================= */

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 22px;
    padding: 0 2px;
}

.invoice-header h2 {
    margin: 0;

    font-size: 28px;
    font-weight: 700;


    display: flex;
    align-items: center;
    gap: 10px;
}

.invoice-header h2 i {
    font-size: 27px;
}

.invoice-subtitle {
    margin: 0 0;


    font-size: 14px;
}



/* =========================================================
   ADD SALE INVOICE BUTTON
   SAME COLOR AS TABLE HEADER
========================================================= */

.invoice-header .add-invoice-btn {
    display: inline-flex !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 8px !important;

    height: 44px !important;

    padding: 0 20px !important;

    background: #00516b !important;

    color: #ffffff !important;

    border: none !important;

    border-radius: 7px !important;

    text-decoration: none !important;

    font-size: 14px !important;

    font-weight: 600 !important;

    line-height: 1 !important;

    white-space: nowrap !important;

    cursor: pointer !important;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.20) !important;

    transition: all 0.25s ease !important;
}


/* PLUS ICON */

.invoice-header .add-invoice-btn i {
    color: #ffffff !important;

    font-size: 17px !important;

    line-height: 1 !important;
}


/* HOVER */

.invoice-header .add-invoice-btn:hover {
    background: #003f52 !important;

    color: #ffffff !important;

    transform: translateY(-1px) !important;

    box-shadow: 0 5px 12px rgba(0, 81, 107, 0.28) !important;
}


/* ACTIVE */

.invoice-header .add-invoice-btn:active {
    transform: translateY(0) !important;
}




/* =========================================================
   TABLE CARD
========================================================= */

.invoice-table-card {
    width: 100%;

    background: #ffffff;

    border-radius: 10px;

    padding: 18px;

    box-sizing: border-box;

    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);

    overflow: hidden;
}


/* =========================================================
   TABLE RESPONSIVE
========================================================= */

.invoice-table-card .table-responsive {
    width: 100%;

    overflow-x: auto;
}


/* =========================================================
   SALE INVOICE TABLE
========================================================= */

.sale-invoice-table {
    width: 100% !important;

    min-width: 1050px;

    border-collapse: collapse;

    margin: 0 !important;
}


/* =========================================================
   TABLE HEADER
========================================================= */

.sale-invoice-table thead th {
    background: #00516b !important;

    color: #ffffff !important;

    padding: 13px 10px !important;

    height: 48px;

    text-align: center !important;

    vertical-align: middle;

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;

    border: none !important;
}

.sale-invoice-table thead th:first-child {
    border-radius: 6px 0 0 0;
}


/* =========================================================
   TABLE BODY
========================================================= */

.sale-invoice-table tbody td {
    padding: 11px 9px !important;

    height: 46px;

    text-align: center;

    vertical-align: middle;

    font-size: 13px;

    color: #374151;

    border-bottom: 1px solid #e5e7eb !important;

    white-space: nowrap;
}


/* =========================================================
   ALTERNATE ROW
========================================================= */

.sale-invoice-table tbody tr:nth-child(even) {
    background: #f8fafc;
}


/* =========================================================
   ROW HOVER
========================================================= */

.sale-invoice-table tbody tr:hover {
    background: #eaf4f8 !important;
}


/* =========================================================
   BUYER
========================================================= */

.sale-invoice-table .buyer-cell {
    text-align: left !important;

    font-weight: 600;

    color: #1e293b;
}


/* =========================================================
   AMOUNT
========================================================= */

.sale-invoice-table .amount-cell {
    font-weight: 700;

    color: #00516b;
}


/* =========================================================
   FBR POSTED
========================================================= */

.fbr-posted {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    color: #15803d;

    font-weight: 600;
}

.fbr-posted i {
    font-size: 13px;
}


/* =========================================================
   NOT POSTED
========================================================= */

.not-posted {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 4px 8px;

    border-radius: 5px;

    background: #fff7ed;

    color: #c2410c;

    font-size: 12px;

    font-weight: 600;
}

.not-posted i {
    font-size: 12px;
}


/* =========================================================
   ACTION BUTTON
========================================================= */

.invoice-action {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border-radius: 6px;

    color: #ffffff !important;

    text-decoration: none !important;

    transition: all 0.2s ease;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.10);
}

.invoice-action i {
    font-size: 14px;
}


/* =========================================================
   EDIT
========================================================= */

.edit-action {
    background: #0d6efd;
}

.edit-action:hover {
    background: #0b5ed7;

    color: #ffffff !important;

    transform: translateY(-1px);
}


/* =========================================================
   VIEW / PRINT
========================================================= */

.view-action {
    background: #00516b;
}

.view-action:hover {
    background: #003f52;

    color: #ffffff !important;

    transform: translateY(-1px);
}


/* =========================================================
   SHORT
========================================================= */

.short-action {
    background: #64748b;
}

.short-action:hover {
    background: #475569;

    color: #ffffff !important;

    transform: translateY(-1px);
}


/* =========================================================
   PDF
========================================================= */

.pdf-action {
    background: #dc3545;
}

.pdf-action:hover {
    background: #bb2d3b;

    color: #ffffff !important;

    transform: translateY(-1px);
}


/* =========================================================
   DELETE
========================================================= */

.delete-action {
    background: #dc3545;
}

.delete-action:hover {
    background: #bb2d3b;

    color: #ffffff !important;

    transform: translateY(-1px);
}


/* =========================================================
   EMPTY ROW
========================================================= */

.sale-invoice-table .empty-row {
    padding: 45px 20px !important;

    text-align: center !important;

    color: #64748b !important;

    font-size: 14px;

    background: #ffffff !important;
}

.empty-row i {
    display: block;

    margin-bottom: 8px;

    font-size: 32px;

    color: #94a3b8;
}


/* =========================================================
   SCROLLBAR
========================================================= */

.invoice-table-card .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.invoice-table-card .table-responsive::-webkit-scrollbar-track {
    background: #edf1f4;

    border-radius: 10px;
}

.invoice-table-card .table-responsive::-webkit-scrollbar-thumb {
    background: #a6b4bb;

    border-radius: 10px;
}

.invoice-table-card .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #00516b;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .invoice-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 14px;
    }

    .invoice-header h2 {
        font-size: 24px;
    }

    .add-invoice-btn {
        width: 100%;
    }

    .invoice-table-card {
        padding: 10px;
    }

    .sale-invoice-table {
        min-width: 1050px;
    }
}

/* =========================================================
   ITEM PAGE - FINAL STYLE
========================================================= */

.item-page-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 20px;
}

.item-page-header h2 {
    margin: 0;

    font-size: 28px;
    font-weight: 700;

    color: #1e293b;
}

.item-page-header h2 i {
    color: #00516b;
    margin-right: 8px;
}

.item-page-header p {
    margin: 5px 0 0;

    color: #64748b;

    font-size: 14px;
}


/* =========================================================
   ADD ITEM BUTTON
========================================================= */

.item-add-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 11px 20px;

    background: #00516b;
    color: #ffffff;

    border-radius: 7px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.20);

    transition: all 0.2s ease;
}

.item-add-btn i {
    font-size: 16px;
}

.item-add-btn:hover {
    background: #003f52;

    color: #ffffff;

    transform: translateY(-1px);

    box-shadow: 0 5px 12px rgba(0, 81, 107, 0.25);
}


/* =========================================================
   TABLE WHITE CARD
========================================================= */

.item-table-card {
    width: 100%;

    background: #ffffff;

    border-radius: 9px;

    padding: 16px;

    box-sizing: border-box;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);

    overflow-x: auto;
}


/* =========================================================
   TABLE
========================================================= */

.item-table {
    width: 100% !important;

    min-width: 1050px;

    border-collapse: collapse !important;

    background: #ffffff;
}


/* =========================================================
   HEADER
========================================================= */

.item-table thead th {
    background: #00516b !important;

    color: #ffffff !important;

    padding: 12px 9px !important;

    height: 46px;

    text-align: center !important;

    vertical-align: middle;

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;

    border: none !important;
}


/* =========================================================
   BODY
========================================================= */

.item-table tbody td {
    padding: 11px 9px !important;

    height: 46px;

    text-align: center;

    vertical-align: middle;

    font-size: 13px;

    color: #374151;

    border-bottom: 1px solid #e5e7eb !important;

    white-space: nowrap;
}


/* =========================================================
   ALTERNATE ROW
========================================================= */

.item-table tbody tr:nth-child(even) {
    background: #f8fafc;
}


/* =========================================================
   HOVER
========================================================= */

.item-table tbody tr:hover {
    background: #eaf4f8 !important;
}


/* =========================================================
   ITEM TITLE
========================================================= */

.item-table .item-title-cell {
    text-align: left !important;

    min-width: 180px;

    padding-left: 13px !important;

    font-weight: 600;

    color: #1e293b;
}


/* =========================================================
   ACTION COLUMN
========================================================= */

.item-table th.action-column,
.item-table td.action-column {
    width: 58px !important;

    min-width: 58px !important;

    max-width: 58px !important;

    padding: 7px 5px !important;

    text-align: center !important;
}


/* =========================================================
   ACTION BUTTON
========================================================= */

.item-action {
    width: 31px;
    height: 31px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border-radius: 6px;

    color: #ffffff !important;

    text-decoration: none;

    transition: all 0.2s ease;
}

.item-action i {
    font-size: 14px;
}


/* EDIT */

.edit-action {
    background: #0d6efd;
}

.edit-action:hover {
    background: #0b5ed7;

    color: #ffffff !important;

    transform: translateY(-1px);
}


/* DELETE */

.delete-action {
    background: #dc3545;
}

.delete-action:hover {
    background: #bb2d3b;

    color: #ffffff !important;

    transform: translateY(-1px);
}


/* =========================================================
   NO DATA
========================================================= */

.item-no-data {
    padding: 35px !important;

    text-align: center !important;

    color: #64748b !important;

    font-size: 14px !important;
}

.item-no-data i {
    margin-right: 6px;

    font-size: 17px;

    color: #00516b;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .item-page-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 12px;
    }

    .item-page-header h2 {
        font-size: 24px;
    }

    .item-add-btn {
        width: auto;
    }

    .item-table-card {
        padding: 10px;
    }

}
/* =========================================
   ADD ITEM FORM HEADER
========================================= */

.item-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding: 0;
    background: transparent;
}

.item-form-header h2 {
    margin: 0;

    display: flex;
    align-items: center;
    gap: 10px;

    color: #162d4d;

    font-size: 27px;
    font-weight: 700;
}

.item-form-header h2 i {
    font-size: 25px;
}

.item-form-header .page-subtitle {
    margin: 6px 0 0;

    color: #64748b;

    font-size: 14px;
}


/* =========================================================
   ADD ITEM FORM PAGE
========================================================= */

.form-card {
    width: 100%;
    box-sizing: border-box;
    padding: 30px;
    background: transparent;
}


/* =========================================================
   FORM HEADER
========================================================= */

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding: 0;
    background: transparent;
}

.form-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;

    color: #162d4d;
    font-size: 27px;
    font-weight: 700;
}

.form-header h2 i {
    font-size: 25px;
    color: #162d4d;
}

.form-header .page-subtitle {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}


/* =========================================================
   BACK TO ITEMS BUTTON
========================================================= */

.form-header .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 11px 18px;

    background: #005d73;
    color: #ffffff;

    border-radius: 7px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition: all 0.2s ease;
}

.form-header .back-btn:hover {
    background: #004b5d;
    color: #ffffff;
    transform: translateY(-1px);
}


/* =========================================================
   FORM SECTIONS
========================================================= */

.form-section {
    background: #ffffff;
    border-radius: 10px;

    padding: 25px;

    margin-bottom: 20px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   SECTION TITLE
========================================================= */

.form-section-title {
    display: flex;
    align-items: center;
    gap: 9px;

    margin: 0 0 22px 0;

    padding-bottom: 12px;

    color: #162d4d;

    font-size: 17px;
    font-weight: 700;

    border-bottom: 1px solid #e2e8f0;
}

.form-section-title i {
    font-size: 18px;
    color: #005d73;
}


/* =========================================================
   FORM GRID
========================================================= */

.item-form-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;
}


/* =========================================================
   FORM GROUP
========================================================= */

.form-group {
    width: 100%;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 7px;

    color: #334155;

    font-size: 13px;
    font-weight: 600;
}

.form-group label i {
    color: #005d73;
    font-size: 14px;
}


/* =========================================================
   INPUTS / SELECT
========================================================= */

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;

    min-height: 42px;

    padding: 9px 12px;

    border: 1px solid #cbd5e1;
    border-radius: 6px;

    background: #ffffff;

    color: #334155;

    font-size: 14px;

    outline: none;

    transition: border-color 0.2s ease,
                box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #005d73;

    box-shadow: 0 0 0 2px rgba(0, 93, 115, 0.08);
}


/* =========================================================
   ERROR
========================================================= */

.form-group ul.errorlist {
    margin: 5px 0 0;
    padding: 0;

    list-style: none;

    color: #dc2626;

    font-size: 12px;
}


/* =========================================================
   BUTTON AREA
========================================================= */

.form-buttons {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 5px;

    padding: 20px 25px;

    background: #ffffff;

    border-radius: 10px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   SAVE BUTTON
========================================================= */

.save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 11px 20px;

    border: none;
    border-radius: 7px;

    background: #005d73;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.save-btn:hover {
    background: #004b5d;
    transform: translateY(-1px);
}

.save-btn i {
    font-size: 16px;
}


/* =========================================================
   RESET BUTTON
========================================================= */

.reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 11px 20px;

    border: 1px solid #cbd5e1;
    border-radius: 7px;

    background: #ffffff;
    color: #475569;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: #f1f5f9;
    color: #334155;
}


/* =========================================================
   CANCEL BUTTON
========================================================= */

.form-buttons .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 11px 20px;

    border-radius: 7px;

    background: #64748b;
    color: #ffffff;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition: all 0.2s ease;
}

.form-buttons .back-btn:hover {
    background: #475569;
    color: #ffffff;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .form-card {
        padding: 20px;
    }

    .item-form-grid {
        grid-template-columns: 1fr;
    }

    .form-header {
        gap: 15px;
    }
}


@media (max-width: 600px) {

    .form-card {
        padding: 15px;
    }

    .form-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-header .back-btn {
        width: auto;
    }

    .form-section {
        padding: 18px;
    }

    .form-buttons {
        flex-wrap: wrap;
        padding: 18px;
    }
}
/* =========================================
   ADD ITEM - HEADER OUTSIDE WHITE CARD
========================================= */

.form-card {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 30px !important;
}


/* HEADER OUTSIDE */

.form-header {
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 22px !important;

    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* ADD ITEM TEXT */

.form-header h2 {
    margin: 0 !important;

    display: flex;
    align-items: center;
    gap: 10px;

    color: #162d4d !important;

    font-size: 27px !important;
    font-weight: 700 !important;
}

.form-header h2 i {
    color: #162d4d !important;
    font-size: 25px !important;
}


/* SUBTITLE */

.form-header .page-subtitle {
    margin: 6px 0 0 !important;

    color: #64748b !important;

    font-size: 14px;
}


/* =========================================
   BACK TO ITEMS - DARK BUTTON
========================================= */

.form-header .back-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background: #005d73 !important;
    color: #ffffff !important;

    border: none !important;
    border-radius: 7px;

    padding: 11px 20px;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    box-shadow: none !important;
}

.form-header .back-btn:hover {
    background: #004b5d !important;
    color: #ffffff !important;
}


/* =========================================
   WHITE FORM SECTIONS
========================================= */

.form-section {
    background: #ffffff !important;

    border-radius: 10px;

    padding: 25px;

    margin-bottom: 20px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    border: none;
}


/* =========================================
   SAVE BUTTON - DARK
========================================= */

.save-btn {
    background: #005d73 !important;
    color: #ffffff !important;

    border: none !important;
}

.save-btn:hover {
    background: #004b5d !important;
    color: #ffffff !important;
}


/* =========================================
   RESET BUTTON
========================================= */

.reset-btn {
    background: #64748b !important;
    color: #ffffff !important;

    border: none !important;
}

.reset-btn:hover {
    background: #475569 !important;
    color: #ffffff !important;
}


/* =========================================
   CANCEL BUTTON
========================================= */

.form-buttons .back-btn {
    background: #64748b !important;
    color: #ffffff !important;

    border: none !important;
}

.form-buttons .back-btn:hover {
    background: #475569 !important;
    color: #ffffff !important;
}


/* =========================================
   BUTTON AREA
========================================= */

.form-buttons {
    background: transparent !important;

    box-shadow: none !important;

    padding: 5px 0 !important;
}



/* =========================================================
   SALE INVOICE PAGE
========================================================= */

.sale-invoice-page {
    padding: 20px;
    background: #f5f7f9;
    min-height: calc(100vh - 70px);
}


/* =========================================================
   PAGE HEADER
========================================================= */

.sale-invoice-header {
    background: #00516b;
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
}

.sale-invoice-header h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 600;
}

.sale-invoice-header p {
    margin: 5px 0 0;
    font-size: 13px;
    opacity: 0.85;
}


/* =========================================================
   MAIN CARD
========================================================= */

.sale-invoice-card {
    background: #ffffff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}


/* =========================================================
   INVOICE INFORMATION
========================================================= */

.invoice-information {
    padding: 20px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #00516b;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e7eb;
}

.invoice-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    padding: 7px 10px;
    border: 1px solid #cbd5df;
    border-radius: 5px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    outline: none;
}

.form-group textarea {
    height: 38px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #00516b;
    box-shadow: 0 0 0 2px rgba(0, 81, 107, 0.08);
}


/* =========================================================
   BUYER ROW
========================================================= */

.buyer-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}


/* =========================================================
   DIVIDER
========================================================= */

.invoice-divider {
    border: 0;
    border-top: 1px solid #e1e7eb;
    margin: 0 20px;
}


/* =========================================================
   ITEM SELECTION
========================================================= */

.item-selection {
    padding: 18px 20px;
}

.item-selection-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.item-selection-row .item-select-wrapper {
    flex: 1;
}

.item-select-wrapper label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.item-select {
    width: 100%;
    height: 40px;
    padding: 7px 12px;
    border: 1px solid #cbd5df;
    border-radius: 5px;
    background: #ffffff;
    font-size: 13px;
    color: #334155;
    outline: none;
}

.item-select:focus {
    border-color: #00516b;
}

.add-item-btn {
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: 5px;
    background: #00516b;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.add-item-btn:hover {
    background: #003f52;
}


/* =========================================================
   SAVE BUTTONS
========================================================= */

.invoice-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 4px 20px 18px;
}

.save-post-btn,
.save-btn {
    border: none;
    border-radius: 5px;
    height: 38px;
    padding: 0 20px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.save-post-btn {
    background: #78b82a;
}

.save-post-btn:hover {
    background: #659d20;
}

.save-btn {
    background: #f0a323;
}

.save-btn:hover {
    background: #d98e11;
}


/* =========================================================
   MASTER DETAILS
========================================================= */

.master-details {
    padding: 0 20px 20px;
}

.master-details-header {
    background: #00516b;
    color: #ffffff;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

.master-details-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dbe3e8;
    border-top: none;
}

.master-details-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.master-details-table th {
    background: #eef3f6;
    color: #334155;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    border-right: 1px solid #dbe3e8;
    border-bottom: 1px solid #dbe3e8;
}

.master-details-table td {
    padding: 8px 9px;
    font-size: 11px;
    color: #475569;
    white-space: nowrap;
    text-align: center;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.empty-row td {
    height: 45px;
    color: #94a3b8;
    font-style: italic;
}


/* =========================================================
   TOTALS
========================================================= */

.invoice-bottom {
    display: flex;
    justify-content: flex-end;
    padding: 0 20px 25px;
}

.invoice-totals {
    width: 360px;
    border: 1px solid #dbe3e8;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #e8edf0;
    font-size: 12px;
}

.total-row span:first-child {
    color: #64748b;
    font-weight: 600;
}

.total-row span:last-child {
    color: #334155;
    font-weight: 600;
}

.grand-total {
    background: #00516b;
    color: #ffffff;
    padding: 11px 12px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {
    .invoice-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .sale-invoice-page {
        padding: 10px;
    }

    .invoice-grid,
    .buyer-row {
        grid-template-columns: 1fr;
    }

    .item-selection-row {
        flex-direction: column;
        align-items: stretch;
    }

    .add-item-btn {
        width: 100%;
    }

    .invoice-totals {
        width: 100%;
    }

    .invoice-bottom {
        justify-content: stretch;
    }
}
.buyer-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr;
    gap: 15px;
    margin-top: 15px;
}
.buyer-main-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.buyer-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr;
    gap: 15px;
    margin-top: 15px;
}
/* =====================================================
   SALE INVOICE PAGE
===================================================== */

.sale-invoice-page {
    padding: 20px;
    background: #f5f7f9;
    min-height: calc(100vh - 70px);
}

.sale-invoice-header {
    background: #00516b;
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
}

.sale-invoice-header h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 600;
}

.sale-invoice-header p {
    margin: 5px 0 0;
    font-size: 13px;
    opacity: .85;
}

.sale-invoice-card {
    background: #ffffff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}


/* =====================================================
   INVOICE INFORMATION
===================================================== */

.invoice-information {
    padding: 20px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #00516b;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e7eb;
}

.invoice-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 38px;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid #cbd5df;
    border-radius: 5px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #00516b;
    box-shadow: 0 0 0 2px rgba(0,81,107,.08);
}


/* =====================================================
   GRN + BUYER
===================================================== */

.grn-buyer-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}


/* =====================================================
   BUYER DETAILS
===================================================== */

.buyer-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr;
    gap: 15px;
    margin-top: 15px;
}


/* =====================================================
   DIVIDER
===================================================== */

.invoice-divider {
    border: 0;
    border-top: 1px solid #e1e7eb;
    margin: 0 20px;
}


/* =====================================================
   ITEM SELECTION
===================================================== */

.item-selection {
    padding: 18px 20px;
}

.item-selection-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.item-select-wrapper {
    flex: 1;
}

.item-select-wrapper label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.item-select {
    width: 100%;
    height: 40px;
    padding: 7px 12px;
    border: 1px solid #cbd5df;
    border-radius: 5px;
    background: #ffffff;
    font-size: 13px;
    color: #334155;
}

.add-item-btn {
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: 5px;
    background: #00516b;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.add-item-btn:hover {
    background: #003f52;
}


/* =====================================================
   SAVE BUTTONS
===================================================== */

.invoice-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 4px 20px 18px;
}

.save-post-btn,
.save-btn {
    height: 38px;
    padding: 0 20px;
    border: none;
    border-radius: 5px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.save-post-btn {
    background: #78b82a;
}

.save-btn {
    background: #f0a323;
}

.save-post-btn:hover {
    background: #659d20;
}

.save-btn:hover {
    background: #d98e11;
}


/* =====================================================
   MASTER DETAILS
===================================================== */

.master-details {
    width: 100%;
    padding: 0 15px 25px;
    box-sizing: border-box;
}

.master-details-header {
    width: 100%;
    background: #00516b;
    color: #ffffff;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
    box-sizing: border-box;
}

.master-details-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #dbe3e8;
    border-top: none;
    box-sizing: border-box;
}

.master-details-table {
    width: max-content;
    min-width: 2400px;
    border-collapse: collapse;
}

.master-details-table th {
    background: #eef3f6;
    color: #334155;
    padding: 11px 12px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    border-right: 1px solid #dbe3e8;
    border-bottom: 1px solid #dbe3e8;
}

.master-details-table td {
    padding: 10px 12px;
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
    text-align: center;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.master-details-table tbody tr:hover {
    background: #f8fafc;
}

.empty-row td {
    height: 60px;
    color: #94a3b8;
    font-style: italic;
}


/* =====================================================
   TOTALS
===================================================== */

.invoice-bottom {
    display: flex;
    justify-content: flex-end;
    padding: 0 20px 25px;
}

.invoice-totals {
    width: 360px;
    border: 1px solid #dbe3e8;
    border-radius: 6px;
    overflow: hidden;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #e8edf0;
    font-size: 12px;
}

.total-row span:first-child {
    color: #64748b;
    font-weight: 600;
}

.total-row span:last-child {
    color: #334155;
    font-weight: 600;
}

.grand-total {
    display: flex;
    justify-content: space-between;
    padding: 11px 12px;
    background: #00516b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}


/* =====================================================
   SEARCHABLE DROPDOWNS
===================================================== */

.select2-container {
    width: 100% !important;
}

.select2-container--open {
    z-index: 99999;
}

.select2-dropdown {
    top: 100% !important;
    bottom: auto !important;
}

.select2-container--open .select2-dropdown--above {
    top: 100% !important;
    bottom: auto !important;
}

.select2-container--open .select2-dropdown--below {
    top: 100% !important;
    bottom: auto !important;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1100px) {

    .invoice-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .buyer-details-row {
        grid-template-columns: 1fr 1fr;
    }
}


@media (max-width: 700px) {

    .sale-invoice-page {
        padding: 10px;
    }

    .invoice-grid,
    .grn-buyer-row,
    .buyer-details-row {
        grid-template-columns: 1fr;
    }

    .item-selection-row {
        flex-direction: column;
        align-items: stretch;
    }

    .add-item-btn {
        width: 100%;
    }

    .invoice-bottom {
        justify-content: stretch;
    }

    .invoice-totals {
        width: 100%;
    }
}
/* =====================================================
   SEARCHABLE DROPDOWN
===================================================== */

.searchable-dropdown + .select2 {
    width: 100% !important;
}

.select2-container {
    width: 100% !important;
}

.select2-container--default
.select2-selection--single {
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    line-height: 36px;
    padding-left: 10px;
    font-size: 13px;
    color: #334155;
}

.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    height: 36px;
}

.select2-container--open {
    z-index: 99999;
}

/* Search box */

.select2-search--dropdown {
    padding: 8px;
}

.select2-search--dropdown
.select2-search__field {
    height: 34px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 13px;
    outline: none;
}

.select2-results__option {
    padding: 7px 10px;
    font-size: 13px;
}

/* Dropdown below */

.select2-container--open
.select2-dropdown--below {
    border-radius: 0 0 5px 5px;
}

.select2-container--open
.select2-dropdown--above {
    border-radius: 5px;
}
/* =====================================================
   SALE INVOICE SEARCHABLE DROPDOWNS
===================================================== */

.searchable-dropdown + .select2 {
    width: 100% !important;
}

.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    display: flex;
    align-items: center;
    background: #ffffff;
}

.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    line-height: 36px;
    padding-left: 10px;
    font-size: 13px;
    color: #334155;
}

.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    height: 36px;
}

.select2-container--open {
    z-index: 99999;
}

/* Search box inside dropdown */
.select2-search--dropdown {
    padding: 8px;
}

.select2-search--dropdown .select2-search__field {
    height: 34px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 13px;
    outline: none;
}

/* Dropdown options */
.select2-results__option {
    padding: 7px 10px;
    font-size: 13px;
}

/* Open downward */
.select2-container--open .select2-dropdown--below {
    border-radius: 0 0 5px 5px;
}

.select2-container--open .select2-dropdown--above {
    border-radius: 5px;
}
/* =====================================================
   BUYER DETAILS
===================================================== */

.buyer-details-row {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #dbe3e8;
    border-radius: 6px;
}

.buyer-details-row .form-group {
    display: flex;
    flex-direction: column;
}

.buyer-details-row label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.buyer-details-row input {
    width: 100%;
    height: 38px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .buyer-details-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .buyer-details-row {
        grid-template-columns: 1fr;
    }
}
/* =====================================================
   SALE INVOICE HEADER
===================================================== */

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.invoice-header h2 {
    margin: 0;
}

.invoice-subtitle {
    margin: 5px 0 0;
}


/* =====================================================
   ADD NEW INVOICE BUTTON
===================================================== */

.add-invoice-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 18px;

    text-decoration: none;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.add-invoice-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.add-invoice-btn i {
    font-size: 16px;
}
/* =====================================================
   SELECT2 - FORM INPUT STYLE
===================================================== */

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: 42px !important;
    border: 1px solid #b8c7da !important;
    border-radius: 6px !important;
    background-color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 12px !important;
}

.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    color: #333 !important;
    line-height: 40px !important;
    padding-left: 0 !important;
    font-size: 14px !important;
}

.select2-container--default
.select2-selection--single
.select2-selection__placeholder {
    color: #8a98a8 !important;
}

.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    height: 40px !important;
    right: 8px !important;
}

/* Focus */

.select2-container--default.select2-container--focus
.select2-selection--single {
    border-color: #8faed0 !important;
    box-shadow: 0 0 0 2px rgba(100, 140, 180, 0.08) !important;
}


/* =====================================================
   SELECT2 DROPDOWN
===================================================== */

.select2-dropdown {
    border: 1px solid #b8c7da !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.select2-container--default
.select2-search--dropdown
.select2-search__field {
    height: 38px !important;
    border: 1px solid #b8c7da !important;
    border-radius: 5px !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
    outline: none !important;
}

.select2-container--default
.select2-results__option {
    padding: 9px 12px !important;
    font-size: 14px !important;
}

.select2-container--default
.select2-results__option--highlighted[aria-selected] {
    background-color: #eef4fa !important;
    color: #333 !important;
}
.bi-box-seam {
    color: white;
}
.sidebar .nav-link i {
    color: white;
}
.sidebar .nav-link {
    color: white;
}

.sidebar .nav-link i {
    color: white;
}
.form-header h2 i.bi-box-seam {
    color: #ffffff !important;
}
.form-header h2 i.bi-box-seam {
    color: #ffffff !important;
}
/* =========================================================
   SALE INVOICE - ITEM REGISTRATION STYLE
   ONLY SALE INVOICE
========================================================= */

.invoice-page {
    width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}


/* =========================================================
   SALE INVOICE MAIN HEADER
========================================================= */

.invoice-header {
    width: 100%;
    min-height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
    padding: 0 2px;

    box-sizing: border-box;
}

.invoice-header > div:first-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.invoice-header h2 {
    margin: 0;

    font-size: 28px;
    font-weight: 700;

    color: #123b63;

    display: flex;
    align-items: center;
    gap: 10px;
}

.invoice-header h2 i {
    width: 44px;
    height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #00516b;
    color: #ffffff;

    border-radius: 8px;

    font-size: 22px;
}

.invoice-subtitle {
    margin: 6px 0 0 2px;

    font-size: 14px;
    color: #58728c;
}


/* =========================================================
   ADD INVOICE BUTTON
========================================================= */

.invoice-header .add-invoice-btn {
    height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 0 20px;

    background: #00516b;
    color: #ffffff;

    border: none;
    border-radius: 7px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    box-shadow: 0 3px 8px rgba(0, 81, 107, 0.20);

    transition: 0.25s ease;
}

.invoice-header .add-invoice-btn i {
    color: #ffffff;
    font-size: 17px;
}

.invoice-header .add-invoice-btn:hover {
    background: #003f52;
    color: #ffffff;

    transform: translateY(-1px);
}


/* =========================================================
   INVOICE INFORMATION CARD
   SAME STYLE AS ITEM REGISTRATION CARD
========================================================= */

.invoice-info-card {
    width: 100%;

    background: #ffffff;

    border-radius: 10px;

    padding: 24px 25px;

    margin-bottom: 20px;

    box-sizing: border-box;

    border: 1px solid #e2e8f0;

    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
}


/* =========================================================
   SECTION HEADER
========================================================= */

.invoice-section-header {
    width: 100%;

    display: flex;
    align-items: center;

    min-height: 46px;

    margin-bottom: 22px;

    padding-left: 14px;

    border-left: 4px solid #00516b;
    border-bottom: 1px solid #dce5ed;

    box-sizing: border-box;
}

.invoice-section-header h3 {
    margin: 0;

    font-size: 18px;
    font-weight: 700;

    color: #123b63;

    display: flex;
    align-items: center;
    gap: 9px;
}

.invoice-section-header h3 i {
    color: #00516b;
    font-size: 17px;
}


/* =========================================================
   INVOICE FORM GRID
========================================================= */

.invoice-form-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    column-gap: 24px;
    row-gap: 18px;

    width: 100%;
}


/* =========================================================
   FORM GROUP
========================================================= */

.invoice-form-grid .form-group {
    width: 100%;
    min-width: 0;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   LABEL
========================================================= */

.invoice-form-grid .form-group label {
    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 600;

    color: #173f64;
}


/* =========================================================
   INPUTS
========================================================= */

.invoice-form-grid .form-control,
.invoice-form-grid select,
.invoice-form-grid input {
    width: 100%;

    height: 43px;

    padding: 0 13px;

    box-sizing: border-box;

    border: 1px solid #bdcfe0;
    border-radius: 6px;

    background: #ffffff;

    color: #243b53;

    font-size: 14px;

    outline: none;

    transition: border-color 0.2s ease,
                box-shadow 0.2s ease;
}


/* =========================================================
   INPUT FOCUS
========================================================= */

.invoice-form-grid .form-control:focus,
.invoice-form-grid select:focus,
.invoice-form-grid input:focus {
    border-color: #00516b;

    box-shadow: 0 0 0 2px rgba(0, 81, 107, 0.10);
}


/* =========================================================
   INVOICE ITEMS CARD
========================================================= */

.invoice-items-card {
    width: 100%;

    background: #ffffff;

    border-radius: 10px;

    padding: 0;

    margin-top: 20px;

    box-sizing: border-box;

    border: 1px solid #e2e8f0;

    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);

    overflow: hidden;
}


/* =========================================================
   INVOICE ITEMS HEADER
========================================================= */

.invoice-items-card .invoice-section-header {
    margin: 0;

    min-height: 50px;

    padding: 0 20px;

    background: #00516b;

    border: none;

    color: #ffffff;
}

.invoice-items-card .invoice-section-header h3 {
    color: #ffffff;
}

.invoice-items-card .invoice-section-header h3 i {
    color: #ffffff;
}


/* =========================================================
   ITEMS CONTENT
========================================================= */

.invoice-items-content {
    padding: 22px 24px;

    box-sizing: border-box;
}


/* =========================================================
   ITEM SELECT ROW
========================================================= */

.invoice-item-select-row {
    display: grid;

    grid-template-columns: 1fr auto;

    gap: 12px;

    align-items: end;

    margin-bottom: 20px;
}

.invoice-item-select-row .form-group {
    width: 100%;
}


/* =========================================================
   ITEM SELECT
========================================================= */

.invoice-item-select-row select,
.invoice-item-select-row .form-control {
    width: 100%;

    height: 43px;

    border: 1px solid #bdcfe0;

    border-radius: 6px;

    padding: 0 13px;

    background: #ffffff;

    font-size: 14px;
}


/* =========================================================
   ADD ITEM BUTTON
========================================================= */

.add-item-btn {
    height: 43px;

    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    background: #00516b;
    color: #ffffff;

    border: none;
    border-radius: 6px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    transition: 0.2s ease;
}

.add-item-btn:hover {
    background: #003f52;
}


/* =========================================================
   TABLE WRAPPER
========================================================= */

.master-details-table-wrapper {
    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    border: 1px solid #dce5ed;
    border-radius: 7px;

    background: #ffffff;
}


/* =========================================================
   MASTER DETAILS TABLE
========================================================= */

.master-details-table {
    width: 100%;

    min-width: 2200px;

    border-collapse: collapse;

    margin: 0;
}

.master-details-table th {
    height: 45px;

    padding: 10px 12px;

    background: #00516b;

    color: #ffffff;

    font-size: 12px;
    font-weight: 600;

    text-align: left;

    white-space: nowrap;

    border-right: 1px solid rgba(255,255,255,0.15);
}

.master-details-table td {
    height: 42px;

    padding: 8px 12px;

    font-size: 13px;

    color: #334e68;

    border-bottom: 1px solid #e6edf3;

    white-space: nowrap;
}

.master-details-table tbody tr:hover {
    background: #f7fafc;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .invoice-form-grid {
        grid-template-columns: 1fr;
    }

    .invoice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .invoice-header .add-invoice-btn {
        align-self: flex-start;
    }
}

@media (max-width: 600px) {

    .invoice-info-card {
        padding: 18px;
    }

    .invoice-items-content {
        padding: 18px;
    }

    .invoice-header h2 {
        font-size: 24px;
    }

    .invoice-item-select-row {
        grid-template-columns: 1fr;
    }

    .add-item-btn {
        width: 100%;
    }
}
/* =====================================================
   SALE INVOICE BACK BUTTON
===================================================== */

.sale-invoice-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 9px 18px;

    background: #6c757d;
    color: #fff;

    border: none;
    border-radius: 6px;

    text-decoration: none;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.sale-invoice-back-btn:hover {
    background: #545b62;
    color: #fff;
    text-decoration: none;
}

.sale-invoice-back-btn i {
    font-size: 15px;
}