/* Vouchly design system
   Fresh visual layer for the Vouchly admin system.
   Theme: Industrial Precision. Graphite dark surfaces, a single
   copper accent and soft grey neutrals, with Space Mono for
   headings, figures and labels and Inter for body text, both
   self hosted locally.
   Brand surfaces (the login brand panel, the brand tile and the
   landing hero) use the Copper Glow gradient: an SVG noise overlay
   layered over copper settling into deep graphite, grainy and
   textured, never smooth. Every other surface is flat.
   This file is self contained: it provides the grid, the layout
   skeleton and every shared component style the admin views use,
   so no legacy theme stylesheet is required. */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Space Mono";
    src: url("../fonts/space-mono-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Space Mono";
    src: url("../fonts/space-mono-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --vx-graphite-950: #1e2023;
    --vx-graphite-900: #2a2d30;
    --vx-primary: #b26a30;
    --vx-primary-hover: #95571f;
    --vx-accent: #c97e3d;
    --vx-accent-dark: #95571f;
    --vx-copper-bg: #f8efe3;
    --vx-copper-border: #ecd7ba;
    --vx-ink: #232629;
    --vx-body: #41464d;
    --vx-muted: #6f767f;
    --vx-faint: #6f767f;
    --vx-bg: #f3f2f0;
    --vx-surface: #ffffff;
    --vx-border: #e2e0dc;
    --vx-border-strong: #c9c6c1;
    --vx-danger: #95571f;
    --vx-danger-bg: #f8efe3;
    --vx-warning: #c97e3d;
    --vx-warning-bg: #f8efe3;
    --vx-success: #41464d;
    --vx-success-dark: #2a2d30;
    --vx-success-bg: #f3f2f0;
    --vx-info: #41464d;
    --vx-info-bg: #f3f2f0;
    --vx-radius: 12px;
    --vx-radius-sm: 8px;
    --vx-topbar-h: 48px;
    --vx-rail-w: 208px;
    --vx-rail-mini: 56px;
    --vx-shadow: 0 1px 3px rgba(30, 32, 35, 0.06), 0 8px 24px -12px rgba(30, 32, 35, 0.12);
    --vx-font: "Inter", system-ui, "Segoe UI", Arial, sans-serif;
    --vx-font-display: "Space Mono", "Courier New", monospace;
    /* Grainy brand surface: SVG feTurbulence noise layered over the
       Copper Glow gradient, copper settling into deep graphite.
       Used only on brand surfaces. */
    --vx-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.38'/%3E%3C/svg%3E");
    --vx-brand-gradient: linear-gradient(150deg, #b26a30 0%, #7a4a20 45%, #222426 100%);
    --vx-brand-bg: var(--vx-grain), var(--vx-brand-gradient);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--vx-font);
    font-size: 13px;
    line-height: 1.45;
    color: var(--vx-body);
    background: var(--vx-bg);
}

a { color: var(--vx-primary); text-decoration: none; }
a:hover, a:focus { color: var(--vx-primary-hover); text-decoration: none; }

h1, h2, h3, h4, h5, h6 { color: var(--vx-ink); font-family: var(--vx-font-display); font-weight: 700; margin: 0 0 8px; }
small { color: var(--vx-muted); }

img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.hidden { display: none !important; }
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-capitalize { text-transform: capitalize; }
.text-danger { color: var(--vx-danger) !important; }
.text-success { color: var(--vx-success) !important; }
.text-muted { color: var(--vx-muted) !important; }
.clearfix::after { content: ""; display: table; clear: both; }

/* Grid subset, compatible with the column classes the views use */
.row { display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; }
[class*="col-"] { position: relative; width: 100%; padding-left: 8px; padding-right: 8px; }
.col-xs-1 { width: 8.333%; } .col-xs-2 { width: 16.666%; } .col-xs-3 { width: 25%; }
.col-xs-4 { width: 33.333%; } .col-xs-5 { width: 41.666%; } .col-xs-6 { width: 50%; }
.col-xs-7 { width: 58.333%; } .col-xs-8 { width: 66.666%; } .col-xs-9 { width: 75%; }
.col-xs-10 { width: 83.333%; } .col-xs-11 { width: 91.666%; } .col-xs-12 { width: 100%; }
@media (min-width: 768px) {
    .col-sm-1 { width: 8.333%; } .col-sm-2 { width: 16.666%; } .col-sm-3 { width: 25%; }
    .col-sm-4 { width: 33.333%; } .col-sm-5 { width: 41.666%; } .col-sm-6 { width: 50%; }
    .col-sm-7 { width: 58.333%; } .col-sm-8 { width: 66.666%; } .col-sm-9 { width: 75%; }
    .col-sm-10 { width: 83.333%; } .col-sm-11 { width: 91.666%; } .col-sm-12 { width: 100%; }
}
@media (min-width: 992px) {
    .col-md-1 { width: 8.333%; } .col-md-2 { width: 16.666%; } .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.333%; } .col-md-5 { width: 41.666%; } .col-md-6 { width: 50%; }
    .col-md-7 { width: 58.333%; } .col-md-8 { width: 66.666%; } .col-md-9 { width: 75%; }
    .col-md-10 { width: 83.333%; } .col-md-11 { width: 91.666%; } .col-md-12 { width: 100%; }
    .col-md-offset-1 { margin-left: 8.333%; } .col-md-offset-2 { margin-left: 16.666%; }
    .col-md-offset-3 { margin-left: 25%; } .col-md-offset-4 { margin-left: 33.333%; }
}
@media (min-width: 1200px) {
    .col-lg-1 { width: 8.333%; } .col-lg-2 { width: 16.666%; } .col-lg-3 { width: 25%; }
    .col-lg-4 { width: 33.333%; } .col-lg-5 { width: 41.666%; } .col-lg-6 { width: 50%; }
    .col-lg-7 { width: 58.333%; } .col-lg-8 { width: 66.666%; } .col-lg-9 { width: 75%; }
    .col-lg-10 { width: 83.333%; } .col-lg-11 { width: 91.666%; } .col-lg-12 { width: 100%; }
}
.container, .container-fluid { width: 100%; padding-left: 12px; padding-right: 12px; margin-left: auto; margin-right: auto; }

