@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");

/* Exact company swatch palettes. The selected company swatch is the actual
   primary UI color (sidebar, action controls, table headers, highlights).
   Dark ink is used on the pastel/bright swatches for readable contrast. */
:root {
    --primary: #FFCCFF;
    --secondary: #A32976;
    --accent: #FFCCFF;
    --brand-swatch: #FFCCFF;
    --brand-swatch-rgb: 255, 204, 255;
    --bg: #FFF8FF;
    --card: #FFFFFF;
    --text: #352435;
    --white: #FFFFFF;
    --success: #198754;
    --danger: #DC3545;
    --warning: #FFC107;
    --shadow: 0 10px 30px rgba(0, 0, 0, .08);
    --radius: 18px;
    --transition: .3s ease;
    --sidebar-width: 280px;
    --soft: #FFE9FF;
    --soft-border: #EDC5ED;
    --heading: #4B294B;
    --muted: #765B76;
    --primary-rgb: 255, 204, 255;
    --secondary-rgb: 163, 41, 118;
    --accent-rgb: 255, 204, 255;
    --primary-contrast: #352435;
    --primary-contrast-rgb: 53, 36, 53;
}

/* Company ID 1: Brownfly Commercial and Industrial Services Inc — exact pink swatch. */
body.brownfly {
    --primary: #FFCCFF;
    --secondary: #A32976;
    --accent: #FFCCFF;
    --brand-swatch: #FFCCFF;
    --brand-swatch-rgb: 255, 204, 255;
    --bg: #FFF8FF;
    --card: #FFFFFF;
    --text: #352435;
    --soft: #FFE9FF;
    --soft-border: #EDC5ED;
    --heading: #4B294B;
    --muted: #765B76;
    --primary-rgb: 255, 204, 255;
    --secondary-rgb: 163, 41, 118;
    --accent-rgb: 255, 204, 255;
    --primary-contrast: #352435;
    --primary-contrast-rgb: 53, 36, 53;
}

/* Company ID 2: Akinito Trading and Industrial Services Inc — exact yellow swatch. */
body.akinito {
    --primary: #FFFF00;
    --secondary: #625200;
    --accent: #FFFF00;
    --brand-swatch: #FFFF00;
    --brand-swatch-rgb: 255, 255, 0;
    --bg: #FFFFF2;
    --card: #FFFFFF;
    --text: #393400;
    --soft: #FFFDBD;
    --soft-border: #E8E18A;
    --heading: #4F4700;
    --muted: #777044;
    --primary-rgb: 255, 255, 0;
    --secondary-rgb: 98, 82, 0;
    --accent-rgb: 255, 255, 0;
    --primary-contrast: #393400;
    --primary-contrast-rgb: 57, 52, 0;
}

/* Company ID 3: Brownfly Commercial (BFC-Single) — exact light-green swatch. */
body.single {
    --primary: #A8D08D;
    --secondary: #35602B;
    --accent: #A8D08D;
    --brand-swatch: #A8D08D;
    --brand-swatch-rgb: 168, 208, 141;
    --bg: #F7FBF3;
    --card: #FFFFFF;
    --text: #263A20;
    --soft: #E9F3E1;
    --soft-border: #C8DEB9;
    --heading: #2D4826;
    --muted: #687C60;
    --primary-rgb: 168, 208, 141;
    --secondary-rgb: 53, 96, 43;
    --accent-rgb: 168, 208, 141;
    --primary-contrast: #263A20;
    --primary-contrast-rgb: 38, 58, 32;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button,
input,
select,
textarea {
    font-family: "Poppins", sans-serif;
    outline: none;
}

button {
    cursor: pointer;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--soft);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: auto;
    padding: 0 25px;
}

.shadow {
    box-shadow: var(--shadow);
}

.rounded {
    border-radius: var(--radius);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.fade {
    animation: fade .4s ease;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--secondary) 45%,
        var(--accent) 100%
    );
}

.login-page::before {
    content: "";
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    top: -120px;
    left: -120px;
    background: rgba(255, 255, 255, .08);
}

.login-page::after {
    content: "";
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    bottom: -180px;
    right: -180px;
    background: rgba(255, 255, 255, .05);
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 45px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
    position: relative;
    z-index: 2;
    animation: fade .5s ease;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.login-logo img {
    width: 180px;
    transition: .3s;
}

.login-logo img:hover {
    transform: scale(1.05);
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
}

.login-title h1 {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
}

.login-title p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.company-select {
    margin-bottom: 20px;
}

.company-select label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.company-select select {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--soft-border);
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    color: var(--heading);
    transition: var(--transition);
}

.company-select select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), .18);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #888;
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--soft-border);
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), .18);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #888;
    cursor: pointer;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.login-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.login-options a {
    color: var(--secondary);
    font-weight: 600;
}

.login-options a:hover {
    color: var(--primary);
}

.login-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(
        90deg,
        var(--primary),
        var(--secondary),
        var(--accent)
    );
    background-size: 250% 250%;
    transition: .4s;
}

.login-btn:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(var(--primary-rgb), .20);
}

.login-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.login-footer span {
    color: var(--primary);
    font-weight: 600;
}

.company-preview {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.company-preview button {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: .3s;
}

.company-preview button:hover {
    transform: scale(1.2);
}

.company-preview .brownfly { background: #ffccff; }
.company-preview .akinito { background: #ffff00; }
.company-preview .single { background: #a8d08d; }

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

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--primary);
    color: #fff;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 10px 0 30px rgba(0, 0, 0, .12);
    transition: left .4s cubic-bezier(.4, 0, .2, 1);
}

.sidebar-header {
    padding: 30px 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-header img {
    width: 170px;
    margin: 0 auto 15px;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.sidebar-header p {
    margin-top: 5px;
    font-size: 13px;
    opacity: .8;
}

.company-switcher {
    padding: 20px 25px;
}

.company-switcher label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, .85);
}

.company-switcher select {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 10px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 14px;
}

.company-switcher select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
}

.company-switcher select option {
    color: #000;
    background: #fff;
}

.sidebar-menu {
    flex: 1;
    padding: 10px 15px;
    overflow-y: auto;
    overflow-x: hidden;
}

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

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    transition: all .25s ease;
}

.sidebar-menu li a i {
    min-width: 24px;
    font-size: 22px;
}

.sidebar-menu li a:hover {
    padding-left: 25px;
    background: rgba(255, 255, 255, .12);
}

.sidebar-menu li a.active {
    background: var(--accent);
    color: var(--primary);
    font-weight: 700;
}

/* Keep PR Input/Log and BES/Bid Evaluation submenus collapsed off-section.
   Both groups expand only while one of their own pages is active. This rule
   lives in the shared stylesheet so the behavior also works on dashboard and
   other pages that do not load pr.css or bes.css. */
.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu {
    display: none;
}
.sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu,
.sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu {
    display: block;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .25);
    border-radius: 10px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-footer a {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 13px;
    border-radius: 12px;
    background: var(--danger);
    color: #fff;
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-footer a:hover {
    background: #bb2d3b;
    transform: translateY(-2px);
}

.sidebar-mobile-toggle {
    position: fixed;
    top: 50%;
    left: calc(var(--sidebar-width) - 19px);
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    padding: 0;
    border: 3px solid var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--primary);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    cursor: pointer;
    z-index: 1200;
    transition:
        left .4s cubic-bezier(.4, 0, .2, 1),
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.sidebar-mobile-toggle:hover {
    background: var(--secondary);
    color: #fff;
    transform: translateY(-50%) scale(1.06);
}

.sidebar-mobile-toggle:active {
    transform: translateY(-50%) scale(.95);
}

.sidebar-mobile-toggle i {
    font-size: 23px;
    transition: transform .3s ease;
}

body.sidebar-hidden .sidebar {
    left: calc(var(--sidebar-width) * -1);
}

body.sidebar-hidden .content {
    margin-left: 0 !important;
    width: 100% !important;
}

body.sidebar-hidden .sidebar-mobile-toggle {
    left: 0;
    background: var(--primary);
    color: #fff;
}

body.sidebar-hidden .sidebar-mobile-toggle i {
    transform: rotate(180deg);
}

.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background: var(--bg);
    transition:
        margin-left .4s cubic-bezier(.4, 0, .2, 1),
        width .4s cubic-bezier(.4, 0, .2, 1);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 999;
    height: 80px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card);
    box-shadow: var(--shadow);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    width: 45px;
    height: 45px;
    min-width: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--secondary);
}

.menu-toggle i {
    font-size: 26px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 350px;
    padding: 13px 20px 13px 50px;
    border: none;
    border-radius: 30px;
    background: var(--soft);
    color: var(--heading);
    font-size: 15px;
    transition: var(--transition);
}

.search-box input:focus {
    background: #fff;
    box-shadow: 0 0 10px rgba(var(--primary-rgb), .10);
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #777;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-icon {
    position: relative;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--soft);
    cursor: pointer;
    transition: var(--transition);
}

.top-icon:hover {
    background: var(--secondary);
    color: #fff;
}

.top-icon i {
    font-size: 22px;
}

.top-icon span {
    position: absolute;
    top: 6px;
    right: 5px;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
}

.datetime {
    text-align: right;
}

.datetime h4 {
    font-size: 15px;
    color: var(--primary);
}

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

.profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.profile img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent);
}

.profile-info h4 {
    font-size: 15px;
    color: var(--primary);
}

.profile-info p {
    font-size: 12px;
    color: var(--muted);
}

.profile-menu {
    position: absolute;
    top: 65px;
    right: 0;
    width: 240px;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: none;
}

.profile-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: var(--text);
    transition: var(--transition);
}

.profile-menu a:hover {
    background: var(--soft);
}

.profile:hover .profile-menu {
    display: block;
}

.dashboard {
    padding: 30px;
}

.page-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

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

.page-header h1 {
    margin: 0;
    color: var(--heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.page-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.page-header .btn-primary,
.page-header .btn-add {
    flex-shrink: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.dashboard-card {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-8px);
}

.dashboard-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 100%;
    background: var(--secondary);
}

.dashboard-info h5 {
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #888;
}

.dashboard-info h2 {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary);
}

.dashboard-info span {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: var(--success);
}

.dashboard-icon {
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 18px;
    background: var(--soft);
}

.dashboard-icon i {
    font-size: 34px;
    color: var(--secondary);
}

.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card,
.activity-card,
.form-card,
.table-card,
.stock-in-card,
.stock-history-card,
.product-view-card,
.view-product-card,
.supplier-view-card,
.category-card,
.stat-box,
.action-card {
    background: var(--card);
}

.chart-card {
    padding: 25px;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.chart-card h3 {
    margin-bottom: 20px;
    font-size: 22px;
    color: var(--primary);
}

.chart-card canvas {
    width: 100% !important;
    height: 350px !important;
}

.activity-card {
    padding: 25px;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.activity-card h3 {
    margin-bottom: 20px;
    font-size: 22px;
    color: var(--primary);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--soft-border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--soft);
}

.activity-icon i {
    font-size: 22px;
    color: var(--secondary);
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    margin-bottom: 4px;
    font-size: 15px;
    color: var(--primary);
}

.activity-content p {
    margin-bottom: 4px;
    font-size: 13px;
    color: #777;
}

.activity-content small {
    color: #999;
    font-size: 12px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 25px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-6px);
    background: var(--primary);
    color: #fff;
}

.action-card i {
    font-size: 38px;
    color: var(--secondary);
    transition: var(--transition);
}

.action-card:hover i {
    color: #fff;
}

.action-card h4 {
    font-size: 16px;
    font-weight: 600;
}

.action-card p {
    font-size: 13px;
    color: #777;
    transition: var(--transition);
}

.action-card:hover p {
    color: rgba(255, 255, 255, .8);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-box {
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-box h2 {
    margin-bottom: 8px;
    font-size: 30px;
    color: var(--primary);
}

.stat-box span {
    font-size: 14px;
    color: #777;
}

.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    margin-bottom: 30px;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color: #fff;
    border-radius: 20px;
    overflow: hidden;
}

.welcome-banner h2 {
    margin-bottom: 8px;
    font-size: 30px;
}

.welcome-banner p {
    font-size: 15px;
    opacity: .9;
}

.welcome-banner i {
    font-size: 90px;
    opacity: .15;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5c636a;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #157347;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #bb2d3b;
}

.btn-warning {
    background: var(--warning);
    color: #212529;
}

.btn-warning:hover {
    background: #ffca2c;
}

.btn i {
    font-size: 18px;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 17px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--primary);
    transition: all .2s ease;
}

.btn-add i {
    font-size: 18px;
}

.btn-add:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(var(--primary-rgb), .16);
}

.form-card {
    padding: 30px;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--soft-border);
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    background: var(--card);
    color: var(--heading);
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 12px rgba(var(--secondary-rgb), .10);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.table-card {
    width: 100%;
    border: 1px solid var(--soft-border);
    border-radius: 16px;
    box-shadow: 0 7px 25px rgba(var(--primary-rgb), .06);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--soft-border);
}

.table-header h3 {
    color: var(--primary);
    font-size: 22px;
}

.table-responsive,
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.table-wrapper {
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary) transparent;
}

.table-wrapper::-webkit-scrollbar {
    height: 7px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--soft);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 10px;
}

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

thead {
    background: var(--primary);
    color: #fff;
}

