﻿/* ============ NEOLOGIC DESIGN SYSTEM ============ */
:root {
    --neo-red: #C8102E;
    --neo-red-2: #E0314D;
    --neo-red-soft: #FDECEF;
    --neo-ink: #1F2430;
    --neo-muted: #6B7280;
    --neo-line: #E5E7EB;
    --neo-bg: #F4F6F9;
}

body {
    font-family: Inter, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    background: var(--neo-bg);
}

/* ---------- App bar ---------- */
.neo-appbar {
    box-shadow: inset 0 -1px 0 var(--neo-line), 0 2px 0 -1px var(--neo-red) !important;
}

.neo-appbar-logo {
    height: 36px;
    margin: 0 10px 0 6px;
}

.neo-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.neo-brand-name {
    font-weight: 800;
    letter-spacing: 1.6px;
    font-size: 15px;
    color: var(--neo-ink);
}

    .neo-brand-name span {
        color: var(--neo-red);
    }

.neo-brand-sub {
    font-size: 10.5px;
    color: var(--neo-muted);
    letter-spacing: .5px;
}

.neo-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.neo-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: right;
}

    .neo-user-text b {
        font-size: 12.5px;
    }

    .neo-user-text small {
        font-size: 10.5px;
        color: var(--neo-muted);
    }

.neo-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--neo-red), var(--neo-red-2));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 3px 8px rgba(200,16,46,.3);
}

/* ---------- Side menu ---------- */
.neo-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 8px 10px;
}

.neo-nav-section {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #6E7687;
    font-weight: 700;
    padding: 16px 12px 6px;
}

.neo-navmenu .mud-nav-link {
    border-radius: 8px;
    margin: 2px 0;
    padding: 8px 12px;
    color: #C9CED8;
    font-weight: 500;
    transition: background .15s, color .15s, transform .08s;
}

    .neo-navmenu .mud-nav-link:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

    .neo-navmenu .mud-nav-link.active {
        background: linear-gradient(90deg, var(--neo-red), var(--neo-red-2));
        color: #fff !important;
        box-shadow: 0 4px 14px rgba(200,16,46,.35);
    }

        .neo-navmenu .mud-nav-link.active .mud-nav-link-icon {
            color: #fff !important;
        }

    .neo-navmenu .mud-nav-link:active {
        transform: scale(.96);
    }

.neo-count {
    display: inline-block;
    margin-left: 8px;
    background: var(--neo-red);
    color: #fff;
    border-radius: 10px;
    padding: 0 7px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 18px;
}

    .neo-count.warn {
        background: #ED8C00;
    }

.mud-nav-link.active .neo-count {
    background: #fff;
    color: var(--neo-red);
}

.neo-nav-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 12px 4px 6px;
}

.neo-user-card {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #C9CED8;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    overflow: hidden;
}

    .neo-user-card:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

.neo-logout-btn {
    width: 100%;
    margin-top: 8px;
    background: transparent;
    border: 1px solid rgba(255,255,255,.15);
    color: #C9CED8;
    border-radius: 8px;
    padding: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
}

    .neo-logout-btn:hover {
        border-color: var(--neo-red);
        color: #fff;
        background: rgba(200,16,46,.18);
    }

    .neo-logout-btn:active {
        transform: scale(.96);
    }

/* ---------- Main area ---------- */
.neo-main {
    background: var(--neo-bg);
    min-height: 100vh;
}

/* ---------- Buttons: compact + press-in click effect ---------- */
.mud-ripple:after {
    display: none !important;
}

.mud-button-root.mud-button {
    text-transform: none;
    font-weight: 600;
    letter-spacing: .2px;
    border-radius: 7px;
    padding: 5px 14px;
    min-height: 32px;
    font-size: .8rem;
    transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease;
}

.mud-button-filled {
    box-shadow: 0 2px 6px rgba(16,24,40,.12);
}

.mud-button-filled-primary:hover {
    box-shadow: 0 6px 16px rgba(200,16,46,.35);
    transform: translateY(-1px);
}

.mud-button-filled-success:hover {
    box-shadow: 0 6px 16px rgba(46,125,50,.35);
    transform: translateY(-1px);
}

.mud-button-root:active {
    transform: scale(.94) !important;
    box-shadow: none !important;
}

.mud-icon-button {
    transition: transform .08s ease, background-color .15s ease;
}

    .mud-icon-button:active {
        transform: scale(.82);
    }

/* ---------- Page header ---------- */
.neo-page-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.neo-page-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--neo-red), var(--neo-red-2));
    box-shadow: 0 6px 16px rgba(200,16,46,.3);
}

