
/* ======================================================
   MAKE INVOICING SYSTEM
   PART 1: GLOBAL STYLES AND BASE COMPONENTS
   ====================================================== */

/* ------------------------------------------------------
   1. GLOBAL CONFIGURATION
   ------------------------------------------------------ */

* {
    box-sizing: border-box;
}

:root {
    --green: #173e32;
    --gold: #b78c42;
    --ink: #1b2924;
    --muted: #6c7872;
    --line: #e0e6e1;
    --bg: #f4f6f3;
}

body {
    margin: 0;
    font: 15px system-ui, -apple-system, Segoe UI, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

[hidden] {
    display: none !important;
}

/* ------------------------------------------------------
   2. TYPOGRAPHY
   ------------------------------------------------------ */

h1 {
    font-size: 28px;
    letter-spacing: -0.7px;
    margin: 7px 0;
}

h2 {
    font-size: 19px;
    margin: 0 0 14px;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold);
}

.muted,
small {
    color: var(--muted);
}

/* ------------------------------------------------------
   3. BUTTONS AND FORM CONTROLS
   ------------------------------------------------------ */

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    border-radius: 7px;
    padding: 10px 15px;
    cursor: pointer;
}

button:hover {
    filter: brightness(0.95);
}

button:disabled {
    opacity: 0.55;
    cursor: wait;
}

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

.ghost {
    background: transparent;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ccd6ce;
    border-radius: 6px;
    background: white;
    color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #b7c9bb;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 14px 0;
}

label input,
label select,
label textarea {
    display: block;
    margin-top: 7px;
    font-weight: 400;
}

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

/* ------------------------------------------------------
   4. LOGIN PAGE
   ------------------------------------------------------ */

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;

    background:
        radial-gradient(
            ellipse at top left,
            #dae5da,
            transparent 60%
        ),
        var(--bg);
}

.login-card {
    width: min(430px, 94vw);
    padding: 38px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 25px 70px #173e3210;
}

.login-card .primary {
    width: 100%;
    margin: 12px 0 20px;
}

.login-card small {
    display: block;
    text-align: center;
}

/* ------------------------------------------------------
   5. SIDEBAR
   ------------------------------------------------------ */

aside {
    width: 230px;
    background: var(--green);
    color: white;

    position: fixed;
    inset: 0 auto 0 0;

    padding: 28px 22px;

    display: flex;
    flex-direction: column;
}

nav {
    margin-top: 30px;
    display: grid;
    gap: 8px;
}

nav button {
    background: transparent;
    border: 0;
    color: #cdded3;
    text-align: left;
    padding: 13px 16px;
}

nav button.active {
    background: #ffffff17;
    color: #fff;
    border-left: 3px solid #d5b779;
}

.aside-foot {
    margin-top: auto;
    font-size: 12px;
    color: #b1c8b9;
    line-height: 1.8;
}

/* ------------------------------------------------------
   6. MAIN DASHBOARD
   ------------------------------------------------------ */

main {
    margin-left: 230px;
    padding: 30px 40px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 32px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 23px;
}

.header-actions {
    display: flex;
    gap: 18px;
    align-items: center;
}

/* ------------------------------------------------------
   7. DASHBOARD STATISTICS
   ------------------------------------------------------ */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 32px;
}

.stats article,
.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 25px;
}

.stats span,
.stats small {
    display: block;
}

.stats strong {
    display: block;
    font-size: 25px;
    margin: 15px 0;
}

.stats article:last-child {
    border-top: 3px solid var(--gold);
}

/* ------------------------------------------------------
   8. SECTION HEADINGS
   ------------------------------------------------------ */

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.section-head h2 {
    margin: 0;
}

/* ------------------------------------------------------
   9. DATA TABLES
   ------------------------------------------------------ */

.table-wrap {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th {
    text-align: left;
    background: #edf1ec;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

td,
th {
    padding: 15px 17px;
    border-bottom: 1px solid #edf1ec;
}

td {
    font-size: 13px;
}

tr:last-child td {
    border-bottom: 0;
}

/* ------------------------------------------------------
   10. STATUS BADGES
   ------------------------------------------------------ */

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 11px;
    background: #f9efda;
    color: #845b0f;
}

.badge.paid {
    background: #e1eee3;
    color: #25613b;
}

.badge.void {
    background: #eee;
    color: #666;
}

/* ------------------------------------------------------
   11. LINKS AND FILTERS
   ------------------------------------------------------ */

.link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--green);
    font-weight: 650;
}

.filters {
    display: flex;
    gap: 12px;
    flex: 1;
}

.filters input {
    max-width: 420px;
}

.filters select {
    max-width: 180px;
}

/* ------------------------------------------------------
   12. FOOTER
   ------------------------------------------------------ */

footer {
    margin-top: 35px;
    font-size: 12px;
    color: var(--muted);
}

/* ------------------------------------------------------
   13. MODAL DIALOG
   ------------------------------------------------------ */