/* App skeleton: slim top bar, left module rail, content, footer */
body.vx-app { padding-top: var(--vx-topbar-h); }

.vx-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
    height: var(--vx-topbar-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 12px;
    background: var(--vx-surface);
    border-bottom: 1px solid var(--vx-border);
    box-shadow: 0 1px 0 rgba(30, 32, 35, 0.02);
}
.vx-topbar .sidebar-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 32px; height: 32px; padding: 6px; border-radius: 8px; cursor: pointer;
}
.vx-topbar .sidebar-toggle:hover { background: var(--vx-copper-bg); }
.vx-topbar .sidebar-toggle .icon-bar { display: block; height: 2px; border-radius: 2px; background: var(--vx-graphite-900); }
.vx-topbar .sidebar-toggle .mobile-sidebar-icon { display: none; }

.vx-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vx-brand-mark {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 8px;
    background-color: var(--vx-graphite-950);
    background-image: var(--vx-brand-bg);
    background-size: 180px 180px, cover;
    color: #ffffff; display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--vx-font-display);
    font-size: 16px; font-weight: 700; letter-spacing: -0.5px;
}
.vx-brand-name { font-family: var(--vx-font-display); font-size: 16px; font-weight: 700; color: var(--vx-graphite-950); letter-spacing: -0.3px; white-space: nowrap; }

.vx-topbar-spacer { flex: 1 1 auto; }

/* Branch switcher pill in the top bar */
.header-firm-branch-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.header-branch-select-shell { position: relative; display: inline-block; }
.header-branch-current { display: none !important; }
.header-branch-select-shell select.form-control {
    appearance: none; -webkit-appearance: none;
    height: 32px; max-width: 240px; padding: 0 28px 0 8px;
    border: 1px solid var(--vx-border); border-radius: 8px;
    background: #f8efe3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23b26a30' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 11px center;
    color: var(--vx-graphite-950); font-weight: 600; font-size: 13px; cursor: pointer;
}
.header-branch-pin {
    width: 28px; height: 28px; border: 1px solid var(--vx-border); border-radius: 8px;
    background: #ffffff; color: var(--vx-faint); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.header-branch-pin.is-pinned { color: var(--vx-accent-dark); border-color: var(--vx-accent); background: var(--vx-copper-bg); }
.mobile-header-branch { display: none; }

/* Top bar search */
.header-search-slot { position: relative; flex: 0 1 520px; }
.header-search-box { position: relative; }
.header-search-box .header-search-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--vx-faint); font-size: 13px;
}
#sidebarTopSearch {
    width: 100%; height: 32px; padding: 0 12px 0 32px;
    border: 1px solid var(--vx-border); border-radius: 12px; background: #f3f2f0;
    font-family: var(--vx-font); font-size: 13px; color: var(--vx-ink); outline: none;
}
#sidebarTopSearch:focus { background: #ffffff; border-color: var(--vx-primary); outline: 2px solid rgba(178, 106, 48, 0.35); }
.sidebar-search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 1040;
    background: #ffffff; border: 1px solid var(--vx-border); border-radius: var(--vx-radius);
    box-shadow: var(--vx-shadow); max-height: 380px; overflow: auto; display: none;
}
.sidebar-search-results:empty { display: none !important; }
.sidebar-search-results a { display: block; padding: 8px 16px; color: var(--vx-body); font-size: 13.5px; }
.sidebar-search-results a:hover { background: var(--vx-copper-bg); color: var(--vx-graphite-950); }