th {
    padding: 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--soft-border);
    font-size: 14px;
    white-space: nowrap;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--soft);
}

td img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 10px;
}

.product-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.product-table thead th {
    height: 54px;
    padding: 0 16px;
    background: var(--soft);
    color: var(--heading);
    border-bottom: 1px solid var(--soft-border);
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .55px;
    white-space: nowrap;
}

.product-table thead th:first-child {
    padding-left: 22px;
}

.product-table thead th:last-child {
    padding-right: 22px;
}

.product-table tbody tr {
    background: var(--card);
    transition: background .18s ease;
}

.product-table tbody tr:hover {
    background: var(--soft);
}

.product-table tbody td {
    height: 82px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 13px;
    border-bottom: 1px solid var(--soft-border);
    vertical-align: middle;
}

.product-table tbody tr:last-child td {
    border-bottom: none;
}

.product-table tbody td:first-child {
    padding-left: 22px;
}

.product-table tbody td:last-child {
    padding-right: 22px;
}

.col-image {
    width: 82px;
}

.col-product {
    min-width: 190px;
}

.col-stock-number {
    min-width: 125px;
    color: var(--text);
    font-weight: 600;
}

.col-category {
    min-width: 125px;
    color: var(--text);
}

.col-supplier {
    min-width: 150px;
    color: var(--muted);
}

.col-price {
    min-width: 105px;
}

.col-stock {
    min-width: 80px;
    text-align: center !important;
}

.col-status {
    min-width: 115px;
}

.col-action {
    min-width: 205px;
}

.product-image {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: contain;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--soft-border);
    border-radius: 10px;
}

.product-image:hover {
    border-color: var(--accent);
}

.product-image-placeholder {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    border: 1px dashed var(--soft-border);
    border-radius: 10px;
    color: var(--muted);
}

.product-image-placeholder i {
    font-size: 25px;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.product-info strong {
    color: var(--heading);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
    word-break: break-word;
}

.product-info small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
}

.price {
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.stock-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 30px;
    padding: 0 9px;
    border-radius: 7px;
    background: var(--soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 750;
}

.stock-good,
.stock-low,
.stock-out {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.stock-good {
    color: #28613a;
    background: #eaf6ed;
    border: 1px solid #cce8d3;
}

.stock-good::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3c8c50;
}

.stock-low {
    color: #856515;
    background: #fff7df;
    border: 1px solid #f0dfaa;
}

.stock-low::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d1a52c;
}

.stock-out {
    color: #9a3535;
    background: #fff0f0;
    border: 1px solid #f0cccc;
}

.stock-out::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c94a4a;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.action-buttons a,
.action-buttons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 32px;
    padding: 0 9px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: all .18s ease;
}

.action-buttons a i,
.action-buttons button i {
    font-size: 15px;
}

.action-buttons .view,
.btn-view {
    color: var(--primary);
    background: var(--soft);
    border: 1px solid var(--soft-border);
}

.action-buttons .view:hover,
.btn-view:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.action-buttons .edit,
.btn-edit {
    color: #85671b;
    background: #fff7df;
    border: 1px solid #efdfb1;
}

.action-buttons .edit:hover,
.btn-edit:hover {
    color: #fff;
    background: #a17d20;
    border-color: #a17d20;
}

.action-buttons .delete,
.btn-delete {
    color: #a13e3e;
    background: #fff0f0;
    border: 1px solid #efcece;
}

.action-buttons .delete:hover,
.btn-delete:hover {
    color: #fff;
    background: #a13e3e;
    border-color: #a13e3e;
}

.product-table.staff-view {
    min-width: 900px;
}

.product-table.staff-view .col-stock {
    min-width: 85px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(25, 135, 84, .15);
    color: var(--success);
}

.badge-danger {
    background: rgba(220, 53, 69, .15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(255, 193, 7, .18);
    color: #8a6d00;
}

.badge-primary {
    background: rgba(var(--primary-rgb), .10);
    color: var(--primary);
}

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 20px;
}

.pagination a {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background: var(--soft);
    transition: var(--transition);
}

.pagination a:hover,
.pagination a.active {
    background: var(--primary);
    color: #fff;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, .45);
    padding: 20px;
    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
    animation: fade .3s ease;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--soft-border);
}

.modal-header h3 {
    color: var(--primary);
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #777;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--soft-border);
}

.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-top: 10px;
}

.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(var(--primary-rgb), .08);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(var(--primary-rgb), .12);
}

.category-image {
    width: 100%;
    height: 210px;
    padding: 0;
    display: block;
    overflow: hidden;
    background: #fff;
}

.category-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;
    object-position: center;
    transition: .35s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.03);
}

.category-info {
    flex: 1;
    padding: 20px 55px 20px 22px;
}

.category-info h3 {
    margin-bottom: 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.category-info p {
    font-size: 13px;
    color: var(--muted);
}

.category-arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    transition: var(--transition);
}

.category-arrow i {
    font-size: 24px;
}

.category-card:hover .category-arrow {
    background: var(--secondary);
    transform: translateX(4px);
}

.stock-in-grid {
    display: grid;
    grid-template-columns: minmax(420px, 500px) 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 24px;
}

.stock-in-card,
.stock-history-card {
    border: 1px solid var(--soft-border);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(var(--primary-rgb), .05);
}

.stock-in-card {
    padding: 26px;
}

.stock-history-card {
    overflow: hidden;
}

.stock-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 24px;
}

.stock-card-header h2 {
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 700;
    color: var(--heading);
}

.stock-card-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.stock-card-header > i {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--soft);
    color: var(--primary);
    font-size: 23px;
    flex-shrink: 0;
}

.stock-field {
    margin-bottom: 18px;
}

.stock-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--heading);
    font-size: 13px;
    font-weight: 600;
}

.stock-field input[type="text"],
.stock-field input[type="number"],
.stock-field select,
.stock-field textarea {
    width: 100%;
    border: 1px solid var(--soft-border);
    background: var(--card);
    color: var(--heading);
    border-radius: 10px;
    padding: 12px 13px;
    font-size: 14px;
    outline: none;
    transition: .2s ease;
}

.stock-field input[type="text"],
.stock-field input[type="number"],
.stock-field select {
    height: 46px;
}

.stock-field textarea {
    min-height: 105px;
    resize: vertical;
    font-family: inherit;
}

.stock-field input:focus,
.stock-field select:focus,
.stock-field textarea:focus,
.stock-in-card .form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .10);
}

.stock-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.price-input {
    position: relative;
}

.price-input span {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #596257;
    font-weight: 600;
    z-index: 2;
}

.price-input input {
    padding-left: 34px !important;
}

.product-images-upload {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.product-upload-box {
    position: relative;
    min-width: 0;
    height: 150px;
    border: 1px dashed var(--soft-border);
    background: var(--soft);
    border-radius: 13px;
    overflow: hidden;
    text-align: center;
    transition: .2s ease;
}

.product-upload-box:hover {
    border-color: var(--primary);
    background: var(--soft);
}

.product-upload-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-upload-box label {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), .94);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

.product-upload-box label i {
    font-size: 17px;
}

.product-upload-box input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.image-help {
    display: block;
    margin-top: 9px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.stock-submit {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
    margin-top: 8px;
}

.stock-submit:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

.stock-submit i {
    font-size: 20px;
}

.stock-history-card .stock-card-header {
    padding: 24px 24px 0;
}

.stock-history-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 0 0 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: var(--secondary) var(--soft);
}

.stock-history-wrapper::-webkit-scrollbar {
    height: 14px;
}

.stock-history-wrapper::-webkit-scrollbar-track {
    background: var(--soft);
    border-top: 1px solid var(--soft-border);
}

.stock-history-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 20px;
    border: 3px solid var(--soft);
}

.stock-history-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.stock-history-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.stock-history-table thead th {
    padding: 13px 15px;
    background: var(--soft);
    border-top: 1px solid var(--soft-border);
    border-bottom: 1px solid var(--soft-border);
    color: var(--heading);
    text-align: left;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.stock-history-table tbody td {
    padding: 15px;
    border-bottom: 1px solid var(--soft-border);
    color: var(--text);
    font-size: 13px;
    vertical-align: middle;
}

.stock-history-table tbody tr {
    transition: .15s ease;
}

.stock-history-table tbody tr:hover {
    background: var(--soft);
}

.stock-history-table strong {
    color: var(--heading);
    font-weight: 600;
}

.stock-date {
    white-space: nowrap;
    color: var(--muted) !important;
    font-size: 12px !important;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 20px;
    background: var(--soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.stock-quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    padding: 5px 9px;
    border-radius: 7px;
    background: var(--soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.stock-remarks {
    max-width: 220px;
    color: var(--muted) !important;
}

.empty-products {
    padding: 0 !important;
    height: 350px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.empty-products-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 60px 20px;
    text-align: center;
}

.empty-products-content > i {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    border-radius: 50%;
    background: var(--soft);
    color: var(--secondary);
    font-size: 30px;
}

.empty-products-content h3 {
    margin: 0 0 7px;
    color: var(--heading);
    font-size: 17px;
    font-weight: 700;
}

.empty-products-content p {
    max-width: 400px;
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.product-view-card {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 40px;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(var(--primary-rgb), .06);
    margin-top: 25px;
}

.product-view-images {
    width: 100%;
}

.product-main-image {
    width: 100%;
    height: 430px;
    background: var(--soft);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

.product-image-thumbnails {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.product-thumbnail {
    height: 95px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--soft);
    padding: 5px;
    cursor: pointer;
    overflow: hidden;
    transition: all .2s ease;
}

.product-thumbnail:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.product-thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .08);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 7px;
}

.product-view-details {
    padding: 5px 0;
}

.product-view-header,
.product-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.product-view-header {
    margin-bottom: 30px;
}

.product-detail-header {
    padding-bottom: 25px;
    border-bottom: 1px solid var(--soft-border);
}

.product-detail-header > div {
    min-width: 0;
}

.product-view-header h2,
.product-detail-header h2 {
    color: var(--heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
}

.product-view-header h2 {
    margin-top: 8px;
}

.product-detail-header h2 {
    margin: 0 0 12px;
}

.product-view-category {
    display: inline-block;
    background: var(--soft);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.product-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.product-detail-item {
    background: var(--soft);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.detail-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
}

.product-detail-item strong {
    color: var(--heading);
    font-size: 16px;
}

.product-detail-price,
.product-price {
    color: var(--primary) !important;
    font-size: 18px !important;
    font-weight: 750 !important;
}

.product-detail-stock,
.current-stock {
    color: var(--primary) !important;
    font-size: 20px !important;
    font-weight: 750 !important;
}

.product-specifications {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.spec-item {
    min-height: 82px;
    padding: 16px 18px;
    background: var(--soft);
    border: 1px solid var(--soft-border);
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    transition: border-color .2s ease, background .2s ease;
}

.spec-item:hover {
    background: var(--soft);
    border-color: var(--accent);
}

.spec-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.spec-item strong {
    color: var(--heading);
    font-size: 15px;
    font-weight: 650;
    word-break: break-word;
}

.product-description {
    margin-top: 28px;
    padding-top: 25px;
    border-top: 1px solid var(--soft-border);
}

.product-description h3 {
    margin: 0 0 12px;
    color: var(--heading);
    font-size: 16px;
    font-weight: 700;
}

.product-description p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.75;
    white-space: normal;
}

.product-description .no-description {
    color: var(--muted);
    font-style: italic;
}

.product-view-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.btn-back,
.btn-edit-product {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.btn-back {
    background: var(--soft);
    color: var(--text);
}

.btn-edit-product {
    background: var(--primary);
    color: #fff;
}

.btn-edit-product:hover {
    background: var(--secondary);
}

.view-product-card {
    width: 100%;
    border: 1px solid var(--soft-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(var(--primary-rgb), .07);
    display: grid;
    grid-template-columns: 44% 56%;
}

.view-product-gallery {
    padding: 30px;
    background: var(--soft);
    border-right: 1px solid var(--soft-border);
}

.main-product-image {
    width: 100%;
    height: 480px;
    background: #fff;
    border: 1px solid var(--soft-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 25px;
    transition: transform .3s ease;
}

.main-product-image:hover img {
    transform: scale(1.03);
}

.product-thumbnails {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.view-product-details {
    padding: 35px 40px;
    background: var(--card);
}

.view-product-details .btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 9px;
    text-decoration: none;
    color: #fff;
    background: var(--primary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all .2s ease;
}

.view-product-details .btn-edit:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

.view-product-details .product-specifications {
    margin-top: 28px;
}

.supplier-form-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 25px;
}

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

.supplier-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

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

.supplier-form-group label {
    font-weight: 600;
    color: var(--heading);
}

.supplier-form-group input {
    width: 100%;
    box-sizing: border-box;
}

.supplier-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.supplier-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.supplier-view-card {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid var(--soft-border);
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(var(--primary-rgb), .06);
}

.supplier-view-title {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--soft-border);
}

.supplier-view-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--soft);
    color: var(--primary);
    font-size: 27px;
}

.supplier-view-title h2 {
    margin: 0;
    color: var(--heading);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.supplier-view-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.supplier-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.supplier-detail {
    min-width: 0;
    padding: 17px;
    background: var(--soft);
    border: 1px solid var(--soft-border);
    border-radius: 12px;
}

.supplier-detail-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.supplier-detail-label i {
    color: var(--secondary);
    font-size: 17px;
}

.supplier-detail-value {
    color: var(--heading);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    word-break: break-word;
}

.supplier-contacts-section {
    padding-top: 28px;
    border-top: 1px solid var(--soft-border);
}

.supplier-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.supplier-section-header h2 {
    margin: 0;
    color: var(--heading);
    font-size: 20px;
    font-weight: 700;
}

.supplier-section-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.supplier-contacts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.supplier-contact-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    padding: 20px;
    background: var(--soft);
    border: 1px solid var(--soft-border);
    border-radius: 14px;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.supplier-contact-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(var(--primary-rgb), .06);
    transform: translateY(-2px);
}

.supplier-contact-number {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--soft);
    color: var(--secondary);
    font-size: 10px;
    font-weight: 700;
}

.supplier-contact-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--soft);
    color: var(--primary);
    font-size: 23px;
}

.supplier-contact-info {
    min-width: 0;
    padding-right: 24px;
}

.supplier-contact-info h3 {
    margin: 0;
    color: var(--heading);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
}

.supplier-contact-position {
    margin: 4px 0 12px;
    color: var(--muted);
    font-size: 12px;
}

.supplier-contact-details {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.supplier-contact-details div {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}

.supplier-contact-details i {
    flex: 0 0 16px;
    margin-top: 1px;
    color: var(--secondary);
    font-size: 16px;
}

.supplier-view-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--soft-border);
}

.supplier-view-actions .btn-secondary,
.supplier-view-actions .btn-edit,
.supplier-view-actions .btn-add {
    min-height: 40px;
}

.supplier-view-actions .btn-secondary {
    background: var(--soft);
    color: var(--text);
    border: 1px solid var(--soft-border);
}

.supplier-view-actions .btn-secondary:hover {
    background: var(--accent);
    color: var(--primary);
}

.supplier-view-actions .btn-edit,
.action-buttons .btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #eadcae;
    border-radius: 8px;
    background: #fff8df;
    color: #80651b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.supplier-view-actions .btn-edit i,
.action-buttons .btn-edit i {
    font-size: 16px;
}

.supplier-view-actions .btn-edit:hover,
.action-buttons .btn-edit:hover {
    background: #a17d20;
    border-color: #a17d20;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(161, 125, 32, .16);
}

.supplier-view-actions .btn-edit:active,
.action-buttons .btn-edit:active {
    transform: translateY(0);
    box-shadow: none;
}

.supplier-table-area {
    width: 100%;
    overflow: hidden;
}

.supplier-drag-bar {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        to bottom,
        var(--card),
        var(--soft)
    );
    border-top: 1px solid var(--soft-border);
    border-bottom: 1px solid var(--soft-border);
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: background .2s ease;
}

.supplier-drag-bar:hover {
    background: var(--soft);
}

.supplier-drag-bar:active {
    cursor: grabbing;
}

.supplier-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 210px;
    height: 31px;
    padding: 0 15px;
    border: 1px solid var(--soft-border);
    border-radius: 9px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1px;
    box-shadow: 0 2px 7px rgba(var(--primary-rgb), .06);
}

