/* =====================================================================
   Techniyos - soft "playful dashboard" theme
   Periwinkle sidebar rail, floating white cards, glossy colour tiles,
   cream page background, tinted pills.
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
    --brand: #0b7fd0;
    --brand-rgb: 11, 127, 208;
    --brand-dark: #0969ad;
    --brand-light: #e3f3fd;
    --brand-sky: #1ea7f4;            /* bright accent used on tiles / active borders */

    --ink-900: #23262d;
    --ink-800: #2b2f3a;
    --ink-700: #444b5a;
    --ink-500: #6f7686;
    --ink-400: #9aa1b0;

    --surface: #f6f7f2;              /* page background (soft cream) */
    --surface-card: #ffffff;
    --rail: #dbe5ff;                 /* sidebar background */
    --border: #e6e9ee;
    --border-soft: #eceee9;
    --field-bg: #f3f4f6;

    --success: #3f9a0b;
    --success-bg: #e7f8d8;
    --danger: #d8323f;
    --danger-bg: #fde8ea;
    --warning: #c26a0a;
    --warning-bg: #fff0dc;
    --info: #0d8aa0;
    --info-bg: #dcf6fa;

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(35, 38, 45, .06);
    --shadow: 0 2px 0 rgba(35, 38, 45, .03), 0 8px 20px rgba(35, 38, 45, .07);
    --shadow-lg: 0 18px 40px rgba(35, 38, 45, .16);

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { scrollbar-width: thin; scrollbar-color: #c3c9d6 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c3c9d6; border-radius: var(--radius-pill); }
::-webkit-scrollbar-track { background: transparent; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--surface);
    font-family: var(--font-sans);
    color: var(--ink-800);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-sans); font-weight: 800; color: var(--ink-900); letter-spacing: -0.015em; }
.text-muted { color: var(--ink-500) !important; }

a { color: var(--brand-dark); }
a:hover { color: var(--brand); }

:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .4); outline-offset: 2px; }

/* =====================================================================
   Glossy colour tiles (icons)
   ===================================================================== */
