* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f4f7f6;
    color: #1d2528;
    font-family: Arial, Helvetica, sans-serif;
}

.app-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 100vh;
    padding: 24px 18px;
    background: #102a2c;
    color: #fff;
}

.brand-block {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    padding-bottom: 20px;
}

.brand-block span {
    display: block;
    color: #9fc5bd;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

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

.brand-row span {
    display: inline-block;
}

.brand-block strong {
    display: block;
    margin-top: 4px;
    font-size: 28px;
}

.report-date-form {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.report-date-form label {
    color: #9fc5bd;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.report-date-form input {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    color-scheme: dark;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    padding: 0;
}

.report-date-form input:focus {
    outline: 0;
    color: #d9fff5;
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a {
    border-radius: 6px;
    color: #d9eeea;
    font-weight: 700;
    padding: 12px 13px;
    text-decoration: none;
}

.side-nav a.active,
.side-nav a:hover,
.side-nav a:focus {
    background: #1b4545;
    color: #fff;
    outline: none;
}

.sidebar-actions {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.division-pill {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #d9eeea;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 12px;
}

.icon-toggle {
    width: 38px;
    min-height: 34px;
    flex: 0 0 auto;
    justify-content: center;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    color: #d9eeea;
    padding: 0;
    border-radius: 6px;
}

.icon-toggle:hover,
.icon-toggle:focus {
    background: #1b4545;
    outline: none;
}

.icon-toggle svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-toggle .eye-closed,
body.hide-extra-menus .icon-toggle .eye-open {
    display: none;
}

body.hide-extra-menus .icon-toggle .eye-closed {
    display: block;
}

body.hide-extra-menus [data-menu-extra] {
    display: none !important;
}

.content-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 48px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #607276;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1, h2, h3 {
    margin: 0;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 19px;
}

h3 {
    font-size: 17px;
}

.button, button {
    border: 0;
    border-radius: 6px;
    background: #136f63;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    font-size: 14px;
    font-weight: 700;
    padding: 11px 15px;
    text-decoration: none;
}

.button.secondary,
.secondary-btn {
    background: #374151;
}

.button.whatsapp {
    background: #1f9d55;
}

.icon-toggle {
    width: 38px;
    min-height: 34px;
    padding: 0;
    background: rgba(255, 255, 255, 0.07);
}

.alert {
    border-radius: 6px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: #e8f6ef;
    border: 1px solid #acd9c1;
}

.alert.danger {
    background: #fff0f0;
    border-color: #e8b0b0;
}

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

.stats div, .panel, .table-panel, .order-note, .screen-section {
    background: #fff;
    border: 1px solid #dce5e3;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(20, 35, 40, 0.06);
}

.stats div {
    padding: 16px;
}

.stats span {
    display: block;
    color: #607276;
    font-size: 13px;
}

.stats strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.screen-section {
    scroll-margin-top: 18px;
    margin-bottom: 18px;
    overflow: hidden;
}

.section-title {
    padding: 18px;
    border-bottom: 1px solid #dce5e3;
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
}

.mobile-collapse-wrap {
    display: contents;
}

.collapse-toggle {
    display: none;
}

.mobile-collapse.collapsed {
    display: none;
}

.panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    box-shadow: none;
}

.transaction-layout {
    display: grid;
    grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
}

.form-row {
    align-content: start;
}


.scan-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.camera-btn {
    background: #0f766e;
    min-width: 92px;
}

.camera-panel {
    display: grid;
    gap: 10px;
    border: 1px solid #cbd7d5;
    border-radius: 8px;
    padding: 10px;
    background: #f8fbfa;
}

.camera-panel[hidden] {
    display: none;
}

.camera-panel video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: #111827;
}

.camera-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    color: #415056;
    font-size: 13px;
}

.camera-actions button {
    background: #9f1239;
    min-height: 36px;
    white-space: nowrap;
}
.row-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form-actions,
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.table-actions form {
    margin: 0;
}

.danger-btn {
    background: #b91c1c;
}

label {
    display: grid;
    gap: 6px;
    color: #415056;
    font-size: 13px;
    font-weight: 700;
}

input, select {
    width: 100%;
    border: 1px solid #cbd7d5;
    border-radius: 6px;
    font: inherit;
    padding: 10px 11px;
}

.table-panel {
    overflow: hidden;
}

.compact-table {
    box-shadow: none;
}

.table-search-bar {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid #dce5e3;
}

.table-search-bar label {
    color: #607276;
    font-size: 13px;
    font-weight: 700;
}