.supplier-drag-handle i {
    font-size: 17px;
    color: var(--secondary);
}

.supplier-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: var(--secondary) var(--soft);
    background: var(--card);
}

.supplier-table-wrapper::-webkit-scrollbar {
    height: 14px;
}

.supplier-table-wrapper::-webkit-scrollbar-track {
    background: var(--soft);
    border-top: 1px solid var(--soft-border);
}

.supplier-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 20px;
    border: 3px solid var(--soft);
}

.supplier-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.supplier-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.supplier-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 14px 18px;
    background: var(--soft);
    color: var(--heading);
    border-bottom: 1px solid var(--soft-border);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.supplier-table td {
    padding: 16px 18px;
    background: var(--card);
    color: var(--text);
    border-bottom: 1px solid var(--soft-border);
    vertical-align: middle;
    white-space: nowrap;
    font-size: 13px;
}

.supplier-table tbody tr {
    transition: background .18s ease;
}

.supplier-table tbody tr:hover td {
    background: var(--soft);
}

.supplier-table th:nth-child(1),
.supplier-table td:nth-child(1) {
    width: 60px;
    min-width: 60px;
}

.supplier-table th:nth-child(2),
.supplier-table td:nth-child(2) {
    min-width: 280px;
}

.supplier-table th:nth-child(3),
.supplier-table td:nth-child(3) {
    min-width: 180px;
}

.supplier-table th:nth-child(4),
.supplier-table td:nth-child(4) {
    min-width: 190px;
}

.supplier-table th:nth-child(5),
.supplier-table td:nth-child(5) {
    min-width: 240px;
}

.supplier-table th:nth-child(6),
.supplier-table td:nth-child(6) {
    min-width: 240px;
}

.supplier-table th:nth-child(7),
.supplier-table td:nth-child(7) {
    min-width: 200px;
}

.supplier-table th:last-child,
.supplier-table td:last-child {
    min-width: 205px;
    position: sticky;
    right: 0;
    z-index: 5;
    background: var(--card);
    box-shadow: -7px 0 15px rgba(var(--primary-rgb), .07);
}

.supplier-table th:last-child {
    z-index: 8;
    background: var(--soft);
}

.supplier-table tbody tr:hover td:last-child {
    background: var(--soft);
}

.supplier-table .supplier-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

.supplier-table .supplier-info strong {
    color: var(--heading);
    font-size: 14px;
    font-weight: 700;
}

.supplier-table .supplier-brand {
    color: var(--muted);
    font-size: 12px;
}

.supplier-table .contact-info {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    max-width: 280px;
}

.supplier-table .contact-info i {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--secondary);
    font-size: 17px;
}

.supplier-table .contact-info span,
.supplier-table .contact-info a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
}

.supplier-table .contact-empty {
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

.supplier-table .email-link,
.supplier-table .phone-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.supplier-table .email-link:hover,
.supplier-table .phone-link:hover {
    text-decoration: underline;
}

.supplier-table .action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.supplier-table .action-buttons a {
    flex-shrink: 0;
}

.stock-in-grid.staff-history-only,
.stock-out-grid.staff-history-only {
    display: block;
    width: 100%;
    margin-top: 24px;
}

.stock-in-grid.staff-history-only .stock-history-card,
.stock-out-grid.staff-history-only .stock-history-card {
    width: 100%;
    max-width: 100%;
}

.stock-in-grid.staff-history-only .stock-card-header,
.stock-out-grid.staff-history-only .stock-card-header {
    padding: 24px 24px 18px;
    margin-bottom: 0;
}

.stock-in-grid.staff-history-only .stock-history-wrapper,
.stock-out-grid.staff-history-only .stock-history-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: var(--secondary) var(--soft);
}

.stock-in-grid.staff-history-only .stock-history-wrapper::-webkit-scrollbar,
.stock-out-grid.staff-history-only .stock-history-wrapper::-webkit-scrollbar {
    height: 14px;
}

.stock-in-grid.staff-history-only .stock-history-wrapper::-webkit-scrollbar-track,
.stock-out-grid.staff-history-only .stock-history-wrapper::-webkit-scrollbar-track {
    background: var(--soft);
}

.stock-in-grid.staff-history-only .stock-history-wrapper::-webkit-scrollbar-thumb,
.stock-out-grid.staff-history-only .stock-history-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 10px;
    border: 3px solid var(--soft);
}

.stock-in-grid.staff-history-only .stock-history-wrapper::-webkit-scrollbar-thumb:hover,
.stock-out-grid.staff-history-only .stock-history-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.stock-in-grid.staff-history-only .stock-history-table,
.stock-out-grid.staff-history-only .stock-history-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.stock-in-grid.staff-history-only .stock-history-table th,
.stock-in-grid.staff-history-only .stock-history-table td,
.stock-out-grid.staff-history-only .stock-history-table th,
.stock-out-grid.staff-history-only .stock-history-table td {
    white-space: nowrap;
}

.stock-in-grid.staff-history-only .stock-history-table thead th,
.stock-out-grid.staff-history-only .stock-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--soft);
}

.stock-in-grid.staff-history-only .stock-history-table tbody tr:hover,
.stock-out-grid.staff-history-only .stock-history-table tbody tr:hover {
    background: var(--soft);
}

.stock-in-grid.staff-history-only .stock-history-table td,
.stock-out-grid.staff-history-only .stock-history-table td {
    height: 58px;
    vertical-align: middle;
}

.stock-in-grid.staff-history-only .stock-history-table .stock-date {
    min-width: 155px;
}

.stock-in-grid.staff-history-only .stock-history-table td:nth-child(2) {
    min-width: 220px;
}

.stock-in-grid.staff-history-only .stock-history-table td:nth-child(3),
.stock-in-grid.staff-history-only .stock-history-table td:nth-child(4) {
    min-width: 130px;
}

.stock-in-grid.staff-history-only .stock-history-table td:nth-child(5) {
    min-width: 100px;
    text-align: center;
}

.stock-in-grid.staff-history-only .stock-history-table td:nth-child(6) {
    min-width: 150px;
}

.stock-in-grid.staff-history-only .stock-history-table td:nth-child(7) {
    min-width: 120px;
}

.stock-in-grid.staff-history-only .stock-history-table td:nth-child(8) {
    min-width: 150px;
}

.stock-in-grid.staff-history-only .stock-history-table td:nth-child(9) {
    min-width: 250px;
}