dialog {
    border: 0;
    border-radius: 12px;
    padding: 25px;

    width: min(950px, 94vw);
    max-height: 90vh;

    box-shadow: 0 20px 80px #0003;
}

dialog::backdrop {
    background: #10251dc0;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-head h2 {
    margin: 0;
}

/* ------------------------------------------------------
   14. GRID AND FORM LAYOUT
   ------------------------------------------------------ */

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.full {
    grid-column: 1 / -1;
}

.items input {
    min-width: 90px;
}

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

.items td,
.items th {
    padding: 6px;
}

/* ------------------------------------------------------
   15. TOTALS AND ACTION BUTTONS
   ------------------------------------------------------ */

.totals {
    margin: 20px 0 20px auto;
    max-width: 330px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.total-row.final {
    font-size: 20px;
    font-weight: 700;
    border-top: 1px solid var(--line);
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0 5px;
}

.narrow {
    max-width: 460px;
}

/* ------------------------------------------------------
   16. DETAILS AND EMPTY STATES
   ------------------------------------------------------ */

.detail-meta {
    padding: 18px;
    background: #f4f6f3;
    border-radius: 8px;
    margin: 15px 0;
    line-height: 1.8;
}

.detail-meta p {
    margin: 4px 0;
    white-space: pre-wrap;
}

.empty {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

/* ------------------------------------------------------
   17. TOAST NOTIFICATIONS
   ------------------------------------------------------ */

#toast {
    position: fixed;
    top: 18px;
    right: 18px;

    max-width: min(450px, 90vw);

    background: #173e32;
    color: #fff;

    padding: 17px 22px;
    border-radius: 9px;
    z-index: 1000;

    box-shadow: 0 10px 40px #0003;
}

#toast.error {
    background: #8a3434;
}

.hint {
    font-size: 12px;
    color: var(--muted);
}

/* ======================================================
   MAKE INVOICING SYSTEM
   PART 2: SALES WORKSPACE AND APPROVAL WORKFLOWS
   ====================================================== */


/* ======================================================
   18. RESPONSIVE BASE LAYOUT - TABLETS
   ====================================================== */

@media (max-width: 900px) {

    aside {
        width: 180px;
        padding: 25px 12px;
    }

    main {
        margin-left: 180px;
        padding: 24px 20px;
    }

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

    .stats strong {
        font-size: 23px;
    }
}


/* ======================================================
   19. RESPONSIVE BASE LAYOUT - MOBILE
   ====================================================== */

@media (max-width: 600px) {

    aside {
        position: static;
        width: 100%;
        padding: 12px;
    }

    aside img {
        width: 95px;
    }

    aside > p,
    .aside-foot {
        display: none;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        margin: 10px 0 0;
        gap: 2px;
    }

    nav button {
        font-size: 12px;
        padding: 9px;
    }

    main {
        margin-left: 0;
        padding: 20px 12px;
    }

    header {
        align-items: flex-start;
    }

    .header-actions {
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
    }

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

    .full {
        grid-column: auto;
    }

    .section-head,
    .filters {
        flex-wrap: wrap;
    }

    .section-head {
        align-items: flex-start;
    }

    .login-card {
        padding: 28px;
    }
}


/* ======================================================
   20. TWO-PAGE SALES WORKSPACE
   ====================================================== */

/* Two-page sales workspace */


/* ------------------------------------------------------
   SALES APPLICATION HEADER
   ------------------------------------------------------ */

.sales-app .sales-header {
    margin: 0;
    padding: 20px clamp(18px, 4vw, 64px);

    background: #fff;
    border-bottom: 1px solid var(--line);

    gap: 20px;

    position: sticky;
    top: 0;
    z-index: 10;
}


/* ------------------------------------------------------
   SALES BRANDING
   ------------------------------------------------------ */

.sales-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sales-brand img {
    max-width: 145px;
    max-height: 65px;
    object-fit: contain;
}

.sales-brand > div {
    border-left: 1px solid var(--line);
    padding-left: 16px;
}

.sales-brand strong,
.sales-brand span {
    display: block;
}

.sales-brand span {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--gold);
    margin-top: 6px;
}


/* ------------------------------------------------------
   SALES MAIN CONTENT
   ------------------------------------------------------ */

.sales-main {
    margin: 0 auto !important;
    padding: 32px clamp(18px, 4vw, 64px) !important;
    max-width: 1700px;
}


/* ------------------------------------------------------
   PAGE HEADING
   ------------------------------------------------------ */

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;
    margin-bottom: 28px;
}

.page-heading .muted {
    line-height: 1.6;
}


/* ======================================================
   21. SALES STATISTICS CARDS
   ====================================================== */

.sales-app .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.sales-app .stats strong {
    font-size: clamp(19px, 1.5vw, 27px);
    overflow-wrap: anywhere;
}

.sales-app .stats article {
    min-width: 0;
    padding: 22px;
}


/* ======================================================
   22. RECORDS PANEL
   ====================================================== */

