/* Final Tanis brand layer. Semantic success/warning/error colors stay intact. */
.tanis-app, .tanis-login, .tanis-invoice {
    --tanis-red: #b51224;
    --tanis-red-dark: #8e0e1d;
    --tanis-soft: #fff0f2;
    --bs-primary: #b51224;
    --bs-primary-rgb: 181, 18, 36;
    --shell-primary: #b51224;
    --shell-primary-soft: #fff0f2;
    --shell-accent: #b51224;
    --form-accent: #b51224;
    --form-accent-soft: #fff0f2;
}
body.tanis-app { background: #f5f5f5; }
.tanis-app .page-shell { --form-accent: #b51224; --form-accent-soft: #fff0f2; }
.tanis-app #sidebar .sidebar-wrapper { background: #161616; }
.tanis-app .sidebar-brand-card {
    position: relative;
    padding: 22px 16px 0;
    border: 1px solid #353033;
    border-radius: 18px;
    background: linear-gradient(155deg, #1c1718, #101010 70%);
    box-shadow: 0 8px 24px #00000020;
    overflow: hidden;
}
.tanis-app .sidebar-brand-top { position: relative; justify-content: center; align-items: center; }
.tanis-app .sidebar-brand-link { flex: 0 1 144px; gap: 0; border-radius: 50%; }
.tanis-app .sidebar-brand-link:focus-visible { outline: 2px solid #ff4055; outline-offset: 5px; }
.tanis-app .sidebar-brand-logo { width: 144px; max-width: 100%; padding: 0; background: #000; border-radius: 50%; }
.tanis-app .sidebar-brand-logo img { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: 1; object-fit: contain; border-radius: inherit; }
.tanis-app .sidebar-brand-controls { position: absolute; top: -10px; right: -6px; }
.tanis-app .sidebar-brand-controls .action-icon-btn,
.tanis-app .sidebar-brand-controls .sidebar-hide {
    width: 32px; height: 32px; padding: 0; border: 1px solid #ffffff20; border-radius: 9px;
    background: #ffffff08; color: #bfb6b8; font-size: 16px; line-height: 1; text-align: center;
}
.tanis-app .sidebar-brand-controls .sidebar-hide { align-content: center; }
.tanis-app .sidebar-brand-controls .action-icon-btn i { font-size: 16px; }
.tanis-app .sidebar-brand-controls .action-icon-btn:hover,
.tanis-app .sidebar-brand-controls .sidebar-hide:hover { background: #b5122426; color: #fff; border-color: #b51224; }
.tanis-app .sidebar-utility { margin-top: 18px; padding: 0; border-top: 1px solid #ffffff12; }
.tanis-app .sidebar-utility .theme-toggle { padding: 14px 0; gap: 12px; border: 0; border-radius: 0; background: none; color: #bfb6b8; }
.tanis-app .theme-toggle-label { margin: 0; cursor: pointer; }
.tanis-app .theme-toggle-label strong { font-size: 12px; font-weight: 600; color: #d8d0d2; letter-spacing: .01em; }
.tanis-app .sidebar-utility .theme-toggle > .d-flex { gap: 8px !important; }
.tanis-app .sidebar-utility .theme-toggle svg { width: 15px; height: 15px; flex-shrink: 0; }
.tanis-app .sidebar-utility .form-switch { padding-left: 0; min-height: 0; display: flex; align-items: center; }
.tanis-app .sidebar-utility #toggle-dark { width: 32px; height: 18px; margin: 0; float: none; cursor: pointer; border-color: #6b6265; }
.tanis-app .sidebar-utility #toggle-dark:focus-visible { outline: 2px solid #ff4055; outline-offset: 3px; box-shadow: none; }
.tanis-app #sidebar .sidebar-title { color: #bdbdbd; }
.tanis-app #sidebar .sidebar-nav-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 12px; }
.tanis-app #sidebar .sidebar-nav-label { display: block; font-size: .86rem; line-height: 1.35; }
.tanis-app #sidebar .sidebar-nav-copy small { color: #aaa1a4; font-size: .66rem; font-weight: 400; line-height: 1.4; }
.tanis-app #sidebar .sidebar-item.active .sidebar-nav-copy small { color: #e4c2c8; }
.tanis-app #sidebar .sidebar-submenu-heading { display: block; padding: 12px 15px 4px; color: #b8a3a8; font-size: .62rem; font-weight: 700; letter-spacing: .08em; line-height: 1.4; text-transform: uppercase; pointer-events: none; }
.tanis-app #sidebar .sidebar-item > .sidebar-link i { color: #fff; }
.tanis-app #sidebar .sidebar-item > .sidebar-link:hover,
.tanis-app #sidebar .sidebar-item.active > .sidebar-link { background: var(--tanis-red); color: #fff; }
.tanis-app #sidebar .submenu .submenu-item.active > a { background: var(--tanis-red); color: #fff; }
.tanis-app #sidebar .submenu .submenu-item a:hover { background: #3c2226; color: #fff; }
.tanis-app .avatar { background: var(--tanis-red); }
.tanis-app .btn-primary,
.tanis-app .btn-new, .tanis-app .ix-btn-new {
    --bs-btn-bg: #b51224;
    --bs-btn-border-color: #b51224;
    --bs-btn-hover-bg: #8e0e1d;
    --bs-btn-hover-border-color: #8e0e1d;
    --bs-btn-active-bg: #8e0e1d;
    --bs-btn-active-border-color: #8e0e1d;
    --bs-btn-disabled-bg: #b51224;
    --bs-btn-disabled-border-color: #b51224;
    background: var(--tanis-red) !important;
    border-color: var(--tanis-red) !important;
    color: #fff !important;
    box-shadow: none;
}
.tanis-app .btn-primary:hover, .tanis-app .btn-new:hover, .tanis-app .ix-btn-new:hover { background: var(--tanis-red-dark) !important; }
.tanis-app .btn-outline-primary { color: var(--tanis-red); border-color: var(--tanis-red); }
.tanis-app .btn-outline-primary:hover, .tanis-app .btn-outline-primary.active { background: var(--tanis-red); color: #fff; }
.tanis-app .text-primary { color: var(--tanis-red) !important; }
.tanis-app .bg-primary, .tanis-app .page-item.active .page-link,
.tanis-app .nav-pills .nav-link.active, .tanis-app .form-check-input:checked,
.tanis-app .fdd-count, .tanis-app .fdd-option.checked .fdd-checkbox { background-color: var(--tanis-red) !important; border-color: var(--tanis-red); color: #fff; }
.tanis-app .filter-select.has-value, .tanis-app .ix-select.has-value,
.tanis-app .fdd-btn.has-value, .tanis-app .fdd-option.checked,
.tanis-app .a-chip, .tanis-app .ix-chip { background: var(--tanis-soft); color: var(--tanis-red-dark); border-color: #d9a1a8; }
.tanis-app .fdd-option.checked .fdd-opt-text { color: var(--tanis-red-dark); }
.tanis-app .a-chip-x { background: #f3cbd0; color: var(--tanis-red-dark); }
.tanis-app .a-chip-x:hover { background: var(--tanis-red); color: #fff; }
.tanis-app .modern-datatable-shell .paginate_button.current,
.tanis-app .modern-datatable-shell .paginate_button.current:hover,
.tanis-app .modern-datatable-shell .paginate_button.current:hover * { background: var(--tanis-red) !important; color: #fff !important; border-color: var(--tanis-red) !important; }
.tanis-app .modern-datatable-shell .dtr-control::before { background: var(--tanis-red) !important; }
.tanis-app .fdd-btn:hover, .tanis-app .fdd-btn.is-open { color: var(--tanis-red); border-color: var(--tanis-red); }
.tanis-app .form-control:focus, .tanis-app .form-select:focus,
.tanis-app .filter-select:focus, .tanis-app .filter-search:focus-within,
.tanis-app .ix-search:focus-within, .tanis-app .ix-select:focus,
.tanis-app .fdd-btn.is-open { border-color: var(--tanis-red) !important; box-shadow: 0 0 0 3px rgba(181,18,36,.18) !important; }
.tanis-app :focus-visible, .tanis-login :focus-visible, .tanis-invoice :focus-visible { outline: 3px solid #b51224; outline-offset: 3px; }
.tanis-app #sidebar :focus-visible { outline-color: #fff; }
[data-bs-theme="dark"] .tanis-app { --shell-primary: #ff9aa5; --shell-primary-soft: #381c21; --form-accent-soft: #381c21; background: #111; }
[data-bs-theme="dark"] .tanis-app .text-primary { color: #ff9aa5 !important; }
[data-bs-theme="dark"] .tanis-app .btn-outline-primary { color: #ff9aa5; border-color: #ff9aa5; }

/* Sign in uses the same local stylesheet and the unmodified official logo. */
.tanis-login *, .tanis-login *::before, .tanis-login *::after { box-sizing: border-box; }
body.tanis-login { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #12080a; color: #191919; font-family: Inter, Arial, sans-serif; overflow-x: hidden; }
body.tanis-login::before {
    content: ""; position: fixed; inset: -25%; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 55% 45% at 20% 20%, rgba(214, 38, 62, .55), transparent 70%),
        radial-gradient(ellipse 50% 45% at 82% 78%, rgba(140, 22, 72, .5), transparent 70%),
        radial-gradient(ellipse 40% 35% at 78% 22%, rgba(255, 138, 120, .2), transparent 70%),
        radial-gradient(ellipse 45% 40% at 25% 85%, rgba(92, 14, 30, .55), transparent 70%),
        linear-gradient(150deg, #3a0c15 0%, #1d090d 45%, #0d0607 100%);
    animation: tanis-login-drift 24s ease-in-out infinite alternate;
    will-change: transform;
}
body.tanis-login::after {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 40%, rgba(0, 0, 0, .45) 100%);
}
@keyframes tanis-login-drift {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    50%  { transform: translate3d(4%, -3%, 0) rotate(6deg) scale(1.06); }
    100% { transform: translate3d(-3%, 4%, 0) rotate(-4deg) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) { body.tanis-login::before { animation: none; } }
.tanis-login .glow-wrap { position: relative; z-index: 1; width: 100%; max-width: 460px; }
.tanis-login .card { background: #fff; border-top: 5px solid var(--tanis-red); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06); }
.tanis-login .hero { padding: 30px 40px 0; text-align: center; }
.tanis-login .login-logo { display: block; width: 100%; max-width: 260px; max-height: 145px; object-fit: contain; height: auto; margin: 0 auto; }
.tanis-login .hero-divider { height: 1px; background: #e5e5e5; margin-top: 24px; }
.tanis-login .body { padding: 28px 40px 36px; }
.tanis-login .form-eyebrow { color: var(--tanis-red); text-transform: uppercase; font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.tanis-login .form-h1 { margin: 8px 0 24px; font-size: 30px; line-height: 1.15; }
.tanis-login .alert { padding: 12px; border-radius: 8px; font-size: 13px; margin-bottom: 18px; display: flex; gap: 8px; }
.tanis-login .alert svg { flex-shrink: 0; }
.tanis-login .alert-error { background: #fff0f2; color: #941026; border: 1px solid #edbdc5; }
.tanis-login .alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.tanis-login .field { margin-bottom: 16px; }
.tanis-login .field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
.tanis-login .input-wrap { position: relative; }
.tanis-login .fi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #656565; display: flex; pointer-events: none; }
.tanis-login .field input { width: 100%; padding: 13px 44px 13px 40px; border: 1px solid #999; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; color: #191919; }
.tanis-login .field input::placeholder { color: #737373; }
.tanis-login .field input:focus { border-color: var(--tanis-red); }
.tanis-login .pw-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #555; cursor: pointer; display: flex; padding: 8px; }
.tanis-login .field-error { color: #941026; font-size: 12px; margin-top: 6px; }
.tanis-login .rem-row { margin: 8px 0 24px; font-size: 13px; }
.tanis-login .rem-row label { display: flex; align-items: center; gap: 8px; color: #555; }
.tanis-login input[type="checkbox"] { accent-color: var(--tanis-red); width: 16px; height: 16px; }
.tanis-login .btn { display: flex; gap: 9px; align-items: center; justify-content: center; width: 100%; padding: 14px; background: var(--tanis-red); color: #fff; border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
.tanis-login .btn:hover { background: var(--tanis-red-dark); }
.tanis-login .foot { text-align: center; color: rgba(255, 255, 255, .7); font-size: 12px; letter-spacing: .04em; margin: 20px 0 0; }
@media (max-width: 500px) { body.tanis-login { padding: 14px; } .tanis-login .body { padding: 24px; } .tanis-login .hero { padding: 24px 24px 0; } }

/* Printed figures remain black on white, including on monochrome printers. */
.tanis-invoice .btn-print { background: var(--tanis-red); color: #fff; }
.tanis-invoice .btn-print:hover { background: var(--tanis-red-dark); }
.tanis-invoice-a4 .header { border-bottom-color: var(--tanis-red); }
.tanis-invoice-a4 .doc-meta h2 { color: var(--tanis-red); }
.tanis-invoice .logo { width: 44mm; max-height: 27mm; height: auto; object-fit: contain; margin: 0 auto 2mm; }
@media print { .tanis-invoice-a4 .doc-meta h2 { color: #000; } }

/* The operational branch is shown once, even on a small screen. */
.tanis-app .shop-branch-label { display:inline-flex; align-items:center; gap:8px; padding:9px 12px; border:1px solid var(--bs-border-color, #e5e7eb); border-radius:11px; font-size:.82rem; font-weight:600; max-width:220px; overflow-wrap:anywhere; }
.tanis-app .shop-branch-label i { color:var(--tanis-red); }
.tanis-app .shop-user-initial { display:flex; align-items:center; justify-content:center; background:var(--tanis-red); color:#fff; font-weight:800; width:38px; height:38px; flex-shrink:0; }
.tanis-app .branch-switch-form .form-select { max-width:200px; }
@media(max-width:575px) { .tanis-app .shop-branch-label { padding:7px 9px; font-size:.74rem; max-width:155px; } .tanis-app .branch-switch-form .form-select { min-width:85px; max-width:140px; } .tanis-app .shop-user-initial { width:32px; height:32px; } }

/* Compact density: the template is sized for very large screens, so tighten it for everyday laptop use.
   The root size only drops on desktop; phones keep 16px so inputs do not zoom on focus. */
@media (min-width: 992px) { html:has(> body.tanis-app) { font-size: 14px; } }
@media (min-width: 1200px) { .tanis-app #sidebar ~ #main { margin-left: 248px; } }
.tanis-app #sidebar .sidebar-wrapper { width: 248px; padding: .85rem .7rem 1rem; }
.tanis-app #sidebar .sidebar-header { margin-bottom: .4rem; }
.tanis-app .sidebar-brand-card { padding: 14px 12px 0; border-radius: 14px; }
.tanis-app .sidebar-brand-link { flex-basis: 76px; }
.tanis-app .sidebar-brand-logo { width: 76px; }
.tanis-app .sidebar-brand-controls { top: -4px; right: -2px; }
.tanis-app .sidebar-brand-controls .action-icon-btn,
.tanis-app .sidebar-brand-controls .sidebar-hide { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.tanis-app .sidebar-utility { margin-top: 10px; }
.tanis-app .sidebar-utility .theme-toggle { padding: 8px 0; }
.tanis-app #sidebar .sidebar-title { margin: .85rem 0 .3rem; padding: 0 .6rem; font-size: .66rem; }
.tanis-app #sidebar .sidebar-item > .sidebar-link { gap: .65rem; margin-bottom: .15rem; padding: .45rem .6rem; border-radius: 10px; font-weight: 600; transform: none; }
.tanis-app #sidebar .sidebar-item > .sidebar-link i { flex-shrink: 0; width: 1.85rem; height: 1.85rem; border-radius: 8px; font-size: .9rem; }
.tanis-app #sidebar .sidebar-link span { margin-left: 0; }
.tanis-app #sidebar .sidebar-item.has-sub > .sidebar-link:after { top: calc(50% - 10px); right: 10px; line-height: 0; }
.tanis-app #sidebar .sidebar-nav-copy { gap: 0; padding-right: 22px; text-align: left; }
.tanis-app #sidebar .sidebar-nav-label { font-size: .9rem; line-height: 1.3; }
/* The description is still available as the link's title tooltip. */
.tanis-app #sidebar .sidebar-nav-copy small { display: none; }
.tanis-app #sidebar .submenu .submenu-item a { padding: .4rem .75rem; font-size: .88rem; border-radius: 8px; }
.tanis-app #sidebar .sidebar-submenu-heading { padding: 8px 12px 2px; }

.tanis-app #main { padding: .7rem; }
.tanis-app .admin-shell { padding: .75rem; border-radius: 22px; }
.tanis-app .admin-topbar { padding: .45rem .8rem; margin-bottom: .75rem; border-radius: 14px; }
.tanis-app .action-icon-btn { width: 36px; height: 36px; }
@media (min-width: 992px) {
    .tanis-app .page-heading h3 { font-size: 1.4rem; }
    .tanis-app .shop-dashboard .sd-heading h2 { font-size: 1.45rem; }
}

.tanis-app .page-shell .form-control,
.tanis-app .page-shell .form-select,
.tanis-app .page-shell select,
.tanis-app .page-shell .choices__inner,
.tanis-app .page-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-height: 36px; border-radius: 10px; }
.tanis-app .page-shell .select2-container .select2-selection--single { display: flex; align-items: center; min-height: 36px; border-radius: 10px; }
.tanis-app .page-shell .form-control-sm,
.tanis-app .page-shell .form-select-sm { min-height: 31px; border-radius: 8px; }
.tanis-app .page-shell textarea { min-height: 76px; border-radius: 10px; }
.tanis-app .page-shell .form-check,
.tanis-app .page-shell .checkbox-stack,
.tanis-app .page-shell .radio-stack { min-height: 36px; padding-top: .5rem; padding-bottom: .5rem; border-radius: 10px; }
.tanis-app .scope-select-card .form-select { min-height: 36px; }
.tanis-app .page-shell .d-flex.justify-content-end .btn,
.tanis-app .page-shell .text-end .btn,
.tanis-app .page-shell .form-actions .btn { min-height: 36px; }
.tanis-app .modern-datatable-shell .dataTables_filter input,
.tanis-app .modern-datatable-shell .dataTables_length select { min-height: 34px; }

.tanis-app .modern-data-table thead th,
.tanis-app .page-shell .table thead th { padding: .6rem .75rem; font-size: .72rem; }
.tanis-app .modern-data-table tbody td,
.tanis-app .page-shell .table tbody td,
.tanis-app .modern-data-table tbody th,
.tanis-app .page-shell .table tbody th { padding: .55rem .75rem; }

/* Barcode scanning: scan bars, camera buttons and the camera dialog (public/js/tanis-scan.js). */
.tanis-scanbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed #d9c9cc; border-radius: 12px; background: #fdf8f8; }
.tanis-scanbar > i { font-size: 1.3rem; color: var(--tanis-red, #b51224); }
.tanis-scanbar > input { flex: 1 1 240px; max-width: 420px; }
.tanis-scan-status { font-size: .82rem; font-weight: 600; }
.tanis-scan-status.is-ok { color: #1d7a3b; }
.tanis-scan-status.is-error { color: var(--tanis-red, #b51224); }
.tanis-scan-camera { display: inline-flex; align-items: center; justify-content: center; width: 38px; min-height: 36px; padding: 0; border: 1px solid #d8ced0; border-radius: 10px; background: #fff; color: var(--tanis-red, #b51224); }
.tanis-scan-camera:hover { background: #fdf1f2; border-color: var(--tanis-red, #b51224); }
.tanis-scan-search { display: flex; gap: 6px; align-items: center; }
.tanis-scan-search > input { flex: 1; min-width: 0; }
.tanis-scan-hit > td, .tanis-scan-hit.adjustment-row { animation: tanis-scan-flash 1.2s ease-out; }
@keyframes tanis-scan-flash { from { background: #e3f6e8; } to { background: transparent; } }
.tanis-scan-dialog { width: min(440px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.tanis-scan-dialog::backdrop { background: rgba(15, 8, 10, .6); }
.tanis-scan-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #eee; }
.tanis-scan-close { border: 0; background: none; font-size: 1.6rem; line-height: 1; color: #777; }
.tanis-scan-view { min-height: 240px; background: #111; }
.tanis-scan-view video { width: 100% !important; display: block; }
.tanis-scan-hint { margin: 0; padding: 10px 16px 14px; font-size: .85rem; color: #555; text-align: center; }
.tanis-no-camera [data-scan-fill] { display: none !important; }