.stock-in-grid.staff-history-only .stock-history-table .stock-remarks {
    max-width: none;
    min-width: 250px;
    white-space: normal;
    word-break: break-word;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(1) {
    min-width: 155px;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(2) {
    min-width: 220px;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(3),
.stock-out-grid.staff-history-only .stock-history-table td:nth-child(4) {
    min-width: 130px;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(5) {
    min-width: 100px;
    text-align: center;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(6) {
    min-width: 150px;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(7) {
    min-width: 120px;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(8) {
    min-width: 150px;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(9) {
    min-width: 250px;
}

.stock-out-grid.staff-history-only .stock-history-table td:nth-child(10) {
    min-width: 180px;
}

.stock-out-grid.staff-history-only .stock-history-table .stock-remarks {
    max-width: none;
    min-width: 250px;
    white-space: normal;
    word-break: break-word;
}

.supplier-search-area {
    width: 100%;
    padding: 20px 22px 4px;
    box-sizing: border-box;
}

.supplier-search-box {
    position: relative;
    width: 100%;
    max-width: 650px;
}

.supplier-search-input {
    width: 100%;
    height: 54px;
    padding: 0 52px;
    box-sizing: border-box;
    border: 1px solid var(--soft-border);
    border-radius: 14px;
    background: var(--card);
    color: var(--heading);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    box-shadow:
        0 2px 6px rgba(var(--primary-rgb), .04),
        0 8px 20px rgba(var(--primary-rgb), .04);
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.supplier-search-input::placeholder {
    color: var(--muted);
    font-weight: 400;
}

.supplier-search-input:hover {
    border-color: var(--accent);
}

.supplier-search-input:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(var(--primary-rgb), .10),
        0 8px 24px rgba(var(--primary-rgb), .07);
}

.supplier-search-box > i.bx-search {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: var(--secondary);
    font-size: 23px;
    pointer-events: none;
}

.supplier-search-clear {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.supplier-search-clear i {
    font-size: 21px;
}

.supplier-search-clear:hover {
    background: var(--soft);
    color: var(--primary);
}

.supplier-search-clear:active {
    transform: translateY(-50%) scale(.94);
}

.supplier-search-result {
    display: flex;
    align-items: center;
    min-height: 22px;
    margin-top: 8px;
    padding-left: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.supplier-search-result:empty {
    display: none;
}

.delivery-type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.delivery-type-button {
    border: 1px solid #d9ded9;
    background: #fff;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    color: #4b5563;
    transition: 0.2s ease;
}

.delivery-type-button:hover {
    border-color: var(--primary);
}

.delivery-type-button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.delivery-reference-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.manual-delivery-box {
    display: none;
}

.manual-delivery-box.active {
    display: block;
}

.inventory-delivery-box.hidden {
    display: none;
}

.manual-note {
    display: block;
    margin-top: 6px;
    color: #8a8f98;
    font-size: 12px;
}

.delivery-value-preview {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
}

.product-search-wrapper {
    position: relative;
    width: 100%;
}

.product-search-input-wrapper {
    position: relative;
    width: 100%;
}

.product-search-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d5dbd5;
    border-radius: 10px;
    outline: none;
    background: #fff;
    font-size: 15px;
    color: #263026;
    transition: 0.2s ease;
    box-sizing: border-box;
}

.product-search-input::placeholder {
    color: #9aa19a;
}

.product-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.product-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid #d9ded9;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.product-search-results.active {
    display: block;
}

.product-search-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f1f0;
    transition: 0.15s ease;
}

.product-search-item:last-child {
    border-bottom: none;
}

.product-search-item:hover {
    background: #f6f8f6;
}

.product-search-item-name {
    font-weight: 700;
    color: #263026;
    line-height: 1.4;
}

.product-search-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    font-size: 12px;
    color: #707770;
}

.product-search-stock {
    font-weight: 700;
    white-space: nowrap;
}

.product-search-stock.out {
    color: #b42318;
}

.product-search-empty {
    padding: 16px;
    text-align: center;
    color: #7a807a;
    font-size: 14px;
}

.selected-product-box {
    display: none;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f5f8f5;
    border: 1px solid #dce5dc;
}

.selected-product-box.active {
    display: block;
}

.selected-product-name {
    font-weight: 700;
    color: #263026;
}

.selected-product-meta {
    margin-top: 5px;
    font-size: 13px;
    color: #6d756d;
}

.clear-product-button {
    margin-top: 8px;
    border: none;
    background: transparent;
    padding: 0;
    color: #9b2c2c;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.clear-product-button:hover {
    text-decoration: underline;
}

.product-table-area {
    width: 100%;
    overflow: hidden;
}

.product-drag-bar {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        to bottom,
        var(--card),
        var(--soft)
    );
    border-top: 1px solid var(--soft-border);
    border-bottom: 1px solid var(--soft-border);
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: background .2s ease;
}

.product-drag-bar:hover {
    background: var(--soft);
}

.product-drag-bar:active,
.product-drag-bar.dragging,
.supplier-drag-bar.dragging {
    cursor: grabbing;
}

.product-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 210px;
    height: 31px;
    padding: 0 15px;
    border: 1px solid var(--soft-border);
    border-radius: 9px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1px;
    box-shadow: 0 2px 7px rgba(var(--primary-rgb), .06);
}

.product-drag-handle i {
    font-size: 17px;
    color: var(--secondary);
}

.product-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: var(--secondary) var(--soft);
    background: var(--card);
    overscroll-behavior-x: contain;
}

.product-table-wrapper::-webkit-scrollbar {
    height: 14px;
}

.product-table-wrapper::-webkit-scrollbar-track {
    background: var(--soft);
    border-top: 1px solid var(--soft-border);
}

.product-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 20px;
    border: 3px solid var(--soft);
}

.product-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.product-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 14px 18px;
    background: var(--soft);
    color: var(--heading);
    border-bottom: 1px solid var(--soft-border);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.product-table td {
    padding: 16px 18px;
    background: var(--card);
    color: var(--text);
    border-bottom: 1px solid var(--soft-border);
    vertical-align: middle;
    white-space: nowrap;
    font-size: 13px;
}

.product-table tbody tr {
    transition: background .18s ease;
}

.product-table tbody tr:hover td {
    background: var(--soft);
}

.product-table th:nth-child(1),
.product-table td:nth-child(1) {
    width: 90px;
    min-width: 90px;
}

.product-table th:nth-child(2),
.product-table td:nth-child(2) {
    min-width: 280px;
}

.product-table th:nth-child(3),
.product-table td:nth-child(3) {
    min-width: 170px;
}

.product-table th:nth-child(4),
.product-table td:nth-child(4) {
    min-width: 90px;
}

.product-table th:nth-child(5),
.product-table td:nth-child(5) {
    min-width: 160px;
}

.product-table th:nth-child(6),
.product-table td:nth-child(6) {
    min-width: 220px;
}

.product-table th:nth-child(7),
.product-table td:nth-child(7) {
    min-width: 130px;
}

.product-table th:nth-child(8),
.product-table td:nth-child(8) {
    min-width: 120px;
}

.product-table th:nth-child(9),
.product-table td:nth-child(9) {
    min-width: 140px;
}

.product-table th:last-child,
.product-table td:last-child {
    min-width: 220px;
    position: sticky;
    right: 0;
    z-index: 5;
    background: var(--card);
    box-shadow:
        -7px 0 15px rgba(var(--primary-rgb), .07);
}

.product-table th:last-child {
    z-index: 8;
    background: var(--soft);
}

.product-table tbody tr:hover td:last-child {
    background: var(--soft);
}

.product-table .product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 230px;
}

.product-table .product-info strong {
    color: var(--heading);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    white-space: normal;
}

.product-table .product-info small {
    color: var(--muted);
    font-size: 11px;
}

.product-table .product-image {
    width: 58px;
    height: 58px;
    object-fit: contain;
    padding: 5px;
    border: 1px solid var(--soft-border);
    border-radius: 10px;
    background: #fff;
}

.product-table .product-uom {
    color: var(--primary);
    font-weight: 700;
}

.product-table .product-price {
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.product-table .stock-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    background: var(--soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 750;
}

.product-table .action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.product-table .action-buttons a {
    flex-shrink: 0;
}

.stock-out-grid .stock-card-header > i {
    background: var(--soft);
    color: var(--primary);
}

.stock-out-grid .stock-submit {
    background: var(--primary);
}

.stock-out-grid .stock-submit:hover {
    background: var(--secondary);
}

.stock-out-grid .stock-history-table thead th {
    background: var(--soft);
    color: var(--heading);
}

body.brownfly .company-preview .brownfly { box-shadow: 0 0 0 3px rgba(255, 204, 255, .75); }
body.akinito .company-preview .akinito { box-shadow: 0 0 0 3px rgba(120, 105, 0, .22); }
body.single .company-preview .single { box-shadow: 0 0 0 3px rgba(63, 107, 53, .20); }

body.brownfly .login-page,
body.akinito .login-page,
body.single .login-page {
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary),
        var(--accent)
    );
}

/* Brand-driven controls: these follow the selected company's official palette. */
body.brownfly .btn-add, body.brownfly .stock-submit, body.brownfly .btn-edit-product,
body.akinito .btn-add, body.akinito .stock-submit, body.akinito .btn-edit-product,
body.single .btn-add, body.single .stock-submit, body.single .btn-edit-product {
    background: var(--primary);
}
body.brownfly .btn-add:hover, body.brownfly .stock-submit:hover, body.brownfly .btn-edit-product:hover,
body.akinito .btn-add:hover, body.akinito .stock-submit:hover, body.akinito .btn-edit-product:hover,
body.single .btn-add:hover, body.single .stock-submit:hover, body.single .btn-edit-product:hover {
    background: var(--secondary);
}
body.brownfly .product-upload-box label, body.brownfly .login-btn,
body.akinito .product-upload-box label, body.akinito .login-btn,
body.single .product-upload-box label, body.single .login-btn {
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

body.pdf-print-layout .sidebar,
body.pdf-print-layout .topbar,
body.pdf-print-layout .report-filters,
body.pdf-print-layout .report-actions,
body.pdf-print-layout .page-header a,
body.pdf-print-layout .sidebar-mobile-toggle {
    display: none !important;
}

body.pdf-print-layout .content {
    margin: 0 !important;
    width: 100% !important;
}

body.pdf-print-layout .wrapper {
    display: block !important;
}

body.pdf-print-layout .dashboard {
    margin: 0 !important;
    padding: 0 !important;
}

body.pdf-print-layout #reportExportArea {
    width: 100% !important;
    background: #fff !important;
}

body.pdf-print-layout .report-table-wrap {
    overflow: visible !important;
}

body.pdf-print-layout .report-table {
    width: 100% !important;
}

body.pdf-print-layout .report-table thead {
    display: table-header-group !important;
}

body.pdf-print-layout .report-table tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

body.pdf-print-layout .report-section {
    break-inside: auto !important;
}

body.pdf-print-layout .report-card,
body.pdf-print-layout .table-card {
    box-shadow: none !important;
}

@media print {

    @page {
        size: A4 landscape;
        margin: 8mm;
    }

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

    .report-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .sidebar,
    .topbar,
    .sidebar-mobile-toggle,
    .page-header a,
    .report-filters,
    .report-actions {
        display: none !important;
    }

    .content {
        margin: 0 !important;
        width: 100% !important;
    }

    .report-card,
    .table-card {
        box-shadow: none !important;
    }
}