.records-panel {
    background: #fff;

    border: 1px solid var(--line);
    border-radius: 14px;

    padding: 22px;
}

.records-panel .section-head {
    margin-top: 0;
}

.records-panel .filters {
    margin-bottom: 20px;
}


/* ======================================================
   23. RECORD PAGINATION
   ====================================================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 14px;
    margin-top: 20px;
}

.pagination span {
    font-size: 12px;
    color: var(--muted);
}


/* ======================================================
   24. BUTTON LINKS
   ====================================================== */

.button-link {
    display: inline-block;

    border: 1px solid var(--line);
    border-radius: 7px;

    padding: 11px 15px;

    text-decoration: none;
    color: var(--green);

    font-size: 14px;
    background: white;
}


/* ======================================================
   25. RECEIPT FORM BRANDING
   ====================================================== */

.receipt-form-brand {
    display: flex;
    align-items: center;
    gap: 28px;

    border-bottom: 2px solid var(--gold);

    padding-bottom: 18px;
    margin-bottom: 22px;
}

.receipt-form-brand img {
    width: 150px;
    max-height: 90px;
    object-fit: contain;
}

.receipt-form-brand p {
    margin: 6px 0;
}


/* ======================================================
   26. MATERIAL ITEMS TABLE
   ====================================================== */

.material-items {
    min-width: 850px;
}

.material-items td,
.material-items th {
    padding: 8px;
}

.material-items input {
    min-width: 90px;
}

.material-items input[name=material_name] {
    min-width: 160px;
}

.material-items .line-amount {
    min-width: 130px;
}


/* ======================================================
   27. INVOICE LIVE TOTAL
   ====================================================== */

.invoice-live-total {
    display: flex;
    justify-content: space-between;
    gap: 15px;

    background: #edf2ec;
    border-radius: 8px;

    padding: 18px;
    margin: 20px 0;

    font-size: 18px;
}


/* ======================================================
   28. PAYMENT DETAILS
   ====================================================== */

.payment-details {
    padding: 16px 20px;

    border: 1px solid var(--line);
    border-radius: 8px;
}

.payment-details p {
    margin: 8px 0;
}


/* ======================================================
   29. PAYMENT RECEIPTS LIST
   ====================================================== */

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

.receipt-list a {
    padding: 12px;

    background: #f2f5ef;
    border-radius: 6px;

    color: var(--green);
    text-decoration: none;
}


/* ======================================================
   30. VOID INVOICE STATUS
   ====================================================== */

.void {
    color: #a43232;
}


/* ======================================================
   31. KEYBOARD FOCUS STYLING
   ====================================================== */

button:focus-visible,
.button-link:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}


/* ======================================================
   32. SALES WORKSPACE - TABLET LAYOUT
   ====================================================== */

@media (max-width: 1000px) {

    .sales-app .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sales-brand > div {
        display: none;
    }
}


/* ======================================================
   33. SALES WORKSPACE - MOBILE LAYOUT
   ====================================================== */

@media (max-width: 600px) {

    .sales-app .sales-header {
        padding: 16px;
        position: static;
        align-items: center;
    }

    .sales-brand img {
        width: 105px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sales-main {
        padding: 24px 14px !important;
    }

    .sales-app .stats {
        gap: 10px;
    }

    .sales-app .stats article {
        padding: 15px;
    }

    .sales-app .stats strong {
        font-size: 18px;
    }

    .records-panel {
        padding: 14px;
    }

    .records-panel .filters input,
    .records-panel .filters select {
        max-width: none;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .receipt-form-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .invoice-live-total {
        font-size: 16px;
    }

    dialog {
        padding: 18px;
    }
}


/* ======================================================
   34. RECORD NAVIGATION TABS
   ====================================================== */

.record-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 20px;
}

.record-tabs button.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}


/* ======================================================
   35. ACCOUNTANT WHATSAPP SHARING
   ====================================================== */

/* Accountant WhatsApp sharing */


/* ------------------------------------------------------
   RECORD ACTION BUTTONS
   ------------------------------------------------------ */

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


/* ------------------------------------------------------
   WHATSAPP BUTTON
   ------------------------------------------------------ */

.whatsapp-button {
    background: #176d43;
    border-color: #176d43;

    color: #fff;
    font-weight: 600;
}

.whatsapp-button:hover {
    background: #125b37;
    filter: none;
}


/* ------------------------------------------------------
   WHATSAPP MESSAGE PREVIEW
   ------------------------------------------------------ */

.whatsapp-preview {
    min-height: 260px;
    line-height: 1.65;
    background: #f5f8f2;
}

#whatsapp-form .hint {
    line-height: 1.6;
}

#invoice-form label > .hint {
    display: block;
    margin-top: 8px;
    font-weight: 400;
}


/* ======================================================
   36. RESPONSIVE WHATSAPP CONTROLS
   ====================================================== */