.table-search-bar input {
    min-height: 40px;
}

.table-wrap {
    overflow-x: auto;
}

tr[hidden] {
    display: none !important;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 940px;
}

.compact-table table {
    min-width: 520px;
}

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5eceb;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef4f3;
    color: #374151;
    font-size: 13px;
}

tr.low td {
    background: #fff7ed;
}

.empty {
    color: #607276;
    text-align: center;
}

.remove-row {
    background: #9f1239;
    min-height: 34px;
    padding: 8px 12px;
}

.order-table {
    margin-top: 18px;
}

.stock-table {
    margin-top: 18px;
}

.order-note {
    margin-top: 18px;
    padding: 18px;
    border-color: #f0c077;
    background: #fffaf0;
}

.order-note p {
    margin: 10px 0 0;
    font-weight: 700;
}

.order-note span {
    color: #7c5a21;
    font-weight: 400;
}


.choice-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(9, 25, 27, 0.58);
}

.choice-modal[hidden] {
    display: none;
}

.choice-dialog {
    display: grid;
    gap: 10px;
    width: min(360px, 100%);
    border-radius: 8px;
    border: 1px solid #dce5e3;
    background: #fff;
    padding: 18px;
    box-shadow: 0 18px 50px rgba(10, 30, 33, 0.22);
}

.choice-dialog h2 {
    margin-bottom: 4px;
}


.modal-caption {
    margin: 0;
    color: #415056;
    font-weight: 700;
}
.ghost-btn {
    background: #eef4f3;
    color: #1d2528;
}

.search-results {
    display: grid;
    gap: 6px;
    border: 1px solid #cbd7d5;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.search-results[hidden] {
    display: none;
}

.search-result-item {
    display: grid;
    gap: 3px;
    width: 100%;
    min-height: 0;
    justify-content: start;
    align-items: start;
    border-radius: 6px;
    background: #eef4f3;
    color: #1d2528;
    padding: 10px 12px;
    text-align: left;
}

.search-result-item span,
.search-empty {
    color: #607276;
    font-size: 13px;
}

.scan-save-actions {
    display: flex;
    justify-content: flex-end;
    padding: 14px;
    border-top: 1px solid #dce5e3;
}

.history-section {
    margin-bottom: 18px;
}

.plain-section-title {
    margin-bottom: 12px;
}

.plain-section-title.compact-title {
    margin-top: 16px;
}

.filter-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}