@media (max-width: 1200px) {

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

    .search-box input {
        width: 250px;
    }

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

    .stock-in-card,
    .stock-history-card {
        max-width: 100%;
        width: 100%;
    }

    .view-product-card,
    .product-view-card {
        grid-template-columns: 1fr;
    }

    .view-product-gallery {
        border-right: none;
        border-bottom: 1px solid var(--soft-border);
    }

    .main-product-image {
        height: 420px;
    }

    .product-main-image {
        height: 350px;
    }

    .supplier-view-card {
        max-width: 100%;
    }

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

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

@media (max-width: 992px) {

    :root {
        --sidebar-width: 280px;
    }

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .sidebar {
        width: var(--sidebar-width);
        left: 0;
    }

    body.sidebar-hidden .sidebar {
        left: calc(var(--sidebar-width) * -1);
    }

    .content {
        width: 100% !important;
        margin-left: 0 !important;
        min-height: 100vh;
        padding: 0 !important;
    }

    .sidebar-mobile-toggle {
        left: calc(var(--sidebar-width) - 20px);
        width: 40px;
        height: 40px;
    }

    body.sidebar-hidden .sidebar-mobile-toggle {
        left: 0;
    }

    .topbar {
        width: 100%;
        min-height: 68px;
        height: auto;
        padding: 10px 18px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        box-shadow: 0 4px 18px rgba(var(--primary-rgb), .08);
    }

    .topbar-left {
        display: none;
    }

    .topbar-right {
        width: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        margin-left: auto;
    }

    .datetime {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        min-width: 0;
        text-align: right;
    }

    .datetime h4 {
        margin: 0;
        font-size: 12px;
        line-height: 1.35;
        font-weight: 600;
        white-space: nowrap;
    }

    .datetime p {
        margin: 2px 0 0;
        font-size: 10px;
        line-height: 1.3;
        white-space: nowrap;
    }

    .profile {
        display: flex;
        align-items: center;
        gap: 9px;
        min-width: 0;
    }

    .profile img {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-width: 2px;
    }

    .profile-info {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        min-width: 0;
        max-width: 145px;
    }

    .profile-info h4 {
        margin: 0;
        max-width: 145px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
        line-height: 1.35;
        font-weight: 600;
    }

    .profile-info p {
        margin: 2px 0 0;
        max-width: 145px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10px;
        line-height: 1.3;
    }

    .profile-menu {
        top: 56px;
        right: 0;
        width: 220px;
        max-width: calc(100vw - 30px);
    }

    .dashboard {
        width: 100%;
        padding: 22px 20px 30px;
    }

    .page-header {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 14px;
        margin-bottom: 20px;
    }

    .page-header > div:first-child {
        width: 100%;
    }

    .page-header h1 {
        font-size: 24px;
        line-height: 1.25;
    }

    .page-header p {
        margin-top: 6px;
        font-size: 13px;
        line-height: 1.55;
    }

    .page-header .btn-primary,
    .page-header .btn-add {
        width: 100%;
        min-height: 44px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin-bottom: 24px;
    }

    .dashboard-card {
        min-width: 0;
        padding: 18px;
        border-radius: 14px;
    }

    .dashboard-card::before {
        width: 4px;
    }

    .dashboard-info {
        min-width: 0;
    }

    .dashboard-info h5 {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .dashboard-info h2 {
        font-size: 25px;
        line-height: 1.2;
    }

    .dashboard-info span {
        margin-top: 6px;
        font-size: 11px;
    }

    .dashboard-icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
        border-radius: 14px;
    }

    .dashboard-icon i {
        font-size: 26px;
    }

    .stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin-top: 22px;
    }

    .stat-box {
        min-width: 0;
        padding: 17px;
        border-radius: 14px;
    }

    .stat-box h2 {
        font-size: 25px;
    }

    .stat-box span {
        font-size: 12px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin-top: 22px;
    }

    .action-card {
        min-width: 0;
        padding: 20px 14px;
        border-radius: 14px;
    }

    .action-card i {
        font-size: 32px;
    }

    .action-card h4 {
        font-size: 14px;
    }

    .action-card p {
        font-size: 11px;
        line-height: 1.45;
    }

    .chart-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 20px;
    }

    .chart-card,
    .activity-card {
        padding: 18px;
        border-radius: 14px;
    }

    .chart-card h3,
    .activity-card h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .chart-card canvas {
        height: 280px !important;
    }

    .welcome-banner {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 24px 20px;
        margin-bottom: 22px;
        border-radius: 16px;
        text-align: center;
    }

    .welcome-banner h2 {
        font-size: 23px;
        line-height: 1.3;
    }

    .welcome-banner p {
        font-size: 13px;
        line-height: 1.55;
    }

    .welcome-banner i {
        display: none;
    }

    .table-card {
        width: 100%;
        border-radius: 14px;
        overflow: hidden;
    }

    .table-header {
        padding: 17px;
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .table-header h3 {
        font-size: 18px;
    }

    .table-header .btn,
    .table-header .btn-add {
        width: 100%;
    }

    .table-responsive,
    .table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        overscroll-behavior-x: contain;
    }

    .table-responsive::-webkit-scrollbar,
    .table-wrapper::-webkit-scrollbar {
        height: 8px;
    }

    .table-responsive::-webkit-scrollbar-track,
    .table-wrapper::-webkit-scrollbar-track {
        background: var(--soft);
    }

    .table-responsive::-webkit-scrollbar-thumb,
    .table-wrapper::-webkit-scrollbar-thumb {
        background: var(--secondary);
        border-radius: 20px;
    }

    .product-table,
    .supplier-table,
    .stock-history-table {
        width: max-content;
    }

    .product-table {
        min-width: 980px;
    }

    .supplier-table {
        min-width: 1100px;
    }

    .stock-history-table {
        min-width: 1200px;
    }

    .product-table thead th {
        height: 48px;
        padding: 0 14px;
        font-size: 10px;
    }

    .product-table tbody td {
        height: 72px;
        padding: 10px 14px;
        font-size: 12px;
    }

    .product-table .product-info {
        min-width: 210px;
        gap: 4px;
    }

    .product-table .product-info strong {
        font-size: 13px;
    }

    .product-table .product-info small {
        font-size: 10px;
    }

    .product-table .product-image {
        width: 52px;
        height: 52px;
    }

    .product-table .stock-number {
        min-width: 38px;
        height: 28px;
        padding: 0 8px;
        font-size: 12px;
    }

    .product-table .action-buttons {
        gap: 6px;
    }

    .product-table .action-buttons a,
    .product-table .action-buttons button {
        min-height: 31px;
        padding: 0 8px;
        font-size: 10px;
    }

    .product-table .action-buttons a i,
    .product-table .action-buttons button i {
        font-size: 14px;
    }

    .product-drag-bar,
    .supplier-drag-bar {
        min-height: 44px;
    }

    .product-drag-handle,
    .supplier-drag-handle {
        min-width: 190px;
        height: 29px;
        padding: 0 13px;
        font-size: 11px;
    }

    .product-drag-handle i,
    .supplier-drag-handle i {
        font-size: 16px;
    }

    .product-table-wrapper,
    .supplier-table-wrapper,
    .stock-history-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .product-table-wrapper::-webkit-scrollbar,
    .supplier-table-wrapper::-webkit-scrollbar,
    .stock-history-wrapper::-webkit-scrollbar {
        height: 10px;
    }

    .product-table-wrapper::-webkit-scrollbar-track,
    .supplier-table-wrapper::-webkit-scrollbar-track,
    .stock-history-wrapper::-webkit-scrollbar-track {
        background: var(--soft);
    }

    .product-table-wrapper::-webkit-scrollbar-thumb,
    .supplier-table-wrapper::-webkit-scrollbar-thumb,
    .stock-history-wrapper::-webkit-scrollbar-thumb {
        background: var(--secondary);
        border-radius: 20px;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .category-card {
        min-height: 0;
        border-radius: 16px;
    }

    .category-image {
        height: 170px;
    }

    .category-info {
        padding: 15px 48px 17px 16px;
    }

    .category-info h3 {
        font-size: 17px;
    }

    .category-info p {
        font-size: 11px;
        line-height: 1.45;
    }

    .category-arrow {
        right: 13px;
        bottom: 13px;
        width: 34px;
        height: 34px;
    }

    .category-arrow i {
        font-size: 20px;
    }

    .form-card {
        padding: 20px;
        border-radius: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 14px;
    }

    .form-control {
        min-height: 44px;
        padding: 11px 13px;
        font-size: 13px;
        border-radius: 10px;
    }

    textarea.form-control {
        min-height: 110px;
    }

    .stock-in-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 18px;
    }

    .stock-in-card,
    .stock-history-card {
        width: 100%;
        max-width: none;
        border-radius: 14px;
    }

    .stock-in-card {
        padding: 19px;
    }

    .stock-card-header {
        gap: 12px;
        margin-bottom: 18px;
    }

    .stock-card-header h2 {
        font-size: 18px;
    }

    .stock-card-header p {
        font-size: 12px;
        line-height: 1.5;
    }

    .stock-card-header > i {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 10px;
        font-size: 21px;
    }

    .stock-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .stock-field {
        margin-bottom: 15px;
    }

    .stock-field label {
        font-size: 12px;
        margin-bottom: 7px;
    }

    .stock-field input[type="text"],
    .stock-field input[type="number"],
    .stock-field select {
        height: 44px;
        font-size: 13px;
        border-radius: 9px;
    }

    .stock-field textarea {
        min-height: 100px;
        font-size: 13px;
        border-radius: 9px;
    }

    .stock-submit {
        height: 46px;
        border-radius: 9px;
        font-size: 13px;
    }

    .product-images-upload {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-upload-box {
        height: 145px;
        border-radius: 11px;
    }

    .product-upload-box:first-child {
        grid-column: 1 / -1;
    }

    .product-upload-box label {
        left: 7px;
        right: 7px;
        bottom: 7px;
        min-height: 36px;
        font-size: 10px;
        border-radius: 8px;
    }

    .image-help {
        font-size: 10px;
        line-height: 1.5;
    }

    .price-input span {
        left: 12px;
    }

    .price-input input {
        padding-left: 32px !important;
    }

    .stock-history-card .stock-card-header {
        padding: 19px 19px 0;
    }

    .stock-history-table {
        min-width: 1200px;
    }

    .stock-history-table thead th {
        padding: 12px 13px;
        font-size: 10px;
    }

    .stock-history-table tbody td {
        padding: 13px;
        font-size: 11px;
    }

    .stock-history-table tbody td strong {
        font-size: 11px;
    }

    .stock-quantity,
    .category-badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    .stock-date {
        font-size: 10px !important;
    }

    .stock-in-grid.staff-history-only .stock-card-header,
    .stock-out-grid.staff-history-only .stock-card-header {
        padding: 19px 19px 15px;
    }

    .stock-in-grid.staff-history-only .stock-history-table {
        min-width: 1200px;
    }

    .stock-out-grid.staff-history-only .stock-history-table {
        min-width: 1300px;
    }

    .view-product-card,
    .product-view-card {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 18px;
        border-radius: 14px;
    }

    .view-product-gallery {
        padding: 18px;
        border-right: none;
        border-bottom: 1px solid var(--soft-border);
    }

    .view-product-details {
        padding: 21px 18px;
    }

    .main-product-image {
        height: 320px;
        border-radius: 12px;
    }

    .product-main-image {
        height: 300px;
        border-radius: 12px;
    }

    .product-thumbnails,
    .product-image-thumbnails {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-top: 10px;
    }

    .product-thumbnail {
        height: 72px;
        border-radius: 10px;
    }

    .product-detail-header,
    .product-view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .product-detail-header {
        padding-bottom: 18px;
    }

    .product-view-header {
        margin-bottom: 18px;
    }

    .product-detail-header h2,
    .product-view-header h2 {
        font-size: 21px;
        line-height: 1.3;
    }

    .product-detail-header .btn-edit,
    .view-product-details .btn-edit {
        width: 100%;
    }

    .product-specifications,
    .product-details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .spec-item,
    .product-detail-item {
        min-height: 68px;
        padding: 13px 14px;
        border-radius: 10px;
    }

    .spec-label,
    .detail-label {
        font-size: 10px;
    }

    .spec-item strong,
    .product-detail-item strong {
        font-size: 14px;
    }

    .product-description {
        margin-top: 20px;
        padding-top: 18px;
    }

    .product-description h3 {
        font-size: 15px;
    }

    .product-description p {
        font-size: 12px;
        line-height: 1.7;
    }

    .product-view-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 18px;
    }

    .btn-back,
    .btn-edit-product {
        width: 100%;
        justify-content: center;
    }

    .supplier-form-card {
        width: 100%;
        max-width: none;
        padding: 19px;
        border-radius: 14px;
    }

    .supplier-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

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

    .supplier-form-group {
        gap: 6px;
    }

    .supplier-form-group label {
        font-size: 12px;
    }

    .supplier-form-group .form-control {
        min-height: 44px;
    }

    .supplier-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
        margin-top: 19px;
    }

    .supplier-form-actions a,
    .supplier-form-actions button {
        width: 100%;
        min-height: 44px;
    }

    .supplier-view-card {
        width: 100%;
        max-width: none;
        padding: 19px;
        border-radius: 14px;
    }

    .supplier-view-title {
        gap: 11px;
        padding-bottom: 18px;
        margin-bottom: 18px;
    }

    .supplier-view-icon {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        border-radius: 11px;
        font-size: 21px;
    }

    .supplier-view-title h2 {
        font-size: 19px;
    }

    .supplier-view-title p {
        font-size: 11px;
    }

    .supplier-details {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 22px;
    }

    .supplier-detail {
        padding: 14px;
        border-radius: 10px;
    }

    .supplier-detail-label {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .supplier-detail-value {
        font-size: 12px;
        line-height: 1.5;
    }

    .supplier-contacts-section {
        padding-top: 20px;
    }

    .supplier-section-header {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    .supplier-section-header h2 {
        font-size: 18px;
    }

    .supplier-section-header p {
        font-size: 11px;
    }

    .supplier-contacts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .supplier-contact-card {
        padding: 15px;
        gap: 10px;
        border-radius: 11px;
    }

    .supplier-contact-icon {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border-radius: 10px;
        font-size: 19px;
    }

    .supplier-contact-info {
        padding-right: 20px;
    }

    .supplier-contact-info h3 {
        font-size: 13px;
    }

    .supplier-contact-position {
        font-size: 10px;
        margin: 3px 0 9px;
    }

    .supplier-contact-details {
        gap: 5px;
    }

    .supplier-contact-details div {
        font-size: 10px;
    }

    .supplier-contact-details i {
        font-size: 14px;
    }

    .supplier-view-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 20px;
        padding-top: 18px;
    }

    .supplier-view-actions a,
    .supplier-view-actions button {
        width: 100%;
        min-height: 44px;
    }

    .supplier-search-area {
        padding: 16px 14px 6px;
    }

    .supplier-search-box {
        width: 100%;
        max-width: none;
    }

    .supplier-search-input {
        width: 100%;
        height: 48px;
        padding: 0 46px;
        font-size: 13px;
        border-radius: 11px;
    }

    .supplier-search-box > i.bx-search {
        left: 15px;
        font-size: 21px;
    }

    .supplier-search-clear {
        right: 8px;
        width: 32px;
        height: 32px;
    }

    .supplier-search-clear i {
        font-size: 19px;
    }

    .supplier-search-result {
        margin-top: 6px;
        padding-left: 2px;
        font-size: 11px;
    }

    .supplier-table {
        min-width: 1100px;
    }

    .supplier-table th {
        padding: 12px 13px;
        font-size: 10px;
    }

    .supplier-table td {
        padding: 13px;
        font-size: 11px;
    }

    .supplier-table th:nth-child(2),
    .supplier-table td:nth-child(2) {
        min-width: 250px;
    }

    .supplier-table th:nth-child(3),
    .supplier-table td:nth-child(3) {
        min-width: 160px;
    }

    .supplier-table th:nth-child(4),
    .supplier-table td:nth-child(4) {
        min-width: 170px;
    }

    .supplier-table th:nth-child(5),
    .supplier-table td:nth-child(5) {
        min-width: 200px;
    }

    .supplier-table th:nth-child(6),
    .supplier-table td:nth-child(6) {
        min-width: 210px;
    }

    .supplier-table th:nth-child(7),
    .supplier-table td:nth-child(7) {
        min-width: 190px;
    }

    .supplier-table th:last-child,
    .supplier-table td:last-child {
        min-width: 195px;
    }

    .supplier-table .supplier-info {
        min-width: 200px;
    }

    .supplier-table .supplier-info strong {
        font-size: 12px;
    }

    .supplier-table .supplier-brand {
        font-size: 10px;
    }

    .supplier-table .contact-info {
        max-width: 230px;
    }

    .supplier-table .contact-info i {
        font-size: 15px;
    }

    .supplier-table .action-buttons {
        gap: 6px;
    }

    .login-page {
        min-height: 100svh;
        padding: 18px 14px;
    }

    .login-card {
        width: 100%;
        max-width: 430px;
        padding: 28px 20px;
        border-radius: 18px;
    }

    .login-logo {
        margin-bottom: 20px;
    }

    .login-logo img {
        width: 150px;
    }

    .login-title {
        margin-bottom: 22px;
    }

    .login-title h1 {
        font-size: 24px;
    }

    .login-title p {
        font-size: 12px;
        line-height: 1.5;
    }

    .company-select select,
    .input-group input {
        min-height: 44px;
        font-size: 13px;
    }

    .form-group label,
    .company-select label {
        font-size: 12px;
    }

    .login-options {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 20px;
        font-size: 12px;
    }

    .login-btn {
        min-height: 46px;
        padding: 12px;
        font-size: 14px;
        border-radius: 10px;
    }

    .login-footer {
        margin-top: 20px;
        font-size: 11px;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100svh - 20px);
        overflow-y: auto;
        border-radius: 15px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-footer {
        flex-direction: column;
    }

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

    .delivery-type-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .delivery-type-button {
        min-height: 44px;
        font-size: 12px;
    }

    .delivery-reference-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .product-search-input {
        height: 46px;
        font-size: 13px;
        border-radius: 9px;
    }

    .product-search-item {
        padding: 11px 12px;
    }

    .product-search-item-name {
        font-size: 12px;
    }

    .product-search-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        font-size: 10px;
    }

    .product-search-results {
        max-height: 240px;
    }

    .selected-product-box {
        padding: 11px 12px;
    }

    .selected-product-name {
        font-size: 12px;
    }

    .selected-product-meta {
        font-size: 10px;
    }

    .report-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .report-actions .btn,
    .report-actions button {
        width: 100%;
        min-height: 42px;
        font-size: 11px;
    }

    .filter-container,
    .filters,
    .filter-bar {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 14px;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
        min-width: 0;
    }

    .filter-group input,
    .filter-group select,
    .filters input,
    .filters select,
    .filter-bar input,
    .filter-bar select {
        width: 100%;
        min-height: 44px;
        font-size: 12px;
    }

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

    .summary-card {
        min-width: 0;
        padding: 14px;
        border-radius: 12px;
    }

    .summary-card .value {
        font-size: 20px;
    }

    .report-card,
    .card {
        width: 100%;
        padding: 14px;
        border-radius: 12px;
    }

    .empty-products {
        height: 280px !important;
    }

    .empty-products-content {
        min-height: 240px;
        padding: 40px 16px;
    }

    .empty-products-content > i {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }

    .empty-products-content h3 {
        font-size: 15px;
    }

    .empty-products-content p {
        font-size: 11px;
        line-height: 1.5;
    }
}