@media (max-width: 600px) {

    .record-actions {
        flex-wrap: wrap;
    }

    #whatsapp-form .actions {
        justify-content: flex-start;
    }

    .whatsapp-preview {
        min-height: 220px;
    }
}


/* ======================================================
   37. BANK AND ADVANCE PAYMENT FIELDS
   ====================================================== */

#bank-fields[hidden] {
    display: none;
}

#advance-field[hidden] {
    display: none;
}


/* ======================================================
   38. PROFILE SIGNATURE
   ====================================================== */

.profile-signature {
    margin: 18px 0;
    padding: 16px;

    border: 1px solid #dbe5db;
    border-radius: 12px;

    background: #fff;
}

.profile-signature img {
    max-width: 240px;
    max-height: 100px;
    object-fit: contain;
}


/* ------------------------------------------------------
   REMOVE SIGNATURE OPTION
   ------------------------------------------------------ */

.signature-remove {
    display: flex;
    align-items: center;
    gap: 10px;
}

.signature-remove input {
    width: auto;
}


/* ======================================================
   39. SHARED ACCOUNTANT / EXECUTIVE HEADER
   ====================================================== */

/* Shared accountant/executive system header. */


/* ------------------------------------------------------
   HEADER GRID
   ------------------------------------------------------ */

.sales-app .sales-header {
    display: grid;

    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}


/* ------------------------------------------------------
   COMPANY LOGO POSITION
   ------------------------------------------------------ */

.sales-app .sales-brand {
    justify-self: start;
}

.sales-app .sales-header .sales-brand img {
    width: 220px;
    max-width: 220px;
    max-height: 78px;
    height: auto;
}


/* ------------------------------------------------------
   SYSTEM HEADER TITLE
   ------------------------------------------------------ */

.sales-app .system-header-title {
    font-size: clamp(18px, 1.7vw, 27px);
    font-weight: 800;

    text-align: center;
    color: #173e32;

    letter-spacing: -0.4px;
}


/* ------------------------------------------------------
   HEADER ACTIONS
   ------------------------------------------------------ */

.sales-app .header-actions {
    justify-self: end;
}


/* ======================================================
   40. RESPONSIVE SHARED HEADER - TABLETS
   ====================================================== */

@media (max-width: 1000px) {

    .sales-app .sales-header {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }

    .sales-app .system-header-title {
        grid-column: 1 / -1;
        grid-row: 2;

        text-align: center;
        font-size: 21px;
    }

    .sales-app .sales-header .sales-brand img {
        width: 190px;
        max-width: 190px;
        max-height: 68px;
    }
}


/* ======================================================
   41. RESPONSIVE SHARED HEADER - MOBILE
   ====================================================== */

@media (max-width: 540px) {

    .sales-app .sales-header .sales-brand img {
        width: 155px;
        max-width: 155px;
        max-height: 58px;
    }

    .sales-app .system-header-title {
        font-size: 19px;
    }

    .sales-app .header-actions {
        font-size: 12px;
    }
}


/* ======================================================
   42. DELETE INVOICE BUTTON
   ====================================================== */

button.delete-invoice {
    background: #fff1f0;
    color: #a51d25;

    border: 1px solid #efbec1;

    font-weight: 700;
}

button.delete-invoice:hover {
    background: #a51d25;
    color: white;
    border-color: #a51d25;
}


/* ======================================================
   43. INVOICE EDIT APPROVAL WORKFLOW
   ====================================================== */

/* Invoice edit approval workflow */


/* ------------------------------------------------------
   EDIT INVOICE BUTTON
   ------------------------------------------------------ */

.invoice-edit-button {
    border-color: #c28a2f !important;
    color: #7a5419 !important;
    background: #fffaf0 !important;

    font-weight: 700;
}


/* ------------------------------------------------------
   EDIT REQUESTS LIST
   ------------------------------------------------------ */

.edit-request-list {
    display: grid;
    gap: 14px;
}


/* ------------------------------------------------------
   EDIT REQUEST CARD
   ------------------------------------------------------ */

.edit-request-card {
    border: 1px solid #dfe6e1;
    border-left: 5px solid #9aa8a0;
    border-radius: 14px;

    padding: 16px;
    background: #fff;

    display: grid;
    gap: 10px;
}


/* ------------------------------------------------------
   PENDING REQUEST
   ------------------------------------------------------ */

.edit-request-card.pending {
    border-left-color: #c28a2f;
    background: #fffdf8;
}


/* ------------------------------------------------------
   COMPLETED REQUEST
   ------------------------------------------------------ */

.edit-request-card.completed {
    border-left-color: #237a55;
}


/* ------------------------------------------------------
   REJECTED REQUEST
   ------------------------------------------------------ */

.edit-request-card.rejected {
    border-left-color: #a33b3b;
}


/* ------------------------------------------------------
   REQUEST HEADER
   ------------------------------------------------------ */

.edit-request-card > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}


/* ------------------------------------------------------
   REQUEST DETAILS
   ------------------------------------------------------ */