.icon-tile {
    --t1: #38b6ff; --t2: #1496ee;
    width: 38px; height: 38px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.05rem;
    background: linear-gradient(160deg, var(--t1), var(--t2));
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14), 0 4px 10px -3px color-mix(in srgb, var(--t2) 70%, transparent);
}
.icon-tile-lg { width: 48px; height: 48px; border-radius: 16px; font-size: 1.3rem; }
.icon-tile-md { width: 46px; height: 46px; border-radius: 15px; font-size: 1.25rem; }
.tile-green  { --t1: #7be02a; --t2: #4fb80c; }
.tile-orange { --t1: #ff8f52; --t2: #f2602a; }
.tile-yellow { --t1: #ffd92a; --t2: #f5b400; }
.tile-blue   { --t1: #3dbaff; --t2: #1496ee; }
.tile-purple { --t1: #c991ff; --t2: #a05af0; }
.tile-pink   { --t1: #ff94c6; --t2: #f063a5; }
.tile-red    { --t1: #ff7078; --t2: #ea3b49; }
.tile-cyan   { --t1: #34d6e8; --t2: #12aec6; }
.tile-dark   { --t1: #41444d; --t2: #22252b; }

/* =====================================================================
   App shell
   ===================================================================== */
.app-wrapper { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { max-width: 1600px; }

/* ---------- Sidebar rail ---------- */
.app-sidebar {
    background: var(--rail);
    color: var(--ink-800);
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 14px 10px;
    transition: width .2s ease, transform .25s ease;
    overflow: hidden;
}
.sidebar-brand {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: 6px 6px 14px;
    white-space: nowrap;
}
.sidebar-brand-link { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.sidebar-brand-text { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink-900); }
.brand-logo {
    width: 44px; height: 44px; border-radius: 14px; background: #fff; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; padding: 6px;
    box-shadow: var(--shadow);
}
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar-close-btn {
    background: #fff; border: 0; color: var(--ink-700); font-size: 1rem; line-height: 1;
    width: 36px; height: 36px; border-radius: 12px; box-shadow: var(--shadow-sm); flex-shrink: 0;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 2px 2px 14px; margin: 0 -2px; }
.nav-section { margin-bottom: 16px; }
.nav-section-label {
    font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
    color: #7f89a3; margin: 0 0 8px 10px;
}
.nav-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow);
    gap: 2px;
}
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 12px;
    color: var(--ink-800);
    font-weight: 700;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.sidebar-nav .nav-link-main {
    padding: 8px 10px;
    font-size: .875rem;
    border: 2px solid transparent;
    border-radius: 16px;
    background: transparent;
}
.sidebar-nav .nav-link-main:hover,
.sidebar-nav .nav-link-main:focus { background: #f4f6fb; color: var(--ink-900); }
.sidebar-nav .nav-link-main.active,
.menu-group.open > .nav-link-main {
    border-color: var(--brand-sky);
    background: #fff;
    color: var(--ink-900);
}
.menu-chevron { color: var(--ink-400); font-size: .72rem; transition: transform .2s ease; }
.menu-group.open > .menu-group-toggle .menu-chevron { transform: rotate(90deg); }

/* sub items: grey pills joined to the parent by a dotted connector */
.submenu { padding: 8px 4px 6px 14px; }
.submenu li { position: relative; padding-left: 26px; margin-bottom: 6px; }
.submenu li::before {
    content: ""; position: absolute; left: 4px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
    border-radius: 50%; background: #d5dae4;
}
.submenu li::after {
    content: ""; position: absolute; left: 12px; top: 50%; width: 10px; height: 2px; margin-top: -1px; background: #e3e7ee;
}
.sidebar-nav .nav-link-sub {
    padding: 10px 14px;
    font-size: .82rem;
    border-radius: 14px;
    background: var(--field-bg);
    color: var(--ink-700);
}
.sidebar-nav .nav-link-sub:hover { background: #e9ecf1; color: var(--ink-900); }
.sidebar-nav .nav-link-sub.active {
    background: var(--brand);
    color: #fff;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16);
}

/* ---------- Top bar ---------- */
.app-topbar {
    background-color: rgba(246, 247, 242, .88);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 18px 28px 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.sidebar-toggle-btn, .topbar-btn {
    width: 44px; height: 44px; border-radius: var(--radius);
    background: #fff; border: 1px solid var(--border);
    color: var(--ink-700); font-size: 1.1rem;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    box-shadow: var(--shadow); text-decoration: none; position: relative;
    transition: background-color .15s ease, color .15s ease;
}
.sidebar-toggle-btn:hover, .topbar-btn:hover { background: var(--brand-light); color: var(--brand-dark); }
.topbar-brand i { font-size: 1.4rem; color: var(--brand); }

.topbar-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-title-text { min-width: 0; }
.topbar-heading { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink-900); line-height: 1.15; }
.topbar-sub { font-size: .8rem; font-weight: 500; color: var(--ink-400); }

.topbar-tools { display: flex; align-items: center; gap: 10px; }
.topbar-search { position: relative; width: 300px; max-width: 38vw; }
.topbar-search > .bi-search { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
.topbar-search input {
    width: 100%; height: 44px; padding: 0 16px 0 44px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: #fff; box-shadow: var(--shadow);
    font-size: .88rem; font-weight: 500; color: var(--ink-800);
}
.topbar-search input::placeholder { color: var(--ink-400); }
.topbar-search input:focus { outline: none; border-color: var(--brand-sky); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15); }
.search-results {
    position: absolute; top: 100%; left: 0; right: 0; min-width: 260px; margin: 8px 0 0; padding: 6px;
    list-style: none; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 1050;
    border: 1px solid var(--border-soft);
}
.search-results a {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 9px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-800); font-weight: 700; font-size: .86rem;
}
.search-results a small { color: var(--ink-400); font-weight: 600; font-size: .72rem; }
.search-results a:hover, .search-results a.is-active { background: var(--brand-light); color: var(--brand-dark); }
.topbar-dot { position: absolute; top: 9px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: #ef4452; border: 2px solid #fff; }
.topbar-avatar {
    width: 44px; height: 44px; border-radius: var(--radius); flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #7be02a, #4fb80c); color: #fff;
    font-weight: 800; font-size: .9rem; text-decoration: none; letter-spacing: .02em;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14), 0 4px 10px -3px rgba(79, 184, 12, .6);
}
.topbar-avatar:hover { color: #fff; filter: brightness(1.05); }

/* ---------- Off-canvas backdrop (mobile only) ---------- */
.app-overlay { display: none; position: fixed; inset: 0; background: rgba(35, 38, 45, .5); z-index: 1035; backdrop-filter: blur(1px); }

@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 288px; transform: translateX(-100%); z-index: 1040; }
    body.sidebar-mobile-open .app-sidebar { transform: translateX(0); }
    body.sidebar-mobile-open .app-overlay { display: block; }
}
@media (min-width: 992px) {
    .sidebar-close-btn { display: none; }
    .app-sidebar { position: sticky; top: 0; height: 100vh; align-self: flex-start; }
    body.sidebar-collapsed .app-sidebar { width: 0; border: 0; padding: 0; }
}
@media (max-width: 767.98px) {
    .app-topbar { padding: 14px 16px 6px; gap: 10px; }
    .app-content { padding-left: 16px !important; padding-right: 16px !important; }
    .topbar-heading { font-size: 1.25rem; }
}
@media (max-width: 575.98px) {
    .topbar-search { display: none; }
    .topbar-sub { display: none; }
    .topbar-title .icon-tile-lg { display: none; }
    .topbar-title { flex: 1 1 auto; }
    .topbar-heading { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-tools { gap: 8px; }
}

/* =====================================================================
   Cards
   ===================================================================== */
.card {
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
}
.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-soft);
    font-weight: 700;
    border-top-left-radius: var(--radius-lg) !important;
    border-top-right-radius: var(--radius-lg) !important;
}
a .card:hover, .card.card-link-hover:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    transition: box-shadow .15s ease, transform .15s ease;
}

/* legacy gradient stat cards (customer page etc.) in the new palette */
.stat-card { color: #fff; border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow), inset 0 -4px 0 rgba(0, 0, 0, .12); }
.stat-card .stat-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-card.bg-primary   { background: linear-gradient(160deg, #3dbaff, #1496ee) !important; }
.stat-card.bg-info      { background: linear-gradient(160deg, #34d6e8, #12aec6) !important; }
.stat-card.bg-success   { background: linear-gradient(160deg, #7be02a, #4fb80c) !important; }
.stat-card.bg-danger    { background: linear-gradient(160deg, #ff7078, #ea3b49) !important; }
.stat-card.bg-warning   { background: linear-gradient(160deg, #ffc21f, #f08c00) !important; }
.stat-card.bg-purple    { background: linear-gradient(160deg, #c991ff, #a05af0) !important; }
.stat-card.bg-secondary { background: linear-gradient(160deg, #6f7686, #4f5666) !important; }
.bg-purple { background-color: #a05af0; }
.text-bg-purple { background-color: #a05af0 !important; color: #fff !important; }

/* =====================================================================
   Dashboard components
   ===================================================================== */
.metric-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 20px 22px 18px;
    height: 100%;
}
.metric-head { display: flex; align-items: center; gap: 14px; }
.metric-label { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8b92a3; line-height: 1.2; }
.metric-tag { font-size: .68rem; font-weight: 700; margin-top: 3px; line-height: 1.2; }
.metric-card { container-type: inline-size; }
.metric-value {
    /* sized from the card's own width so long money values stay on one line */
    font-size: clamp(1.15rem, 1.1rem + .6vw, 1.8rem);
    font-size: clamp(1.15rem, 10cqw, 2rem);
    font-weight: 800; letter-spacing: -.025em; color: var(--ink-900);
    margin: 16px 0 8px; line-height: 1.15; overflow-wrap: anywhere;
}
.metric-foot { font-size: .76rem; font-weight: 700; color: var(--ink-400); display: flex; align-items: center; gap: 5px; }

.tone-green  { color: #3f9a0b; }
.tone-blue   { color: #0b86cf; }
.tone-orange { color: #d9740d; }
.tone-yellow { color: #b88a00; }
.tone-red    { color: #d8323f; }
.tone-purple { color: #8a47d6; }
.tone-pink   { color: #c93d86; }
.tone-cyan   { color: #0d8aa0; }

.panel {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 22px;
    height: 100%;
}
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel-title { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink-900); line-height: 1.2; margin: 0; }
.panel-sub { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #9aa1b0; margin-top: 2px; }
.panel-action {
    margin-left: auto; padding: 8px 14px; border-radius: 12px; background: var(--field-bg);
    color: var(--ink-700); font-size: .8rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.panel-action:hover { background: var(--brand-light); color: var(--brand-dark); }
.panel .table { margin-bottom: 0; }
.panel .table thead th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.panel .table thead th:last-child  { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.panel .table thead th { border-bottom: 0; }
.empty-note { text-align: center; color: var(--ink-500); padding: 28px 12px; font-weight: 600; }

/* tinted "tip" pills (quick links / alerts) */
.tip-list { display: grid; gap: 10px; }
.tip-pill {
    --p-bg: #e3f4fd; --p-bd: #a9dcf7; --p-fg: #0b6ea8;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: 15px;
    background: var(--p-bg); border: 1.5px solid var(--p-bd); color: var(--p-fg);
    font-size: .86rem; font-weight: 700; text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease;
}
.tip-pill:hover { color: var(--p-fg); box-shadow: 0 6px 14px -6px var(--p-bd); transform: translateY(-1px); }
.tip-pill i { font-size: 1rem; }
.tip-pill .ms-auto { opacity: .6; }
.tip-green  { --p-bg: #eaf9dc; --p-bd: #b9e695; --p-fg: #377c08; }
.tip-blue   { --p-bg: #e3f4fd; --p-bd: #a9dcf7; --p-fg: #0b6ea8; }
.tip-orange { --p-bg: #fff1df; --p-bd: #ffd29b; --p-fg: #a85a05; }
.tip-red    { --p-bg: #fdeaec; --p-bd: #f6b9be; --p-fg: #b72b37; }
.tip-purple { --p-bg: #f3eafe; --p-bd: #dcc3fa; --p-fg: #7339bd; }
.tip-pink   { --p-bg: #fde8f3; --p-bd: #f6bddb; --p-fg: #a8346f; }
.tip-cyan   { --p-bg: #def7fa; --p-bd: #a5e6ef; --p-fg: #0c7385; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
    border-radius: var(--radius);
    font-weight: 700;
    font-size: .875rem;
    padding: .55rem 1.05rem;
    transition: filter .12s ease, box-shadow .12s ease, transform .12s ease, background-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 11px; padding: .38rem .75rem; font-size: .8rem; }
.btn-primary, .btn-dark, .btn-success, .btn-danger { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.btn-dark { background-color: var(--ink-900); border-color: var(--ink-900); }
.btn-dark:hover, .btn-dark:focus { background-color: #000; border-color: #000; }
.btn-primary { background-color: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--brand-dark); border-color: var(--brand-dark); }
.btn-success { background-color: #3f9a0b; border-color: #3f9a0b; }
.btn-success:hover { background-color: #347f09; border-color: #347f09; }
.btn-outline-primary { color: var(--brand-dark); border-color: #a9dcf7; background: #fff; }
.btn-outline-primary:hover, .btn-outline-primary:focus { background-color: var(--brand); border-color: var(--brand); color: #fff; }
.btn-outline-secondary { color: var(--ink-700); border-color: var(--border); background: #fff; }
.btn-outline-secondary:hover { background-color: var(--ink-800); border-color: var(--ink-800); color: #fff; }
.btn-outline-danger:hover { box-shadow: 0 4px 10px rgba(216, 50, 63, .25); }
.btn i { vertical-align: -1px; }

/* =====================================================================
   Forms
   ===================================================================== */
.form-control, .form-select {
    border-radius: var(--radius);
    border-color: var(--border);
    font-size: .9rem;
    font-weight: 500;
    padding: .55rem .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-sky);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15);
}
.form-label { font-weight: 700; font-size: .8rem; color: var(--ink-700); margin-bottom: .35rem; }
.form-text { color: var(--ink-500); font-size: .78rem; }
.input-group-text { background-color: var(--field-bg); border-color: var(--border); border-radius: var(--radius); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15); }

/* =====================================================================
   Tables
   ===================================================================== */
.table {
    --bs-table-hover-bg: rgba(var(--brand-rgb), .04);
    font-size: .9rem;
}
.table thead th {
    background-color: #f4f6f9;
    color: #7c8497;
    font-weight: 800;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    border-bottom: 1px solid var(--border);
    padding-top: .75rem;
    padding-bottom: .75rem;
}
.table td { border-color: var(--border-soft); padding-top: .75rem; padding-bottom: .75rem; vertical-align: middle; font-weight: 500; }
.table > :not(caption) > * > * { box-shadow: none; }

/* =====================================================================
   Badges & alerts (soft pill style)
   ===================================================================== */
.badge { border-radius: var(--radius-pill); font-weight: 700; font-size: .72rem; padding: .45em .8em; letter-spacing: .01em; }
.text-bg-primary   { background-color: var(--brand-light) !important; color: var(--brand-dark) !important; }
.text-bg-secondary { background-color: #eef0f4 !important; color: var(--ink-700) !important; }
.text-bg-success   { background-color: var(--success-bg) !important; color: #2f7a08 !important; }
.text-bg-danger    { background-color: var(--danger-bg) !important; color: #a8232f !important; }
.text-bg-warning   { background-color: var(--warning-bg) !important; color: #8f4e06 !important; }
.text-bg-info      { background-color: var(--info-bg) !important; color: #0b6b7c !important; }
.text-bg-dark      { background-color: var(--ink-800) !important; color: #fff !important; }

.alert { border: 1.5px solid transparent; border-radius: var(--radius); font-size: .9rem; font-weight: 600; }
.alert-success { background-color: var(--success-bg); border-color: #b9e695; color: #2c6e07; }
.alert-danger  { background-color: var(--danger-bg); border-color: #f6b9be; color: #8e1f2a; }
.alert-warning { background-color: var(--warning-bg); border-color: #ffd29b; color: #7c4305; }
.alert-info    { background-color: var(--info-bg); border-color: #a5e6ef; color: #0a5f6f; }

/* =====================================================================
   Dropdowns, modals, pagination, tabs, progress
   ===================================================================== */
.dropdown-menu { border: 1px solid var(--border-soft); box-shadow: var(--shadow-lg); border-radius: 18px; padding: .4rem; }
.dropdown-item { border-radius: 11px; font-size: .88rem; font-weight: 600; padding: .5rem .7rem; }
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--brand-light); color: var(--brand-dark); }

.modal-content { border: none; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--border-soft); }

.nav-tabs { border-bottom-color: var(--border); }
.nav-tabs .nav-link { border: none; color: var(--ink-500); font-weight: 700; font-size: .88rem; border-radius: 0; padding: .6rem .9rem; }
.nav-tabs .nav-link.active { color: var(--brand-dark); background: none; border-bottom: 3px solid var(--brand-sky); }

.pagination .page-link { border-color: var(--border); color: var(--ink-700); border-radius: 11px; margin: 0 2px; font-weight: 600; }
.pagination .page-item.active .page-link { background-color: var(--brand); border-color: var(--brand); color: #fff; }

.progress { border-radius: var(--radius-pill); background-color: var(--border-soft); }
.progress-bar { background-color: var(--brand-sky); }

/* =====================================================================
   Login page
   ===================================================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 12% 12%, rgba(61, 186, 255, .28), transparent 45%),
        radial-gradient(circle at 88% 88%, rgba(123, 224, 42, .22), transparent 42%),
        linear-gradient(135deg, var(--rail), var(--surface));
    padding: 1rem;
}
.login-card { max-width: 410px; width: 100%; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: none; }

/* =====================================================================
   Point of Sale
   ===================================================================== */
.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 410px;
    gap: 16px;
    align-items: start;
}
.pos-catalog { display: flex; flex-direction: column; gap: 14px; min-height: 60vh; }
.pos-search { position: relative; }
.pos-search > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: 1.1rem; }
.pos-search input {
    width: 100%; height: 50px; padding: 0 16px 0 46px; font-size: 1rem; font-weight: 600;
    border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--field-bg);
}
.pos-search input:focus { outline: none; background: #fff; border-color: var(--brand-sky); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15); }
.pos-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-cat {
    border: 0; background: var(--field-bg); color: var(--ink-700); font-weight: 700; font-size: .8rem;
    padding: 8px 14px; border-radius: var(--radius-pill);
}
.pos-cat:hover { background: #e9ecf1; }
.pos-cat.active { background: var(--brand); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; align-content: start; }
.pos-grid .empty-note { grid-column: 1 / -1; }
.pos-item {
    display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
    background: #fff; border: 1.5px solid var(--border); border-radius: 18px; padding: 14px;
    box-shadow: var(--shadow-sm); transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.pos-item:hover:not(:disabled) { border-color: var(--brand-sky); box-shadow: var(--shadow); transform: translateY(-1px); }
.pos-item:active:not(:disabled) { transform: translateY(1px); }
.pos-item:disabled { opacity: .5; cursor: not-allowed; }
.pos-item-img { width: 100%; height: 92px; object-fit: cover; border-radius: 12px; background: var(--field-bg); margin-bottom: 4px; display: block; }
.pos-item-img.ph { display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; color: #b3bbcb; background: linear-gradient(160deg, #eef1f6, #e4e8f0); }
.pos-item-name { font-weight: 800; font-size: .88rem; color: var(--ink-900); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.pos-item-price { font-weight: 800; font-size: 1.05rem; color: var(--brand-dark); }
.pos-item-meta { font-size: .7rem; font-weight: 600; color: var(--ink-500); }
.pos-item.is-out .pos-item-meta { color: var(--danger); }

.pos-cart { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.pos-lines { max-height: 34vh; min-height: 90px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.pos-lines .empty-note { padding: 18px 8px; font-size: .85rem; }
.pos-line {
    display: grid; grid-template-columns: 1fr auto auto 24px; gap: 8px; align-items: center;
    padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.pos-line:last-child { border-bottom: 0; }
.pos-line-name { font-weight: 700; font-size: .85rem; line-height: 1.2; }
.pos-line-sub { font-size: .7rem; color: var(--ink-500); font-weight: 600; }
.pos-line-ctl { display: flex; align-items: center; gap: 4px; }
.pos-qty-btn { width: 28px; height: 28px; border: 0; border-radius: 9px; background: var(--field-bg); font-weight: 800; color: var(--ink-800); line-height: 1; }
.pos-qty-btn:hover { background: var(--brand-light); color: var(--brand-dark); }
.pos-qty { width: 52px; height: 28px; text-align: center; border: 1px solid var(--border); border-radius: 9px; font-weight: 700; font-size: .85rem; padding: 0 2px; -moz-appearance: textfield; }
.pos-qty::-webkit-outer-spin-button, .pos-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pos-line-amt { font-weight: 800; font-size: .85rem; min-width: 70px; text-align: right; }
.pos-line-del { border: 0; background: none; color: var(--ink-400); font-size: 1.2rem; line-height: 1; padding: 0; }
.pos-line-del:hover { color: var(--danger); }

.pos-discount { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pos-discount .input-group { max-width: 190px; }
.pos-totals { background: var(--field-bg); border-radius: 16px; padding: 12px 14px; }
.pos-row { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; font-weight: 600; padding: 2px 0; }
.pos-row.muted { color: var(--ink-500); font-size: .78rem; }
.pos-row.grand { font-size: 1.35rem; font-weight: 800; color: var(--ink-900); border-top: 1.5px dashed #cfd5df; margin-top: 6px; padding-top: 8px; }

.pos-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pos-method { border: 1.5px solid var(--border); background: #fff; border-radius: 12px; padding: 8px 4px; font-size: .75rem; font-weight: 800; color: var(--ink-700); }
.pos-method:hover { border-color: var(--brand-sky); }
.pos-method.active { background: var(--brand-light); border-color: var(--brand-sky); color: var(--brand-dark); }
.pos-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pos-quick-btn { border: 0; background: var(--field-bg); border-radius: var(--radius-pill); padding: 5px 12px; font-size: .75rem; font-weight: 800; color: var(--ink-700); }
.pos-quick-btn:hover { background: var(--brand-light); color: var(--brand-dark); }
.pos-change { margin-top: 8px; font-weight: 800; font-size: .9rem; min-height: 1.3em; }
.pos-change.ok { color: var(--success); }
.pos-change.bad { color: var(--danger); }
.pos-change.warn { color: var(--warning); }
.pos-actions { display: flex; gap: 8px; }
.pos-actions .btn-primary { padding: .8rem 1rem; font-size: 1rem; }

.pos-done { position: fixed; inset: 0; z-index: 1060; background: rgba(35, 38, 45, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pos-done[hidden] { display: none; }
.pos-done-card { background: #fff; border-radius: var(--radius-xl); padding: 28px 26px; width: 100%; max-width: 360px; text-align: center; box-shadow: var(--shadow-lg); }
.pos-done-total { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.pos-done-change { font-weight: 800; color: var(--success); min-height: 1.4em; }
.pos-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 1070; opacity: 0; pointer-events: none;
    background: var(--ink-900); color: #fff; padding: 11px 18px; border-radius: var(--radius); font-weight: 700; font-size: .88rem;
    max-width: 90vw; transition: opacity .2s ease, transform .2s ease; box-shadow: var(--shadow-lg);
}
.pos-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 991.98px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { position: static; }
    .pos-lines { max-height: none; }
}
@media print { .pos-layout, .pos-done, .pos-toast { display: none !important; } }

/* ---------- Product profile ---------- */
.barcode-panel { padding: 22px 18px; }
.barcode-name { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 10px; }
.barcode-art svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.barcode-number { font-family: 'Courier New', monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: .22em; color: var(--ink-900); margin-top: 6px; }
.profile-photo { width: 100%; max-width: 200px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 20px; border: 1px solid var(--border); background: var(--field-bg); }
.profile-photo-empty { display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 3rem; color: #b3bbcb; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.profile-fact { background: var(--field-bg); border-radius: 14px; padding: 12px 14px; }
.profile-fact-label { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8b92a3; margin-bottom: 3px; }
.profile-fact-value { font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.profile-barcode { max-width: 200px; margin: 12px auto 0; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.profile-barcode .barcode-number { font-size: .8rem; letter-spacing: .14em; }
@media print { .barcode-panel { box-shadow: none; border: 0; } .barcode-panel .no-print { display: none !important; } }

/* =====================================================================
   Misc app utilities
   ===================================================================== */
.item-row .remove-row { cursor: pointer; }
.print-only { display: none; }

/* Statement tables: full grid lines on screen and in print/PDF */
.statement-table,
.statement-table > :not(caption) > * > * { border: 1px solid #adb5bd !important; }
.statement-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .container-fluid { padding: 0 !important; }
    .app-sidebar, .app-topbar, .app-overlay, footer { display: none !important; }
    .app-main { display: block !important; }
    .print-only { display: block !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
}