.neo-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--neo-ink);
    line-height: 1.2;
}

.neo-page-sub {
    color: var(--neo-muted);
    font-size: 12px;
}

.neo-page-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ---------- Cards ---------- */
.neo-card {
    background: #fff;
    border: 1px solid var(--neo-line);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}

.neo-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--neo-line);
    flex-wrap: wrap;
}

    .neo-card-header .ico {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        background: var(--neo-red-soft);
        color: var(--neo-red);
        display: grid;
        place-items: center;
    }

.neo-card-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--neo-ink);
}

.neo-card-body {
    padding: 14px 16px;
}

.neo-chip-count {
    background: #EEF0F4;
    border-radius: 12px;
    padding: 1px 9px;
    font-size: 11px;
    font-weight: 700;
}

/* ---------- MudTable polish ---------- */
.mud-table {
    border: 1px solid var(--neo-line);
    border-radius: 12px !important;
    box-shadow: none !important;
}

.mud-table-head .mud-table-cell {
    background: #F8F9FB;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #4B5563;
}

.mud-chip {
    font-weight: 600;
    font-size: 11px;
}

/* ---------- PO: supplier box ---------- */
.supplier-box {
    background: #F8F9FB;
    border: 1px dashed #D5D9E0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.6;
}

    .supplier-box .name {
        font-weight: 700;
        font-size: 13.5px;
    }

.state-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    margin-top: 4px;
}

    .state-pill.intra {
        background: #E8F5E9;
        color: #2E7D32;
    }

    .state-pill.inter {
        background: #FFF3E0;
        color: #E65100;
    }

/* ---------- PO: item grid ---------- */
.po-grid-wrap {
    overflow-x: auto;
    border: 1px solid var(--neo-line);
    border-radius: 10px;
}

.po-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1180px;
    font-size: 12.5px;
}

    .po-grid thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--neo-ink);
        color: #fff;
        font-weight: 600;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: .6px;
        padding: 10px 6px;
        text-align: left;
        border-bottom: 3px solid var(--neo-red);
        white-space: nowrap;
    }

    .po-grid th.r, .po-grid td.r {
        text-align: right;
    }

    .po-grid tbody td {
        padding: 6px;
        border-bottom: 1px solid var(--neo-line);
        vertical-align: top;
        background: #fff;
        transition: background .12s;
    }

    .po-grid tbody tr:nth-child(even) td {
        background: #FAFBFC;
    }

    .po-grid tbody tr:hover td {
        background: #FFF6F7;
    }

    .po-grid tbody tr.row-error td {
        background: #FFF1F2;
    }

        .po-grid tbody tr.row-error td:first-child {
            box-shadow: inset 4px 0 0 var(--neo-red);
        }

    .po-grid .sl {
        width: 38px;
        text-align: center;
    }

        .po-grid .sl span {
            display: inline-grid;
            place-items: center;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #EEF0F4;
            font-weight: 700;
            font-size: 11px;
            margin-top: 4px;
        }

    .po-grid .cell {
        width: 100%;
        border: 1px solid transparent;
        background: transparent;
        border-radius: 6px;
        padding: 5px 7px;
        font: inherit;
        color: var(--neo-ink);
        outline: none;
        transition: border-color .15s, background .15s, box-shadow .15s;
    }

        .po-grid .cell:hover {
            border-color: #D5D9E0;
            background: #fff;
        }

        .po-grid .cell:focus {
            border-color: var(--neo-red);
            background: #fff;
            box-shadow: 0 0 0 3px rgba(200,16,46,.12);
        }

        .po-grid .cell.num {
            text-align: right;
        }

        .po-grid .cell.desc {
            font-weight: 600;
        }

        .po-grid .cell.model {
            font-size: 11.5px;
            color: var(--neo-muted);
            font-style: italic;
        }

    .po-grid .amt {
        text-align: right;
        padding-top: 11px;
        white-space: nowrap;
    }

        .po-grid .amt small {
            display: block;
            color: var(--neo-muted);
            font-size: 10px;
        }

    .po-grid .line-total {
        text-align: right;
        font-weight: 700;
        padding-top: 11px;
        white-space: nowrap;
        color: var(--neo-ink);
    }

    .po-grid tfoot td {
        background: #F3F4F7;
        font-weight: 700;
        padding: 11px 6px;
        border-top: 2px solid var(--neo-ink);
        white-space: nowrap;
    }

        .po-grid tfoot td.grand {
            color: var(--neo-red);
            font-size: 14px;
        }

.row-actions {
    white-space: nowrap;
    opacity: .45;
    transition: opacity .15s;
    padding-top: 8px !important;
}

.po-grid tr:hover .row-actions {
    opacity: 1;
}