.edit-request-card p {
    margin: 0;
    color: #3e4c45;
}

.edit-request-card small {
    color: #69776f;
}

.edit-request-card .badge {
    text-transform: capitalize;
}


/* ======================================================
   44. INVOICE EDIT REQUEST NOTES
   ====================================================== */

.edit-request-note {
    border: 1px solid #dfc692;
    border-radius: 12px;

    padding: 14px 16px;

    background: #fffaf0;
    margin-bottom: 14px;
}

.edit-request-note p {
    margin: 6px 0 0;
}


/* ======================================================
   45. INVOICE EDIT TOTALS
   ====================================================== */

.edit-totals {
    display: flex;
    justify-content: flex-end;

    gap: 20px;
    flex-wrap: wrap;

    margin: 16px 0;
    padding: 14px;

    border-radius: 12px;
    background: #eff4f0;
}

.edit-totals span:last-child {
    font-size: 1.08rem;
    color: #124d3d;
}

.edit-totals strong {
    margin-left: 6px;
}


/* ======================================================
   46. DELETE REQUEST BUTTONS
   ====================================================== */

.delete-request-button,
.danger-button {
    border-color: #c94a4a !important;
    color: #8f2222 !important;
    background: #fff4f4 !important;

    font-weight: 700;
}

.danger-button:hover,
.delete-request-button:hover {
    background: #ffe5e5 !important;
}


/* ======================================================
   47. REQUEST SECTIONS
   ====================================================== */

.request-section {
    display: grid;
    gap: 12px;
}

.request-section + .request-section {
    margin-top: 26px;
    padding-top: 22px;

    border-top: 1px solid #dfe6e1;
}

.request-section h3 {
    margin: 0;
    color: #173f35;
}


/* ======================================================
   48. DELETE REQUEST STATUS CARDS
   ====================================================== */

.delete-request-card.pending {
    border-left-color: #c94a4a;
    background: #fff9f9;
}

.delete-request-card.approved {
    border-left-color: #8f2222;
    background: #fff4f4;
}


/* ======================================================
   49. MATERIAL PRICE ACTIVE CHECKBOX
   ====================================================== */

.price-active {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.price-active input {
    width: auto !important;
}


/* ======================================================
   50. MATERIAL CATALOG INPUTS
   ====================================================== */

.material-items select {
    min-width: 150px;
}

.material-items small[data-supplier] {
    display: block;
    margin-top: 5px;

    color: #69776f;
    white-space: nowrap;
}

/* ======================================================
   MAKE INVOICING SYSTEM
   PART 3: FORMS, CATALOGS, FILTERS AND NOTIFICATIONS
   ====================================================== */


/* ======================================================
   51. RESPONSIVE INVOICE MATERIAL CATALOG
   ====================================================== */

/* Responsive invoice material catalog */


/* ------------------------------------------------------
   INVOICE FORM TABLE CONTAINER
   ------------------------------------------------------ */

#invoice-form .table-wrap {
    max-width: 100%;
    border-radius: 12px;
}


/* ------------------------------------------------------
   INVOICE MATERIALS TABLE
   ------------------------------------------------------ */

#invoice-form .material-items {
    min-width: 1040px;
    table-layout: fixed;
}

#invoice-form .material-items th,
#invoice-form .material-items td {
    padding: 10px;
    vertical-align: top;
}


/* ------------------------------------------------------
   MATERIAL NAME COLUMN
   ------------------------------------------------------ */

#invoice-form .material-items th:nth-child(1),
#invoice-form .material-items td:nth-child(1) {
    width: 260px;
}


/* ------------------------------------------------------
   BRAND NAME COLUMN
   ------------------------------------------------------ */

#invoice-form .material-items th:nth-child(2),
#invoice-form .material-items td:nth-child(2) {
    width: 230px;
}


/* ------------------------------------------------------
   UNIT COLUMN
   ------------------------------------------------------ */

#invoice-form .material-items th:nth-child(3),
#invoice-form .material-items td:nth-child(3) {
    width: 125px;
}


/* ------------------------------------------------------
   RATE PER UNIT COLUMN
   ------------------------------------------------------ */

#invoice-form .material-items th:nth-child(4),
#invoice-form .material-items td:nth-child(4) {
    width: 140px;
}


/* ------------------------------------------------------
   QUANTITY COLUMN
   ------------------------------------------------------ */

#invoice-form .material-items th:nth-child(5),
#invoice-form .material-items td:nth-child(5) {
    width: 120px;
}


/* ------------------------------------------------------
   DISCOUNT COLUMN
   ------------------------------------------------------ */

#invoice-form .material-items th:nth-child(6),
#invoice-form .material-items td:nth-child(6) {
    width: 115px;
}


/* ------------------------------------------------------
   MATERIAL FORM INPUTS
   ------------------------------------------------------ */

#invoice-form .material-items select,
#invoice-form .material-items input {
    min-width: 0;
    width: 100%;
}