.history-table {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.history-table .table-wrap {
    background: #fff;
    border: 1px solid #dce5e3;
}

.history-table table {
    min-width: 900px;
}

.filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.date-override {
    display: grid;
    gap: 10px;
    border: 1px solid #dce5e3;
    border-radius: 8px;
    background: #f8fbfa;
    padding: 10px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.check-row input {
    width: auto;
}

input:disabled {
    background: #eef4f3;
    color: #607276;
}
@media (max-width: 980px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        z-index: 10;
        min-height: auto;
        padding: 14px 12px;
        gap: 12px;
    }

    .brand-block {
        padding-bottom: 10px;
    }

    .report-date-form {
        margin-top: 10px;
    }

    .side-nav,
    .sidebar-actions {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .side-nav a,
    .sidebar-actions .button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .split-grid,
    .transaction-layout,
    .filter-panel {
        grid-template-columns: 1fr;
    }

    .content-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 18px;
    }
}

@media (max-width: 680px) {
    body {
        background: #eef4f3;
    }

    .app-layout {
        display: block;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: block;
        padding: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .brand-block {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 0;
        padding: 4px 0 10px;
        gap: 10px;
    }

    .brand-block span {
        font-size: 11px;
        flex: 0 0 auto;
    }

    .report-date-form {
        display: block;
        flex: 0 0 auto;
        width: 142px;
        margin-top: 0;
    }

    .report-date-form label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .report-date-form input {
        min-width: 0;
        min-height: 26px;
        border: 0;
        border-radius: 0;
        background: transparent;
        font-size: 14px;
        padding: 0;
        text-align: right;
    }

    .side-nav {
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding: 2px 0 8px;
    }

    .side-nav a {
        flex: 0 0 auto;
        padding: 9px 11px;
        font-size: 13px;
        white-space: nowrap;
    }

    .sidebar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        margin-top: 0;
    }

    .division-pill {
        display: block;
        margin: 0 0 8px;
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-actions .button {
        min-height: 36px;
        padding: 8px 7px;
        font-size: 12px;
        white-space: normal;
        text-align: center;
    }

    .content-shell {
        width: 100%;
        padding: 12px 10px 28px;
    }

    .page-header {
        margin-bottom: 12px;
    }

    .eyebrow {
        font-size: 11px;
    }

    h1 {
        font-size: 22px;
        line-height: 1.15;
    }

    h2 {
        font-size: 17px;
    }

    h3 {
        font-size: 16px;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-bottom: 12px;
    }

    .stats div {
        padding: 12px 14px;
    }

    .stats strong {
        font-size: 24px;
        margin-top: 4px;
    }

    .screen-section,
    .table-panel,
    .order-note,
    .stats div {
        border-radius: 7px;
        box-shadow: 0 5px 14px rgba(20, 35, 40, 0.05);
    }

    .section-title,
    .panel,
    .split-grid,
    .transaction-layout,
    .order-note {
        padding: 12px;
    }

    .split-grid,
    .transaction-layout {
        gap: 12px;
    }

    .panel {
        gap: 10px;
    }

    .mobile-collapse-wrap {
        display: grid;
        gap: 10px;
    }

    .collapse-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 42px;
        background: #374151;
    }

    .row-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .form-actions,
    .table-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button,
    button {
        width: 100%;
        min-height: 44px;
    }

    .icon-toggle {
        width: 38px;
        min-height: 34px;
    }

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

    .camera-btn {
        min-width: 0;
    }

    input,
    select {
        min-height: 44px;
        font-size: 16px;
    }

    .camera-panel video {
        aspect-ratio: 3 / 4;
        max-height: 58vh;
    }

    .camera-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .table-wrap {
        overflow: visible;
    }

    table,
    .compact-table table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 10px;
        font-size: 13px;
    }

    thead {
        display: none;
    }

    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tr {
        border: 1px solid #dce5e3;
        border-radius: 7px;
        background: #fff;
        overflow: hidden;
    }

    tr.low td {
        background: #fff7ed;
    }

    td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 11px;
        border-bottom: 1px solid #edf2f1;
        text-align: right;
        word-break: break-word;
    }

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

    td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: #607276;
        font-weight: 700;
        text-align: left;
    }

    td.empty {
        display: block;
        text-align: center;
    }

    td.empty::before {
        content: none;
    }

    .order-table {
    margin-top: 18px;
}

.stock-table {
        margin-top: 12px;
    }


    .dashboard-table table,
    .order-table table {
        border-collapse: collapse;
        border-spacing: 0;
        table-layout: fixed;
        font-size: 12px;
    }

    .dashboard-table thead,
    .order-table thead {
        display: table-header-group;
    }

    .dashboard-table tbody,
    .dashboard-table tr,
    .dashboard-table td,
    .order-table tbody,
    .order-table tr,
    .order-table td {
        display: revert;
        width: auto;
    }

    .dashboard-table tr,
    .order-table tr {
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .dashboard-table th,
    .dashboard-table td,
    .order-table th,
    .order-table td {
        display: table-cell;
        padding: 7px 5px;
        border-bottom: 1px solid #e5eceb;
        text-align: left;
        word-break: break-word;
    }

    .dashboard-table td::before,
    .order-table td::before {
        content: none;
    }

    .dashboard-table th:nth-child(3),
    .dashboard-table td:nth-child(3),
    .dashboard-table th:nth-child(5),
    .dashboard-table td:nth-child(5) {
        display: none;
    }

    .history-table .table-wrap {
        overflow-x: auto;
    }

    .history-table table {
        min-width: 760px;
        border-collapse: collapse;
        border-spacing: 0;
        table-layout: fixed;
        font-size: 12px;
    }

    .history-table thead {
        display: table-header-group;
    }

    .history-table tbody,
    .history-table tr,
    .history-table td {
        display: revert;
        width: auto;
    }

    .history-table tr {
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .history-table th,
    .history-table td {
        display: table-cell;
        padding: 8px 7px;
        border: 1px solid #1d2528;
        text-align: left;
        vertical-align: middle;
        word-break: normal;
    }

    .history-table td::before {
        content: none;
    }

    .history-table th {
        background: #fff;
        color: #1d2528;
        font-weight: 700;
    }

    .history-table td.empty {
        display: table-cell;
        text-align: center;
    }

    .history-table td.empty::before {
        content: none;
    }

    .search-results {
        max-height: 220px;
    }

    .search-result-item {
        min-height: 48px;
    }

    .scan-save-actions {
        padding: 12px;
    }
    #scanTable .remove-row {
        width: auto;
        min-height: 34px;
        margin-left: auto;
    }
}







