* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

button {
    font-family: inherit;
    cursor: pointer;
}

.app {
    display: flex;
    min-height: 100vh;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: #111827;
    color: white;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 28px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: bold;
}

.logo h2 {
    font-size: 16px;
    margin-bottom: 3px;
}

.logo span {
    font-size: 11px;
    color: #9ca3af;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

.nav-item:hover {
    background: #1f2937;
    color: white;
}

.nav-item.active {
    background: #2563eb;
    color: white;
}

.nav-item span {
    width: 20px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
}


/* =========================
   MAIN
========================= */

.main {
    flex: 1;
    padding: 30px;
    overflow-x: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.header p {
    color: #6b7280;
    font-size: 14px;
}

.profile {
    border: 1px solid #e5e7eb;
    background: white;
    padding: 8px 14px 8px 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #374151;
}

.profile-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* =========================
   CARDS
========================= */

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 14px;
}

.card-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.card h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.card p {
    font-size: 12px;
    color: #6b7280;
}

.card p.positive {
    color: #16a34a;
}


/* =========================
   PANELS
========================= */

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

.panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    min-height: 280px;
}

.panel-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f0f0f0;
}

.panel-header h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.panel-header p {
    font-size: 12px;
    color: #9ca3af;
}

.view-button {
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 12px;
}

.empty-state {
    height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #6b7280;
}

.empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 20px;
}

.empty-state h4 {
    color: #374151;
    margin-bottom: 5px;
}

.empty-state p {
    font-size: 12px;
}


/* =========================
   QUICK ACTIONS
========================= */

.quick-section {
    margin-top: 24px;
}

.quick-section h3 {
    font-size: 16px;
    margin-bottom: 14px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.quick-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    text-align: left;
    transition: 0.2s;
}

.quick-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
}

.quick-card > span {
    display: block;
    font-size: 22px;
    margin-bottom: 12px;
}

.quick-card strong {
    display: block;
    color: #1f2937;
    margin-bottom: 5px;
}

.quick-card small {
    color: #9ca3af;
    font-size: 11px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {

    .sidebar {
        width: 210px;
    }

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

    .main {
        padding: 20px;
    }
}

@media (max-width: 600px) {

    .sidebar {
        display: none;
    }

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

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

    .header {
        align-items: flex-start;
    }
}
/* =====================================
   INVENTORY PAGE
===================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 30px;
    background: #f5f7fb;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 28px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: bold;
}

.brand h2 {
    font-size: 16px;
    margin-bottom: 3px;
}

.brand span {
    font-size: 11px;
    color: #9ca3af;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
}

.menu-item:hover {
    background: #1f2937;
    color: white;
}

.menu-item.active {
    background: #2563eb;
    color: white;
}

.menu-item span {
    font-size: 14px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.page-header p {
    color: #6b7280;
    font-size: 14px;
}

.primary-button {
    border: none;
    background: #2563eb;
    color: white;
    padding: 11px 17px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.primary-button:hover {
    background: #1d4ed8;
}


/* Summary */

.inventory-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.summary-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.summary-card strong {
    font-size: 25px;
}

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Inventory Section */

.inventory-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

.section-header {
    padding: 22px;
}

.section-header h2 {
    font-size: 17px;
    margin-bottom: 5px;
}

.section-header p {
    font-size: 12px;
    color: #9ca3af;
}


/* Toolbar */

.inventory-toolbar {
    display: flex;
    gap: 12px;
    padding: 0 22px 20px;
}

.search-box {
    flex: 1;
    max-width: 450px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 13px;
}

.inventory-toolbar select {
    height: 40px;
    min-width: 150px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 10px;
    background: white;
    color: #374151;
}


/* Table */

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

.inventory-table {
    width: 100%;
    border-collapse: collapse;
}

.inventory-table th {
    text-align: left;
    padding: 13px 18px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #e5e7eb;
}

.inventory-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #374151;
}

.item-name strong {
    display: block;
    color: #111827;
}

.item-name small {
    display: block;
    color: #9ca3af;
    margin-top: 3px;
    font-size: 11px;
}

.type-badge,
.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.product-badge {
    background: #eff6ff;
    color: #2563eb;
}

.service-badge {
    background: #f3e8ff;
    color: #7e22ce;
}

.active-status {
    background: #ecfdf5;
    color: #15803d;
}

.low-stock {
    background: #fff7ed;
    color: #c2410c;
}

.stock-na {
    color: #9ca3af;
}

.action-button {
    border: none;
    background: transparent;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
}


/* Empty State */

.inventory-table .empty-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.inventory-table .empty-state p {
    color: #9ca3af;
    font-size: 12px;
    margin: 7px 0 16px;
}


/* Responsive */

@media (max-width: 1000px) {

    .inventory-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {

    .main-content {
        padding: 20px;
    }

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

    .page-header {
        align-items: flex-start;
    }

    .inventory-toolbar {
        flex-direction: column;
    }

    .search-box {
        max-width: none;
    }

    .inventory-toolbar select {
        width: 100%;
    }
}
/* =====================================
   ADD ITEM FORM
===================================== */

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.secondary-button:hover {
    background: #f9fafb;
}


.form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 28px;
    max-width: 1000px;
}


.form-block {
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid #f0f0f0;
}

.form-block:last-of-type {
    border-bottom: none;
}


.form-block h2 {
    font-size: 17px;
    margin-bottom: 6px;
}


.form-help {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 18px;
}


.type-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}


.type-option {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    gap: 12px;
    cursor: pointer;
}


.type-option:hover {
    border-color: #2563eb;
}


.type-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}


.type-option input {
    margin-top: 3px;
}


.type-option strong {
    display: block;
    margin-bottom: 5px;
}


.type-option small {
    display: block;
    color: #9ca3af;
    font-size: 11px;
}


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


.form-group {
    display: flex;
    flex-direction: column;
}


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


.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}


.form-group label span {
    color: #dc2626;
}


.form-group input,
.form-group select,
.form-block textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    background: white;
}


.form-group input:focus,
.form-group select:focus,
.form-block textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #eff6ff;
}


.field-note {
    margin-top: 6px;
    color: #9ca3af;
    font-size: 11px;
}


.stock-toggle {
    margin-bottom: 20px;
    font-size: 13px;
}


.stock-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
}


.money-input {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}


.money-input:focus-within {
    border-color: #2563eb;
}


.money-input span {
    padding-left: 12px;
    color: #6b7280;
}


.money-input input {
    border: none;
    box-shadow: none;
}


.money-input input:focus {
    box-shadow: none;
}


.form-block textarea {
    resize: vertical;
}


.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 5px;
}


@media (max-width: 700px) {

    .type-selection,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .form-section {
        padding: 20px;
    }

}
/* =====================================
   CATEGORY MODAL
===================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}


.modal {
    width: 100%;
    max-width: 520px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}


.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 22px 24px;
    border-bottom: 1px solid #f0f0f0;
}


.modal-header h2 {
    font-size: 18px;
    margin-bottom: 5px;
}


.modal-header p {
    font-size: 12px;
    color: #9ca3af;
}


.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 7px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 22px;
    cursor: pointer;
}


.modal form {
    padding: 24px;
}


.modal .form-group {
    margin-bottom: 20px;
}


.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 5px;
}


/* =====================================
   DASHBOARD V2 - COMPATIBILITY STYLES
   These styles match the current dashboard.html
===================================== */

.header-business {
    color: #374151;
    font-size: 16px;
    font-weight: 500;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.summary-grid .summary-card {
    min-height: 110px;
}

.summary-card > div:last-child {
    flex: 1;
}

.summary-card p {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 7px;
}

.summary-card h3 {
    font-size: 24px;
    color: #111827;
}

.dashboard-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-top: 22px;
    overflow: hidden;
}

.dashboard-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 22px;
    border-bottom: 1px solid #f0f0f0;
}

.dashboard-section .section-header h2 {
    font-size: 17px;
    margin-bottom: 5px;
}

.dashboard-section .section-header p {
    font-size: 12px;
    color: #9ca3af;
}

.dashboard-section .section-header a {
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.dashboard-section .section-header a:hover {
    text-decoration: underline;
}

.dashboard-section > .empty-state {
    min-height: 220px;
    height: auto;
    padding: 35px 20px;
}

.dashboard-section .empty-state h3 {
    color: #374151;
    margin-bottom: 5px;
    font-size: 16px;
}

.dashboard-section .empty-state p {
    color: #9ca3af;
    font-size: 12px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.quick-action {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-height: 92px;
    padding: 18px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #1f2937;
    text-decoration: none;
    transition: 0.2s;
}

.quick-action:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
}

.quick-action > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    background: #eff6ff;
    font-size: 21px;
}

.quick-action strong {
    display: block;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 5px;
}

.quick-action small {
    display: block;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.5;
}

.quick-section {
    margin-top: 24px;
}


/* =====================================
   SETTINGS PAGE
===================================== */

.settings-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 28px;
    max-width: 1100px;
}

.settings-card-header {
    margin-bottom: 24px;
}

.settings-card-header h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.settings-card-header p {
    color: #9ca3af;
    font-size: 12px;
}

.settings-card .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-card .form-group {
    display: flex;
    flex-direction: column;
}

.settings-card .form-group.full-width {
    grid-column: 1 / -1;
}

.settings-card .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}

.settings-card .form-group input,
.settings-card .form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    background: white;
    color: #1f2937;
}

.settings-card .form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.settings-card .form-group input:focus,
.settings-card .form-group textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #eff6ff;
}

.settings-card .form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-primary {
    border: none;
    background: #2563eb;
    color: white;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #1d4ed8;
}


/* =====================================
   DASHBOARD + SETTINGS RESPONSIVE
===================================== */

@media (max-width: 1100px) {

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

    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 800px) {

    .header {
        align-items: flex-start;
        gap: 15px;
    }

    .header-business {
        display: none;
    }

    .settings-card {
        padding: 20px;
    }

    .settings-card .form-grid {
        grid-template-columns: 1fr;
    }

    .settings-card .form-group.full-width {
        grid-column: auto;
    }

}

@media (max-width: 600px) {

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

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

    .dashboard-section .section-header {
        flex-direction: column;
        gap: 10px;
    }

    .settings-card {
        padding: 16px;
    }

}

/* =========================================================
   BT PRINTING SHOP — FINAL UI POLISH
   Global visual system for all existing pages
========================================================= */
:root {
    --ui-bg: #f6f8fc;
    --ui-surface: #ffffff;
    --ui-border: #e6eaf0;
    --ui-text: #172033;
    --ui-muted: #6b7280;
    --ui-primary: #2563eb;
    --ui-primary-dark: #1d4ed8;
    --ui-sidebar: #111827;
    --ui-sidebar-2: #182235;
    --ui-success: #15803d;
    --ui-warning: #b45309;
    --ui-danger: #dc2626;
    --ui-radius: 14px;
    --ui-shadow: 0 6px 24px rgba(15, 23, 42, .055);
}

html { scroll-behavior: smooth; }

body {
    background: var(--ui-bg) !important;
    color: var(--ui-text) !important;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    font-size: 14px;
    line-height: 1.5;
}

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

.app-layout { min-height: 100vh; }

.sidebar {
    width: 258px !important;
    min-width: 258px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    background: linear-gradient(180deg, var(--ui-sidebar) 0%, #0f172a 100%) !important;
    border-right: 1px solid rgba(255,255,255,.05);
    padding: 22px 14px !important;
    box-shadow: 8px 0 30px rgba(15,23,42,.06);
    z-index: 20;
}

.brand {
    padding: 4px 10px 24px !important;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 16px;
}

.brand-logo {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    box-shadow: 0 8px 18px rgba(37,99,235,.28);
}

.brand h2 {
    color: #fff;
    font-size: 15px !important;
    font-weight: 750;
    letter-spacing: -.2px;
}

.brand span { color: #94a3b8 !important; }

.sidebar-menu { gap: 4px !important; }

.menu-item {
    min-height: 43px;
    border: 1px solid transparent;
    border-radius: 10px !important;
    padding: 10px 12px !important;
    color: #cbd5e1 !important;
    font-weight: 550;
    transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}

.menu-item:hover {
    background: rgba(255,255,255,.065) !important;
    border-color: rgba(255,255,255,.06);
    color: #fff !important;
    transform: translateX(2px);
}

.menu-item.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border-color: rgba(255,255,255,.08);
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(37,99,235,.24);
}

.menu-item span { width: 22px; font-size: 15px; }

.main-content {
    background: var(--ui-bg) !important;
    padding: 30px 34px !important;
}

.page-header {
    min-height: 54px;
    margin-bottom: 24px !important;
}

.page-header h1 {
    color: var(--ui-text);
    font-size: 27px !important;
    line-height: 1.15;
    font-weight: 780;
    letter-spacing: -.65px;
}

.page-header p { color: var(--ui-muted) !important; margin-top: 5px; }

.primary-button,
.btn-primary,
.sale-save-button {
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-dark)) !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 7px 16px rgba(37,99,235,.18);
    font-weight: 700 !important;
    transition: transform .16s ease, box-shadow .16s ease;
}

.primary-button:hover,
.btn-primary:hover,
.sale-save-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(37,99,235,.23);
}

.secondary-button,
.btn-secondary {
    background: #fff !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 10px !important;
    color: #374151 !important;
    box-shadow: 0 2px 7px rgba(15,23,42,.025);
}

.inventory-summary,
.summary-grid {
    gap: 16px !important;
}

.summary-card,
.card {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius) !important;
    background: var(--ui-surface) !important;
    box-shadow: var(--ui-shadow);
    transition: transform .16s ease, box-shadow .16s ease;
}

.summary-card:hover,
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15,23,42,.075); }