/* Top bar user area */
.vx-user-area { display: flex; align-items: center; gap: 8px; }
.vouchly-pwa-install {
    border: 0; background: transparent; color: var(--vx-muted); padding: 8px; font-size: 15px; cursor: pointer; border-radius: 8px;
}
.vouchly-pwa-install:hover { background: var(--vx-copper-bg); color: var(--vx-primary); }

.navbar-custom-menu .nav { list-style: none; margin: 0; padding: 0; }
.navbar-custom-menu .dropdown { position: relative; }
.header-user-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 12px; }
.header-user-trigger:hover { background: #f3f2f0; }
.header-role-chip {
    background: var(--vx-copper-bg); color: var(--vx-accent-dark); border: 1px solid var(--vx-copper-border);
    font-family: var(--vx-font-display);
    font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 999px; white-space: nowrap;
}
.header-small-logo, .header-large-logo { height: 30px; width: 30px; object-fit: contain; border-radius: 8px; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 1050;
    background: #ffffff; border: 1px solid var(--vx-border); border-radius: var(--vx-radius);
    box-shadow: var(--vx-shadow); padding: 8px; list-style: none; margin: 0; display: none;
}
.open > .dropdown-menu, .dropdown.open .dropdown-menu { display: block; }
.dropdown-menu > li > a { display: block; padding: 8px 12px; color: var(--vx-body); border-radius: var(--vx-radius-sm); font-size: 13.5px; }
.dropdown-menu > li > a:hover { background: var(--vx-copper-bg); color: var(--vx-graphite-950); }
.dropdown-menu .divider { height: 1px; background: var(--vx-border); margin: 8px 4px; }
.sstopuser { padding: 8px 12px; }
.sstopuser .ssuserleft { float: left; margin-right: 12px; }
.sstopuser .ssuserleft img { width: 40px; height: 40px; border-radius: 999px; object-fit: cover; }
.sstopuser h4 { margin: 4px 0 0; font-size: 15px; }
.sstopuser h5 { margin: 0; font-size: 12px; color: var(--vx-muted); font-weight: 500; }
.sspass { clear: both; padding-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.sspass a { padding: 8px 12px; border: 1px solid var(--vx-border); border-radius: 8px; font-size: 12.5px; color: var(--vx-body); }
.sspass a:hover { border-color: var(--vx-primary); color: var(--vx-primary); }

/* Left module rail */
.vx-rail {
    position: fixed; top: var(--vx-topbar-h); left: 0; bottom: 0; z-index: 1020;
    width: var(--vx-rail-w);
    background: var(--vx-graphite-950);
    color: #c9c6c1; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.vx-rail::-webkit-scrollbar { width: 5px; }
.vx-rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 4px; }
.vx-rail .sidebar { padding: 8px 8px 12px; }
.vx-rail-caption {
    font-family: var(--vx-font-display);
    font-size: 11px; font-weight: 700;
    color: rgba(201, 198, 193, 0.55); padding: 8px 8px 4px;
}
.sidebar-menu { list-style: none; margin: 0; padding: 0; }
.sidebar-menu > li { margin: 2px 0; }
.sidebar-menu li > a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 8px;
    font-family: var(--vx-font-display);
    color: #c9c6c1; font-size: 13.5px; font-weight: 400; position: relative;
}
.sidebar-menu li > a:hover { background: rgba(255, 255, 255, 0.09); color: #ffffff; }
.sidebar-menu li.active > a { background: rgba(255, 255, 255, 0.13); color: #ffffff; }
.sidebar-menu > li.active > a::before {
    content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3.5px;
    border-radius: 0 4px 4px 0; background: var(--vx-accent);
}
.sidebar-menu .menu-icon-colorful {
    flex: 0 0 auto; width: 24px; height: 24px; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.12); border-radius: 8px; font-size: 13px;
}
.sidebar-menu .submenu-link-icon { width: 18px; text-align: center; font-size: 12px; flex: 0 0 auto; }
.sidebar-menu li > a > .pull-right { margin-left: auto; float: none !important; font-size: 12px; opacity: 0.7; }
.sidebar-menu li.active > a > .pull-right, .sidebar-menu li.menu-open > a > .pull-right { transform: rotate(-90deg); }
.treeview-menu { list-style: none; margin: 2px 0 4px; padding: 2px 0 2px 8px; display: none; }
li.active > .treeview-menu, li.menu-open > .treeview-menu { display: block; }
.treeview-menu > li > a { padding: 5px 8px; font-size: 12.5px; color: #c9c6c1; border-radius: 8px; }
.treeview-menu > li > a:hover { color: #ffffff; }
.treeview-menu > li.active > a { color: #ffffff; background: rgba(201, 126, 61, 0.28); }
.treeview-menu .treeview-menu { padding-left: 16px; }
.vx-rail-plan {
    margin: 12px 4px 4px; padding: 8px; border-radius: var(--vx-radius);
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); color: #e2e0dc;
}
.vx-rail-plan strong { display: block; color: #ffffff; font-size: 13px; }
.vx-rail-plan span { font-size: 12px; color: #c9c6c1; }
.vx-rail-plan a { display: inline-block; margin-top: 8px; color: #c97e3d; font-weight: 600; font-size: 12.5px; }

body.sidebar-collapse .vx-rail { width: var(--vx-rail-mini); }
body.sidebar-collapse .vx-rail .sidebar-menu li > a span,
body.sidebar-collapse .vx-rail .sidebar-menu li > a > .pull-right,
body.sidebar-collapse .vx-rail-caption,
body.sidebar-collapse .vx-rail-plan { display: none; }
body.sidebar-collapse .vx-rail .treeview-menu { display: none !important; }

.main-sidebar-backdrop {
    position: fixed; inset: 0; top: var(--vx-topbar-h); background: rgba(30, 32, 35, 0.45);
    z-index: 1015; opacity: 0; pointer-events: none;
}
body.sidebar-open .main-sidebar-backdrop { opacity: 1; pointer-events: auto; }
.control-sidebar-bg { display: none; }

/* Content area */
.content-wrapper { margin-left: var(--vx-rail-w); min-height: calc(100vh - var(--vx-topbar-h)); background: var(--vx-bg); }
body.sidebar-collapse .content-wrapper, body.sidebar-collapse .main-footer { margin-left: var(--vx-rail-mini); }
.content-header { padding: 12px 16px 0; }
.content-header h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.content-header h1 .fa { color: var(--vx-primary); }
.content-header h1 small { font-size: 13px; font-weight: 500; }
.content-header .breadcrumb { background: transparent; padding: 4px 0 0; margin: 0; font-size: 12px; list-style: none; display: flex; gap: 8px; }
.content { padding: 12px 16px 20px; }
.main-footer {
    margin-left: var(--vx-rail-w); padding: 10px 16px; background: var(--vx-surface);
    border-top: 1px solid var(--vx-border); color: var(--vx-muted); font-size: 12px;
}
.main-footer strong { color: var(--vx-graphite-900); }

/* Cards and boxes */
.box {
    background: var(--vx-surface); border: 1px solid var(--vx-border);
    border-radius: var(--vx-radius); box-shadow: var(--vx-shadow);
    margin-bottom: 12px; overflow: hidden;
}
.box-header { padding: 10px 12px; border-bottom: 1px solid var(--vx-border); display: flex; align-items: center; gap: 12px; }
.box-header.with-border { border-bottom: 1px solid var(--vx-border); }
.box-title { font-family: var(--vx-font-display); font-size: 14px; font-weight: 700; margin: 0; color: var(--vx-ink); }
.box-body { padding: 12px; }
.box-footer { padding: 8px 12px; border-top: 1px solid var(--vx-border); background: #f8efe3; }
.box-tools { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
.box.box-primary, .box.box-info, .box.box-success, .box.box-danger, .box.box-warning { border-top: 3px solid var(--vx-primary); }
.box.box-success { border-top-color: var(--vx-success); }
.box.box-danger { border-top-color: var(--vx-danger); }
.box.box-warning { border-top-color: var(--vx-warning); }
.box.box-info { border-top-color: var(--vx-info); }
.box-solid { box-shadow: none; }

.small-box {
    border-radius: var(--vx-radius); color: #ffffff; padding: 12px; margin-bottom: 12px;
    position: relative; overflow: hidden; box-shadow: var(--vx-shadow); background: var(--vx-primary);
}
.small-box h3 { color: #ffffff; font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.small-box p { margin: 0; color: rgba(255, 255, 255, 0.85); }
.small-box .icon { display: none; }
.small-box .small-box-footer { display: block; margin-top: 8px; color: #ffffff; font-weight: 600; font-size: 13px; }
.small-box.bg-aqua, .small-box.bg-light-blue { background: var(--vx-info); }
.small-box.bg-green { background: var(--vx-success-dark); }
.small-box.bg-yellow { background: var(--vx-warning); }
.small-box.bg-red { background: var(--vx-danger); }
.small-box.bg-navy, .small-box.bg-purple { background: var(--vx-graphite-900); }
.info-box { display: flex; gap: 12px; background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius); box-shadow: var(--vx-shadow); padding: 12px; margin-bottom: 12px; }
.info-box-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--vx-radius); background: var(--vx-copper-bg); color: var(--vx-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.info-box-number { font-family: var(--vx-font-display); font-size: 17px; font-weight: 700; color: var(--vx-ink); }
.info-box-text { color: var(--vx-muted); font-size: 12.5px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--vx-font); font-size: 13px; font-weight: 600; line-height: 1.35;
    padding: 6px 12px; border-radius: 8px; border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap; vertical-align: middle;
}
.btn:focus { outline: 2px solid rgba(178, 106, 48, 0.45); outline-offset: 1px; }
.btn-primary { background: var(--vx-primary); border-color: var(--vx-primary); color: #ffffff; }
.btn-primary:hover, .btn-primary:focus { background: var(--vx-primary-hover); border-color: var(--vx-primary-hover); color: #ffffff; }
.btn-success { background: var(--vx-success); border-color: var(--vx-success); color: #ffffff; }
.btn-success:hover, .btn-success:focus { background: var(--vx-success-dark); border-color: var(--vx-success-dark); color: #ffffff; }
.btn-danger { background: var(--vx-danger); border-color: var(--vx-danger); color: #ffffff; }
.btn-danger:hover { background: #95571f; color: #ffffff; }
.btn-warning { background: #b26a30; border-color: #b26a30; color: #ffffff; }
.btn-warning:hover { background: var(--vx-warning); color: #ffffff; }
.btn-info { background: var(--vx-info); border-color: var(--vx-info); color: #ffffff; }
.btn-info:hover { background: #41464d; color: #ffffff; }
.btn-default { background: #ffffff; border-color: var(--vx-border-strong); color: var(--vx-body); }
.btn-default:hover { border-color: var(--vx-primary); color: var(--vx-primary); }
.btn-link { background: transparent; border-color: transparent; color: var(--vx-primary); box-shadow: none; }
.btn-sm { padding: 4px 8px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 2px 6px; font-size: 11.5px; border-radius: 8px; }
.btn-lg { padding: 8px 16px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn.disabled, .btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }

/* Forms */
.form-group { margin-bottom: 10px; }
label { display: inline-block; margin-bottom: 4px; font-weight: 600; font-size: 12.5px; color: var(--vx-ink); }
.control-label { padding-top: 6px; }
.form-control {
    display: block; width: 100%; height: 32px; padding: 4px 8px;
    font-family: var(--vx-font); font-size: 13px; color: var(--vx-ink);
    background: #ffffff; border: 1px solid var(--vx-border-strong); border-radius: 8px;
    outline: none;
}
textarea.form-control { height: auto; min-height: 64px; }
select.form-control { cursor: pointer; }
.form-control:focus { border-color: var(--vx-primary); outline: 2px solid rgba(178, 106, 48, 0.35); outline-offset: 0; }
.form-control.input-sm { height: 28px; padding: 2px 6px; font-size: 12.5px; border-radius: 8px; }
.form-control[disabled], .form-control[readonly] { background: #f3f2f0; color: var(--vx-muted); }
.has-feedback { position: relative; }
.has-feedback .form-control { padding-right: 32px; }
.form-control-feedback { position: absolute; right: 8px; top: 0; height: 32px; line-height: 32px; color: var(--vx-faint); pointer-events: none; }
.help-block { display: block; margin-top: 4px; font-size: 12.5px; color: var(--vx-muted); }
.has-error .form-control { border-color: var(--vx-danger); }
.has-error .help-block, .has-error label { color: var(--vx-danger); }
.input-group { display: flex; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group-addon { display: inline-flex; align-items: center; padding: 0 12px; background: #f3f2f0; border: 1px solid var(--vx-border-strong); border-left: 0; border-radius: 0 8px 8px 0; color: var(--vx-muted); font-size: 13px; }
.input-group-btn .btn { border-radius: 0 8px 8px 0; }
.checkbox, .radio { display: block; margin: 8px 0; }
.checkbox label, .radio label { font-weight: 500; color: var(--vx-body); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--vx-primary); width: 15px; height: 15px; vertical-align: -2px; margin-right: 8px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; margin-bottom: 12px; background: #ffffff; font-size: 13px; }
.table > thead > tr > th {
    text-align: left; font-family: var(--vx-font-display); font-size: 12px; font-weight: 700;
    color: var(--vx-muted); background: #f3f2f0; border-bottom: 2px solid var(--vx-border);
    padding: 6px 8px; vertical-align: middle;
}
.table > tbody > tr > td, .table > tfoot > tr > td { padding: 6px 8px; border-bottom: 1px solid var(--vx-border); vertical-align: middle; color: var(--vx-body); }
.table-striped > tbody > tr:nth-child(even) { background: #f8efe3; }
.table-hover > tbody > tr:hover { background: var(--vx-copper-bg); }
.table-bordered, .table-bordered > thead > tr > th, .table-bordered > tbody > tr > td { border: 1px solid var(--vx-border); }
.table-responsive { overflow-x: auto; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--vx-border-strong); border-radius: 8px; padding: 8px 12px; font-family: var(--vx-font);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important; border: 1px solid transparent !important; color: var(--vx-body) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--vx-primary) !important; color: #ffffff !important; border-color: var(--vx-primary) !important;
}

/* Alerts, labels, badges, tabs, pagination */
.alert { padding: 8px 12px; border-radius: var(--vx-radius); border: 1px solid; margin-bottom: 12px; font-size: 13px; }
.alert-success { background: var(--vx-success-bg); border-color: #c9c6c1; color: #2a2d30; }
.alert-danger, .alert-error { background: var(--vx-danger-bg); border-color: #f8efe3; color: #95571f; }
.alert-warning { background: var(--vx-warning-bg); border-color: #c9c6c1; color: #95571f; }
.alert-info { background: var(--vx-info-bg); border-color: #c9c6c1; color: #41464d; }
.alert .close { float: right; background: none; border: 0; font-size: 17px; cursor: pointer; color: inherit; opacity: 0.6; }
.label, .badge {
    display: inline-block; padding: 2px 6px; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 1.5; color: #ffffff; background: var(--vx-faint);
}
.label-primary, .badge-primary { background: var(--vx-primary); }
.label-success, .badge-success { background: var(--vx-success-dark); }
.label-danger, .badge-danger { background: var(--vx-danger); }
.label-warning, .badge-warning { background: var(--vx-warning); }
.label-info, .badge-info { background: var(--vx-info); }
.label-default, .badge-default { background: #e2e0dc; color: var(--vx-body); }
.nav-tabs { display: flex; gap: 4px; list-style: none; margin: 0 0 12px; padding: 0; border-bottom: 2px solid var(--vx-border); flex-wrap: wrap; }
.nav-tabs > li > a { display: block; padding: 6px 12px; font-weight: 600; font-size: 13px; color: var(--vx-muted); border-radius: 8px 8px 0 0; margin-bottom: 0px; }
.nav-tabs > li > a:hover { color: var(--vx-primary); }
.nav-tabs > li.active > a { color: var(--vx-primary); border-bottom: 2px solid var(--vx-primary); }
.pagination { display: inline-flex; list-style: none; gap: 4px; margin: 8px 0; padding: 0; flex-wrap: wrap; }
.pagination > li > a, .pagination > li > span {
    display: inline-flex; min-width: 28px; height: 28px; align-items: center; justify-content: center;
    padding: 0 8px; border: 1px solid var(--vx-border); border-radius: 8px; background: #ffffff; color: var(--vx-body); font-size: 13px;
}
.pagination > li.active > a, .pagination > li.active > span { background: var(--vx-primary); border-color: var(--vx-primary); color: #ffffff; }
.progress { height: 8px; background: #e2e0dc; border-radius: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--vx-accent); }
.callout { border-left: 4px solid var(--vx-primary); background: var(--vx-copper-bg); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
/* Modal base state: hidden on load, shown only in the open state.
   This replaces the base rule the old Bootstrap stylesheet used to provide;
   without it every modal, including the dashboard Quick Add panel, renders open. */
.modal { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal.in, .modal.show, .modal.vx-qa-open { display: block; }
.modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background: rgba(35, 38, 41, .24); }
.modal-content { border-radius: 12px; border: 1px solid var(--vx-border); box-shadow: var(--vx-shadow); overflow: hidden; }
.modal-header { padding: 10px 12px; border-bottom: 1px solid var(--vx-border); background: #f8efe3; }
.modal-title { font-family: var(--vx-font-display); font-size: 15px; font-weight: 700; }
.modal-body { padding: 12px; }
.modal-footer { padding: 8px 12px; border-top: 1px solid var(--vx-border); background: #f8efe3; text-align: right; }
.select2-container .select2-selection--single { height: 32px !important; border: 1px solid var(--vx-border-strong) !important; border-radius: 8px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 30px !important; }
.select2-dropdown { border-color: var(--vx-border-strong) !important; border-radius: 8px !important; overflow: hidden; }

/* Dashboard refresh: stat cards first, roomy boxes, calm palette */
body .dashboard-page .box { border-radius: var(--vx-radius); }
body .dashboard-page .side-stat-card {
    background: var(--vx-surface); border: 1px solid var(--vx-border); border-top: 3px solid var(--vx-primary);
    border-radius: var(--vx-radius); box-shadow: var(--vx-shadow); padding: 12px; margin-bottom: 12px;
}
body .dashboard-page .side-stat-card-stock { border-top-color: var(--vx-accent); }
body .dashboard-page .side-stat-card-cash { border-top-color: var(--vx-graphite-900); }
body .dashboard-page .side-stat-card-return { border-top-color: var(--vx-warning); }
body .dashboard-page .side-stat-card-alert { border-top-color: var(--vx-danger); }
body .dashboard-page .side-stat-value { font-family: var(--vx-font-display); font-size: 19px; font-weight: 700; color: var(--vx-ink); }
body .dashboard-page .dashboard-row-kpi { align-items: stretch; }
body .dashboard-page .box-header { background: #f8efe3; }

/* Neutralize the strongest legacy inline colors on core screens */
.content-wrapper [style*="color:#95571f"], .content-wrapper [style*="color: #95571f"],
.content-wrapper [style*="color:#95571f"], .content-wrapper [style*="color: #95571f"] { color: var(--vx-primary) !important; }
.content-wrapper [style*="background:#95571f"], .content-wrapper [style*="background: #95571f"],
.content-wrapper [style*="background-color:#95571f"], .content-wrapper [style*="background-color: #95571f"],
.content-wrapper [style*="background:#95571f"], .content-wrapper [style*="background: #95571f"] { background: var(--vx-primary) !important; }
.content-wrapper [style*="border-color:#95571f"], .content-wrapper [style*="border-color: #95571f"] { border-color: var(--vx-primary) !important; }

/* Login page, split brand panel and form card */
body.login-page {
    min-height: 100vh; margin: 0;
    background: var(--vx-graphite-950);
    font-family: var(--vx-font); display: flex; align-items: stretch; justify-content: center;
}
.vx-login-shell { display: flex; width: 100%; max-width: 1020px; margin: auto; padding: 20px 16px; gap: 0; align-items: stretch; }
.vx-login-brand {
    flex: 1 1 46%; color: #e2e0dc; padding: 32px 28px; display: flex; flex-direction: column; justify-content: center; gap: 16px;
    background-color: var(--vx-graphite-950);
    background-image: var(--vx-brand-bg);
    background-size: 180px 180px, cover;
    border-radius: 12px;
}
.vx-login-brand .vx-brand-mark { width: 44px; height: 44px; font-size: 24px; border-radius: 12px; }
.vx-login-brand h1 { color: #ffffff; font-size: 27px; line-height: 1.2; letter-spacing: -0.5px; margin: 0; }
.vx-login-brand p { margin: 0; font-size: 15px; color: #c9c6c1; max-width: 380px; }
.vx-login-points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.vx-login-points li { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #e2e0dc; }
.vx-login-points .fa { color: var(--vx-accent); }
.vx-login-card {
    flex: 1 1 54%; max-width: 480px; background: #ffffff; border-radius: 12px;
    box-shadow: 0 16px 40px rgba(30, 32, 35, 0.35); padding: 24px 24px 20px; align-self: center;
}
.vx-login-card h2 { font-size: 21px; margin: 0 0 4px; }
.vx-login-card .vx-login-sub { color: var(--vx-muted); margin: 0 0 16px; font-size: 14px; }
body.login-page .login-form .form-group { position: relative; margin-bottom: 12px; }
body.login-page .login-form .form-control { height: 40px; border-radius: 8px; padding: 6px 40px 6px 10px; font-size: 14px; }
body.login-page .login-form .form-control.has-login-error { border-color: var(--vx-danger); outline: 2px solid rgba(149, 87, 31, 0.3); }
body.login-page .login-field-error { display: none; color: var(--vx-danger); font-size: 12.5px; margin-top: 4px; }
body.login-page .login-field-error.is-visible { display: block; }
body.login-page .form-control-feedback { height: 40px; line-height: 40px; }
body.login-page .login-password-toggle {
    position: absolute; right: 30px; top: 0; height: 40px; width: 32px;
    background: none; border: 0; color: var(--vx-faint); cursor: pointer; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
body.login-page .login-password-toggle:hover, body.login-page .login-password-toggle:focus { color: #b26a30; outline: none; }
body.login-page .login-password-toggle svg { width: 18px; height: 18px; flex: 0 0 18px; }
body.login-page .login-form-options { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 16px; font-size: 13.5px; }
body.login-page .login-form-options .forgot { font-weight: 600; }
body.login-page .remember-login { font-weight: 500; color: var(--vx-body); margin: 0; cursor: pointer; }
body.login-page .login-form .btn { width: 100%; height: 40px; font-size: 14px; border-radius: 8px; background: var(--vx-primary); color: #ffffff; border: 1px solid var(--vx-primary); }
body.login-page .login-form .btn:hover { background: var(--vx-primary-hover); }
body.login-page .login-support { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--vx-border); font-size: 13.5px; color: var(--vx-muted); }
body.login-page .login-support strong { color: var(--vx-ink); }
body.login-page .login-support p { margin: 4px 0 12px; }
body.login-page .login-support-button {
    display: inline-flex; align-items: center; gap: 8px; padding: 0;
    color: var(--vx-accent-dark); font-weight: 600; font-size: 13.5px;
}
body.login-page .login-support-button:hover { text-decoration: underline; }
body.login-page .vx-login-copy { margin-top: 20px; font-size: 12px; color: var(--vx-faint); }

@media (max-width: 991px) {
    .vx-rail { transform: translateX(-100%); width: var(--vx-rail-w) !important; }
    body.sidebar-open .vx-rail { transform: translateX(0); box-shadow: 0 0 60px rgba(30, 32, 35, 0.4); }
    body.sidebar-collapse .vx-rail .sidebar-menu li > a span,
    body.sidebar-collapse .vx-rail .sidebar-menu li > a > .pull-right,
    body.sidebar-collapse .vx-rail-caption, body.sidebar-collapse .vx-rail-plan { display: initial; }
    body.sidebar-collapse .vx-rail .sidebar-menu li > a > .pull-right { display: inline-block; }
    .content-wrapper, .main-footer { margin-left: 0 !important; }
    .header-search-slot { display: none; }
    .header-branch-select-shell select.form-control { max-width: 150px; }
    .vx-brand-tag { display: none; }
    .vx-login-shell { flex-direction: column; }
    .vx-login-brand { padding: 12px 8px 24px; }
    .vx-login-card { max-width: 100%; width: 100%; }
}
@media (max-width: 560px) {
    .vx-brand-name { font-size: 16px; }
    .header-role-chip { display: none; }
    .content { padding: 12px; }
    .content-header { padding: 16px 12px 4px; }
}

/* On page calculator (toggled by the Open Calculator link in forms) */
.vx-calc {
    position: fixed; right: 16px; bottom: 16px; width: 264px; z-index: 2000;
    background: var(--vx-surface); border: 1px solid var(--vx-border-strong);
    border-radius: var(--vx-radius); box-shadow: var(--vx-shadow); display: none;
    overflow: hidden;
}
.vx-calc.vx-calc-open { display: block; }
.vx-calc-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: #f8efe3; border-bottom: 1px solid var(--vx-border);
    font-family: var(--vx-font-display); font-size: 13px; font-weight: 700; color: #232629;
}
.vx-calc-close {
    border: 0; background: transparent; font-size: 18px; line-height: 1;
    color: var(--vx-muted); cursor: pointer; padding: 0 4px;
}
.vx-calc-close:hover { color: #232629; }
.vx-calc-display {
    padding: 12px; text-align: right; font-family: var(--vx-font-display);
    font-size: 22px; font-weight: 700; color: #232629; word-break: break-all;
    border-bottom: 1px solid var(--vx-border);
}
.vx-calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; }
.vx-calc-grid button {
    height: 40px; border: 1px solid var(--vx-border); border-radius: var(--vx-radius-sm);
    background: var(--vx-surface); color: #232629; font-size: 15px; cursor: pointer;
}
.vx-calc-grid button:hover { background: #f3f2f0; }
.vx-calc-grid .vx-calc-zero { grid-column: span 2; }
.vx-calc-grid .vx-calc-equals { background: var(--vx-primary); border-color: var(--vx-primary); color: #ffffff; }
.vx-calc-grid .vx-calc-equals:hover { background: var(--vx-accent); }

@media print {
    .vx-topbar, .vx-rail, .main-footer, .main-sidebar-backdrop { display: none !important; }
    .content-wrapper { margin-left: 0 !important; }
    body.vx-app { padding-top: 0; }
}

/* UI pass: third party widget overrides in the Industrial Precision palette.
   Library CSS files are not edited; their blue defaults are overridden here. */
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--vx-primary) !important; color: #ffffff !important; }
.select2-container--default .select2-results__option[aria-selected="true"] { background-color: var(--vx-copper-bg) !important; color: var(--vx-ink) !important; }
.select2-container--open .select2-selection--single, .select2-container--focus .select2-selection--single { border-color: var(--vx-primary) !important; outline: 2px solid rgba(178, 106, 48, 0.35) !important; }
.select2-container--default .select2-search--dropdown .select2-search__field { border-color: var(--vx-border-strong) !important; border-radius: 8px !important; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--vx-primary) !important; outline: 2px solid rgba(178, 106, 48, 0.35) !important; }
.datepicker table tr td.active, .datepicker table tr td.active:hover, .datepicker table tr td.active.disabled, .datepicker table tr td.active.disabled:hover, .datepicker table tr td span.active, .datepicker table tr td span.active:hover { background-color: var(--vx-primary) !important; background-image: none !important; border-color: var(--vx-primary) !important; color: #ffffff !important; text-shadow: none !important; }
.datepicker table tr td.today, .datepicker table tr td.today:hover { background-color: var(--vx-copper-bg) !important; background-image: none !important; border-color: var(--vx-copper-border) !important; color: var(--vx-accent-dark) !important; }
.datepicker table tr td.day:hover, .datepicker table tr td span:hover { background-color: var(--vx-copper-bg) !important; }
.datepicker .datepicker-switch:hover, .datepicker .prev:hover, .datepicker .next:hover, .datepicker tfoot tr th:hover { background-color: var(--vx-copper-bg) !important; }
:focus-visible { outline: 2px solid rgba(178, 106, 48, 0.45); outline-offset: 1px; }
/* UI pass: compact data density for legacy per page style blocks is handled
   globally here so list and form pages share the same rhythm. */
.table-condensed > thead > tr > th, .table-condensed > tbody > tr > td { padding: 4px 6px !important; }
.box .box-body .table:last-child { margin-bottom: 0; }
.modal-dialog { margin: 16px auto; }
@media (min-width: 768px) { .modal-dialog { width: 560px; } .modal-lg { width: 760px; } .modal-sm { width: 320px; } }