@media (max-width: 600px) {

    .dashboard {
        padding: 18px 14px 25px;
    }

    .topbar {
        min-height: 62px;
        padding: 8px 12px;
    }

    .topbar-right {
        gap: 8px;
    }

    .datetime h4 {
        font-size: 10px;
    }

    .datetime p {
        font-size: 9px;
    }

    .profile {
        gap: 7px;
    }

    .profile img {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .profile-info {
        max-width: 105px;
    }

    .profile-info h4 {
        max-width: 105px;
        font-size: 10px;
    }

    .profile-info p {
        max-width: 105px;
        font-size: 8px;
    }

    .page-header {
        gap: 11px;
        margin-bottom: 17px;
    }

    .page-header h1 {
        font-size: 21px;
    }

    .page-header p {
        font-size: 11px;
    }

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

    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

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

    .dashboard-card {
        padding: 16px;
    }

    .dashboard-info h2 {
        font-size: 23px;
    }

    .dashboard-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .dashboard-icon i {
        font-size: 24px;
    }

    .chart-card,
    .activity-card {
        padding: 15px;
    }

    .chart-card h3,
    .activity-card h3 {
        font-size: 16px;
    }

    .chart-card canvas {
        height: 230px !important;
    }

    .welcome-banner {
        padding: 20px 16px;
    }

    .welcome-banner h2 {
        font-size: 20px;
    }

    .welcome-banner p {
        font-size: 11px;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .category-image {
        height: 175px;
    }

    .category-card {
        border-radius: 14px;
    }

    .category-info {
        padding: 15px 52px 16px 16px;
    }

    .category-info h3 {
        font-size: 17px;
    }

    .category-info p {
        font-size: 11px;
    }

    .product-images-upload {
        grid-template-columns: 1fr;
    }

    .product-upload-box:first-child {
        grid-column: auto;
    }

    .product-upload-box {
        height: 175px;
    }

    .stock-in-card {
        padding: 15px;
    }

    .stock-card-header {
        align-items: flex-start;
    }

    .stock-card-header h2 {
        font-size: 17px;
    }

    .stock-card-header p {
        font-size: 11px;
    }

    .stock-card-header > i {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 19px;
    }

    .product-drag-handle,
    .supplier-drag-handle {
        min-width: 180px;
        font-size: 10px;
    }

    .product-table {
        min-width: 960px;
    }

    .supplier-table {
        min-width: 1050px;
    }

    .stock-history-table {
        min-width: 1180px;
    }

    .view-product-gallery {
        padding: 14px;
    }

    .view-product-details {
        padding: 18px 14px;
    }

    .main-product-image {
        height: 270px;
    }

    .product-main-image {
        height: 250px;
    }

    .product-thumbnail {
        height: 65px;
    }

    .product-detail-header h2,
    .product-view-header h2 {
        font-size: 19px;
    }

    .supplier-view-card {
        padding: 15px;
    }

    .supplier-view-title h2 {
        font-size: 18px;
    }

    .supplier-detail {
        padding: 13px;
    }

    .supplier-contact-card {
        padding: 14px;
    }

    .supplier-search-area {
        padding: 13px 12px 5px;
    }

    .supplier-search-input {
        height: 46px;
        font-size: 12px;
    }

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

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

@media (max-width: 420px) {

    .dashboard {
        padding: 15px 10px 22px;
    }

    .topbar {
        padding: 7px 9px;
    }

    .topbar-right {
        gap: 6px;
    }

    .datetime {
        display: none;
    }

    .profile img {
        width: 35px;
        height: 35px;
        min-width: 35px;
    }

    .profile-info {
        max-width: 90px;
    }

    .profile-info h4 {
        max-width: 90px;
        font-size: 9px;
    }

    .profile-info p {
        max-width: 90px;
        font-size: 8px;
    }

    .page-header h1 {
        font-size: 19px;
    }

    .page-header p {
        font-size: 10px;
    }

    .page-header .btn-primary,
    .page-header .btn-add {
        min-height: 42px;
        font-size: 11px;
    }

    .dashboard-card {
        padding: 14px;
    }

    .dashboard-info h5 {
        font-size: 11px;
    }

    .dashboard-info h2 {
        font-size: 21px;
    }

    .dashboard-info span {
        font-size: 10px;
    }

    .dashboard-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .dashboard-icon i {
        font-size: 22px;
    }

    .chart-card,
    .activity-card {
        padding: 13px;
    }

    .chart-card canvas {
        height: 210px !important;
    }

    .welcome-banner {
        padding: 18px 14px;
    }

    .welcome-banner h2 {
        font-size: 18px;
    }

    .category-image {
        height: 165px;
    }

    .category-info {
        padding: 14px 48px 15px 14px;
    }

    .category-info h3 {
        font-size: 16px;
    }

    .category-info p {
        font-size: 10px;
    }

    .category-arrow {
        right: 11px;
        bottom: 11px;
        width: 32px;
        height: 32px;
    }

    .category-arrow i {
        font-size: 19px;
    }

    .stock-in-card {
        padding: 13px;
    }

    .stock-history-card .stock-card-header {
        padding: 17px 14px 0;
    }

    .product-upload-box {
        height: 165px;
    }

    .main-product-image {
        height: 235px;
    }

    .product-main-image {
        height: 220px;
    }

    .product-thumbnail {
        height: 60px;
    }

    .supplier-view-card {
        padding: 13px;
    }

    .supplier-view-title {
        gap: 9px;
    }

    .supplier-view-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        font-size: 19px;
    }

    .supplier-view-title h2 {
        font-size: 17px;
    }

    .supplier-contact-card {
        padding: 13px;
    }

    .supplier-contact-icon {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
        font-size: 18px;
    }

    .login-card {
        padding: 23px 16px;
    }

    .login-logo img {
        width: 135px;
    }

    .login-title h1 {
        font-size: 22px;
    }

    .product-drag-handle,
    .supplier-drag-handle {
        min-width: 170px;
        height: 28px;
        padding: 0 10px;
        font-size: 9px;
    }

    .product-drag-handle i,
    .supplier-drag-handle i {
        font-size: 15px;
    }
}

@media (max-width: 360px) {

    :root {
        --sidebar-width: 250px;
    }

    .sidebar {
        width: var(--sidebar-width);
    }

    body.sidebar-hidden .sidebar {
        left: calc(var(--sidebar-width) * -1);
    }

    .sidebar-mobile-toggle {
        left: calc(var(--sidebar-width) - 19px);
    }

    body.sidebar-hidden .sidebar-mobile-toggle {
        left: 0;
    }

    .dashboard {
        padding: 13px 8px 20px;
    }

    .topbar {
        min-height: 58px;
        padding: 6px 8px;
    }

    .datetime {
        display: none;
    }

    .profile-info {
        max-width: 95px;
    }

    .profile-info h4 {
        max-width: 95px;
        font-size: 9px;
    }

    .profile-info p {
        max-width: 95px;
        font-size: 7px;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .dashboard-info h2 {
        font-size: 20px;
    }

    .category-image {
        height: 155px;
    }

    .stock-submit {
        font-size: 12px;
    }

    .product-table {
        min-width: 940px;
    }

    .supplier-table {
        min-width: 1020px;
    }

    .stock-history-table {
        min-width: 1150px;
    }

    .search-box input {
        padding-left: 40px;
        padding-right: 10px;
        font-size: 12px;
    }

    .search-box i {
        left: 12px;
    }
}

.supplier-search-area,
.product-search-area {
    width: 100%;
    padding: 22px 24px 8px;
    box-sizing: border-box;
}

.supplier-search-box {
    position: relative;
    width: 100%;
    max-width: 760px;
}

.supplier-search-input {
    width: 100%;
    height: 54px;
    padding: 0 52px 0 50px;
    box-sizing: border-box;
    border: 1px solid var(--soft-border);
    border-radius: 14px;
    background: var(--card);
    color: var(--heading);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    box-shadow:
        0 2px 4px rgba(var(--primary-rgb), .03),
        0 8px 24px rgba(var(--primary-rgb), .05);
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease,
        transform .2s ease;
}

.supplier-search-input::placeholder {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.supplier-search-input:hover {
    border-color: var(--accent);
    box-shadow:
        0 4px 12px rgba(var(--primary-rgb), .05),
        0 10px 28px rgba(var(--primary-rgb), .06);
}

.supplier-search-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(var(--primary-rgb), .09),
        0 8px 24px rgba(var(--primary-rgb), .07);
}

.supplier-search-box > i.bx-search {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: var(--secondary);
    font-size: 22px;
    pointer-events: none;
    transition:
        color .2s ease,
        transform .2s ease;
}

.supplier-search-box:focus-within > i.bx-search {
    color: var(--primary);
    transform: translateY(-50%) scale(1.04);
}

.supplier-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.supplier-search-clear i {
    font-size: 20px;
}

.supplier-search-clear:hover {
    background: var(--soft);
    color: var(--primary);
}

.supplier-search-clear:active {
    transform: translateY(-50%) scale(.92);
}

.supplier-search-result {
    display: flex;
    align-items: center;
    min-height: 24px;
    margin-top: 8px;
    padding-left: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.supplier-search-result:empty {
    display: none;
}

.product-search-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.product-search-area .supplier-search-box {
    width: 100%;
    max-width: 760px;
}

.product-search-area .supplier-search-input {
    padding-right: 55px;
}

@media (max-width: 992px) {

    .supplier-search-area,
    .product-search-area {
        padding: 18px 20px 8px;
    }

    .supplier-search-box,
    .product-search-area .supplier-search-box {
        width: 100%;
        max-width: 100%;
    }

    .supplier-search-input {
        height: 52px;
        font-size: 13px;
        border-radius: 13px;
    }

    .supplier-search-input::placeholder {
        font-size: 12px;
    }

    .supplier-search-box > i.bx-search {
        left: 16px;
        font-size: 21px;
    }

    .supplier-search-clear {
        right: 9px;
        width: 34px;
        height: 34px;
    }

    .supplier-search-result {
        font-size: 11px;
    }
}

@media (max-width: 600px) {

    .supplier-search-area,
    .product-search-area {
        padding: 15px 14px 7px;
    }

    .supplier-search-input {
        height: 48px;
        padding: 0 45px 0 44px;
        font-size: 12px;
        border-radius: 11px;
    }

    .supplier-search-input::placeholder {
        font-size: 11px;
    }

    .supplier-search-box > i.bx-search {
        left: 14px;
        font-size: 20px;
    }

    .supplier-search-clear {
        right: 7px;
        width: 31px;
        height: 31px;
        border-radius: 8px;
    }

    .supplier-search-clear i {
        font-size: 18px;
    }

    .supplier-search-result {
        margin-top: 6px;
        padding-left: 2px;
        min-height: 20px;
        font-size: 10px;
    }
}

@media (max-width: 420px) {

    .supplier-search-area,
    .product-search-area {
        padding: 12px 10px 6px;
    }

    .supplier-search-input {
        height: 46px;
        padding-left: 40px;
        padding-right: 42px;
        font-size: 11px;
    }

    .supplier-search-input::placeholder {
        font-size: 10px;
    }

    .supplier-search-box > i.bx-search {
        left: 12px;
        font-size: 18px;
    }

    .supplier-search-clear {
        right: 6px;
        width: 29px;
        height: 29px;
    }

    .supplier-search-clear i {
        font-size: 17px;
    }

    .supplier-search-result {
        font-size: 9px;
    }
}
/* Approval-level indicator shown beside the signed-in account. */
.approval-level-label{display:inline-block;margin-top:3px;font-size:11px;font-weight:700;letter-spacing:.02em;color:var(--secondary);background:var(--soft);border:1px solid var(--soft-border);border-radius:999px;padding:3px 8px}


/* Global five-second online toast notifications for all authenticated IMS users. */
.bfc-online-toast-container {
    position: fixed; right: 22px; bottom: 22px; z-index: 100500;
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
    width: min(360px, calc(100vw - 28px)); pointer-events: none;
}
.bfc-online-toast {
    position: relative; display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 76px; box-sizing: border-box;
    padding: 15px 18px 18px; overflow: hidden; background: #fff; color: #243326;
    border: 1px solid #d5e7d5; border-radius: 14px;
    box-shadow: 0 14px 38px rgba(24,49,27,.20);
    animation: bfcOnlineToastIn .28s cubic-bezier(.2,.8,.2,1) both;
}
.bfc-online-toast.is-leaving { animation: bfcOnlineToastOut .24s ease-in both; }
.bfc-online-toast-icon {
    display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px;
    border-radius: 12px; background: #e8f7ec; color: #16743a; font-size: 23px;
}
.bfc-online-toast-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.bfc-online-toast-copy strong { overflow-wrap: anywhere; color: #223b27; font-size: 14px; font-weight: 800; line-height: 1.35; }
.bfc-online-toast-copy small { color: #5c6e5f; font-size: 12px; line-height: 1.3; }
.bfc-online-toast-live { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #20a451; box-shadow: 0 0 0 4px rgba(32,164,81,.12); }
.bfc-online-toast-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: #20a451; transform-origin: left; animation: bfcOnlineToastProgress 5s linear forwards; }
@keyframes bfcOnlineToastIn { from { opacity: 0; transform: translate3d(18px,12px,0) scale(.98); } to { opacity: 1; transform: translate3d(0,0,0) scale(1); } }
@keyframes bfcOnlineToastOut { to { opacity: 0; transform: translate3d(12px,8px,0) scale(.98); } }
@keyframes bfcOnlineToastProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 520px) {
    .bfc-online-toast-container { right: 14px; bottom: 14px; width: calc(100vw - 28px); }
    .bfc-online-toast { min-height: 70px; padding: 13px 14px 16px; }
    .bfc-online-toast-icon { width: 38px; height: 38px; flex-basis: 38px; }
}
@media (prefers-reduced-motion: reduce) {
    .bfc-online-toast, .bfc-online-toast.is-leaving { animation: none; }
    .bfc-online-toast-progress { animation: none; transform: scaleX(0); }
}


/* =====================================================================
   EXACT COMPANY SWATCH THEME — GLOBAL APPLICATION UI
   Applies the supplied swatch as the visible company theme color rather
   than using it only as a minor accent. This is screen UI only; official
   BES/Quotation document templates keep their approved document palettes.
   ===================================================================== */
@media screen {
  body.brownfly, body.akinito, body.single {
    background-color: var(--bg) !important;
    color: var(--text) !important;
  }

  /* Sidebar, company switcher and navigation use the exact company swatch. */
  body.brownfly .sidebar, body.akinito .sidebar, body.single .sidebar {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
    border-right: 1px solid rgba(var(--primary-contrast-rgb), .18) !important;
    box-shadow: 8px 0 24px rgba(var(--primary-contrast-rgb), .12) !important;
  }
  body.brownfly .sidebar-header,
  body.akinito .sidebar-header,
  body.single .sidebar-header {
    background: transparent !important;
    border-bottom-color: rgba(var(--primary-contrast-rgb), .18) !important;
  }
  body.brownfly .sidebar-header h2,
  body.brownfly .sidebar-header p,
  body.brownfly .company-switcher label,
  body.brownfly .sidebar-menu li a,
  body.brownfly .sidebar-menu li a i,
  body.brownfly .sidebar-footer a,
  body.akinito .sidebar-header h2,
  body.akinito .sidebar-header p,
  body.akinito .company-switcher label,
  body.akinito .sidebar-menu li a,
  body.akinito .sidebar-menu li a i,
  body.akinito .sidebar-footer a,
  body.single .sidebar-header h2,
  body.single .sidebar-header p,
  body.single .company-switcher label,
  body.single .sidebar-menu li a,
  body.single .sidebar-menu li a i,
  body.single .sidebar-footer a {
    color: var(--primary-contrast) !important;
    opacity: 1;
  }
  body.brownfly .sidebar-menu li a:hover,
  body.brownfly .sidebar-menu li a.active,
  body.akinito .sidebar-menu li a:hover,
  body.akinito .sidebar-menu li a.active,
  body.single .sidebar-menu li a:hover,
  body.single .sidebar-menu li a.active {
    background: rgba(var(--primary-contrast-rgb), .09) !important;
    border-color: rgba(var(--primary-contrast-rgb), .18) !important;
    border-left-color: var(--secondary) !important;
    color: var(--primary-contrast) !important;
    box-shadow: none !important;
  }
  body.brownfly .sidebar-menu li a.active i,
  body.brownfly .sidebar-menu li a:hover i,
  body.akinito .sidebar-menu li a.active i,
  body.akinito .sidebar-menu li a:hover i,
  body.single .sidebar-menu li a.active i,
  body.single .sidebar-menu li a:hover i,
  body.brownfly .bes-sidebar-submenu a i,
  body.akinito .bes-sidebar-submenu a i,
  body.single .bes-sidebar-submenu a i {
    color: var(--secondary) !important;
  }
  body.brownfly .bes-sidebar-submenu a,
  body.akinito .bes-sidebar-submenu a,
  body.single .bes-sidebar-submenu a {
    color: var(--primary-contrast) !important;
  }
  body.brownfly .company-switcher select,
  body.akinito .company-switcher select,
  body.single .company-switcher select {
    color: var(--primary-contrast) !important;
    background: rgba(255,255,255,.62) !important;
    border: 1px solid rgba(var(--primary-contrast-rgb), .22) !important;
    box-shadow: none !important;
  }
  body.brownfly .company-switcher select option,
  body.akinito .company-switcher select option,
  body.single .company-switcher select option {
    color: var(--primary-contrast) !important;
    background: #fff !important;
  }
  body.brownfly .sidebar-footer a,
  body.akinito .sidebar-footer a,
  body.single .sidebar-footer a {
    border-color: rgba(var(--primary-contrast-rgb), .22) !important;
    background: rgba(255,255,255,.28) !important;
  }

  /* Header bars and primary action surfaces use the chosen swatch. */
  body.brownfly .table-card table thead th,
  body.brownfly .table-wrapper table thead th,
  body.brownfly .product-table thead th,
  body.brownfly .supplier-table thead th,
  body.brownfly .client-list-table thead th,
  body.brownfly .pr-log-table thead th,
  body.brownfly .pr-item-table thead th,
  body.brownfly .ps-table thead th,
  body.brownfly .um-table thead th,
  body.brownfly .currency-settings-table thead th,
  body.brownfly .stock-history-table thead th,
  body.brownfly .quote-table thead th,
  body.akinito .table-card table thead th,
  body.akinito .table-wrapper table thead th,
  body.akinito .product-table thead th,
  body.akinito .supplier-table thead th,
  body.akinito .client-list-table thead th,
  body.akinito .pr-log-table thead th,
  body.akinito .pr-item-table thead th,
  body.akinito .ps-table thead th,
  body.akinito .um-table thead th,
  body.akinito .currency-settings-table thead th,
  body.akinito .stock-history-table thead th,
  body.akinito .quote-table thead th,
  body.single .table-card table thead th,
  body.single .table-wrapper table thead th,
  body.single .product-table thead th,
  body.single .supplier-table thead th,
  body.single .client-list-table thead th,
  body.single .pr-log-table thead th,
  body.single .pr-item-table thead th,
  body.single .ps-table thead th,
  body.single .um-table thead th,
  body.single .currency-settings-table thead th,
  body.single .stock-history-table thead th,
  body.single .quote-table thead th {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
    border-color: rgba(var(--primary-contrast-rgb), .28) !important;
  }

  body.brownfly .btn-primary,
  body.brownfly .btn-add,
  body.brownfly .stock-submit,
  body.brownfly .btn-edit-product,
  body.brownfly .pr-btn-primary,
  body.brownfly .bes-btn-primary,
  body.brownfly .client-primary-btn,
  body.brownfly .um-btn-primary,
  body.brownfly .us-primary-button,
  body.brownfly .currency-save-btn,
  body.brownfly .login-btn,
  body.akinito .btn-primary,
  body.akinito .btn-add,
  body.akinito .stock-submit,
  body.akinito .btn-edit-product,
  body.akinito .pr-btn-primary,
  body.akinito .bes-btn-primary,
  body.akinito .client-primary-btn,
  body.akinito .um-btn-primary,
  body.akinito .us-primary-button,
  body.akinito .currency-save-btn,
  body.akinito .login-btn,
  body.single .btn-primary,
  body.single .btn-add,
  body.single .stock-submit,
  body.single .btn-edit-product,
  body.single .pr-btn-primary,
  body.single .bes-btn-primary,
  body.single .client-primary-btn,
  body.single .um-btn-primary,
  body.single .us-primary-button,
  body.single .currency-save-btn,
  body.single .login-btn {
    background: var(--primary) !important;
    background-image: none !important;
    border-color: rgba(var(--primary-contrast-rgb), .25) !important;
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
    box-shadow: 0 3px 9px rgba(var(--primary-contrast-rgb), .10) !important;
  }
  body.brownfly .btn-primary:hover, body.brownfly .btn-add:hover,
  body.brownfly .stock-submit:hover, body.brownfly .btn-edit-product:hover,
  body.brownfly .pr-btn-primary:hover, body.brownfly .bes-btn-primary:hover,
  body.akinito .btn-primary:hover, body.akinito .btn-add:hover,
  body.akinito .stock-submit:hover, body.akinito .btn-edit-product:hover,
  body.akinito .pr-btn-primary:hover, body.akinito .bes-btn-primary:hover,
  body.single .btn-primary:hover, body.single .btn-add:hover,
  body.single .stock-submit:hover, body.single .btn-edit-product:hover,
  body.single .pr-btn-primary:hover, body.single .bes-btn-primary:hover {
    filter: brightness(.96) !important;
    color: var(--primary-contrast) !important;
  }

  body.brownfly .pagination a.active, body.brownfly .pagination a:hover,
  body.akinito .pagination a.active, body.akinito .pagination a:hover,
  body.single .pagination a.active, body.single .pagination a:hover,
  body.brownfly .delivery-type-button.active,
  body.akinito .delivery-type-button.active,
  body.single .delivery-type-button.active,
  body.brownfly .sidebar-mobile-toggle,
  body.akinito .sidebar-mobile-toggle,
  body.single .sidebar-mobile-toggle {
    background: var(--primary) !important;
    border-color: rgba(var(--primary-contrast-rgb), .25) !important;
    color: var(--primary-contrast) !important;
  }
  body.brownfly .action-card:hover,
  body.akinito .action-card:hover,
  body.single .action-card:hover {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
  }

  /* Current company tint for selected cards, badges, icons and focus accents. */
  body.brownfly .dashboard-icon,
  body.brownfly .stock-in-card .card-icon,
  body.brownfly .stock-out-grid .stock-card-header > i,
  body.akinito .dashboard-icon,
  body.akinito .stock-in-card .card-icon,
  body.akinito .stock-out-grid .stock-card-header > i,
  body.single .dashboard-icon,
  body.single .stock-in-card .card-icon,
  body.single .stock-out-grid .stock-card-header > i {
    background: var(--soft) !important;
    color: var(--secondary) !important;
  }
  body.brownfly .profile-avatar,
  body.akinito .profile-avatar,
  body.single .profile-avatar {
    background: var(--soft) !important;
    color: var(--secondary) !important;
    border-color: var(--soft-border) !important;
  }
  body.brownfly :where(input, select, textarea):focus,
  body.akinito :where(input, select, textarea):focus,
  body.single :where(input, select, textarea):focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 3px rgba(var(--secondary-rgb), .17) !important;
  }
}


/* The login experience remains on its established green palette. */
body.login-page {
    --primary: #2E4A2E;
    --secondary: #4D7C2F;
    --accent: #D2B48C;
    --primary-rgb: 46, 74, 46;
    --secondary-rgb: 77, 124, 47;
    --accent-rgb: 210, 180, 140;
    --primary-contrast: #FFFFFF;
    --primary-contrast-rgb: 255, 255, 255;
}


/* ================================================================
   COMPANY SWATCH TEXT CONTRAST PATCH — 2026-11-12
   Keep the exact company swatches while making all text/icons readable.
   This patch is screen-only; official BES/Quotation print templates
   retain their approved document typography and color treatment.
   ================================================================ */
@media screen {
  body.brownfly:not(.login-page),
  body.akinito:not(.login-page),
  body.single:not(.login-page) {
    color: var(--text) !important;
  }

  /* Sidebar: the company swatches are light, so all navigation text is dark. */
  body.brownfly:not(.login-page) .sidebar,
  body.akinito:not(.login-page) .sidebar,
  body.single:not(.login-page) .sidebar {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
  }
  body.brownfly:not(.login-page) .sidebar :is(.sidebar-header, .sidebar-header h2, .sidebar-header p, .company-switcher label, .sidebar-menu a, .sidebar-menu a span, .sidebar-menu a i, .bes-sidebar-submenu a, .bes-sidebar-submenu a span, .bes-sidebar-submenu a i, .sidebar-footer a, .sidebar-footer a span, .sidebar-footer a i),
  body.akinito:not(.login-page) .sidebar :is(.sidebar-header, .sidebar-header h2, .sidebar-header p, .company-switcher label, .sidebar-menu a, .sidebar-menu a span, .sidebar-menu a i, .bes-sidebar-submenu a, .bes-sidebar-submenu a span, .bes-sidebar-submenu a i, .sidebar-footer a, .sidebar-footer a span, .sidebar-footer a i),
  body.single:not(.login-page) .sidebar :is(.sidebar-header, .sidebar-header h2, .sidebar-header p, .company-switcher label, .sidebar-menu a, .sidebar-menu a span, .sidebar-menu a i, .bes-sidebar-submenu a, .bes-sidebar-submenu a span, .bes-sidebar-submenu a i, .sidebar-footer a, .sidebar-footer a span, .sidebar-footer a i) {
    color: var(--primary-contrast) !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .sidebar-menu li a:hover,
  body.brownfly:not(.login-page) .sidebar-menu li a.active,
  body.brownfly:not(.login-page) .bes-sidebar-submenu a:hover,
  body.brownfly:not(.login-page) .bes-sidebar-submenu a.active,
  body.akinito:not(.login-page) .sidebar-menu li a:hover,
  body.akinito:not(.login-page) .sidebar-menu li a.active,
  body.akinito:not(.login-page) .bes-sidebar-submenu a:hover,
  body.akinito:not(.login-page) .bes-sidebar-submenu a.active,
  body.single:not(.login-page) .sidebar-menu li a:hover,
  body.single:not(.login-page) .sidebar-menu li a.active,
  body.single:not(.login-page) .bes-sidebar-submenu a:hover,
  body.single:not(.login-page) .bes-sidebar-submenu a.active {
    background: rgba(var(--primary-contrast-rgb), .10) !important;
    border-color: rgba(var(--primary-contrast-rgb), .18) !important;
    color: var(--primary-contrast) !important;
    box-shadow: none !important;
  }
  body.brownfly:not(.login-page) .company-switcher select,
  body.akinito:not(.login-page) .company-switcher select,
  body.single:not(.login-page) .company-switcher select {
    color: var(--primary-contrast) !important;
    background: rgba(255,255,255,.72) !important;
    border: 1px solid rgba(var(--primary-contrast-rgb), .28) !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .company-switcher select option,
  body.akinito:not(.login-page) .company-switcher select option,
  body.single:not(.login-page) .company-switcher select option {
    color: var(--primary-contrast) !important;
    background: #fff !important;
  }

  /* Every button that uses the light company swatch gets dark readable text. */
  body.brownfly:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active),
  body.akinito:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active),
  body.single:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active) {
    background: var(--primary) !important;
    background-image: none !important;
    border-color: rgba(var(--primary-contrast-rgb), .30) !important;
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active) *,
  body.akinito:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active) *,
  body.single:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active) * {
    color: inherit !important;
    text-shadow: none !important;
  }

  /* Text-only accents must be darker than the pale company swatch. */
  body.brownfly:not(.login-page) :is(.datetime h4, .table-header h3, .modal-header h3, .action-buttons .view, .btn-view, .badge-primary, .page-header h1, .page-title, .section-title),
  body.akinito:not(.login-page) :is(.datetime h4, .table-header h3, .modal-header h3, .action-buttons .view, .btn-view, .badge-primary, .page-header h1, .page-title, .section-title),
  body.single:not(.login-page) :is(.datetime h4, .table-header h3, .modal-header h3, .action-buttons .view, .btn-view, .badge-primary, .page-header h1, .page-title, .section-title) {
    color: var(--secondary) !important;
  }
  body.brownfly:not(.login-page) .table-header h3,
  body.akinito:not(.login-page) .table-header h3,
  body.single:not(.login-page) .table-header h3,
  body.brownfly:not(.login-page) .modal-header h3,
  body.akinito:not(.login-page) .modal-header h3,
  body.single:not(.login-page) .modal-header h3 {
    font-weight: 700 !important;
  }

  /* Dashboard banner used to place white text over the pale swatch. */
  body.brownfly:not(.login-page) .welcome-banner,
  body.akinito:not(.login-page) .welcome-banner,
  body.single:not(.login-page) .welcome-banner {
    background: linear-gradient(135deg, var(--soft), var(--primary)) !important;
    color: var(--primary-contrast) !important;
  }
  body.brownfly:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i),
  body.akinito:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i),
  body.single:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i) {
    color: var(--primary-contrast) !important;
    opacity: 1 !important;
  }

  /* Data table headings, toasts and small interactive labels. */
  body.brownfly:not(.login-page) :is(.table-card, .table-wrapper, .table-responsive, .log-table-wrap, .po-log-wrap) table thead th,
  body.akinito:not(.login-page) :is(.table-card, .table-wrapper, .table-responsive, .log-table-wrap, .po-log-wrap) table thead th,
  body.single:not(.login-page) :is(.table-card, .table-wrapper, .table-responsive, .log-table-wrap, .po-log-wrap) table thead th {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
    border-color: rgba(var(--primary-contrast-rgb), .32) !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .bfc-online-toast,
  body.akinito:not(.login-page) .bfc-online-toast,
  body.single:not(.login-page) .bfc-online-toast {
    color: var(--primary-contrast) !important;
  }
  body.brownfly:not(.login-page) .bfc-online-toast :is(h1,h2,h3,p,span,strong,small),
  body.akinito:not(.login-page) .bfc-online-toast :is(h1,h2,h3,p,span,strong,small),
  body.single:not(.login-page) .bfc-online-toast :is(h1,h2,h3,p,span,strong,small) {
    color: var(--primary-contrast) !important;
  }

  /* Topbar text remains dark on its white surface. */
  body.brownfly:not(.login-page) .topbar,
  body.akinito:not(.login-page) .topbar,
  body.single:not(.login-page) .topbar { color: var(--heading) !important; }
  body.brownfly:not(.login-page) .topbar :is(.profile-name,.profile-info,.datetime h4,.topbar-title),
  body.akinito:not(.login-page) .topbar :is(.profile-name,.profile-info,.datetime h4,.topbar-title),
  body.single:not(.login-page) .topbar :is(.profile-name,.profile-info,.datetime h4,.topbar-title) {
    color: var(--heading) !important;
  }
}