/* ------------------------------------------------------
   MATERIAL CATEGORY AND ITEM SPACING
   ------------------------------------------------------ */

#invoice-form .material-items td:first-child select + small,
#invoice-form .material-items td:first-child select + small + select {
    margin-top: 7px;
}


/* ------------------------------------------------------
   MATERIAL CATEGORY LABELS
   ------------------------------------------------------ */

#invoice-form .material-items td:first-child > small {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}


/* ------------------------------------------------------
   READ-ONLY MATERIAL INPUTS
   ------------------------------------------------------ */

#invoice-form .material-items input[readonly] {
    background: #f1f4f1;
    color: #33453d;
}


/* ======================================================
   52. CLIENT PROFILE PICKER
   ====================================================== */

/* Client profile picker */


/* ------------------------------------------------------
   CLIENT PROFILE PICKER CONTAINER
   ------------------------------------------------------ */

.client-profile-picker {
    border: 1px solid #d8e2da;
    border-radius: 14px;

    background: #f8faf8;

    padding: 18px;
    margin: 0 0 20px;
}


/* ------------------------------------------------------
   CLIENT PROFILE HEADER
   ------------------------------------------------------ */

.client-profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.client-profile-head strong,
.client-profile-head span {
    display: block;
}

.client-profile-head span {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}


/* ------------------------------------------------------
   CLIENT PROFILE SEARCH
   ------------------------------------------------------ */

.client-profile-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 14px;
}


/* ------------------------------------------------------
   CLIENT PROFILE SEARCH RESULTS
   ------------------------------------------------------ */

#client-profile-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;

    margin-top: 10px;

    max-height: 230px;
    overflow: auto;
}


/* ------------------------------------------------------
   CLIENT PROFILE RESULT BUTTONS
   ------------------------------------------------------ */

#client-profile-results button {
    text-align: left;
    display: grid;
    gap: 3px;
    padding: 12px;
}

#client-profile-results button span,
#client-profile-results button small {
    font-size: 11px;
    color: var(--muted);
    white-space: normal;
}


/* ------------------------------------------------------
   SELECTED CLIENT PROFILE
   ------------------------------------------------------ */

#selected-client-profile {
    display: grid;
    gap: 4px;

    border: 2px solid #8eaa96;
    background: #fff;
    border-radius: 10px;

    padding: 13px;
    margin-top: 12px;
}

#selected-client-profile span,
#selected-client-profile small {
    color: var(--muted);
}


/* ------------------------------------------------------
   CREATE NEW CLIENT PROFILE
   ------------------------------------------------------ */

#client-profile-create {
    border-top: 1px solid #d8e2da;
    margin-top: 16px;
    padding-top: 8px;
}


/* ======================================================
   53. CLIENT PROFILE RESPONSIVENESS
   ====================================================== */

@media (max-width: 700px) {

    #client-profile-results {
        grid-template-columns: 1fr;
    }

    .client-profile-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-profile-search {
        grid-template-columns: 1fr;
    }
}


/* ======================================================
   54. RECORD FILTER LAYOUT
   ====================================================== */

.filters {
    align-items: center;
    flex-wrap: wrap;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;

    margin: 0;

    color: #53635b;
    font-size: 13px;
    white-space: nowrap;
}

.filters label input {
    min-width: 145px;
    height: 48px;
}


/* ------------------------------------------------------
   FILTER INPUTS
   ------------------------------------------------------ */

.records-panel .filters > input,
.records-panel .filters > select {
    height: 48px;
}


/* ------------------------------------------------------
   FILTER SUBMIT BUTTON
   ------------------------------------------------------ */

.records-panel .filters > button[type="submit"] {
    height: 48px;
    align-self: center;

    padding: 0 27px;

    border: 1px solid #124c3d;
    border-radius: 9px;

    background: #124c3d;
    color: #fff;

    font-weight: 750;

    box-shadow: 0 7px 16px rgba(18, 76, 61, 0.16);

    transition: 0.18s ease;
}


/* ------------------------------------------------------
   FILTER SUBMIT BUTTON HOVER
   ------------------------------------------------------ */

.records-panel .filters > button[type="submit"]:hover {
    background: #0d3e32;
    border-color: #0d3e32;

    transform: translateY(-1px);
    filter: none;
}


/* ------------------------------------------------------
   FILTER SUBMIT BUTTON ACTIVE
   ------------------------------------------------------ */

.records-panel .filters > button[type="submit"]:active {
    transform: translateY(0);
}


/* ------------------------------------------------------
   RECORD ACTION BUTTONS OVERRIDE
   ------------------------------------------------------ */

.record-actions {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
}


/* ======================================================
   55. EXPANDED EXECUTIVE MATERIAL PRICES CATALOG
   ====================================================== */

/* Expanded executive Material Prices catalog */


/* ------------------------------------------------------
   MATERIAL CATALOG MODAL
   ------------------------------------------------------ */