.summary-card span { color: #7b8494 !important; }
.summary-card strong { color: var(--ui-text) !important; font-weight: 780; }

.summary-icon,
.card-icon {
    background: #eff6ff !important;
    color: var(--ui-primary);
    border-radius: 11px !important;
}

.inventory-section,
.dashboard-section,
.panel,
.form-section,
.details-card,
.sale-form-section {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius) !important;
    background: #fff !important;
    box-shadow: var(--ui-shadow);
}

.section-header,
.dashboard-section .section-header,
.sale-section-header {
    border-bottom: 1px solid #edf0f4 !important;
}

.section-header h2,
.dashboard-section h2,
.sale-section-header h2 { font-weight: 720; color: var(--ui-text); }

.inventory-toolbar { padding-top: 4px; }

.search-box {
    height: 42px !important;
    border-color: var(--ui-border) !important;
    background: #fff;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(15,23,42,.025);
}

.search-box:focus-within {
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 4px #eff6ff;
}

.inventory-toolbar select,
select,
input,
textarea {
    border-color: #dfe4eb !important;
    border-radius: 10px !important;
}

input, select, textarea { color: #1f2937; background: #fff; }

input:focus, select:focus, textarea:focus {
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 4px #eff6ff !important;
    outline: none !important;
}

.inventory-table th,
.return-history-table th {
    background: #f8fafc !important;
    color: #64748b !important;
    font-weight: 750 !important;
    border-color: #e8edf3 !important;
}

.inventory-table td,
.return-history-table td {
    border-color: #eef1f5 !important;
}

.inventory-table tbody tr:hover,
.return-history-table tbody tr:hover {
    background: #fafcff;
}

.type-badge,
.status-badge {
    border-radius: 999px !important;
    font-weight: 700 !important;
}

.action-button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-button:hover { background: #eff6ff; color: var(--ui-primary); }

.form-section { padding: 30px !important; }
.form-block { border-color: #edf0f4 !important; }
.form-block h2 { font-weight: 720; }
.form-help, .field-note { color: #7b8494 !important; }

.type-option {
    border-color: var(--ui-border) !important;
    border-radius: 12px !important;
    background: #fff;
    transition: all .16s ease;
}
.type-option:hover { border-color: #93c5fd !important; transform: translateY(-1px); }
.type-option:has(input:checked) {
    border-color: #60a5fa !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.07);
}

.form-actions { margin-top: 8px; }

.modal-overlay,
.return-modal-backdrop { backdrop-filter: blur(4px); }
.modal,
.return-modal {
    border-radius: 16px !important;
    box-shadow: 0 28px 70px rgba(15,23,42,.20) !important;
}

.modal-close {
    border-radius: 9px !important;
}

.empty-state { color: #64748b !important; }

/* Common status colors */
.active-status { background: #ecfdf3 !important; color: #15803d !important; }
.low-stock { background: #fff7ed !important; color: #b45309 !important; }

/* Better mobile behavior */
@media (max-width: 1100px) {
    .sidebar { width: 232px !important; min-width: 232px; }
    .main-content { padding: 26px !important; }
}

@media (max-width: 800px) {
    .sidebar { width: 78px !important; min-width: 78px; padding: 18px 10px !important; }
    .brand { justify-content: center; padding-left: 0 !important; padding-right: 0 !important; }
    .brand > div:last-child { display: none; }
    .menu-item { justify-content: center; padding: 11px 8px !important; }
    .menu-item span { margin: 0; }
    .menu-item { font-size: 0; }
    .main-content { padding: 22px 18px !important; }
    .page-header { gap: 14px; align-items: flex-start !important; }
    .page-header h1 { font-size: 23px !important; }
}

@media (max-width: 600px) {
    .sidebar { display: none !important; }
    .main-content { padding: 18px 14px !important; }
    .page-header { flex-direction: column; }
    .page-header > * { max-width: 100%; }
    .page-header .primary-button,
    .page-header .secondary-button { width: 100%; }
    .summary-grid,
    .inventory-summary { grid-template-columns: 1fr !important; }
    .form-section { padding: 20px !important; }
    .table-container { border-radius: 10px; }
}

/* Print stays clean */
@media print {
    body { background: #fff !important; }
    .sidebar { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .summary-card, .inventory-section, .details-card { box-shadow: none !important; }
}


/* =========================================================
   PURCHASES PAGE — PROFESSIONAL UI POLISH
   Keeps existing HTML/classes and improves spacing,
   alignment, sidebar consistency and responsive behavior.
========================================================= */

:root {
    --purchase-sidebar: 224px;
    --purchase-page-gap: 28px;
    --purchase-border: #e4e9f0;
    --purchase-bg: #f4f7fb;
    --purchase-text: #172033;
    --purchase-muted: #64748b;
    --purchase-primary: #2563eb;
    --purchase-primary-dark: #1d4ed8;
}

/* --- Application shell --- */

body {
    margin: 0;
    background: var(--purchase-bg);
}

.app-layout {
    min-height: 100vh;
    display: flex;
    width: 100%;
}

/* Fixed, clean sidebar alignment */
.sidebar {
    width: var(--purchase-sidebar) !important;
    min-width: var(--purchase-sidebar) !important;
    box-sizing: border-box;
    padding: 22px 14px 18px !important;
    display: flex;
    flex-direction: column;
}

.brand {
    min-height: 48px;
    padding: 0 8px 24px !important;
    margin-bottom: 6px;
    box-sizing: border-box;
    align-items: center;
}

.brand-logo {
    flex: 0 0 42px;
}

.brand h2 {
    margin: 0 0 3px !important;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand span {
    display: block;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu,
.sidebar-bottom {
    gap: 5px !important;
}

.menu-item {
    min-height: 42px;
    box-sizing: border-box;
    padding: 10px 12px !important;
    border-radius: 9px !important;
    gap: 11px !important;
    line-height: 1;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.menu-item span:first-child {
    width: 22px;
    min-width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.menu-item:hover {
    transform: translateX(1px);
}

.menu-item.active {
    box-shadow: 0 6px 16px rgba(37, 99, 235, .16);
}

/* Keep lower menu visually separated */
.sidebar-bottom {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, .13);
}

/* --- Main page spacing --- */

.main-content {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    padding: 28px 32px 42px !important;
    background: var(--purchase-bg);
}

/* Purchase/inventory-style pages should not touch the viewport edges */
.main-content > * {
    width: 100%;
    max-width: 1540px;
    margin-left: auto;
    margin-right: auto;
}

/* Header alignment */
.page-header {
    min-height: 54px;
    margin: 0 0 22px !important;
    align-items: center !important;
    gap: 20px;
}

.page-header > div:first-child {
    min-width: 0;
}

.page-header h1 {
    margin: 0 0 5px !important;
    color: var(--purchase-text);
    font-size: 27px !important;
    line-height: 1.15;
    letter-spacing: -.35px;
}

.page-header p {
    margin: 0 !important;
    color: var(--purchase-muted);
    line-height: 1.4;
}

/* New Purchase button — consistent top-right position */
.page-header .primary-button,
.page-header .primary-action,
.page-header a.primary-button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
}

/* --- Four summary cards --- */

.inventory-summary {
    width: 100%;
    margin: 0 0 20px !important;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px !important;
}

.summary-card {
    min-height: 84px;
    box-sizing: border-box;
    padding: 16px 17px !important;
    border-radius: 14px !important;
    border: 1px solid var(--purchase-border) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.summary-card > div:first-child {
    min-width: 0;
}

.summary-card span {
    margin: 0 0 6px !important;
    color: #6b7280 !important;
    font-size: 12px !important;
    line-height: 1.25;
}

.summary-card strong {
    display: block;
    color: var(--purchase-text) !important;
    font-size: 19px !important;
    line-height: 1.2;
    white-space: nowrap;
}

.summary-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    border-radius: 11px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

/* --- Purchase history card --- */

.inventory-section {
    width: 100%;
    margin: 0 !important;
    overflow: hidden;
    border-radius: 15px !important;
    border: 1px solid var(--purchase-border) !important;
    background: #fff !important;
}

.inventory-section .section-header {
    padding: 17px 20px 13px !important;
    margin: 0 !important;
}

.inventory-section .section-header h2 {
    margin: 0 0 4px !important;
    font-size: 17px !important;
}

.inventory-section .section-header p {
    margin: 0 !important;
    color: var(--purchase-muted);
    font-size: 12px;
}

/* Toolbar */
.inventory-toolbar {
    padding: 12px 20px 14px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 1px solid #edf0f4;
}

.search-box {
    min-width: 280px;
    height: 40px !important;
    box-sizing: border-box;
    border-radius: 9px !important;
}

.inventory-toolbar select {
    height: 40px !important;
    min-width: 135px;
    padding: 0 12px !important;
    box-sizing: border-box;
}

/* Table */
.table-container {
    width: 100%;
    overflow-x: auto;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff;
}

.table-container table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
}

.table-container th {
    height: 38px;
    padding: 9px 13px !important;
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 10px !important;
    font-weight: 750 !important;
    letter-spacing: .05em;
    text-transform: uppercase;
    border-bottom: 1px solid #e8edf3 !important;
    white-space: nowrap;
    vertical-align: middle;
}

.table-container td {
    height: 54px;
    padding: 10px 13px !important;
    color: #334155;
    font-size: 12px !important;
    border-bottom: 1px solid #eef1f5 !important;
    vertical-align: middle;
    white-space: nowrap;
}

.table-container tbody tr:last-child td {
    border-bottom: 0 !important;
}

.table-container tbody tr:hover td {
    background: #fbfdff;
}

.table-container td:first-child,
.table-container th:first-child {
    padding-left: 20px !important;
}

.table-container td:last-child,
.table-container th:last-child {
    padding-right: 20px !important;
}

/* Action button */
.table-container .secondary-button,
.table-container .details-button,
.table-container .view-button,
.table-container a {
    white-space: nowrap;
}

/* --- Cleaner number emphasis --- */

.table-container td:nth-last-child(2) {
    font-variant-numeric: tabular-nums;
}

/* --- Responsive --- */

@media (max-width: 1200px) {
    :root {
        --purchase-sidebar: 216px;
    }

    .main-content {
        padding: 24px 24px 36px !important;
    }

    .inventory-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .sidebar {
        width: 78px !important;
        min-width: 78px !important;
        padding: 18px 10px !important;
    }

    .brand {
        justify-content: center;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .brand > div:last-child {
        display: none;
    }

    .menu-item {
        justify-content: center;
        padding: 11px 8px !important;
        font-size: 0 !important;
    }

    .menu-item span:first-child {
        margin: 0;
    }

    .sidebar-bottom {
        padding-top: 12px;
    }

    .main-content {
        padding: 22px 18px 32px !important;
    }

    .page-header {
        align-items: flex-start !important;
    }

    .page-header h1 {
        font-size: 24px !important;
    }
}

@media (max-width: 640px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        padding: 18px 14px 28px !important;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }

    .page-header .primary-button,
    .page-header .primary-action,
    .page-header a.primary-button {
        width: 100%;
    }

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

    .inventory-toolbar {
        align-items: stretch;
    }

    .search-box,
    .inventory-toolbar select {
        width: 100%;
        min-width: 0;
    }

    .summary-card {
        min-height: 78px;
    }
}

/* --- Print --- */

@media print {
    .sidebar {
        display: none !important;
    }

    .main-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .page-header .primary-button,
    .page-header .primary-action {
        display: none !important;
    }

    .summary-card,
    .inventory-section {
        box-shadow: none !important;
    }
}


/* =========================================================
   FINAL UNIFIED DESIGN SYSTEM
   Brand-driven, responsive, consistent across every page.
========================================================= */

:root {
    --brand-primary: #2563eb;
    --brand-sidebar: #111827;
    --app-bg: #f4f7fb;
    --surface: #ffffff;
    --border: #e4e9f0;
    --border-soft: #edf1f5;
    --text: #172033;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --radius: 14px;
    --sidebar-width: 224px;
    --content-max: 1540px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-card: 0 8px 24px rgba(15, 23, 42, .045);
}

/* -------------------------
   GLOBAL
------------------------- */

html {
    min-height: 100%;
    background: var(--app-bg);
}

body {
    min-height: 100vh;
    background: var(--app-bg) !important;
    color: var(--text);
}

a {
    color: inherit;
}

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

.app-layout {
    min-height: 100vh;
    display: flex;
    width: 100%;
    background: var(--app-bg);
}

/* -------------------------
   SIDEBAR
------------------------- */

.sidebar {
    position: sticky !important;
    top: 0;
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    height: 100vh;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 20px 13px 16px !important;
    background: var(--brand-sidebar) !important;
    color: #fff;
    display: flex !important;
    flex-direction: column;
    overflow-y: auto;
    z-index: 20;
}

.brand {
    min-height: 58px;
    padding: 0 7px 21px !important;
    margin: 0 0 7px !important;
    display: flex !important;
    align-items: center;
    gap: 11px !important;
    border-bottom: 1px solid rgba(255,255,255,.10);
}

.brand-logo,
.brand-logo-image {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 11px !important;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    background: var(--brand-primary) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    letter-spacing: -.4px;
    box-shadow: 0 5px 16px rgba(0,0,0,.16);
}

.brand-logo-image {
    background: #fff;
    padding: 3px;
    box-shadow: 0 5px 16px rgba(0,0,0,.16);
}

.brand-copy {
    min-width: 0;
}

.brand h2 {
    margin: 0 0 3px !important;
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand span {
    display: block;
    max-width: 145px;
    color: #aeb9c9 !important;
    font-size: 10px !important;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    margin-top: 5px;
}

.menu-item {
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 11px !important;
    border-radius: 9px !important;
    color: #cbd5e1 !important;
    background: transparent;
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    line-height: 1.15;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.menu-item > span:first-child {
    width: 21px;
    min-width: 21px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
}

.menu-item:hover {
    color: #fff !important;
    background: rgba(255,255,255,.07) !important;
    transform: translateX(1px);
}

.menu-item.active {
    color: #fff !important;
    background: var(--brand-primary) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.14);
}

.menu-item-disabled {
    cursor: default;
    opacity: .58;
}

.menu-item-disabled:hover {
    transform: none;
    background: transparent !important;
}

.sidebar-bottom {
    margin-top: auto !important;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.09);
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

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

.main-content {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    padding: 26px 30px 22px !important;
    background: var(--app-bg) !important;
    overflow-x: hidden;
}

.main-content > * {
    width: 100%;
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
}

.page-header {
    min-height: 52px;
    margin: 0 0 20px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px;
}

.page-header h1 {
    margin: 0 0 4px !important;
    color: var(--text) !important;
    font-size: 27px !important;
    font-weight: 800 !important;
    letter-spacing: -.45px;
    line-height: 1.15;
}

.page-header p {
    margin: 0 !important;
    color: var(--muted) !important;
    font-size: 12px !important;
    line-height: 1.45;
}

/* -------------------------
   BUTTONS
------------------------- */

.btn-primary,
.primary-button,
.primary-action,
.page-header .btn-primary {
    min-height: 40px;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px !important;
    border: 1px solid var(--brand-primary) !important;
    border-radius: 9px !important;
    background: var(--brand-primary) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    text-decoration: none !important;
    box-shadow: 0 5px 13px rgba(37,99,235,.15);
    cursor: pointer;
}

.btn-primary:hover,
.primary-button:hover,
.primary-action:hover {
    filter: brightness(.96);
    transform: translateY(-1px);
}

.btn-secondary,
.secondary-button,
.details-button,
.view-button {
    min-height: 38px;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 13px !important;
    border: 1px solid var(--border) !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    text-decoration: none !important;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.btn-secondary:hover,
.secondary-button:hover,
.details-button:hover {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
}

button.danger,
.btn-danger {
    border-color: #dc2626 !important;
    background: #dc2626 !important;
    color: #fff !important;
}

/* -------------------------
   CARDS / SECTIONS
------------------------- */

.summary-card,
.card,
.panel,
.inventory-section,
.details-card,
.settings-card {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-card);
}

.inventory-summary,
.summary-grid,
.dashboard-summary-grid {
    gap: 14px !important;
}

.inventory-summary {
    margin-bottom: 18px !important;
}

.summary-card {
    min-height: 82px;
    padding: 15px 17px !important;
}

.summary-card .summary-label,
.summary-card span {
    color: var(--muted) !important;
    font-size: 11px !important;
}

.summary-card .summary-value,
.summary-card strong {
    color: var(--text) !important;
    font-size: 18px !important;
    font-weight: 800 !important;
}

/* -------------------------
   TABLES
------------------------- */

.inventory-section,
.details-card {
    overflow: hidden;
}

.inventory-section-header,
.details-card-header,
.panel-header,
.settings-card-header {
    padding: 16px 19px !important;
    border-bottom: 1px solid var(--border-soft) !important;
}

.inventory-section-header h2,
.details-card-header h2,
.panel-header h3,
.settings-card-header h2 {
    margin: 0 0 4px !important;
    font-size: 16px !important;
    color: var(--text) !important;
}

.inventory-section-header p,
.details-card-header p,
.panel-header p,
.settings-card-header p {
    margin: 0 !important;
    color: var(--muted-2) !important;
    font-size: 11px !important;
}

.inventory-table,
.details-table,
.table-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.inventory-table th,
.details-table th,
.table-container th {
    padding: 10px 12px !important;
    height: 38px;
    background: #f8fafc !important;
    color: #64748b !important;
    border-bottom: 1px solid var(--border-soft) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.inventory-table td,
.details-table td,
.table-container td {
    padding: 11px 12px !important;
    min-height: 48px;
    border-bottom: 1px solid #eef2f6 !important;
    color: #334155 !important;
    font-size: 12px !important;
    vertical-align: middle;
}

.inventory-table tr:last-child td,
.details-table tr:last-child td,
.table-container tr:last-child td {
    border-bottom: 0 !important;
}

.inventory-table tbody tr:hover td,
.details-table tbody tr:hover td,
.table-container tbody tr:hover td {
    background: #fbfdff !important;
}

/* -------------------------
   FORMS
------------------------- */

.form-grid {
    gap: 15px !important;
}

.form-group label {
    display: block;
    margin: 0 0 6px !important;
    color: #334155 !important;
    font-size: 11px !important;
    font-weight: 750 !important;
}

.form-group input,
.form-group select,
.form-group textarea,
.settings-form input,
.settings-form select,
.settings-form textarea {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 9px 11px !important;
    border: 1px solid #dbe2ea !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #1f2937 !important;
    font-size: 12px !important;
    outline: none;
}

.form-group textarea,
.settings-form textarea {
    min-height: 92px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

.form-actions {
    margin-top: 18px !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

/* -------------------------
   SEARCH / TOOLBAR
------------------------- */

.inventory-toolbar,
.filter-bar,
.toolbar {
    gap: 9px !important;
    padding: 12px 18px !important;
}

.search-box {
    min-height: 40px !important;
    border-radius: 9px !important;
}

/* -------------------------
   FOOTER
------------------------- */

.app-footer {
    max-width: var(--content-max);
    margin: 24px auto 0 !important;
    padding: 15px 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    color: var(--muted-2);
    border-top: 1px solid var(--border);
    font-size: 10px;
}

.app-footer > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.app-footer strong {
    color: #475569;
    font-size: 11px;
}

.app-footer span {
    white-space: nowrap;
}

.footer-meta {
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* -------------------------
   SETTINGS
------------------------- */

.settings-page .page-header {
    margin-bottom: 18px !important;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card {
    overflow: hidden;
}

.settings-card-body {
    padding: 19px !important;
}

.branding-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: #f8fafc;
}

.branding-logo-preview {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 13px;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 800;
    font-size: 19px;
}

.branding-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.branding-preview strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
}

.branding-preview p,
.branding-preview small {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.color-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 13px;
}

.color-setting {
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    display: grid;
    grid-template-columns: 34px 1fr 46px;
    gap: 11px;
    align-items: center;
}

.color-swatch {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(0,0,0,.08);
}

.color-setting label {
    display: block;
    margin-bottom: 3px;
    font-weight: 750;
    font-size: 12px;
}

.color-setting small {
    color: var(--muted);
    font-size: 10px;
}

.color-setting input[type="color"] {
    width: 42px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.live-theme-note {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 13px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--brand-primary) 7%, white);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, white);
}

.live-theme-note > span {
    color: var(--brand-primary);
}

.live-theme-note strong {
    display: block;
    font-size: 11px;
    margin-bottom: 3px;
}

.live-theme-note p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.logo-upload-grid {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.logo-dropzone {
    min-height: 118px;
    min-width: 280px;
    padding: 18px;
    box-sizing: border-box;
    border: 1.5px dashed #cbd5e1;
    border-radius: 11px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    text-align: center;
}

.logo-dropzone:hover {
    border-color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 4%, white);
}

.logo-dropzone input {
    display: none;
}

.upload-icon {
    color: var(--brand-primary);
    font-size: 21px;
}

.logo-dropzone strong {
    font-size: 12px;
}

.logo-dropzone small {
    color: var(--muted);
    font-size: 10px;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: #475569;
}

.check-row input {
    width: 15px;
    height: 15px;
    min-height: 0;
}

.flash-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.flash-message {
    padding: 11px 13px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 11px;
}

.flash-message.error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

/* -------------------------
   DETAILS / INVOICE PAGES
------------------------- */

.purchase-details-page,
.sale-details-page {
    max-width: 1540px;
}

.details-card-body {
    padding: 19px !important;
}

.sale-info-grid {
    gap: 12px !important;
}

.info-box {
    background: #f8fafc !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: 10px !important;
    padding: 13px !important;
}

.info-label {
    color: var(--muted-2) !important;
    font-size: 9px !important;
    font-weight: 750;
}

.info-value {
    color: var(--text) !important;
    font-size: 13px !important;
}

.summary-grid {
    gap: 16px !important;
}

.totals-box {
    border-radius: 11px !important;
}

.action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.action-button {
    min-height: 38px;
    padding: 8px 12px !important;
    border-radius: 9px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
}

.action-button.return {
    border-color: #fed7aa !important;
    background: #fff7ed !important;
    color: #c2410c !important;
}

.action-button.return:hover {
    background: #ffedd5 !important;
}

/* -------------------------
   PRINT DOCUMENT HEADER
------------------------- */

.print-document-header {
    display: none;
}

.print-document-footer {
    display: none;
}

/* -------------------------
   RESPONSIVE
------------------------- */

@media (max-width: 1180px) {
    :root {
        --sidebar-width: 216px;
    }

    .main-content {
        padding: 23px 22px 20px !important;
    }

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

@media (max-width: 820px) {
    .sidebar {
        width: 76px !important;
        min-width: 76px !important;
        padding: 17px 9px !important;
    }

    .brand {
        justify-content: center;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .brand-copy {
        display: none;
    }

    .menu-item {
        justify-content: center;
        padding-left: 7px !important;
        padding-right: 7px !important;
        font-size: 0 !important;
    }

    .menu-item > span:first-child {
        width: 24px;
        font-size: 16px;
    }

    .sidebar-bottom {
        padding-top: 11px;
    }

    .main-content {
        padding: 20px 17px !important;
    }

    .page-header h1 {
        font-size: 23px !important;
    }

    .sale-info-grid {
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    }
}

@media (max-width: 620px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        padding: 17px 13px 20px !important;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .page-header > div:last-child,
    .page-header .action-row {
        width: 100%;
        justify-content: stretch;
    }

    .page-header .btn-primary,
    .page-header .btn-secondary,
    .page-header .primary-button,
    .page-header .action-button {
        flex: 1;
    }

    .sale-info-grid {
        grid-template-columns: 1fr !important;
    }

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

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

    .app-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-meta {
        justify-content: flex-start;
    }
}

/* -------------------------
   PRINT / INVOICE LAYOUT
------------------------- */

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    html,
    body {
        background: #fff !important;
    }

    body {
        color: #111 !important;
        font-size: 11px !important;
    }

    .sidebar,
    .no-print,
    .page-header .btn-primary,
    .page-header .btn-secondary,
    .page-header .primary-button,
    .page-header .action-button,
    .action-row,
    .app-footer {
        display: none !important;
    }

    .app-layout {
        display: block !important;
        min-height: auto !important;
    }

    .main-content {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        overflow: visible !important;
    }

    .print-document-header {
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 20px;
        padding-bottom: 12px;
        margin-bottom: 14px;
        border-bottom: 2px solid #111;
    }

    .print-brand {
        display: flex;
        align-items: center;
        gap: 11px;
    }

    .print-brand img,
    .print-brand-fallback {
        width: 54px;
        height: 54px;
        object-fit: contain;
        border-radius: 9px;
        border: 1px solid #ddd;
    }

    .print-brand-fallback {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #111;
        color: #fff;
        font-weight: 800;
        font-size: 16px;
    }

    .print-brand h2 {
        margin: 0 0 2px;
        font-size: 19px;
    }

    .print-brand p,
    .print-brand small {
        display: block;
        margin: 1px 0;
        color: #555;
        font-size: 9px;
    }

    .print-document-meta {
        min-width: 170px;
        text-align: right;
        display: grid;
        gap: 3px;
        font-size: 9px;
        color: #555;
    }

    .print-document-meta strong {
        color: #111;
        font-size: 14px;
    }

    .page-header {
        margin-bottom: 10px !important;
    }

    .page-header h1 {
        font-size: 17px !important;
    }

    .page-header p {
        font-size: 9px !important;
    }

    .inventory-section,
    .details-card,
    .summary-grid > *,
    .details-card-body,
    .notes-box,
    .totals-box {
        box-shadow: none !important;
        break-inside: avoid;
    }

    .inventory-section,
    .details-card {
        border: 1px solid #d8d8d8 !important;
        border-radius: 5px !important;
        margin-bottom: 8px !important;
    }

    .inventory-section-header,
    .details-card-header {
        padding: 8px 10px !important;
    }

    .details-card-body {
        padding: 9px !important;
    }

    .inventory-table th,
    .details-table th {
        background: #f3f3f3 !important;
        color: #222 !important;
        padding: 6px 7px !important;
        font-size: 8px !important;
    }

    .inventory-table td,
    .details-table td {
        padding: 6px 7px !important;
        color: #222 !important;
        font-size: 9px !important;
    }

    .info-box {
        padding: 7px !important;
        background: #fafafa !important;
    }

    .info-label {
        font-size: 7px !important;
    }

    .info-value {
        font-size: 9px !important;
    }

    .print-document-footer {
        display: flex !important;
        justify-content: space-between;
        gap: 15px;
        margin-top: 14px;
        padding-top: 8px;
        border-top: 1px solid #bbb;
        font-size: 8px;
        color: #555;
    }

    .sale-details-page .return-modal-backdrop,
    .sale-details-page .return-modal {
        display: none !important;
    }
}


/* =========================================================
   APP SHELL ALIGNMENT
   Printing Jobs / Backup & Restore / related pages use .app-shell.
   Keep the sidebar and main content side-by-side so the page does not
   render the main content underneath the full sidebar height.
========================================================= */
.app-shell {
    display: flex !important;
    width: 100% !important;
    min-height: 100vh !important;
    align-items: stretch !important;
}

.app-shell > .sidebar {
    flex: 0 0 var(--final-sidebar-width, 258px) !important;
}

.app-shell > .main-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* =========================================================
   MASTER STABILITY / CONTENT ALIGNMENT OVERRIDE
   Keep every main page centered without changing its internal layout.
========================================================= */
.main-content > * {
    width: min(100%, 1540px);
    max-width: 1540px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.app-footer {
    width: min(100%, 1540px);
    max-width: 1540px;
    margin-left: auto !important;
    margin-right: auto !important;
}


/* =========================================================
   FINAL MASTER UI OVERRIDES
   One consistent centered content system across the app.
========================================================= */

:root {
    --final-sidebar-width: 258px;
    --final-content-max: 1240px;
}

.app-layout {
    display: flex !important;
    width: 100% !important;
    min-height: 100vh !important;
}

.sidebar {
    flex: 0 0 var(--final-sidebar-width) !important;
    width: var(--final-sidebar-width) !important;
    min-width: var(--final-sidebar-width) !important;
}

.main-content {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 26px 30px 24px !important;
    box-sizing: border-box !important;
}

.main-content > * {
    width: min(100%, var(--final-content-max)) !important;
    max-width: var(--final-content-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.brand-logo-image {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    object-fit: contain !important;
    display: block !important;
    flex: 0 0 42px !important;
    box-sizing: border-box !important;
}

/* Dashboard: no top-right Administrator/profile block. */
.dashboard-profile {
    display: none !important;
}

/* Dashboard quick actions intentionally contain only the three core actions. */
.dashboard-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Recent Sales first, Low Stock directly below it. */
.dashboard-two-column {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
}

@media (max-width: 900px) {
    .main-content {
        padding: 22px 18px !important;
    }
    .dashboard-quick-actions {
        grid-template-columns: 1fr !important;
    }
}

@media print {
    .main-content > * {
        width: 100% !important;
        max-width: none !important;
    }
}

/* =========================================================
   UI REFINEMENT V2 — PROFESSIONAL BUSINESS DASHBOARD
   Visual-only layer. No routes, database fields or JS behavior changed.
========================================================= */
:root {
    --ui-v2-bg: #f3f6fa;
    --ui-v2-surface: #ffffff;
    --ui-v2-border: #e5eaf0;
    --ui-v2-border-strong: #d8e0e9;
    --ui-v2-text: #172033;
    --ui-v2-muted: #667085;
    --ui-v2-soft: #f7f9fc;
    --ui-v2-radius: 16px;
    --ui-v2-shadow: 0 8px 28px rgba(15, 23, 42, .055);
    --ui-v2-shadow-hover: 0 12px 34px rgba(15, 23, 42, .09);
}

body {
    background: var(--ui-v2-bg) !important;
    color: var(--ui-v2-text) !important;
}

.main-content {
    padding: 30px 34px 30px !important;
}

.main-content > * {
    max-width: 1360px !important;
}

/* -------------------------
   SIDEBAR / BRAND
------------------------- */
.sidebar {
    box-shadow: 8px 0 24px rgba(15, 23, 42, .06);
    border-right: 1px solid rgba(255,255,255,.05);
}

.brand-logo,
.brand-logo-image {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 12px !important;
}

.brand-logo-image {
    padding: 4px !important;
}

.brand-copy h2 {
    font-size: 14px !important;
    font-weight: 800 !important;
}

.menu-item {
    min-height: 42px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 650 !important;
}

.menu-item > span:first-child {
    width: 23px !important;
    min-width: 23px !important;
    height: 23px;
    border-radius: 7px;
    background: rgba(255,255,255,.055);
    font-size: 14px !important;
}

.menu-item.active > span:first-child {
    background: rgba(255,255,255,.16);
}

/* -------------------------
   PAGE HEADERS
------------------------- */
.page-header {
    min-height: 58px !important;
    margin-bottom: 22px !important;
}

.page-header h1 {
    font-size: 28px !important;
    font-weight: 820 !important;
    letter-spacing: -.55px !important;
}

.page-header p {
    max-width: 720px;
    font-size: 12px !important;
    color: #748094 !important;
}

/* -------------------------
   SUMMARY CARD SYSTEM
------------------------- */
.inventory-summary,
.summary-grid,
.dashboard-summary-grid,
.category-summary,
.supplier-summary-grid {
    gap: 16px !important;
}

.summary-card,
.supplier-stat-card {
    position: relative;
    min-height: 104px !important;
    padding: 18px 19px !important;
    border: 1px solid var(--ui-v2-border) !important;
    border-radius: var(--ui-v2-radius) !important;
    background: var(--ui-v2-surface) !important;
    box-shadow: var(--ui-v2-shadow) !important;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.summary-card::before,
.supplier-stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--brand-primary);
    opacity: .85;
}

.summary-card:hover,
.supplier-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ui-v2-shadow-hover) !important;
    border-color: var(--ui-v2-border-strong) !important;
}

.summary-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.summary-card span,
.summary-label,
.supplier-stat-top span {
    color: #748094 !important;
    font-size: 11px !important;
    font-weight: 650 !important;
    letter-spacing: .01em;
}

.summary-card strong,
.summary-value {
    margin-top: 6px;
    font-size: 21px !important;
    line-height: 1.15 !important;
    font-weight: 820 !important;
    color: var(--ui-v2-text) !important;
    font-variant-numeric: tabular-nums;
}

.summary-card small {
    display: block;
    margin-top: 7px;
    color: #98a2b3;
    font-size: 10px;
}

.summary-icon,
.supplier-stat-icon {
    width: 43px !important;
    height: 43px !important;
    min-width: 43px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    background: #eef4ff !important;
    border: 1px solid #e0eaff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

/* -------------------------
   DASHBOARD
------------------------- */
.dashboard-page .dashboard-summary-grid {
    margin-bottom: 20px !important;
}

.dashboard-stat-link {
    text-decoration: none !important;
}

.dashboard-stat-link:nth-child(2)::before { background: #7c3aed; }
.dashboard-stat-link:nth-child(3)::before { background: #0891b2; }
.dashboard-stat-link:nth-child(4)::before { background: #d97706; }

.dashboard-section {
    border: 1px solid var(--ui-v2-border) !important;
    border-radius: var(--ui-v2-radius) !important;
    background: #fff !important;
    box-shadow: var(--ui-v2-shadow) !important;
    overflow: hidden;
}

.dashboard-section .section-header {
    min-height: 67px;
    padding: 16px 19px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ui-v2-border) !important;
}

.dashboard-section .section-header h2 {
    margin: 0 0 3px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
}

.dashboard-section .section-header p {
    margin: 0 !important;
    color: #98a2b3 !important;
    font-size: 10px !important;
}

.dashboard-section .section-header a {
    font-size: 11px !important;
    font-weight: 750;
    color: var(--brand-primary) !important;
    text-decoration: none;
}

.dashboard-quick-actions {
    gap: 12px !important;
    margin: 0 !important;
}

.quick-action {
    min-height: 92px !important;
    padding: 15px 16px !important;
    border: 1px solid var(--ui-v2-border) !important;
    border-radius: 13px !important;
    background: #fbfcfe !important;
    text-decoration: none !important;
    transition: all .16s ease;
}

.quick-action:hover {
    background: #fff !important;
    border-color: #cfd8e3 !important;
    transform: translateY(-2px);
    box-shadow: var(--ui-v2-shadow);
}

.quick-action > span {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #eef4ff !important;
    font-size: 16px !important;
    margin-bottom: 8px;
}

.quick-action strong {
    display: block;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #263246 !important;
}

.quick-action small {
    display: block;
    margin-top: 3px;
    color: #98a2b3 !important;
    font-size: 10px !important;
}

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

.dashboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.dashboard-table th {
    padding: 10px 16px !important;
    background: #f8fafc !important;
    color: #7b8798 !important;
    border-bottom: 1px solid var(--ui-v2-border) !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: .055em;
    text-align: left;
    white-space: nowrap;
}

.dashboard-table td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #eef2f6 !important;
    color: #344054 !important;
    font-size: 11px !important;
    white-space: nowrap;
}

.dashboard-table tbody tr:hover td {
    background: #fbfdff !important;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

/* -------------------------
   MAIN TABLES
------------------------- */
.inventory-section,
.category-section,
.supplier-list-card {
    border: 1px solid var(--ui-v2-border) !important;
    border-radius: var(--ui-v2-radius) !important;
    box-shadow: var(--ui-v2-shadow) !important;
    background: #fff !important;
    overflow: hidden;
}

.inventory-section .section-header,
.category-section > .section-header,
.supplier-list-card > .section-header {
    padding: 17px 19px !important;
}

.inventory-table th,
.details-table th,
.category-table th,
.supplier-table th {
    height: 40px !important;
    padding: 10px 14px !important;
    background: #f8fafc !important;
    color: #7b8798 !important;
    border-bottom: 1px solid var(--ui-v2-border) !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.inventory-table td,
.details-table td,
.category-table td,
.supplier-table td {
    min-height: 52px !important;
    padding: 12px 14px !important;
    border-bottom: 1px solid #edf1f5 !important;
    color: #344054 !important;
    font-size: 11px !important;
    vertical-align: middle;
}

.inventory-table tbody tr:hover td,
.details-table tbody tr:hover td,
.category-table tbody tr:hover td,
.supplier-table tbody tr:hover td {
    background: #fbfdff !important;
}

.item-name strong {
    font-size: 12px !important;
    font-weight: 750 !important;
    color: #273246 !important;
}

.item-name small {
    font-size: 10px !important;
    color: #98a2b3 !important;
}

/* -------------------------
   BADGES / STATUS
------------------------- */
.type-badge,
.status-badge,
.product-badge,
.service-badge,
.active-status {
    min-height: 24px;
    padding: 4px 9px !important;
    border-radius: 999px !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 1.2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.status-paid,
.status-success,
.active-status {
    background: #ecfdf3 !important;
    color: #15803d !important;
    border: 1px solid #ccefdc;
}

.status-partial {
    background: #fff7ed !important;
    color: #c2410c !important;
    border: 1px solid #fed7aa;
}

.status-due,
.status-low {
    background: #fff7ed !important;
    color: #b45309 !important;
    border: 1px solid #fde2bd;
}

.status-inactive {
    background: #f2f4f7 !important;
    color: #667085 !important;
    border: 1px solid #e4e7ec;
}

.product-badge {
    background: #eef4ff !important;
    color: #315fbd !important;
    border: 1px solid #dce7ff;
}

.service-badge {
    background: #f5f0ff !important;
    color: #7a43b6 !important;
    border: 1px solid #e9ddff;
}

/* -------------------------
   TOOLBARS / SEARCH
------------------------- */
.inventory-toolbar,
.supplier-toolbar {
    padding: 13px 18px !important;
    background: #fff !important;
    border-bottom: 1px solid var(--ui-v2-border) !important;
}

.search-box {
    min-height: 40px !important;
    border: 1px solid #dce3eb !important;
    background: #fff !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 2px rgba(16,24,40,.03);
}

.search-box:focus-within {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08) !important;
}

.inventory-toolbar select,
.supplier-toolbar select {
    min-height: 40px !important;
    border: 1px solid #dce3eb !important;
    border-radius: 10px !important;
    background: #fff !important;
}

/* -------------------------
   ACTION BUTTONS / TABLE ACTIONS
------------------------- */
.category-actions,
.supplier-actions,
.item-actions,
.table-actions,
.action-buttons {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.category-actions a,
.category-actions button,
.supplier-actions a,
.supplier-actions button,
.item-actions a,
.item-actions button,
.table-actions a,
.table-actions button {
    min-height: 30px !important;
    padding: 6px 9px !important;
    border-radius: 8px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
}

/* -------------------------
   FORMS / INPUT CARDS
------------------------- */
.inventory-form-card,
.expense-form-card,
.edit-card,
.password-card,
.security-card {
    border: 1px solid var(--ui-v2-border) !important;
    border-radius: var(--ui-v2-radius) !important;
    background: #fff !important;
    box-shadow: var(--ui-v2-shadow) !important;
}

.form-card-header,
.expense-form-card > .card-header,
.inventory-form-card > .card-header {
    border-bottom: 1px solid var(--ui-v2-border) !important;
}

.form-group label,
.field-label {
    color: #344054 !important;
    font-size: 11px !important;
    font-weight: 750 !important;
}

.form-group input,
.form-group select,
.form-group textarea,
.field-input,
.field-select,
.field-textarea,
.expense-form-card input,
.expense-form-card select,
.expense-form-card textarea {
    border: 1px solid #d9e1ea !important;
    border-radius: 9px !important;
    min-height: 41px !important;
    background: #fff !important;
    box-shadow: inset 0 1px 1px rgba(16,24,40,.02);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.09) !important;
}

/* -------------------------
   DETAIL PAGES
------------------------- */
.details-card,
.supplier-card {
    border: 1px solid var(--ui-v2-border) !important;
    border-radius: var(--ui-v2-radius) !important;
    background: #fff !important;
    box-shadow: var(--ui-v2-shadow) !important;
    overflow: hidden;
}

.details-card-header,
.supplier-card-title {
    background: #fff !important;
}

.info-box,
.detail-info-box {
    border: 1px solid var(--ui-v2-border) !important;
    border-radius: 11px !important;
    background: #f8fafc !important;
}

/* -------------------------
   SETTINGS / SECURITY
------------------------- */
.settings-card,
.security-card {
    border-radius: var(--ui-v2-radius) !important;
    box-shadow: var(--ui-v2-shadow) !important;
}

.settings-card-header,
.security-card-header {
    background: #fbfcfe !important;
}

/* -------------------------
   EMPTY STATES
------------------------- */
.dashboard-empty-state,
.empty-state,
.inventory-table .empty-state {
    padding: 42px 20px !important;
    text-align: center;
    color: #667085;
}

.dashboard-empty-icon,
.empty-icon {
    width: 52px !important;
    height: 52px !important;
    margin: 0 auto 11px !important;
    border-radius: 15px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9 !important;
    font-size: 22px !important;
}

.dashboard-empty-state h3,
.empty-state h3 {
    margin: 0 0 5px !important;
    font-size: 14px !important;
    color: #344054 !important;
}

.dashboard-empty-state p,
.empty-state p {
    margin: 0 !important;
    font-size: 11px !important;
    color: #98a2b3 !important;
}

/* -------------------------
   FOOTER
------------------------- */
.app-footer {
    margin-top: 26px !important;
    padding-top: 15px !important;
    border-top: 1px solid var(--ui-v2-border) !important;
    color: #98a2b3 !important;
}

/* -------------------------
   RESPONSIVE
------------------------- */
@media (max-width: 1180px) {
    .main-content {
        padding: 26px 24px 28px !important;
    }

    .inventory-summary,
    .dashboard-summary-grid,
    .supplier-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 820px) {
    .sidebar {
        width: 78px !important;
        min-width: 78px !important;
    }

    .brand-copy,
    .menu-item:not(.logout-item)::after {
        display: none !important;
    }

    .brand {
        justify-content: center;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .menu-item {
        justify-content: center !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        font-size: 0 !important;
    }

    .menu-item > span:first-child {
        margin: 0 !important;
    }

    .main-content {
        padding: 22px 18px 26px !important;
    }

    .page-header {
        align-items: flex-start !important;
    }
}

@media (max-width: 620px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        padding: 18px 13px 24px !important;
    }

    .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .page-header h1 {
        font-size: 23px !important;
    }

    .inventory-summary,
    .summary-grid,
    .dashboard-summary-grid,
    .category-summary,
    .supplier-summary-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-quick-actions {
        grid-template-columns: 1fr !important;
    }

    .summary-card,
    .supplier-stat-card {
        min-height: 92px !important;
    }

    .inventory-toolbar,
    .supplier-toolbar {
        flex-direction: column;
        align-items: stretch !important;
    }

    .search-box,
    .inventory-toolbar select,
    .supplier-toolbar select {
        width: 100% !important;
        max-width: none !important;
    }

    .app-footer {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

/* =========================================================
   V1 FIX — SALES STATUS FILTER
   Kept as a small additive layer so UI REFINED V2 remains intact.
========================================================= */
.sales-status-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.sales-status-filter label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

.sales-status-filter select {
    height: 40px;
    min-width: 145px;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    padding: 0 34px 0 11px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    outline: none;
}

.sales-status-filter select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #eff6ff;
}

@media (max-width: 700px) {
    .sales-status-filter {
        width: 100%;
        margin-left: 0;
    }

    .sales-status-filter select {
        width: 100%;
    }
}

/* =========================
   REPORTS
========================= */
.reports-main-content { padding-bottom: 40px; }
.reports-page { width: 100%; max-width: 1260px; margin: 0 auto; }
.reports-header { align-items: center; }
.report-print-btn { white-space: nowrap; }
.report-controls-card,
.report-table-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 8px 24px rgba(15,23,42,.05); }
.report-controls-card { margin-bottom: 18px; overflow: hidden; }
.report-type-tabs { display:flex; flex-wrap:wrap; gap:8px; padding:14px; border-bottom:1px solid #edf0f4; background:#fbfcfe; }
.report-tab { display:inline-flex; align-items:center; gap:7px; padding:10px 13px; border-radius:10px; text-decoration:none; color:#475569; font-size:13px; font-weight:700; border:1px solid transparent; }
.report-tab:hover { background:#eef4ff; color:var(--brand-primary,#2563eb); }
.report-tab.active { background:var(--brand-primary,#2563eb); color:#fff; box-shadow:0 4px 12px rgba(37,99,235,.18); }
.report-filter-form { display:grid; grid-template-columns:170px 170px 1fr auto; gap:14px; align-items:end; padding:18px; }
.report-date-field label, .report-presets > label { display:block; font-size:12px; font-weight:700; color:#64748b; margin-bottom:6px; }
.report-date-field input { width:100%; height:42px; border:1px solid #d8dee8; border-radius:9px; padding:0 11px; font:inherit; background:#fff; }
.report-presets { min-width:0; }
.preset-buttons { display:flex; flex-wrap:wrap; gap:7px; }
.preset-buttons button { height:38px; padding:0 10px; border:1px solid #d8dee8; background:#fff; color:#475569; border-radius:8px; font-size:12px; font-weight:600; }
.preset-buttons button:hover { border-color:var(--brand-primary,#2563eb); color:var(--brand-primary,#2563eb); background:#f8fbff; }
.report-apply-btn { height:42px; white-space:nowrap; }
.report-info-note { margin:0 0 18px; padding:12px 14px; border-radius:10px; border:1px solid #dbeafe; background:#eff6ff; color:#334155; font-size:13px; line-height:1.5; }
.report-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.report-summary-card { background:#fff; border:1px solid #e5e7eb; border-radius:14px; padding:18px; box-shadow:0 7px 20px rgba(15,23,42,.04); min-height:116px; }
.report-summary-card span { display:block; color:#64748b; font-size:12px; font-weight:700; margin-bottom:8px; }
.report-summary-card strong { display:block; color:#0f172a; font-size:23px; line-height:1.2; }
.report-summary-card small { display:block; margin-top:7px; color:#94a3b8; font-size:11px; }
.report-table-title { padding:18px 20px; border-bottom:1px solid #edf0f4; }
.report-table-title h2 { margin:0; font-size:18px; color:#0f172a; }
.report-table-title p { margin:5px 0 0; color:#94a3b8; font-size:12px; }
.report-table-wrap { overflow:auto; }
.report-table { width:100%; border-collapse:collapse; min-width:900px; }
.report-table th { padding:12px 14px; text-align:left; background:#f8fafc; color:#64748b; font-size:11px; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; border-bottom:1px solid #e5e7eb; }
.report-table td { padding:13px 14px; color:#334155; font-size:13px; border-bottom:1px solid #eef2f7; white-space:nowrap; }
.report-table tbody tr:hover { background:#fafcff; }
.report-table td small { color:#94a3b8; }
.status-badge, .stock-status { display:inline-flex; align-items:center; justify-content:center; padding:5px 8px; border-radius:999px; font-size:10px; font-weight:800; }
.status-paid { background:#ecfdf3; color:#15803d; }
.status-partial { background:#fff7ed; color:#c2410c; }
.status-due { background:#fef2f2; color:#b91c1c; }
.stock-in-stock { background:#ecfdf3; color:#15803d; }
.stock-low-stock { background:#fff7ed; color:#c2410c; }
.stock-out-of-stock { background:#fef2f2; color:#b91c1c; }
.stock-not-tracked { background:#f1f5f9; color:#64748b; }
.empty-report { text-align:center !important; color:#94a3b8 !important; padding:40px !important; }
.pl-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.pl-card { background:#fff; border:1px solid #e5e7eb; border-radius:14px; padding:17px; box-shadow:0 7px 20px rgba(15,23,42,.04); }
.pl-card span { display:block; color:#64748b; font-size:12px; font-weight:700; margin-bottom:8px; }
.pl-card strong { font-size:21px; color:#0f172a; }
.pl-card-highlight { border-color:#bfdbfe; background:#eff6ff; }
.pl-breakdown { max-width:820px; margin:0 auto; }
.pl-lines { padding:10px 22px 22px; }
.pl-lines > div { display:flex; justify-content:space-between; gap:20px; padding:13px 4px; border-bottom:1px solid #eef2f7; font-size:14px; color:#475569; }
.pl-lines > div strong { color:#0f172a; }
.pl-lines .pl-total { font-weight:800; color:#0f172a; background:#f8fafc; padding-left:12px; padding-right:12px; }
.pl-lines .pl-grand-total { font-size:16px; font-weight:800; background:#eff6ff; color:#0f172a; padding:16px 12px; border-radius:9px; margin-top:6px; border:1px solid #dbeafe; }
.pl-lines .pl-reference { font-size:12px; color:#94a3b8; border-bottom:0; padding-bottom:4px; }
@media (max-width: 1100px) {
    .report-filter-form { grid-template-columns:1fr 1fr; }
    .report-presets { grid-column:1 / -1; }
    .report-apply-btn { justify-self:start; }
    .report-summary-grid, .pl-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
    .report-filter-form { grid-template-columns:1fr; }
    .report-presets { grid-column:auto; }
    .report-summary-grid, .pl-summary-grid { grid-template-columns:1fr; }
    .reports-header { gap:12px; }
}
@media print {
    .sidebar, .report-controls-card, .report-print-btn { display:none !important; }
    .app-layout, .main-content { display:block !important; width:100% !important; margin:0 !important; padding:0 !important; }
    .reports-page { max-width:none; }
    .report-table-card, .report-summary-card, .pl-card { box-shadow:none; }
    .report-table { min-width:0; }
    .report-table th, .report-table td { font-size:10px; padding:7px; }
}
/* =========================================================
   PROTIMA PRESS — UNIFIED DASHBOARD UI THEME
   Visual-only layer. No application logic or form behavior is changed.
   ========================================================= */
:root{
  --ui-primary:#1677ff;
  --ui-primary-2:#2d8cff;
  --ui-navy:#062a57;
  --ui-navy-2:#0a3a72;
  --ui-bg:#edf6ff;
  --ui-card:#ffffff;
  --ui-text:#12213f;
  --ui-muted:#7183a3;
  --ui-border:#dbe9f8;
  --ui-shadow:0 10px 30px rgba(42,91,145,.10);
  --ui-radius:16px;
}

*{box-sizing:border-box}
html{background:var(--ui-bg)}
body{
  margin:0;
  min-height:100vh;
  font-family:"Segoe UI",Inter,Arial,sans-serif;
  color:var(--ui-text);
  background:
    radial-gradient(circle at 88% 8%,rgba(117,196,255,.25),transparent 26%),
    radial-gradient(circle at 45% 100%,rgba(255,255,255,.95),transparent 35%),
    linear-gradient(135deg,#eaf5ff 0%,#f8fbff 52%,#e8f4ff 100%);
}
body:before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;
  background:linear-gradient(155deg,transparent 0 45%,rgba(83,167,255,.06) 45.1% 60%,transparent 60.1%);
}
button,input,select,textarea{font-family:inherit}

/* ---------- Application shell ---------- */
.app-layout{display:flex;min-height:100vh}
.sidebar{
  width:285px!important;min-width:285px;min-height:100vh!important;
  position:sticky;top:0;height:100vh;overflow:auto;
  padding:18px 17px!important;
  color:#fff;
  background:
    radial-gradient(circle at 85% 12%,rgba(37,125,255,.20),transparent 24%),
    linear-gradient(155deg,#082c5a 0%,#052650 52%,#031e40 100%)!important;
  border-right:1px solid rgba(255,255,255,.06);
  box-shadow:8px 0 30px rgba(4,36,72,.12);
  z-index:20;
}
.brand{display:flex;align-items:center;gap:11px;padding:4px 6px 24px!important}
.brand-logo-image,.brand-logo{
  width:45px!important;height:45px!important;min-width:45px;
  border-radius:13px!important;object-fit:cover;
  box-shadow:0 5px 16px rgba(0,0,0,.16);
}
.brand-logo{display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#fff,#dcecff)!important;color:#0966d9!important;font-weight:800}
.brand-copy h2{margin:0 0 3px!important;font-size:17px!important;font-weight:750!important;color:#fff!important;letter-spacing:-.2px}
.brand-copy span{font-size:11px!important;color:#aac2df!important}
.sidebar-menu,.sidebar-bottom{gap:5px!important}
.sidebar-bottom{margin-top:auto!important;padding-top:17px!important;border-top:1px solid rgba(184,214,245,.22)!important}
.menu-item{
  display:flex!important;align-items:center;gap:12px!important;
  min-height:44px;padding:10px 13px!important;border-radius:11px!important;
  color:#e5eef9!important;text-decoration:none!important;
  font-size:14px!important;font-weight:560!important;
  transition:.18s ease!important;
}
.menu-item span:first-child{width:25px;display:inline-flex;justify-content:center;font-size:18px;filter:saturate(.9)}
.menu-item:hover{background:rgba(69,150,255,.13)!important;color:#fff!important;transform:translateX(1px)}
.menu-item.active{
  background:linear-gradient(135deg,#0878ff,#1768e8)!important;
  color:#fff!important;box-shadow:0 8px 20px rgba(0,107,255,.27)!important;
}
.logout-item{color:#d9e6f6!important}

/* ---------- Main content ---------- */
.main-content{
  flex:1;min-width:0;padding:24px 28px 18px!important;
  background:transparent!important;
}
.page-header,.dashboard-header{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  margin:0 0 20px!important;padding:4px 2px!important;
}
.page-header h1{
  margin:0!important;font-size:31px!important;line-height:1.08!important;
  font-weight:800!important;letter-spacing:-.8px!important;color:#12213f!important;
}
.page-header p{margin:6px 0 0!important;color:#7890af!important;font-size:13px!important}
.page-header .btn,.page-header .primary-button{white-space:nowrap}

/* ---------- Universal cards / sections ---------- */
.summary-card,.dashboard-section,.inventory-section,.details-card,.security-card,
.supplier-card,.supplier-summary-card,.report-controls-card,.report-table-card,
.report-summary-card,.pl-card,.costing-card,.table-container,.info-box,
.form-block,.sale-form-section,.sale-section,.job-card,.inventory-form,
.settings-card,.backup-card,.users-card,.modal-content{
  background:rgba(255,255,255,.94)!important;
  border:1px solid rgba(190,216,242,.78)!important;
  border-radius:var(--ui-radius)!important;
  box-shadow:var(--ui-shadow)!important;
}
.dashboard-section,.inventory-section,.details-card,.report-controls-card,.report-table-card,
.costing-card,.form-block,.sale-form-section,.job-card{padding:18px!important}
.section-header{margin-bottom:13px!important}
.section-header h2,.details-card-header h2,.report-table-title h2,.costing-card h2{
  color:#132541!important;font-weight:760!important;letter-spacing:-.25px!important
}
.section-header p,.sub,.details-card-header p{color:#7b8da8!important}

/* ---------- Dashboard ---------- */
.dashboard-page{max-width:1480px;margin:0 auto}
.dashboard-summary-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px!important;margin-bottom:16px!important}
.dashboard-summary-grid .summary-card{min-height:108px;padding:18px 19px!important;position:relative;overflow:hidden}
.dashboard-summary-grid .summary-card:after{
  content:"";position:absolute;right:-12px;bottom:-18px;width:86px;height:86px;border-radius:50%;background:rgba(36,126,255,.07)
}
.summary-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.summary-card span{color:#7c8da7;font-size:12px;font-weight:600}
.summary-card strong{display:block;margin-top:7px;color:#142543;font-size:25px;font-weight:800}
.summary-icon{width:48px!important;height:48px!important;border-radius:13px!important;display:flex;align-items:center;justify-content:center;font-size:23px!important;background:linear-gradient(145deg,#e6f1ff,#cde4ff)!important;color:#0875ef}
.dashboard-summary-grid .summary-card:nth-child(2) .summary-icon{background:linear-gradient(145deg,#f0e4ff,#dfc9ff)!important}
.dashboard-summary-grid .summary-card:nth-child(3) .summary-icon{background:linear-gradient(145deg,#dffaf1,#c4f2df)!important}
.dashboard-summary-grid .summary-card:nth-child(4) .summary-icon{background:linear-gradient(145deg,#fff0e7,#ffd9c4)!important}
.quick-actions{display:grid!important;grid-template-columns:repeat(3,1fr);gap:12px!important}
.quick-action{border-radius:13px!important;border:1px solid #d9e9f8!important;background:linear-gradient(100deg,#edf6ff,#f9fcff)!important;padding:15px 17px!important;box-shadow:none!important}
.quick-action:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(40,100,160,.08)!important}
.dashboard-two-column{display:grid!important;grid-template-columns:1.3fr 1fr;gap:16px!important}
.dashboard-table-wrap{border:1px solid #e2edf8!important;border-radius:12px!important;overflow:auto}
.dashboard-table,.inventory-table,.report-table,.data-table,table{border-collapse:collapse}
.dashboard-table th,.inventory-table th,.report-table th,table thead th{
  background:#eef6ff!important;color:#5e7697!important;font-size:11px!important;text-transform:uppercase;letter-spacing:.3px;
  font-weight:750!important;padding:11px 13px!important;border-bottom:1px solid #dceafa!important
}
.dashboard-table td,.inventory-table td,.report-table td,table tbody td{padding:10px 13px!important;border-bottom:1px solid #edf2f8!important;color:#253b5b!important;font-size:13px!important}
.dashboard-table tbody tr:hover,.inventory-table tbody tr:hover,.report-table tbody tr:hover{background:#f7fbff!important}

/* ---------- Buttons ---------- */
.primary-button,.btn-primary,.btn.primary-button,.action-button,.modal-button.primary,
button[type="submit"]:not(.btn-secondary):not(.secondary-button){
  background:linear-gradient(135deg,#0878ff,#1767e7)!important;color:#fff!important;border:0!important;
  border-radius:10px!important;box-shadow:0 7px 17px rgba(15,108,238,.20)!important;
  font-weight:700!important;padding:10px 16px!important;
}
.primary-button:hover,.btn-primary:hover,button[type="submit"]:not(.btn-secondary):not(.secondary-button):hover{filter:brightness(1.03);transform:translateY(-1px)}
.secondary-button,.btn-secondary,.btn.secondary-button,.modal-button.secondary{
  background:#fff!important;color:#356086!important;border:1px solid #cfe0f1!important;
  border-radius:10px!important;font-weight:650!important;padding:10px 15px!important;box-shadow:none!important
}
.secondary-button:hover,.btn-secondary:hover{background:#f5faff!important}
.btn-small,.mini-button{border-radius:8px!important}

/* ---------- Forms ---------- */
.form-grid{gap:14px!important}
.form-group,.inventory-form-group,.expense-form-group,.security-form-group,.field,.supplier-field,
.report-date-field,.quick-customer-field{margin-bottom:0!important}
.form-group label,.field label,.inventory-form-group label,.expense-form-group label,.security-form-group label,
.report-date-field label,.field-label{display:block;color:#536b89!important;font-size:12px!important;font-weight:700!important;margin-bottom:7px!important}
input,select,textarea{
  width:100%;min-height:42px;padding:10px 12px!important;border:1px solid #d5e4f2!important;
  border-radius:10px!important;background:#fbfdff!important;color:#1d3454!important;outline:none!important;
  box-shadow:inset 0 1px 2px rgba(25,72,115,.02)!important;font-size:13px!important
}
input:focus,select:focus,textarea:focus{border-color:#70adf4!important;box-shadow:0 0 0 3px rgba(22,119,255,.10)!important;background:#fff!important}
textarea{min-height:90px;resize:vertical}

/* ---------- Inventory / lists ---------- */
.inventory-summary,.report-summary-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px!important;margin-bottom:16px!important}
.inventory-summary .summary-card,.report-summary-card{padding:16px 18px!important}
.inventory-toolbar{display:flex!important;align-items:center;gap:10px!important;padding:12px 0!important;flex-wrap:wrap}
.search-box{flex:1;min-width:240px;background:#f8fbff!important;border:1px solid #d8e7f5!important;border-radius:10px!important}
.table-container{padding:0!important;overflow:auto}
.status-badge{border-radius:999px!important;padding:5px 10px!important;font-size:11px!important;font-weight:750!important;border:0!important}
.status-paid{background:#d9f7e8!important;color:#12834e!important}.status-partial{background:#fff0c7!important;color:#ad6a00!important}.status-due,.status-low{background:#ffe1e1!important;color:#c62828!important}

/* ---------- Reports ---------- */
.report-type-tabs{display:flex!important;gap:8px!important;flex-wrap:wrap!important;margin-bottom:14px!important}
.report-tab{border:1px solid #d8e7f5!important;border-radius:9px!important;background:#f8fbff!important;color:#52708f!important;padding:9px 12px!important;text-decoration:none!important;font-size:12px!important;font-weight:650!important}
.report-tab.active{background:#e7f2ff!important;border-color:#7eb7f5!important;color:#096ddd!important}
.report-filter-form{display:grid!important;grid-template-columns:150px 150px 1fr auto;gap:12px!important;align-items:end}
.preset-buttons{display:flex;gap:6px;flex-wrap:wrap}.preset-buttons button{border:1px solid #d5e5f3;background:#fff;border-radius:8px;padding:7px 9px;color:#55718e;font-size:11px}
.report-summary-card{min-height:105px}.report-summary-card span{font-size:12px;color:#7186a0}.report-summary-card strong{display:block;margin:7px 0 3px;font-size:22px;color:#152947}.report-summary-card small{color:#8a9ab0}

/* ---------- Details / jobs / purchases / sales ---------- */
.details-card-header{padding-bottom:12px!important;border-bottom:1px solid #e8f0f7!important;margin-bottom:14px!important}
.summary-row,.sale-summary-row{border-bottom:1px solid #edf2f7!important;padding:10px 0!important}
.summary-label,.info-label{color:#7a8da7!important;font-size:12px!important}.summary-value,.info-value{color:#1b3455!important;font-weight:700!important}
.info-box{padding:14px!important;background:#f7fbff!important}
.job-card{transition:.18s ease}.job-card:hover{transform:translateY(-2px)}

/* ---------- Printing costing ---------- */
.costing-grid{gap:16px!important}
.costing-card{background:rgba(255,255,255,.96)!important}
.costing-card h2{font-size:18px!important}
.section-label{color:#6e84a0!important;font-size:11px!important;font-weight:800!important;letter-spacing:.65px!important}
.inventory-section-header{border-radius:11px!important;background:#f3f8fd!important;border:1px solid #dfebf6!important}

/* ---------- Footer ---------- */
.app-footer{margin-top:18px!important;padding:13px 3px!important;color:#7890ac!important;font-size:12px!important;border-top:1px solid #dceaf6!important;background:transparent!important}

/* ---------- Login / security pages ---------- */
.login-page,.login-container,.auth-page{background:transparent!important}
.login-card,.auth-card,.security-card{border-radius:20px!important;background:rgba(255,255,255,.96)!important;border:1px solid #d8e8f6!important;box-shadow:0 18px 50px rgba(24,75,125,.13)!important}
.login-card h1,.auth-card h1{color:#112744!important;font-weight:800!important}

/* ---------- Modals / dropdowns ---------- */
.modal-content{border-radius:16px!important}.modal-close{border-radius:8px!important;background:#eef6ff!important;color:#477091!important}
.item-action-dropdown{border:1px solid #dbe9f6!important;border-radius:11px!important;box-shadow:0 15px 35px rgba(18,59,101,.14)!important}

/* ---------- Responsive ---------- */
@media(max-width:1200px){
  .sidebar{width:245px!important;min-width:245px}
  .dashboard-summary-grid,.inventory-summary,.report-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .dashboard-two-column{grid-template-columns:1fr!important}
  .report-filter-form{grid-template-columns:1fr 1fr!important}
}
@media(max-width:850px){
  .app-layout{display:block}.sidebar{position:relative;width:100%!important;min-width:0;height:auto;min-height:auto!important}.sidebar-menu,.sidebar-bottom{display:grid;grid-template-columns:repeat(2,1fr)}.sidebar-bottom{margin-top:10px!important}.main-content{padding:18px!important}.page-header{align-items:flex-start;flex-direction:column}.quick-actions{grid-template-columns:1fr!important}.dashboard-summary-grid,.inventory-summary,.report-summary-grid{grid-template-columns:1fr!important}
}
@media(max-width:560px){
  .sidebar-menu,.sidebar-bottom{grid-template-columns:1fr}.main-content{padding:13px!important}.page-header h1{font-size:25px!important}.report-filter-form{grid-template-columns:1fr!important}.form-grid{grid-template-columns:1fr!important}.dashboard-two-column{display:block!important}.dashboard-two-column>*+*{margin-top:14px}
}

/* =========================================================
   PROTIMA PRESS — FULL BODY UI REDESIGN v2
   Visual-only overrides. No routes, JS, forms or data logic changed.
   ========================================================= */
:root{
  --pp-blue:#1677ff;
  --pp-blue-dark:#0752ad;
  --pp-navy:#082d5b;
  --pp-bg:#eef7ff;
  --pp-card:#ffffff;
  --pp-border:#d8e9f8;
  --pp-text:#142746;
  --pp-muted:#7187a5;
  --pp-shadow:0 8px 26px rgba(38,92,146,.10);
  --pp-radius:16px;
}

body{
  background:
    radial-gradient(circle at 88% 0%,rgba(111,191,255,.24),transparent 25%),
    radial-gradient(circle at 42% 100%,rgba(255,255,255,.96),transparent 34%),
    linear-gradient(135deg,#eaf5ff 0%,#f8fbff 52%,#e8f4ff 100%) !important;
  color:var(--pp-text) !important;
}

.main-content{
  padding:24px 28px 22px !important;
  background:transparent !important;
}

/* Page headers become a consistent Protima Press visual block */
.page-header{
  position:relative;
  min-height:68px;
  align-items:center !important;
  margin-bottom:18px !important;
  padding:2px 2px 2px 68px !important;
}
.page-header > div:first-child{min-width:0}
.page-header h1{
  font-size:30px !important;
  color:#102441 !important;
  font-weight:800 !important;
  letter-spacing:-.8px !important;
}
.page-header p{color:#7890ad !important;font-size:13px !important}
.page-header:before{
  position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:48px;height:48px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  font-size:23px;
  background:linear-gradient(145deg,#dff0ff,#c5e1ff);
  box-shadow:0 7px 18px rgba(32,116,211,.12);
}
.inventory-page .page-header:before{content:'📦'}
.supplier-page .page-header:before{content:'🚚'}
.category-page .page-header:before{content:'🗂️'}
.settings-page .page-header:before{content:'⚙️'}
.security-page .page-header:before{content:'👤'}
.reports-page .page-header:before,.report-page .page-header:before{content:'📊'}
.printing-jobs-page .page-header:before,.jobs-page .page-header:before{content:'🖨️'}
.printing-costing-page .page-header:before,.costing-page .page-header:before{content:'🖨️'}
.expenses-page .page-header:before{content:'💸'}
.sales-page .page-header:before{content:'🧾'}
.customers-page .page-header:before{content:'👥'}

/* Universal body cards */
.dashboard-section,
.inventory-section,
.supplier-list-card,
.supplier-card,
.details-card,
.report-table-card,
.report-controls-card,
.report-summary-card,
.pl-card,
.costing-card,
.form-card,
.form-block,
.sale-form-section,
.sale-section,
.expense-form-card,
.inventory-form-card,
.inventory-form-wrap,
.edit-card,
.settings-card,
.backup-card,
.security-card,
.users-card,
.job-card,
.jobs-panel,
.info-box,
.purchase-details-page > section,
.category-section,
.category-table-wrap,
.category-summary > *,
.supplier-summary-grid > *,
.summary-card,
.printing-costing-page > section{
  background:rgba(255,255,255,.96) !important;
  border:1px solid rgba(192,218,241,.82) !important;
  border-radius:16px !important;
  box-shadow:var(--pp-shadow) !important;
}

.dashboard-section,
.inventory-section,
.details-card,
.report-table-card,
.report-controls-card,
.costing-card,
.form-card,
.form-block,
.sale-form-section,
.sale-section,
.expense-form-card,
.inventory-form-card,
.edit-card,
.settings-card,
.backup-card,
.security-card,
.job-card,
.jobs-panel,
.category-section,
.category-table-wrap{
  padding:18px !important;
}

/* Section headings */
.section-header,
.inventory-section-header,
.supplier-list-head,
.category-section-head,
.report-table-title,
.details-card-header,
.settings-card-header,
.security-card-header,
.sale-section-header{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  padding-bottom:12px !important;
  margin-bottom:14px !important;
  border-bottom:1px solid #e5eef7 !important;
}
.section-header h2,
.inventory-section-header h2,
.supplier-list-head h2,
.category-section-head h2,
.report-table-title h2,
.details-card-header h2,
.settings-card-header h2,
.security-card-header h2,
.sale-section-header h2{
  color:#132844 !important;
  font-size:17px !important;
  font-weight:780 !important;
  letter-spacing:-.2px !important;
}
.section-header p,.details-card-header p,.sub,.section-subtitle{color:#7b90ab !important}

/* KPI cards */
.summary-card,
.supplier-stat-card,
.dashboard-summary-grid .summary-card,
.inventory-summary .summary-card{
  position:relative !important;
  overflow:hidden !important;
  min-height:104px !important;
  padding:17px 18px !important;
  background:linear-gradient(145deg,#fff,#f6fbff) !important;
}
.summary-card:after,
.supplier-stat-card:after{
  content:'';position:absolute;right:-20px;bottom:-28px;width:105px;height:105px;
  border-radius:50%;background:rgba(22,119,255,.055);pointer-events:none;
}
.summary-card-top{display:flex !important;align-items:flex-start !important;justify-content:space-between !important}
.summary-card span,.summary-label{color:#7a8fa9 !important;font-size:12px !important;font-weight:650 !important}
.summary-card strong,.summary-value{color:#132744 !important;font-weight:800 !important}
.summary-icon,
.supplier-stat-icon{
  width:48px !important;height:48px !important;border-radius:14px !important;
  display:flex !important;align-items:center !important;justify-content:center !important;
  font-size:22px !important;
  background:linear-gradient(145deg,#e0efff,#c9e3ff) !important;
  box-shadow:0 7px 16px rgba(23,118,222,.10) !important;
}
.summary-card:nth-child(2) .summary-icon,.supplier-stat-card:nth-child(2) .supplier-stat-icon{background:linear-gradient(145deg,#f1e5ff,#dfcbff) !important}
.summary-card:nth-child(3) .summary-icon,.supplier-stat-card:nth-child(3) .supplier-stat-icon{background:linear-gradient(145deg,#ddfaef,#c6f1df) !important}
.summary-card:nth-child(4) .summary-icon,.supplier-stat-card:nth-child(4) .supplier-stat-icon{background:linear-gradient(145deg,#fff0e5,#ffd8c3) !important}

/* Toolbars */
.inventory-toolbar,
.supplier-toolbar,
.category-tools,
.jobs-panel .toolbar,
.inventory-form-actions,
.form-actions,
.expense-form-actions,
.sale-form-actions,
.report-filter-form{
  background:#f6faff !important;
  border:1px solid #dfedf8 !important;
  border-radius:13px !important;
  padding:11px !important;
}
.search-box{background:#fff !important;border:1px solid #d5e6f5 !important;box-shadow:0 2px 8px rgba(40,92,140,.04) !important}

/* Tables */
.table-container,
.dashboard-table-wrap,
.supplier-table-wrap,
.report-table-wrap,
.history-table-wrap,
.items-wrap,
.sale-items-wrapper{
  border:1px solid #dfeaf5 !important;
  border-radius:13px !important;
  overflow:auto !important;
  background:#fff !important;
}
.inventory-table,.dashboard-table,.report-table,.data-table,.history-table,table{border-collapse:separate !important;border-spacing:0 !important;width:100%}
thead th,table thead th,
.inventory-table th,.dashboard-table th,.report-table th{
  background:linear-gradient(180deg,#eef7ff,#e8f3fc) !important;
  color:#58718f !important;
  border-bottom:1px solid #d6e6f3 !important;
  font-size:11px !important;
  text-transform:uppercase;
  letter-spacing:.35px;
  font-weight:800 !important;
  padding:12px 13px !important;
}
tbody td,table tbody td,
.inventory-table td,.dashboard-table td,.report-table td{
  color:#263d5d !important;
  border-bottom:1px solid #edf2f7 !important;
  padding:11px 13px !important;
  font-size:13px !important;
}
tbody tr:hover,table tbody tr:hover{background:#f7fbff !important}

/* Inputs */
.form-group label,.field label,.inventory-form-group label,.expense-form-group label,
.security-form-group label,.supplier-field label,.field-label,.report-date-field label{
  color:#536c8a !important;font-weight:750 !important;font-size:12px !important
}
input,select,textarea{
  background:#fbfdff !important;
  border:1px solid #d4e4f1 !important;
  color:#203754 !important;
  border-radius:10px !important;
  min-height:42px !important;
}
input:hover,select:hover,textarea:hover{border-color:#bdd7ed !important}
input:focus,select:focus,textarea:focus{
  border-color:#63a5ee !important;
  box-shadow:0 0 0 3px rgba(22,119,255,.10) !important;
  background:#fff !important;
}

/* Buttons */
.primary-button,.btn-primary,.action-button,
button[type="submit"]:not(.secondary-button):not(.btn-secondary){
  background:linear-gradient(135deg,#0878ff,#1768e8) !important;
  color:#fff !important;border:0 !important;border-radius:10px !important;
  box-shadow:0 7px 17px rgba(15,108,238,.18) !important;font-weight:750 !important;
}
.secondary-button,.btn-secondary{
  background:#fff !important;color:#376188 !important;
  border:1px solid #cfe0ef !important;border-radius:10px !important;
  box-shadow:none !important;font-weight:700 !important;
}
.danger,.btn-danger,.delete-action{border-radius:9px !important}

/* Action links / icons */
.item-action-link,.action-link,.mini-button{
  border-radius:8px !important;
  color:#2f5d88 !important;
}
.item-action-link:hover,.action-link:hover{background:#edf6ff !important;color:#0873e9 !important}
.delete-action:hover{background:#fff0f0 !important;color:#d62828 !important}

/* Status chips */
.status-badge,.pill,.status-paid,.status-partial,.status-due,.status-low{
  border-radius:999px !important;font-weight:800 !important;padding:5px 10px !important;border:0 !important
}
.status-paid{background:#d8f7e7 !important;color:#13834e !important}
.status-partial{background:#fff0c9 !important;color:#a96a00 !important}
.status-due,.status-low{background:#ffe0e0 !important;color:#c62828 !important}

/* Form cards and detail blocks */
.form-card,.form-block,.sale-form-section,.sale-section,.expense-form-card,
.inventory-form-card,.edit-card{background:linear-gradient(145deg,#fff,#fbfdff) !important}
.form-card h2,.form-block h2,.expense-form-card h2,.inventory-form-card h2{color:#152b49 !important;font-weight:780 !important}
.info-box{background:linear-gradient(145deg,#f5faff,#edf6ff) !important;border:1px solid #d9eafa !important}
.info-label,.summary-label{color:#7b90aa !important}
.info-value,.summary-value{color:#183250 !important}

/* Jobs: turn plain blocks into polished cards */
.job-card,.printing-job-card{
  transition:transform .18s ease,box-shadow .18s ease !important;
  background:linear-gradient(145deg,#fff,#f8fcff) !important;
}
.job-card:hover,.printing-job-card:hover{transform:translateY(-2px) !important;box-shadow:0 14px 32px rgba(31,91,145,.13) !important}

/* Reports */
.report-type-tabs{background:#f4f9fe !important;border:1px solid #dfeaf5 !important;padding:7px !important;border-radius:12px !important}
.report-tab{border:1px solid #d7e7f4 !important;background:#fff !important;color:#55728f !important;border-radius:9px !important}
.report-tab.active{background:#e5f2ff !important;color:#076fe5 !important;border-color:#8bc0f3 !important}
.report-summary-card{background:linear-gradient(145deg,#fff,#f6fbff) !important}

/* Category / supplier / settings special cards */
.category-section-head,.supplier-list-head,.settings-card-header,.security-card-header{background:#f5faff !important;border-radius:11px !important;padding:11px 13px !important}
.color-setting,.color-swatch{border-radius:12px !important}

/* New Quotation body: keep functionality, upgrade visuals */
.costing-card{
  background:linear-gradient(145deg,#fff,#f8fcff) !important;
  border-color:#cfe3f4 !important;
}
.costing-card h2{font-size:17px !important;color:#142946 !important}
.collapsible-section{overflow:hidden !important}
.collapsible-section > .collapsible-header{background:linear-gradient(100deg,#f2f8ff,#f9fcff) !important;border-bottom:1px solid #deebf6 !important}

/* Modals */
.modal-content,.customer-modal,.return-modal{
  background:#fff !important;border:1px solid #d8e8f5 !important;
  border-radius:18px !important;box-shadow:0 22px 60px rgba(20,65,110,.20) !important;
}

/* Empty states */
.empty-state,.dashboard-empty-state,.supplier-empty{
  background:linear-gradient(145deg,#f8fcff,#eef7ff) !important;
  border:1px dashed #cbdfee !important;border-radius:14px !important;
  color:#7890aa !important;padding:28px !important;
}
.dashboard-empty-icon,.empty-state-icon{filter:saturate(.9);opacity:.9}

/* Footer */
.app-footer{color:#7890ab !important;border-top:1px solid #d9e9f5 !important}

@media(max-width:1100px){
  .main-content{padding:20px !important}
  .dashboard-summary-grid,.inventory-summary,.report-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
}
@media(max-width:700px){
  .main-content{padding:14px !important}
  .page-header{padding-left:58px !important}
  .page-header h1{font-size:25px !important}
  .dashboard-summary-grid,.inventory-summary,.report-summary-grid{grid-template-columns:1fr !important}
}

/* Protima Press - unified page header alignment fix */
.page-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 24px;
    margin-bottom: 25px;
}
.page-header > div:first-child {
    min-width: 0;
}
.page-header h1 {
    margin: 0 0 6px 0 !important;
    line-height: 1.15 !important;
}
.page-header p {
    margin: 0 !important;
    line-height: 1.45 !important;
}
.page-header .btn-primary,
.page-header .primary-button {
    flex: 0 0 auto;
    margin: 0 !important;
    align-self: flex-start !important;
    white-space: nowrap;
}
@media (max-width: 700px) {
    .page-header {
        flex-direction: column;
        align-items: stretch !important;
    }
    .page-header .btn-primary,
    .page-header .primary-button {
        align-self: flex-start !important;
    }
}

/* =========================================================
   PROTIMA PRESS — FINAL PAGE HEADER ALIGNMENT
   Visual-only fix. No functionality changed.
========================================================= */
.page-header,
.page-header.dashboard-header {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 24px !important;
    min-height: 58px !important;
    margin: 0 0 22px !important;
    padding: 0 0 0 68px !important;
    box-sizing: border-box !important;
}

.page-header > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.page-header h1 {
    margin: 0 0 5px 0 !important;
    padding: 0 !important;
    line-height: 1.12 !important;
    font-size: 30px !important;
    font-weight: 800 !important;
}

.page-header p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.45 !important;
}

.page-header:before {
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    margin: 0 !important;
}

.page-header .primary-button,
.page-header .primary-action,
.page-header .btn-primary,
.page-header .action-button,
.page-header > a,
.page-header > button {
    flex: 0 0 auto !important;
    align-self: flex-start !important;
    margin: 0 !important;
    margin-top: 2px !important;
    min-height: 40px !important;
    height: 40px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

/* Dashboard has no action button; keep its title block aligned to the same grid. */
.dashboard-header {
    padding-left: 68px !important;
}

/* Printing Jobs / Backup pages use the same header structure even when
   their template has a compact app-shell wrapper. */
.app-shell .page-header {
    padding-left: 68px !important;
}

@media (max-width: 700px) {
    .page-header,
    .page-header.dashboard-header,
    .app-shell .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        min-height: auto !important;
        padding-left: 58px !important;
    }

    .page-header:before {
        width: 46px !important;
        height: 46px !important;
    }

    .page-header .primary-button,
    .page-header .primary-action,
    .page-header .btn-primary,
    .page-header .action-button,
    .page-header > a,
    .page-header > button {
        align-self: flex-start !important;
        margin-top: 0 !important;
    }
}

/* =========================================================
   PROTIMA PRESS — FINAL GLOBAL PAGE WIDTH & HEADER ALIGNMENT
   UI ONLY: no routes, forms, calculations or functionality changed.
========================================================= */
.main-content {
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* Every page uses the full available content width. */
.main-content > * {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* One consistent header alignment across Dashboard and all inner pages. */
.page-header,
.header {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 24px !important;
}

.page-header > div:first-child,
.header > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.page-header h1,
.header h1 {
    margin-top: 0 !important;
}

.page-header p,
.header p {
    margin-bottom: 0 !important;
}

.page-header .primary-button,
.page-header .primary-action,
.page-header .btn-primary,
.page-header > a.primary-button,
.page-header > a.btn-primary,
.header .primary-button,
.header .primary-action,
.header .btn-primary {
    flex: 0 0 auto !important;
    align-self: flex-start !important;
    margin-top: 2px !important;
}

/* Dashboard header keeps its content aligned without changing its function. */
.dashboard-header {
    align-items: flex-start !important;
}

/* Keep wide tables/cards from becoming artificially narrow. */
.table-container,
.inventory-section,
.dashboard-section,
.jobs-panel,
.backup-list,
.backup-grid,
.settings-card,
.settings-grid,
.content-card,
.panel,
.card,
.cards,
.summary-grid,
.inventory-summary,
.job-cards {
    max-width: none !important;
}

@media (max-width: 800px) {
    .main-content {
        padding: 22px 18px !important;
    }

    .page-header,
    .header {
        gap: 14px !important;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 18px 14px !important;
    }

    .page-header,
    .header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .page-header .primary-button,
    .page-header .primary-action,
    .page-header .btn-primary,
    .header .primary-button,
    .header .primary-action,
    .header .btn-primary {
        width: 100% !important;
        margin-top: 4px !important;
    }
}

/* Normalize Add Item radio / stock checkbox controls */
.add-item-page .type-option input[type="radio"], .type-option input[type="radio"] { width:16px !important; height:16px !important; min-width:16px !important; min-height:16px !important; margin:3px 0 0 !important; transform:none !important; }
.add-item-page .stock-toggle input[type="checkbox"], .stock-toggle input[type="checkbox"] { width:16px !important; height:16px !important; min-width:16px !important; min-height:16px !important; margin:0 !important; transform:none !important; }


/* Inventory page — matched to Inventory.pdf reference (scoped; other pages unchanged) */
.inventory-page-pro { color:#102f52; }
.inventory-page-pro .page-header { align-items:flex-start !important; margin:0 0 14px !important; gap:20px !important; }
.inventory-page-pro .page-header h1 { color:#101820 !important; font-size:28px !important; line-height:1.12 !important; letter-spacing:-.65px !important; font-weight:800 !important; margin:0 0 3px !important; }
.inventory-page-pro .page-header p { color:#9aa5b2 !important; font-size:12px !important; line-height:1.35 !important; margin:0 !important; }
.inventory-page-pro .add-item-cta { background:#123b6d !important; color:#fff !important; border:0 !important; border-radius:10px !important; padding:12px 15px !important; min-height:42px !important; font-size:12px !important; font-weight:750 !important; box-shadow:none !important; }
.inventory-page-pro .add-item-icon { font-size:15px !important; line-height:1 !important; }
.inventory-page-pro .inventory-summary { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:12px !important; margin:0 0 18px !important; }
.inventory-page-pro .inventory-summary .summary-card { min-height:120px !important; box-sizing:border-box !important; display:flex !important; align-items:center !important; justify-content:space-between !important; gap:10px !important; padding:15px 16px !important; border:0 !important; border-radius:11px !important; background:#123b6d !important; color:#fff !important; box-shadow:none !important; }
.inventory-page-pro .summary-card:after { display:none !important; }
.inventory-page-pro .summary-card span { display:block !important; color:#fff !important; font-size:15px !important; line-height:1.3 !important; font-weight:650 !important; margin-bottom:5px !important; }
.inventory-page-pro .summary-card strong { display:block !important; color:#fff !important; font-size:27px !important; line-height:1.05 !important; font-weight:800 !important; }
.inventory-page-pro .summary-icon { flex:0 0 auto !important; width:48px !important; height:48px !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; color:#fff !important; font-size:34px !important; }
.inventory-page-pro .inventory-summary .summary-card:nth-child(4) .summary-icon { color:#ffed00 !important; font-size:38px !important; }
.inventory-page-pro .inventory-reference-section { padding:0 !important; margin:0 !important; border:0 !important; border-top:4px solid #123b6d !important; border-radius:0 !important; box-shadow:none !important; background:transparent !important; }
.inventory-page-pro .inventory-section-topline { display:flex !important; align-items:center !important; justify-content:space-between !important; gap:18px !important; padding:12px 8px 14px !important; }
.inventory-page-pro .inventory-section-heading { flex:0 0 auto !important; min-width:155px !important; }
.inventory-page-pro .inventory-section-heading h2 { margin:0 0 3px !important; color:#111820 !important; font-size:22px !important; line-height:1.15 !important; letter-spacing:-.35px !important; font-weight:800 !important; }
.inventory-page-pro .inventory-section-heading p { margin:0 !important; color:#9aa5b2 !important; font-size:12px !important; line-height:1.3 !important; }
.inventory-page-pro .inventory-toolbar { flex:1 1 auto !important; display:flex !important; align-items:center !important; justify-content:flex-end !important; gap:8px !important; min-width:0 !important; padding:0 !important; border:0 !important; border-radius:0 !important; background:transparent !important; flex-wrap:nowrap !important; }
.inventory-page-pro .inventory-toolbar .search-box { flex:1 1 230px !important; min-width:150px !important; max-width:270px !important; height:43px !important; display:flex !important; align-items:center !important; gap:8px !important; padding:0 11px !important; border:1px solid #d8cafa !important; border-radius:10px !important; background:#fff !important; box-shadow:none !important; }
.inventory-page-pro .inventory-toolbar .search-box > span { display:none !important; }
.inventory-page-pro .inventory-toolbar .search-box input { min-width:0 !important; width:100% !important; height:100% !important; border:0 !important; outline:0 !important; box-shadow:none !important; background:transparent !important; color:#42546a !important; font-size:12px !important; }
.inventory-page-pro .inventory-toolbar .search-box input::placeholder { color:#a3aab4 !important; opacity:1 !important; }
.inventory-page-pro .inventory-toolbar select { flex:0 1 125px !important; min-width:105px !important; width:auto !important; height:43px !important; padding:0 25px 0 11px !important; border:1px solid #d8cafa !important; border-radius:10px !important; background-color:#fff !important; color:#7d8793 !important; font-size:12px !important; box-shadow:none !important; }
.inventory-page-pro .table-container { border:1px solid #e4edf7 !important; border-radius:14px !important; overflow:auto !important; background:#fff !important; box-shadow:0 8px 20px rgba(25,68,112,.08) !important; }
.inventory-page-pro .inventory-table { min-width:850px !important; border-collapse:separate !important; border-spacing:0 !important; }
.inventory-page-pro .inventory-table thead th { padding:14px 12px !important; background:#eaf4fc !important; color:#63758b !important; border-bottom:1px solid #e1ebf5 !important; font-size:10px !important; line-height:1.2 !important; font-weight:800 !important; letter-spacing:.1px !important; white-space:nowrap !important; }
.inventory-page-pro .inventory-table tbody td { padding:13px 12px !important; height:53px !important; border-bottom:1px solid #edf1f6 !important; color:#657184 !important; font-size:11px !important; vertical-align:middle !important; }
.inventory-page-pro .inventory-table tbody tr:last-child td { border-bottom:0 !important; }
.inventory-page-pro .inventory-table .item-name strong { color:#344256 !important; font-size:11px !important; font-weight:750 !important; }
.inventory-page-pro .inventory-table .type-badge { padding:5px 8px !important; border-radius:20px !important; background:#edf3ff !important; color:#4971b7 !important; font-size:9px !important; font-weight:700 !important; }
.inventory-page-pro .inventory-table .status-badge { display:inline-block !important; padding:5px 8px !important; border-radius:20px !important; font-size:10px !important; font-weight:750 !important; white-space:nowrap !important; }
.inventory-page-pro .inventory-table .active-status { color:#2e986b !important; background:#eafaf1 !important; }
.inventory-page-pro .inventory-table .low-stock { color:#b66e2d !important; background:#fff4e8 !important; }
.inventory-page-pro .inventory-table .action-button { width:35px !important; height:35px !important; border:0 !important; border-radius:9px !important; color:#fff !important; background:#1677ed !important; box-shadow:0 3px 8px rgba(22,119,237,.2) !important; font-size:20px !important; }
@media (max-width:1100px) { .inventory-page-pro .inventory-section-topline { align-items:flex-start !important; flex-direction:column !important; } .inventory-page-pro .inventory-toolbar { width:100% !important; justify-content:flex-start !important; flex-wrap:wrap !important; } .inventory-page-pro .inventory-toolbar .search-box { max-width:none !important; } }
@media (max-width:760px) { .inventory-page-pro .inventory-summary { grid-template-columns:repeat(2,minmax(0,1fr)) !important; } .inventory-page-pro .inventory-summary .summary-card { min-height:100px !important; } .inventory-page-pro .inventory-section-topline { padding-left:2px !important; padding-right:2px !important; } .inventory-page-pro .inventory-toolbar select { flex:1 1 130px !important; } }
@media (max-width:440px) { .inventory-page-pro .inventory-summary { grid-template-columns:1fr !important; } .inventory-page-pro .inventory-toolbar .search-box { flex-basis:100% !important; } }


/* v38: Inventory PDF geometry and alignment correction. Scoped to Inventory only. */
.inventory-page-pro { width:100%; max-width:none; color:#102f52; }
.inventory-page-pro .page-header { min-height:0!important; padding:0!important; margin:0 0 14px!important; align-items:flex-start!important; }
.inventory-page-pro .page-header:before { display:none!important; content:none!important; }
.inventory-page-pro .page-header h1 { font-size:28px!important; line-height:1.05!important; letter-spacing:-.6px!important; margin:0 0 3px!important; }
.inventory-page-pro .page-header p { font-size:12px!important; line-height:1.2!important; margin:0!important; color:#9aa5b2!important; }
.inventory-page-pro .add-item-cta { min-height:42px!important; padding:10px 13px!important; margin:0!important; }
.inventory-page-pro .inventory-summary { grid-template-columns:repeat(4,minmax(0,1fr))!important; gap:12px!important; margin:0 0 18px!important; }
.inventory-page-pro .inventory-summary .summary-card { height:120px!important; min-height:120px!important; padding:14px 10px!important; border-radius:11px!important; background:#123b6d!important; }
.inventory-page-pro .inventory-summary .summary-card span { font-size:15px!important; line-height:1.25!important; margin-bottom:5px!important; }
.inventory-page-pro .inventory-summary .summary-card strong { font-size:27px!important; line-height:1!important; }
.inventory-page-pro .inventory-summary .summary-icon { width:44px!important; height:44px!important; font-size:32px!important; }
.inventory-page-pro .inventory-reference-section { border-top:4px solid #123b6d!important; margin-top:0!important; }
.inventory-page-pro .inventory-section-topline { display:flex!important; flex-direction:row!important; align-items:center!important; justify-content:space-between!important; gap:14px!important; padding:12px 8px 14px!important; }
.inventory-page-pro .inventory-section-heading { flex:0 0 178px!important; min-width:0!important; }
.inventory-page-pro .inventory-section-heading h2 { font-size:22px!important; line-height:1.15!important; margin:0 0 3px!important; }
.inventory-page-pro .inventory-section-heading p { font-size:12px!important; line-height:1.25!important; }
.inventory-page-pro .inventory-toolbar { flex:1 1 auto!important; width:auto!important; display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important; align-items:center!important; justify-content:flex-end!important; gap:8px!important; padding:0!important; border:0!important; background:transparent!important; min-width:0!important; }
.inventory-page-pro .inventory-toolbar .search-box { flex:1 1 230px!important; width:auto!important; min-width:120px!important; max-width:270px!important; height:43px!important; box-sizing:border-box!important; border:1px solid #d8cafa!important; border-radius:10px!important; padding:0 10px!important; position:relative!important; }
.inventory-page-pro .inventory-toolbar .search-box:after { content:'⌕'; flex:0 0 24px; width:24px; height:41px; margin-right:-10px; display:flex; align-items:center; justify-content:center; background:#d8cafa; color:#fff; font-size:22px; border-radius:0 9px 9px 0; }
.inventory-page-pro .inventory-toolbar .search-box input { flex:1 1 auto!important; width:100%!important; min-width:0!important; padding:0 5px!important; }
.inventory-page-pro .inventory-toolbar select { flex:0 1 125px!important; min-width:90px!important; max-width:145px!important; height:43px!important; padding:0 22px 0 10px!important; border-radius:10px!important; border-color:#d8cafa!important; background:#fff!important; }
.inventory-page-pro .table-container { border-radius:14px!important; border:1px solid #e4edf7!important; box-shadow:0 8px 20px rgba(25,68,112,.08)!important; }
.inventory-page-pro .inventory-table { width:100%!important; min-width:800px!important; table-layout:auto!important; }
.inventory-page-pro .inventory-table thead th { padding:14px 10px!important; height:42px!important; background:#eaf4fc!important; font-size:10px!important; }
.inventory-page-pro .inventory-table tbody td { padding:10px!important; height:53px!important; font-size:11px!important; }
@media (min-width:761px) and (max-width:1100px) {
 .sidebar { width:164px!important; min-width:164px!important; padding:14px 11px!important; }
 .sidebar .brand { gap:7px!important; padding:4px 2px 20px!important; }
 .sidebar .brand-logo,.sidebar .brand-logo-image { width:32px!important; min-width:32px!important; height:42px!important; border-radius:10px!important; }
 .sidebar .brand-copy h2 { font-size:12px!important; line-height:1.2!important; }
 .sidebar .brand-copy span { display:block!important; font-size:9px!important; line-height:1.2!important; white-space:nowrap!important; overflow:hidden!important; text-overflow:ellipsis!important; }
 .sidebar .menu-item { gap:7px!important; min-height:37px!important; padding:8px 7px!important; border-radius:9px!important; font-size:11px!important; line-height:1.2!important; }
 .sidebar .menu-item span:first-child { width:20px!important; min-width:20px!important; font-size:14px!important; }
 .main-content { padding:16px!important; }
}
@media (max-width:1100px) {
 .inventory-page-pro .inventory-section-topline { flex-direction:row!important; align-items:center!important; }
 .inventory-page-pro .inventory-toolbar { flex-wrap:nowrap!important; }
 .inventory-page-pro .inventory-toolbar .search-box { max-width:270px!important; }
}
@media (max-width:760px) {
 .inventory-page-pro .inventory-section-topline { flex-direction:column!important; align-items:stretch!important; }
 .inventory-page-pro .inventory-section-heading { flex-basis:auto!important; }
 .inventory-page-pro .inventory-toolbar { flex-wrap:wrap!important; }
 .inventory-page-pro .inventory-toolbar .search-box { max-width:none!important; flex-basis:100%!important; }
 .inventory-page-pro .inventory-toolbar select { flex:1 1 120px!important; max-width:none!important; }
 .sidebar { width:100%!important; min-width:0!important; }
}