/* Final readability overrides for light company swatches. Exact brand
   backgrounds stay #FFCCFF / #A8D08D / #FFFF00; text is dark enough to read. */
@media screen {
  body.brownfly:not(.login-page),
  body.akinito:not(.login-page),
  body.single:not(.login-page) { color: var(--text) !important; }

  /* Navigation and company switcher: defeat white text inherited from the old dark sidebar. */
  body.brownfly:not(.login-page) .sidebar .sidebar-menu li > a,
  body.brownfly:not(.login-page) .sidebar .sidebar-menu li > a :is(span,i),
  body.brownfly:not(.login-page) .sidebar .bes-sidebar-submenu > a,
  body.brownfly:not(.login-page) .sidebar .bes-sidebar-submenu > a :is(span,i),
  body.brownfly:not(.login-page) .sidebar .company-switcher label,
  body.brownfly:not(.login-page) .sidebar .sidebar-header :is(h1,h2,h3,p),
  body.akinito:not(.login-page) .sidebar .sidebar-menu li > a,
  body.akinito:not(.login-page) .sidebar .sidebar-menu li > a :is(span,i),
  body.akinito:not(.login-page) .sidebar .bes-sidebar-submenu > a,
  body.akinito:not(.login-page) .sidebar .bes-sidebar-submenu > a :is(span,i),
  body.akinito:not(.login-page) .sidebar .company-switcher label,
  body.akinito:not(.login-page) .sidebar .sidebar-header :is(h1,h2,h3,p),
  body.single:not(.login-page) .sidebar .sidebar-menu li > a,
  body.single:not(.login-page) .sidebar .sidebar-menu li > a :is(span,i),
  body.single:not(.login-page) .sidebar .bes-sidebar-submenu > a,
  body.single:not(.login-page) .sidebar .bes-sidebar-submenu > a :is(span,i),
  body.single:not(.login-page) .sidebar .company-switcher label,
  body.single:not(.login-page) .sidebar .sidebar-header :is(h1,h2,h3,p) {
    color: var(--primary-contrast) !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .sidebar .sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.brownfly:not(.login-page) .sidebar .sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.akinito:not(.login-page) .sidebar .sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.akinito:not(.login-page) .sidebar .sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.single:not(.login-page) .sidebar .sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.single:not(.login-page) .sidebar .sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a.active {
    color: var(--primary-contrast) !important;
    background: rgba(var(--primary-contrast-rgb), .13) !important;
    border-color: rgba(var(--primary-contrast-rgb), .22) !important;
  }
  body.brownfly:not(.login-page) .company-switcher select,
  body.akinito:not(.login-page) .company-switcher select,
  body.single:not(.login-page) .company-switcher select {
    color: var(--primary-contrast) !important;
    background: rgba(255,255,255,.82) !important;
    border-color: rgba(var(--primary-contrast-rgb),.28) !important;
  }
  body.brownfly:not(.login-page) .company-switcher select option,
  body.akinito:not(.login-page) .company-switcher select option,
  body.single:not(.login-page) .company-switcher select option {
    background: #fff !important; color: #222 !important;
  }

  /* Primary colored controls use the correct dark ink, including child icons/text. */
  body.brownfly:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active),
  body.akinito:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active),
  body.single:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) {
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) *,
  body.akinito:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) *,
  body.single:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) * {
    color: inherit !important; text-shadow: none !important;
  }

  /* These accent labels were using the pastel swatch itself as text on white. */
  body.brownfly:not(.login-page) :is(.datetime h4,.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.table-header h3,.modal-header h3,.category-info h3,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.action-buttons .view,.btn-view,.badge-primary,.product-table .product-uom,.product-table .product-price),
  body.akinito:not(.login-page) :is(.datetime h4,.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.table-header h3,.modal-header h3,.category-info h3,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.action-buttons .view,.btn-view,.badge-primary,.product-table .product-uom,.product-table .product-price),
  body.single:not(.login-page) :is(.datetime h4,.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.table-header h3,.modal-header h3,.category-info h3,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.action-buttons .view,.btn-view,.badge-primary,.product-table .product-uom,.product-table .product-price) {
    color: var(--secondary) !important;
  }

  /* Main data-grid headers: dark text on the official light company swatch. */
  body.brownfly:not(.login-page) :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap) table thead th,
  body.akinito:not(.login-page) :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap) table thead th,
  body.single:not(.login-page) :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap) table thead th {
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
  }

  /* Dashboard banner uses a light tint so its text never disappears on the swatch. */
  body.brownfly:not(.login-page) .welcome-banner,
  body.akinito:not(.login-page) .welcome-banner,
  body.single:not(.login-page) .welcome-banner {
    background: linear-gradient(135deg,var(--soft),var(--primary)) !important;
    color: var(--primary-contrast) !important;
  }
  body.brownfly:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i),
  body.akinito:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i),
  body.single:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i) {
    color: var(--primary-contrast) !important; opacity: 1 !important;
  }

  /* Toast copy and topbar text. */
  body.brownfly:not(.login-page) .bfc-online-toast,
  body.akinito:not(.login-page) .bfc-online-toast,
  body.single:not(.login-page) .bfc-online-toast { color: var(--primary-contrast) !important; }
  body.brownfly:not(.login-page) .topbar,
  body.akinito:not(.login-page) .topbar,
  body.single:not(.login-page) .topbar { color: var(--heading) !important; }
}