.row-actions button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    color: #6B7280;
    font-size: 12px;
    transition: background .12s, transform .08s;
}

    .row-actions button:hover:not(:disabled) {
        background: #EEF0F4;
        color: var(--neo-ink);
    }

    .row-actions button.del:hover {
        background: var(--neo-red-soft);
        color: var(--neo-red);
    }

    .row-actions button:active:not(:disabled) {
        transform: scale(.82);
    }

    .row-actions button:disabled {
        opacity: .3;
        cursor: default;
    }

.po-add-row {
    width: 100%;
    border: 1.5px dashed #D5D9E0;
    background: #fff;
    padding: 9px;
    border-radius: 8px;
    color: var(--neo-muted);
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: .15s;
}

    .po-add-row:hover {
        border-color: var(--neo-red);
        color: var(--neo-red);
        background: #FFF6F7;
    }

    .po-add-row:active {
        transform: scale(.99);
    }

.po-empty {
    text-align: center;
    padding: 34px 10px;
    color: var(--neo-muted);
}

/* ---------- PO: GST summary + totals ---------- */
.gst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    .gst-table th {
        background: #F8F9FB;
        color: #4B5563;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: .4px;
        padding: 8px 14px;
        text-align: left;
        border-bottom: 1px solid var(--neo-line);
    }

    .gst-table td {
        padding: 8px 14px;
        border-bottom: 1px solid var(--neo-line);
    }

    .gst-table .r {
        text-align: right;
    }

.sum-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: #374151;
}

.sum-grand {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 2px solid var(--neo-ink);
    margin-top: 8px;
    padding-top: 10px;
    font-weight: 700;
}

    .sum-grand b {
        font-size: 22px;
        color: var(--neo-red);
    }

.sum-words {
    font-size: 11.5px;
    color: var(--neo-muted);
    font-style: italic;
    margin-top: 4px;
}

/* ---------- PO: attachments ---------- */
.drop-zone {
    position: relative;
    border: 2px dashed #D5D9E0;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    color: var(--neo-muted);
    background: #FAFBFC;
    transition: .15s;
}

    .drop-zone:hover {
        border-color: var(--neo-red);
        background: #FFF6F7;
        color: var(--neo-red);
    }

    .drop-zone input[type=file] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
        width: 100%;
        height: 100%;
    }

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--neo-line);
    border-radius: 8px;
    padding: 5px 6px 5px 10px;
    background: #fff;
    font-size: 12px;
}

    .file-chip.pending {
        border-style: dashed;
        background: #F0F7FF;
    }

    .file-chip a {
        color: var(--neo-ink);
        font-weight: 600;
        text-decoration: none;
    }

        .file-chip a:hover {
            color: var(--neo-red);
        }

/* ---------- PO: sticky action bar ---------- */
.po-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 18px -16px -16px;
    padding: 10px 22px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--neo-line);
    box-shadow: 0 -6px 20px rgba(16,24,40,.07);
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}

.po-stat {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

    .po-stat label {
        font-size: 10px;
        color: var(--neo-muted);
        text-transform: uppercase;
        letter-spacing: .7px;
    }

    .po-stat b {
        font-size: 14px;
        color: var(--neo-ink);
    }

    .po-stat.grand b {
        font-size: 20px;
        color: var(--neo-red);
    }

.po-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
/* ---------- PO sheet: shrink to fit on phones / tablets ---------- */
.po-fit {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .po-fit .po-sheet {
        min-width: 860px;
    }

@media (max-width: 900px) {
    .po-fit .po-sheet {
        zoom: .8;
    }
}

@media (max-width: 700px) {
    .po-fit .po-sheet {
        zoom: .6;
    }
}

@media (max-width: 520px) {
    .po-fit .po-sheet {
        zoom: .42;
    }
}

/* Bill preview smaller on phones */
@media (max-width: 700px) {
    .bill-frame {
        height: 420px !important;
    }


    /* ---------- Mobile performance: lighter effects ---------- */
    @media (max-width: 900px) {
        .po-actionbar {
            backdrop-filter: none;
            background: #fff;
        }

        .neo-card, .mud-table, .mud-paper {
            box-shadow: none !important;
        }

        .neo-page-icon, .neo-avatar, .neo-navmenu .mud-nav-link.active {
            box-shadow: none !important;
        }

        .po-grid tbody td, .po-grid .cell, .neo-navmenu .mud-nav-link,
        .mud-button-root, .mud-icon-button {
            transition: none !important;
        }

        .mud-button-filled-primary:hover, .mud-button-filled-success:hover {
            transform: none;
            box-shadow: none;
        }
    }
}