dialog.material-catalog-modal {
    width: min(1460px, calc(100vw - 28px));
    max-width: none;
    max-height: 96vh;

    padding: 26px 28px;
}


/* ------------------------------------------------------
   MATERIAL CATALOG TABLE WRAPPER
   ------------------------------------------------------ */

dialog.material-catalog-modal #modal-body > .table-wrap {
    max-height: calc(96vh - 220px);
    overflow: auto;
}


/* ------------------------------------------------------
   MATERIAL CATALOG TABLE
   ------------------------------------------------------ */

dialog.material-catalog-modal table {
    min-width: 1180px;
}


/* ------------------------------------------------------
   MATERIAL CATALOG TABLE CELLS
   ------------------------------------------------------ */

dialog.material-catalog-modal td,
dialog.material-catalog-modal th {
    padding: 14px 16px;
}


/* ======================================================
   56. MATERIAL CATALOG FILTERS
   ====================================================== */

.material-catalog-filters {
    display: grid;

    grid-template-columns:
        minmax(280px, 1fr)
        minmax(190px, 260px);

    gap: 12px;
    margin: 14px 0;
}

.material-catalog-filters input,
.material-catalog-filters select {
    height: 48px;
    border-radius: 9px;
}

.material-catalog-filters input {
    padding-left: 16px;
}

.material-catalog-filters select {
    background-color: #fff;
}


/* ======================================================
   57. MATERIAL CATALOG MOBILE MODAL
   ====================================================== */

@media (max-width: 600px) {

    dialog.material-catalog-modal {
        width: calc(100vw - 12px);
        padding: 16px 12px;
    }

    dialog.material-catalog-modal #modal-body > .table-wrap {
        max-height: calc(96vh - 145px);
    }
}


/* ======================================================
   58. VALIDATION AND SUCCESS TOAST POSITION
   ====================================================== */

/* Keep validation and success messages above
   an open modal dialog. */


/* ------------------------------------------------------
   TOAST Z-INDEX
   ------------------------------------------------------ */

#toast {
    z-index: 2147483647;
}


/* ------------------------------------------------------
   TOAST INSIDE MODAL
   ------------------------------------------------------ */

dialog > #toast {
    position: fixed;
    inset: 18px 18px auto auto;
    margin: 0;
}


/* ======================================================
   59. MATERIAL CATALOG FILTER RESPONSIVENESS
   ====================================================== */

@media (max-width: 700px) {

    .material-catalog-filters {
        grid-template-columns: 1fr;
    }
}


/* ======================================================
   60. EXPANDED INVOICE FORM MODAL
   ====================================================== */

.invoice-form-modal {
    width: min(1380px, calc(100vw - 28px));
    max-width: none;
    padding: 26px 28px;
}


/* ------------------------------------------------------
   INVOICE MODAL BODY
   ------------------------------------------------------ */

.invoice-form-modal #modal-body {
    overflow-x: hidden;
}


/* ------------------------------------------------------
   INVOICE MATERIALS TABLE CONTAINER
   ------------------------------------------------------ */

.invoice-form-modal #invoice-form > .table-wrap,
.invoice-form-modal #invoice-edit-form > .table-wrap {
    width: 100%;
    overflow-x: auto;
}


/* ------------------------------------------------------
   INVOICE MATERIALS TABLE WIDTH
   ------------------------------------------------------ */

.invoice-form-modal .material-items {
    min-width: 1100px;
}


/* ------------------------------------------------------
   INVOICE MATERIALS TABLE HEADINGS
   ------------------------------------------------------ */

.invoice-form-modal .material-items th {
    white-space: normal;
    line-height: 1.25;
}


/* ------------------------------------------------------
   INVOICE MATERIAL TABLE CELLS
   ------------------------------------------------------ */

.invoice-form-modal .material-items td {
    vertical-align: top;
}


/* ------------------------------------------------------
   INVOICE MATERIAL SELECT AND INPUT FIELDS
   ------------------------------------------------------ */

.invoice-form-modal .material-items select,
.invoice-form-modal .material-items input {
    height: 45px;
}


/* ------------------------------------------------------
   ADD MATERIAL BUTTONS
   ------------------------------------------------------ */

.invoice-form-modal #add-item,
.invoice-form-modal #edit-add-item {
    margin-top: 10px;
}


/* ======================================================
   61. CLIENT PROFILE SEARCH PROMPT
   ====================================================== */

.profile-search-prompt {
    grid-column: 1 / -1;

    margin: 0;
    padding: 18px;

    border: 1px dashed #cbd8ce;
    border-radius: 10px;

    background: #fff;
    color: var(--muted);

    text-align: center;
    font-size: 13px;
}


/* ======================================================
   62. LEDGER FILTER MODAL
   ====================================================== */

.ledger-filter-modal {
    width: min(720px, calc(100vw - 28px));
}


/* ------------------------------------------------------
   LEDGER FILTER BRANDING
   ------------------------------------------------------ */