/* Explicit operational table header text override. Kept separate from
   document preview classes so BES and Quotation print sheets are untouched. */
@media screen {
  body.brownfly:not(.login-page) .table-card table thead th,
  body.brownfly:not(.login-page) .table-wrapper table thead th,
  body.brownfly:not(.login-page) .table-responsive table thead th,
  body.brownfly:not(.login-page) .product-table thead th,
  body.brownfly:not(.login-page) .supplier-table thead th,
  body.brownfly:not(.login-page) .client-list-table thead th,
  body.brownfly:not(.login-page) .pr-log-table thead th,
  body.brownfly:not(.login-page) .pr-item-table thead th,
  body.brownfly:not(.login-page) .ps-table thead th,
  body.brownfly:not(.login-page) .um-table thead th,
  body.brownfly:not(.login-page) .currency-settings-table thead th,
  body.brownfly:not(.login-page) .stock-history-table thead th,
  body.brownfly:not(.login-page) .quote-table thead th,
  body.brownfly:not(.login-page) .po-log-table thead th,
  body.akinito:not(.login-page) .table-card table thead th,
  body.akinito:not(.login-page) .table-wrapper table thead th,
  body.akinito:not(.login-page) .table-responsive table thead th,
  body.akinito:not(.login-page) .product-table thead th,
  body.akinito:not(.login-page) .supplier-table thead th,
  body.akinito:not(.login-page) .client-list-table thead th,
  body.akinito:not(.login-page) .pr-log-table thead th,
  body.akinito:not(.login-page) .pr-item-table thead th,
  body.akinito:not(.login-page) .ps-table thead th,
  body.akinito:not(.login-page) .um-table thead th,
  body.akinito:not(.login-page) .currency-settings-table thead th,
  body.akinito:not(.login-page) .stock-history-table thead th,
  body.akinito:not(.login-page) .quote-table thead th,
  body.akinito:not(.login-page) .po-log-table thead th,
  body.single:not(.login-page) .table-card table thead th,
  body.single:not(.login-page) .table-wrapper table thead th,
  body.single:not(.login-page) .table-responsive table thead th,
  body.single:not(.login-page) .product-table thead th,
  body.single:not(.login-page) .supplier-table thead th,
  body.single:not(.login-page) .client-list-table thead th,
  body.single:not(.login-page) .pr-log-table thead th,
  body.single:not(.login-page) .pr-item-table thead th,
  body.single:not(.login-page) .ps-table thead th,
  body.single:not(.login-page) .um-table thead th,
  body.single:not(.login-page) .currency-settings-table thead th,
  body.single:not(.login-page) .stock-history-table thead th,
  body.single:not(.login-page) .quote-table thead th,
  body.single:not(.login-page) .po-log-table thead th {
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
  }
}