.ledger-filter-brand {
    display: flex;
    align-items: center;
    gap: 20px;

    border-bottom: 2px solid var(--gold);

    padding: 4px 0 18px;
    margin-bottom: 18px;
}

.ledger-filter-brand img {
    width: 130px;
    max-height: 70px;
    object-fit: contain;
}

.ledger-filter-brand strong,
.ledger-filter-brand span {
    display: block;
}

.ledger-filter-brand strong {
    font-size: 18px;
}

.ledger-filter-brand span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}


/* ------------------------------------------------------
   LEDGER FILTER FORM
   ------------------------------------------------------ */

.ledger-filter-form {
    border: 1px solid var(--line);
    border-radius: 12px;

    padding: 18px;
    background: #f8faf8;
}

.ledger-filter-form label {
    margin-top: 0;
}

.ledger-filter-form .actions {
    margin-bottom: 0;
}


/* ======================================================
   63. PAGINATION BUTTONS
   ====================================================== */

.pagination button:not(:disabled) {
    border-color: #b8c9bd;
    color: var(--green);

    font-weight: 700;
    background: #fff;
}

.pagination button:not(:disabled):hover {
    background: var(--green);
    color: #fff;
    border-color: var(--green);

    filter: none;
}


/* ======================================================
   64. INVOICE AND LEDGER MOBILE MODALS
   ====================================================== */

@media (max-width: 700px) {

    .invoice-form-modal {
        width: calc(100vw - 12px);
        padding: 16px 12px;
    }

    .ledger-filter-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .ledger-filter-form {
        padding: 13px;
    }
}


/* ======================================================
   65. SALES EXECUTIVE NOTIFICATIONS
   ====================================================== */

/* Sales Executive invoice-request notifications */


/* ------------------------------------------------------
   NOTIFICATION BELL
   ------------------------------------------------------ */

.notification-bell {
    position: relative;

    width: 44px;
    height: 44px;
    padding: 0;

    display: grid;
    place-items: center;

    border-radius: 50%;
    border: 1px solid #d5dfd8;

    background: #f8faf8;
    color: var(--green);

    font-size: 20px;

    transition: 0.18s ease;
}


/* ------------------------------------------------------
   NOTIFICATION BELL HOVER AND UNREAD STATE
   ------------------------------------------------------ */

.notification-bell:hover,
.notification-bell.has-unread {
    background: #edf5ef;
    border-color: #9cb5a4;
    filter: none;
}

.notification-bell.has-unread {
    box-shadow: 0 0 0 4px rgba(183, 140, 66, 0.12);
}


/* ------------------------------------------------------
   NOTIFICATION COUNT BADGE
   ------------------------------------------------------ */

.notification-bell b {
    position: absolute;

    top: -5px;
    right: -5px;

    min-width: 21px;
    height: 21px;

    padding: 0 5px;

    display: grid;
    place-items: center;

    border: 2px solid #fff;
    border-radius: 20px;

    background: #b52e34;
    color: #fff;

    font-size: 10px;
    line-height: 1;
}


/* ======================================================
   66. NOTIFICATION LIST
   ====================================================== */

.notification-list {
    display: grid;
    gap: 11px;

    max-height: 62vh;
    overflow: auto;

    padding: 2px;
}


/* ======================================================
   67. NOTIFICATION CARDS
   ====================================================== */

.notification-card {
    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 14px;

    border: 1px solid #dce5de;
    border-left: 5px solid #277653;
    border-radius: 13px;

    padding: 14px;
    background: #fff;
}


/* ------------------------------------------------------
   REJECTED NOTIFICATION
   ------------------------------------------------------ */

.notification-card.rejected {
    border-left-color: #ad3f3f;
    background: #fffafa;
}


/* ------------------------------------------------------
   APPROVED NOTIFICATION
   ------------------------------------------------------ */

.notification-card.approved {
    border-left-color: #9d292f;
    background: #fff8f8;
}


/* ------------------------------------------------------
   NOTIFICATION TEXT
   ------------------------------------------------------ */

.notification-card p {
    margin: 4px 0;
    color: #35463e;
}

.notification-card small {
    display: block;
}


/* ======================================================
   68. NOTIFICATION STATUS BADGES
   ====================================================== */

.notification-status {
    padding: 5px 9px;

    border-radius: 20px;

    background: #edf4ef;
    color: #285e43;

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
}


/* ------------------------------------------------------
   REJECTED / APPROVED STATUS BADGES
   ------------------------------------------------------ */

.notification-card.rejected .notification-status,
.notification-card.approved .notification-status {
    background: #fae8e8;
    color: #8b282d;
}


/* ======================================================
   69. NOTIFICATION MOBILE RESPONSIVENESS
   ====================================================== */

@media (max-width: 600px) {

    .notification-card {
        grid-template-columns: auto 1fr;
    }

    .notification-card button {
        grid-column: 1 / -1;
    }

    .notification-bell {
        width: 40px;
        height: 40px;
    }

    .sales-app .header-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}
