@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --cyan: #06b6d4;
    --green: #16a34a;
    --orange: #f59e0b;
    --red: #dc2626;
    --purple: #7c3aed;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --text: #172033;
    --muted: #64748b;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.theme-dark {
    --bg: #0f172a;
    --surface: #111827;
    --surface-2: #1f2937;
    --line: #273449;
    --line-strong: #3b4a62;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --shadow: 0 14px 34px rgba(0, 0, 0, .28);
}

* {
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
}

*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Roboto", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button,
input,
select,
textarea,
label {
    font-family: "Roboto", sans-serif;
}

.swal2-popup,
.swal2-title,
.swal2-html-container,
.swal2-actions button {
    font-family: "Roboto", sans-serif !important;
}

.swal2-popup {
    border-radius: 8px !important;
}

.swal2-container.swal2-top-end {
    padding: 12px !important;
}

.swal2-popup.swal2-toast {
    width: min(320px, calc(100vw - 24px)) !important;
    min-height: 48px !important;
    padding: 9px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .16) !important;
}

.swal2-toast .swal2-title {
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    text-align: left !important;
}

.swal2-toast .swal2-icon {
    width: 22px !important;
    min-width: 22px !important;
    height: 22px !important;
    margin: 0 9px 0 0 !important;
    border-width: 2px !important;
    font-size: 9px !important;
}

.swal2-toast .swal2-timer-progress-bar {
    background: currentColor !important;
    opacity: .28;
}

.swal2-toast.swal2-icon-success {
    color: #166534 !important;
    background: #dcfce7 !important;
    border-color: #86efac !important;
}

.swal2-toast.swal2-icon-error {
    color: #991b1b !important;
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

.swal2-toast.swal2-icon-warning {
    color: #92400e !important;
    background: #fef3c7 !important;
    border-color: #fcd34d !important;
}

.swal2-toast.swal2-icon-info,
.swal2-toast.swal2-icon-question {
    color: #1e40af !important;
    background: #dbeafe !important;
    border-color: #93c5fd !important;
}

.swal2-toast .swal2-success-ring,
.swal2-toast .swal2-icon-content,
.swal2-toast [class^="swal2-success-line"] {
    color: inherit !important;
    border-color: currentColor !important;
}

.swal2-toast [class^="swal2-success-line"] {
    background-color: currentColor !important;
}

[class^="fa-"],
[class*=" fa-"],
.fa,
.fa-classic,
.fa-sharp,
.fas,
.fa-solid,
.far,
.fa-regular,
.fab,
.fa-brands {
    font-family: "Font Awesome 6 Free" !important;
}

[class^="fa-"]::before,
[class*=" fa-"]::before,
.fa::before,
.fa-classic::before,
.fa-sharp::before,
.fas::before,
.fa-solid::before,
.far::before,
.fa-regular::before,
.fab::before,
.fa-brands::before {
    font-family: "Font Awesome 6 Free" !important;
}

.fas,
.fa-solid {
    font-weight: 900;
}

.fas::before,
.fa-solid::before {
    font-weight: 900;
}

.far,
.fa-regular {
    font-weight: 400;
}

.far::before,
.fa-regular::before {
    font-weight: 400;
}

.fab,
.fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400;
}

.fab::before,
.fa-brands::before {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 24px rgba(15, 23, 42, .04);
    z-index: 5;
    overflow-y: auto;
}

.brand {
    position: sticky;
    top: 0;
    z-index: 6;
    flex: 0 0 68px;
    min-height: 68px;
    padding: 12px 24px 11px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.brand img {
    display: block;
    width: 100%;
    max-width: 176px;
    height: auto;
    object-fit: contain;
}

.nav {
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    gap: 2px;
}

.nav a,
.userbox a,
.btn {
    border: 0;
    text-decoration: none;
    cursor: pointer;
    font-family: "Roboto", sans-serif;
}

button,
input,
select,
textarea {
    font-family: "Roboto", sans-serif;
}

.nav a,
.nav-group-title {
    min-height: 38px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #475569;
    font-weight: 700;
    border-left: 3px solid transparent;
    border-radius: 8px;
}

.nav-group-title {
    width: 100%;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    font-family: "Roboto", sans-serif;
    text-align: left;
    cursor: pointer;
}

.nav a span,
.nav-group-title span {
    width: 20px;
    color: #94a3b8;
    text-align: center;
}

.nav a:hover,
.nav-group-title:hover {
    background: #f1f5f9;
    color: var(--blue-dark);
}

.nav a.active,
.nav-group-title.active {
    border-left-color: var(--blue);
    color: var(--blue-dark);
    background: #eff6ff;
}

.nav a.active span,
.nav-group-title.active span { color: var(--blue); }

.nav-group {
    border-radius: 10px;
}

.nav-group-title .fa-chevron-down {
    margin-left: auto;
    color: #94a3b8;
    font-size: 11px;
    transition: transform .16s ease;
}

.nav-group.open .nav-group-title {
    color: var(--blue-dark);
}

.nav-group.open .nav-group-title span {
    color: var(--blue);
}

.nav-group.open .nav-group-title .fa-chevron-down {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    gap: 2px;
    margin: 2px 0 6px 28px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
}

.nav-group.open .nav-submenu {
    display: grid;
}

.nav-submenu a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
    border-left: 0;
}

.nav-submenu a.active {
    border-left: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.main {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: 64px;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(190px, 280px) minmax(240px, 1fr) auto;
    gap: 18px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 4;
}

.page-kicker {
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 800;
}

.page-title {
    margin-top: 3px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.global-search input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px 10px 38px;
    background: var(--surface-2);
    outline: none;
}

.global-search {
    position: relative;
}

.global-search .fa-magnifying-glass {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.global-search input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px #dbeafe;
}

.userbox {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #334155;
    font-weight: 700;
}

.user-trigger {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 5px 10px 5px 5px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #334155;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.user-trigger:hover,
.userbox:focus-within .user-trigger {
    border-color: #bfdbfe;
    box-shadow: 0 0 0 3px #dbeafe;
}

.user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 230px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: .16s ease;
    z-index: 20;
}

.userbox:hover .user-menu,
.userbox:focus-within .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-head {
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}

.user-menu-head b,
.user-menu-head span {
    display: block;
}

.user-menu-head span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
}

.user-menu a:hover {
    background: #eff6ff;
    color: var(--blue-dark);
}

.user-menu i {
    width: 18px;
    text-align: center;
    color: #64748b;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .12);
}

.userbox a {
    color: var(--blue-dark);
    font-weight: 800;
}

.app {
    max-width: none;
    margin: 0;
    padding: 26px 28px;
    width: 100%;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.page-header .hero {
    margin-bottom: 0;
}

.page-header .actions {
    margin: 0;
    justify-content: flex-end;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.hero {
    margin: 0 0 18px;
    padding: 0;
    color: var(--text);
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    text-align: left;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0;
}

.hero:after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    margin-top: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 16px 0 16px;
}

.inline-search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-import {
    display: inline-flex;
    margin: 0;
}


.inline-search .input {
    min-width: 260px;
}

.btn {
    border-radius: 8px;
    padding: 9px 14px;
    background: var(--surface);
    color: var(--text);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.btn:hover { filter: brightness(.98); }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-gray { background: #e5e7eb; border-color: #e5e7eb; color: #111827; }
.btn-light { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.small { padding: 6px 10px; font-size: 12px; }

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

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

.stat-card {
    min-height: 132px;
    background:
        radial-gradient(circle at 90% 20%, rgba(37, 99, 235, .10), transparent 30%),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stat-card:before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--stat-color, var(--blue));
}

.stat-card:after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: 14px;
    width: 98px;
    height: 32px;
    opacity: .7;
    background: linear-gradient(135deg, transparent 0 20%, rgba(37,99,235,.22) 20% 25%, transparent 25% 45%, rgba(37,99,235,.32) 45% 50%, transparent 50% 70%, rgba(6,182,212,.42) 70% 75%, transparent 75%);
}

.stat-blue { --stat-color: #2563eb; }
.stat-green { --stat-color: #16a34a; }
.stat-orange { --stat-color: #f59e0b; }
.stat-purple { --stat-color: #7c3aed; }

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--stat-color, var(--blue));
    background: #eff6ff;
    font-size: 18px;
    flex: 0 0 auto;
}

.stat-body {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.stat-body span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 900;
    margin-bottom: 8px;
}

.stat-body strong {
    display: block;
    color: var(--text);
    font-size: 30px;
    line-height: 1.05;
}

.stat-body em {
    display: inline-flex;
    margin-top: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-style: normal;
    font-size: 11px;
    font-weight: 900;
}

.stat-green .stat-icon,
.stat-green .stat-body em { background: #dcfce7; color: #15803d; }
.stat-orange .stat-icon,
.stat-orange .stat-body em { background: #ffedd5; color: #c2410c; }
.stat-purple .stat-icon,
.stat-purple .stat-body em { background: #ede9fe; color: #6d28d9; }
.stat-blue .stat-icon,
.stat-blue .stat-body em { background: #dbeafe; color: #1d4ed8; }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, .9fr);
    gap: 20px;
    align-items: start;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    min-height: 122px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card:before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--blue);
}

.card.green:before { background: var(--green); }
.card.orange:before { background: var(--orange); }
.card.red:before { background: var(--red); }

.card:after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 88px;
    height: 34px;
    opacity: .7;
    background: linear-gradient(135deg, transparent 0 18%, #bfdbfe 18% 22%, transparent 22% 42%, #93c5fd 42% 46%, transparent 46% 68%, #67e8f9 68% 72%, transparent 72%);
}

.card span:first-child {
    color: var(--muted);
    font-size: 18px;
}

.card h3 {
    margin: 12px 0 8px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.card strong {
    font-size: 28px;
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    white-space: nowrap;
}

.badge.green { background: #dcfce7; color: #15803d; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }

.panel,
.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.panel {
    margin-top: 18px;
    overflow: hidden;
}

.panel-title {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    font-weight: 900;
    color: var(--text);
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.panel-title:before { display: none; }

.panel-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.panel-search .input {
    width: min(420px, 42vw);
    height: 34px;
    padding: 6px 10px;
}

.panel-search .btn {
    min-height: 34px;
}

.parts-panel-title {
    align-items: center;
}

.parts-panel-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
}

.bulk-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.bulk-inline-form .input {
    width: auto;
    min-width: 150px;
    height: 34px;
}

.check-col {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.check-col input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
    cursor: pointer;
}

.chart-panel {
    padding: 0;
    overflow: hidden;
}

.chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 0;
    margin-bottom: 12px;
}

.chart-title {
    font-size: 14px;
    font-weight: 900;
    color: var(--text);
}

.chart-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.chart {
    height: 260px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(to bottom, transparent 0 19%, var(--line) 20%, transparent 21% 39%, var(--line) 40%, transparent 41% 59%, var(--line) 60%, transparent 61% 79%, var(--line) 80%, transparent 81%),
        linear-gradient(135deg, rgba(37,99,235,.14), rgba(6,182,212,.05));
    position: relative;
    overflow: hidden;
}

.chart-live {
    height: auto;
    min-height: 260px;
    background: #fff;
    border: 0;
    border-radius: 0;
    padding: 0 10px 10px;
}

.chart-live:before,
.chart-live:after {
    display: none;
}

.php-chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 260px;
    font-family: "Roboto", sans-serif;
}

.chart:before {
    content: "";
    position: absolute;
    inset: 34px 18px 42px;
    background: linear-gradient(135deg, transparent 0 9%, #60a5fa 10% 11%, transparent 12% 20%, #60a5fa 21% 22%, transparent 23% 32%, #2563eb 33% 34%, transparent 35% 43%, #2563eb 44% 45%, transparent 46% 56%, #1d4ed8 57% 58%, transparent 59% 68%, #2563eb 69% 70%, transparent 71% 80%, #1d4ed8 81% 82%, transparent 83%);
    clip-path: polygon(0 72%, 7% 62%, 14% 76%, 22% 58%, 30% 66%, 39% 38%, 48% 52%, 58% 22%, 67% 45%, 76% 36%, 86% 41%, 100% 18%, 100% 100%, 0 100%);
}

.chart:after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 42px;
    height: 2px;
    background: #2563eb;
    transform: skewY(-8deg);
    transform-origin: left center;
    box-shadow: 70px -18px 0 -1px #2563eb, 150px 4px 0 -1px #2563eb, 230px -42px 0 -1px #2563eb, 330px -14px 0 -1px #2563eb, 460px -78px 0 -1px #2563eb, 590px -36px 0 -1px #2563eb;
}

.form-card {
    padding: 20px;
    margin: 0 0 18px;
}

.module-form .actions {
    margin: 16px 0 0;
}

.reception-form {
    display: grid;
    gap: 18px;
}

.reception-section {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    background: var(--surface);
}

.lookup-box,
.vehicle-picker {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}

.lookup-row,
.vehicle-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.lookup-box .field,
.vehicle-picker .field {
    margin: 0;
    position: relative;
}

.vehicle-smart-picker {
    position: relative;
}

.vehicle-smart-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.lookup-results {
    position: absolute;
    z-index: 30;
    width: min(520px, calc(100vw - 64px));
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
}

.lookup-result {
    display: grid;
    width: 100%;
    gap: 4px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.lookup-result:hover {
    background: #eff6ff;
}

.theme-dark .lookup-result:hover {
    background: rgba(37, 99, 235, .18);
}

.lookup-result strong {
    font-size: 14px;
    font-weight: 900;
}

.lookup-result span,
.lookup-result em,
.lookup-empty,
.muted-help {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.lookup-empty {
    padding: 12px 14px;
}

.quote-reception-lookup {
    position: relative;
}

.quote-reception-results {
    max-height: 360px;
    overflow-y: auto;
}

.section-title {
    margin: -16px -16px 16px;
    padding: 8px 14px;
    border-radius: 12px 12px 0 0;
    background: #fff3cd;
    color: #111827;
    font-weight: 900;
    text-transform: uppercase;
}

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

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

.check-list {
    display: grid;
    gap: 8px;
}

.check-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 180px;
    gap: 12px;
    align-items: center;
}

.check-row label {
    color: var(--text);
    font-weight: 700;
}

.check-row .input {
    height: 34px;
    padding: 6px 10px;
}

.service-field {
    grid-column: 1 / -1;
}

.checkbox-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
}

.checkbox-pills label {
    margin: 0;
    cursor: pointer;
}

.checkbox-pills input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-pills span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 800;
    border: 1px solid var(--line);
}

.checkbox-pills input:checked + span {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.form-card h3 {
    margin: 14px 0 12px;
    color: var(--text);
    font-size: 14px;
    letter-spacing: .04em;
}

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

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.field label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
    color: #334155;
}

.input,
select,
textarea,
input {
    max-width: 100%;
}

.input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 10px 11px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.input:focus,
select:focus,
textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px #dbeafe;
}

textarea { min-height: 88px; resize: vertical; }

.empty-state {
    min-height: 280px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: var(--surface);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 40px;
    box-shadow: var(--shadow);
}

.empty-state i {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--blue);
    background: #eff6ff;
    font-size: 26px;
    margin: 0 auto 14px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.table-wrap {
    overflow: auto;
}

.repair-module-tabs {
    margin-bottom: 16px;
}

.repair-modern-panel .actions-cell {
    min-width: 330px;
    white-space: nowrap;
}

.repair-modern-panel .repair-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 6px;
}

.repair-modern-panel .repair-row-actions .btn {
    flex: 0 0 auto;
}

.repair-modern-panel .empty-cell {
    padding: 22px;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.repair-modern-form {
    display: grid;
    gap: 18px;
}

.repair-form-section {
    display: grid;
    gap: 12px;
}

.repair-form-section .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 900;
}

.repair-form-section .section-title.with-actions {
    flex-wrap: wrap;
}

.repair-work-note {
    color: var(--muted);
    font-weight: 700;
}

.repair-work-table {
    min-width: 980px;
    table-layout: fixed;
}

.repair-work-table th:nth-child(1),
.repair-work-table td:nth-child(1) {
    width: 60px;
    text-align: center;
}

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

.repair-work-table th:nth-child(3),
.repair-work-table td:nth-child(3),
.repair-work-table th:nth-child(4),
.repair-work-table td:nth-child(4) {
    width: 105px;
}

.repair-work-table th:nth-child(5),
.repair-work-table td:nth-child(5) {
    width: 150px;
}

.repair-work-table th:nth-child(6),
.repair-work-table td:nth-child(6),
.repair-work-table th:nth-child(7),
.repair-work-table td:nth-child(7) {
    width: 120px;
    text-align: center;
}

.repair-work-table .group-row td {
    background: #f8fafc;
    color: var(--text);
    font-weight: 900;
}

.repair-work-table .table-input {
    width: 100%;
    min-height: 32px;
    padding: 6px 8px;
    border-color: transparent;
    background: transparent;
}

.repair-work-table .table-input:focus {
    border-color: var(--blue);
    background: var(--surface);
}

.repair-work-table .center {
    text-align: center;
}

.repair-work-table .check-cell {
    text-align: center;
}

.repair-work-table input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--blue);
}

.repair-modern-form .span-2 {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .repair-modern-form .span-2 {
        grid-column: auto;
    }
}

.repair-sheet {
    color: #000;
    background: #fff;
    border: 1px solid #d7dde8;
    padding: 18px 16px 22px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.repair-sheet-head {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.repair-sheet-head h1 {
    margin: 0;
    color: #1d5acb;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.repair-period {
    display: grid;
    grid-template-columns: auto 128px auto 1fr auto;
    gap: 8px 12px;
    align-items: center;
    min-width: min(650px, 100%);
    font-weight: 700;
}

.sheet-date-input,
.sheet-line-input,
.sheet-cell-input,
.repair-sheet-search input,
.repair-sheet-filter input,
.repair-sheet-filter select {
    width: 100%;
    min-height: 28px;
    border: 1px solid #0b55e7;
    background: #fff;
    color: #000;
    padding: 3px 7px;
    font-size: 14px;
    border-radius: 0;
    outline: none;
}

.sheet-date-input {
    height: 60px;
    background: #fff2c7;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
}

.sheet-date-input.wide {
    min-width: 250px;
}

.repair-sheet-toolbar {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(320px, 430px);
    gap: 28px;
    align-items: center;
    margin-bottom: 20px;
}

.repair-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.repair-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    border: 2px solid #0b55e7;
    border-left-width: 0;
    color: #000;
    background: #fff;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
}

.repair-tabs a:first-child {
    border-left-width: 2px;
}

.repair-tabs a.active {
    background: #ff7900;
    color: #fff;
}

.repair-sheet-search input {
    min-height: 31px;
    border: 2px solid #ff8a00;
    font-size: 16px;
}

.repair-sheet-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 170px 170px auto auto;
    gap: 8px;
    align-items: center;
    margin: 0 0 18px;
}

.repair-sheet-filter input,
.repair-sheet-filter select {
    border-color: #b7c7e5;
    border-radius: 4px;
}

.repair-sheet-panel {
    position: relative;
    border: 1px solid #0b55e7;
    border-top: 0;
}

.repair-sheet-strip,
.repair-form-band {
    display: grid;
    align-items: center;
    min-height: 25px;
    padding: 3px 6px;
    background: #c7d8f4;
    border-top: 1px solid #0b55e7;
    border-bottom: 1px solid #0b55e7;
    color: #000;
    font-size: 16px;
    font-weight: 800;
}

.repair-form-band {
    grid-template-columns: minmax(210px, 470px) 1fr;
    margin-top: 18px;
    background: transparent;
    border: 0;
    padding: 0;
}

.repair-form-band strong {
    min-height: 23px;
    padding: 3px 6px;
    background: #fff2c7;
}

.repair-form-band div {
    min-height: 23px;
    background: #fff2c7;
}

.repair-sheet-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid #0b55e7;
}

.sheet-mini-btn,
.sheet-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 29px;
    padding: 4px 12px;
    border: 1px solid #0b55e7;
    background: #fff;
    color: #000;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.sheet-mini-btn.danger,
.sheet-action-btn.danger {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

.sheet-action-btn.primary {
    background: #fff;
}

.sheet-action-btn.muted {
    background: #f8fafc;
}

.repair-form-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(82px, 1fr));
}

.repair-form-actions .sheet-action-btn {
    border-left-width: 0;
}

.repair-form-actions .sheet-action-btn:first-child {
    border-left-width: 1px;
}

.repair-sheet-table-wrap {
    width: 100%;
    overflow: auto;
}

.repair-sheet-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.repair-sheet-table th,
.repair-sheet-table td {
    height: 26px;
    border: 1px solid #0b55e7;
    padding: 2px 5px;
    color: #000;
    font-size: 16px;
    line-height: 1.2;
    vertical-align: middle;
}

.repair-sheet-table th {
    background: #fff2c7;
    font-weight: 900;
    text-align: center;
}

.repair-sheet-table th:nth-child(1),
.repair-sheet-table td:nth-child(1) {
    width: 36px;
    text-align: center;
}

.repair-sheet-table th:nth-child(2),
.repair-sheet-table td:nth-child(2) {
    width: 60px;
    text-align: center;
}

.repair-sheet-table th:nth-child(3),
.repair-sheet-table td:nth-child(3) {
    width: 150px;
}

.repair-sheet-table th:nth-child(8),
.repair-sheet-table td:nth-child(8) {
    width: 290px;
}

.sheet-actions-cell {
    text-align: center;
    white-space: nowrap;
}

.sheet-actions-cell a {
    color: #000;
    text-decoration: none;
}

.repair-sheet-form {
    display: block;
}

.repair-sheet-fields {
    display: grid;
    gap: 0 28px;
    margin: 0 0 12px;
}

.repair-sheet-fields.two {
    grid-template-columns: minmax(360px, 470px) minmax(360px, 470px);
    justify-content: space-between;
}

.repair-sheet-fields label,
.repair-summary-row label {
    display: grid;
    grid-template-columns: 118px minmax(160px, 220px);
    align-items: center;
    min-height: 21px;
    color: #000;
    font-size: 14px;
}

.repair-sheet-fields label:nth-child(even) {
    grid-template-columns: 126px minmax(100px, 1fr);
}

.sheet-line-input {
    min-height: 22px;
    height: 22px;
    border-width: 1px;
    font-size: 14px;
}

.sheet-line-input[readonly] {
    background: #fff;
}

.sheet-line-input.compact {
    max-width: 102px;
}

.repair-info-row {
    display: grid;
    grid-template-columns: 330px auto 1fr;
    gap: 4px;
    align-items: center;
    margin: 18px 0;
}

.repair-info-row strong {
    font-size: 15px;
}

.repair-info-row em {
    color: #f00;
    font-size: 14px;
}

.repair-sub-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.repair-sub-tabs button {
    min-height: 25px;
    border: 2px solid #0b55e7;
    border-left-width: 0;
    background: #fff;
    color: #000;
    font-weight: 800;
    cursor: pointer;
}

.repair-sub-tabs button:first-child {
    border-left-width: 2px;
}

.repair-sub-tabs button.active {
    background: #fff2c7;
    color: #000;
}

.repair-form-table th:nth-child(1),
.repair-form-table td:nth-child(1) {
    width: 80px;
}

.repair-form-table th:nth-child(2),
.repair-form-table td:nth-child(2) {
    width: 260px;
    text-align: left;
}

.repair-form-table th:nth-child(3),
.repair-form-table td:nth-child(3) {
    width: 105px;
}

.repair-form-table th:nth-child(4),
.repair-form-table td:nth-child(4),
.repair-form-table th:nth-child(6),
.repair-form-table td:nth-child(6),
.repair-form-table th:nth-child(7),
.repair-form-table td:nth-child(7) {
    width: 120px;
    text-align: center;
}

.repair-form-table th:nth-child(5),
.repair-form-table td:nth-child(5) {
    width: 140px;
}

.sheet-section-row td {
    background: #fff2c7;
    font-weight: 900;
}

.sheet-cell-input {
    min-height: 21px;
    height: 21px;
    border: 0;
    padding: 0 3px;
    background: transparent;
}

.sheet-cell-input:focus,
.sheet-line-input:focus {
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.sheet-cell-input.center {
    text-align: center;
}

.strong-cell {
    font-weight: 700;
}

.center {
    text-align: center;
}

.repair-summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(210px, 1fr)) minmax(320px, 1.5fr);
    gap: 14px;
    align-items: center;
    margin-top: 14px;
}

.repair-summary-row label {
    grid-template-columns: auto minmax(110px, 1fr);
    gap: 8px;
    font-weight: 700;
}

.repair-summary-row .note {
    min-width: 240px;
}

@media (max-width: 1100px) {
    .repair-sheet-head,
    .repair-sheet-toolbar,
    .repair-sheet-fields.two,
    .repair-info-row,
    .repair-summary-row {
        grid-template-columns: 1fr;
    }

    .repair-period {
        min-width: 0;
        grid-template-columns: auto 1fr;
    }

    .repair-period label:nth-of-type(2),
    .repair-period .wide {
        grid-column: auto;
    }

    .repair-tabs,
    .repair-form-actions,
    .repair-sub-tabs,
    .repair-sheet-filter {
        grid-template-columns: 1fr 1fr;
    }
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.pagination-size,
.pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

.pagination-size .input {
    width: 78px;
    height: 34px;
    padding: 6px 10px;
}

.pagination-summary {
    color: var(--muted);
    font-weight: 700;
}

.page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    background: var(--surface-2);
    text-decoration: none !important;
    color: var(--text);
    font-weight: 900;
}

.page-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.page-btn.disabled {
    pointer-events: none;
    opacity: .45;
}

.page-ellipsis {
    color: var(--muted);
    font-weight: 900;
}

.repair-items-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    margin-bottom: 18px;
}

.repair-items-table {
    min-width: 980px;
}

.repair-items-table th:nth-child(1),
.repair-items-table td:nth-child(1) {
    width: 56px;
    text-align: center;
}

.repair-items-table th:nth-child(2),
.repair-items-table td:nth-child(2) {
    width: 120px;
}

.repair-items-table th:nth-child(3),
.repair-items-table td:nth-child(3) {
    min-width: 420px;
    width: 52%;
}

.repair-items-table th:nth-child(4),
.repair-items-table td:nth-child(4),
.repair-items-table th:nth-child(5),
.repair-items-table td:nth-child(5),
.repair-items-table th:nth-child(6),
.repair-items-table td:nth-child(6) {
    width: 140px;
}

.repair-items-table th:nth-child(6),
.repair-items-table td:nth-child(6) {
    text-align: center;
}

.repair-items-table td {
    vertical-align: top;
}

.repair-items-table td:nth-child(4),
.repair-items-table td:nth-child(5),
.repair-items-table td:nth-child(6),
.repair-items-table td:nth-child(7) {
    vertical-align: middle;
}

.repair-items-table .item-type,
.repair-items-table .item-number {
    height: 38px;
}

.repair-items-table .item-description {
    min-height: 54px;
    resize: vertical;
    line-height: 1.5;
    white-space: pre-wrap;
}

.repair-items-table .amount {
    padding: 8px 12px;
    font-weight: 900;
    color: var(--blue-dark);
    text-align: center;
    white-space: nowrap;
}

.stock-items-table {
    min-width: 1120px;
    table-layout: fixed;
}

.stock-entry-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.stock-items-table th:nth-child(1),
.stock-items-table td:nth-child(1) {
    width: 44px;
    text-align: center;
}

.stock-items-table th:nth-child(2),
.stock-items-table td:nth-child(2) {
    width: 180px;
}

.stock-items-table th:nth-child(3),
.stock-items-table td:nth-child(3),
.stock-items-table th:nth-child(4),
.stock-items-table td:nth-child(4) {
    width: 20%;
}

.stock-items-table th:nth-child(5),
.stock-items-table td:nth-child(5) {
    width: 90px;
}

.stock-items-table th:nth-child(6),
.stock-items-table td:nth-child(6) {
    width: 110px;
}

.stock-items-table th:nth-child(7),
.stock-items-table td:nth-child(7),
.stock-items-table th:nth-child(8),
.stock-items-table td:nth-child(8) {
    width: 150px;
}

.stock-items-table th:nth-child(9),
.stock-items-table td:nth-child(9) {
    width: 54px;
    text-align: center;
}

.stock-items-table input,
.stock-items-table select {
    width: 100%;
    height: 34px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    padding: 6px 9px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.stock-items-table input:focus,
.stock-items-table select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .18);
}

.stock-items-table tbody tr.active-row,
.stock-items-table tbody tr:hover {
    background: #f8fbff;
}

.stock-items-table .amount {
    font-weight: 900;
    color: var(--blue-dark);
}

.row-remove {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff1f2;
    color: #dc2626;
    cursor: pointer;
}

.row-remove:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.stock-filter .form-grid {
    grid-template-columns: 150px 150px minmax(260px, 1fr) 110px;
    align-items: end;
}

.stock-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
}

.stock-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font-weight: 900;
    text-decoration: none;
}

.stock-tabs a.active,
.stock-tabs a:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.stock-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
    gap: 18px;
    align-items: start;
}

.compact-table th,
.compact-table td,
.inventory-table th,
.inventory-table td {
    padding: 10px 12px;
}

.inventory-table th:nth-child(1),
.inventory-table td:nth-child(1) {
    width: 120px;
}

.inventory-table th:nth-child(4),
.inventory-table td:nth-child(4),
.inventory-table th:nth-child(5),
.inventory-table td:nth-child(5),
.inventory-table th:nth-child(6),
.inventory-table td:nth-child(6) {
    width: 120px;
}

.is-low-stock {
    background: #fff1f2;
}

.stock-category-list {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.stock-category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    font-weight: 800;
}

.stock-category-row strong {
    min-width: 34px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    text-align: center;
}

.category-form-grid {
    grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) minmax(220px, 1fr);
}

.drag-handle {
    width: 24px;
    height: 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--muted);
    cursor: grab;
    display: inline-grid;
    place-items: center;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.drag-handle:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: var(--blue);
    transform: translateY(-1px);
}

.category-sort-table th:first-child,
.category-sort-table td:first-child {
    width: 78px;
    min-width: 78px;
    padding-left: 10px;
    padding-right: 14px;
    text-align: center;
}

.drag-handle:active {
    cursor: grabbing;
}

[data-category-row].dragging {
    opacity: .72;
    background: #eff6ff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}

.category-sort-table tbody tr {
    position: relative;
}

.category-sort-table tbody tr.drop-before td:first-child,
.category-sort-table tbody tr.drop-after td:first-child {
    position: relative;
}

.category-sort-table tbody tr.drop-before td:first-child:before,
.category-sort-table tbody tr.drop-after td:first-child:after {
    content: "";
    position: absolute;
    left: 8px;
    right: -9999px;
    height: 3px;
    border-radius: 999px;
    background: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    pointer-events: none;
    z-index: 2;
}

.category-sort-table tbody tr.drop-before td:first-child:before {
    top: -2px;
}

.category-sort-table tbody tr.drop-after td:first-child:after {
    bottom: -2px;
}

.is-dragging-category .category-sort-table tbody tr[data-category-row] {
    cursor: grabbing;
}

.category-sort-status {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.category-sort-status[data-state="saving"] {
    color: var(--blue-dark);
}

.category-sort-status[data-state="saved"] {
    color: var(--green);
}

.category-sort-status[data-state="error"] {
    color: var(--red);
}

.muted-cell {
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.icon-btn {
    min-width: 34px;
    height: 34px;
    padding: 0;
    font-size: 18px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: var(--surface);
}

th {
    background: var(--surface-2);
    color: var(--muted);
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

.num {
    text-align: right;
    font-family: "Roboto", sans-serif;
    white-space: nowrap;
}

.num-center {
    text-align: center;
    font-family: "Roboto", sans-serif;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 14%, rgba(37,99,235,.20), transparent 28%),
        radial-gradient(circle at 82% 80%, rgba(6,182,212,.18), transparent 30%),
        #eef5ff;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr);
}

.login-visual {
    padding: 48px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(29, 78, 216, .90)),
        linear-gradient(135deg, #0f172a, #2563eb);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-visual:after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 42px solid rgba(255,255,255,.08);
}

.login-brand {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.login-title span {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.login-brand img {
    display: block;
    width: min(280px, 70%);
    height: auto;
}

.login-copy {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.login-copy h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.1;
    letter-spacing: -.02em;
}

.login-copy p {
    margin: 18px 0 0;
    color: rgba(255,255,255,.78);
    font-size: 15px;
    line-height: 1.7;
}

.login-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.login-stats div {
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 14px;
    padding: 16px;
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(8px);
}

.login-stats strong,
.login-stats span {
    display: block;
}

.login-stats strong {
    font-size: 24px;
}

.login-stats span {
    margin-top: 4px;
    color: rgba(255,255,255,.76);
    font-weight: 700;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 36px;
}

.login-card {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid #dbe5f2;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
}

.login-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.login-title span {
    color: var(--blue);
    background: #eff6ff;
    font-size: 18px;
}

.login-title h2 {
    margin: 0;
    font-size: 26px;
}

.login-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.login-field {
    margin-bottom: 16px;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    z-index: 1;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.login-input-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.login-input-wrap .input {
    width: 100%;
    padding-left: 44px !important;
    height: 44px;
}

.login-btn {
    width: 100%;
    height: 46px;
    margin-top: 4px;
}

.login-verification-card .login-title span { color: #6d28d9; background: #f3e8ff; }
.login-verification-card form { margin: 0; }
.otp-code-input { padding-right: 14px !important; font-size: 22px; font-weight: 800; letter-spacing: .32em; text-align: center; font-variant-numeric: tabular-nums; }
.login-otp-meta { display: flex; align-items: center; gap: 7px; margin: -4px 0 14px; color: #64748b; font-size: 12px; line-height: 1.5; }
.login-secondary-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #e2e8f0; }
.login-link-button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 0; border: 0; color: #2563eb; background: transparent; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.login-link-button.muted { color: #64748b; }
.login-link-button:hover { text-decoration: underline; }
.login-link-button:disabled { color: #94a3b8; cursor: wait; text-decoration: none; }

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.remember-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.login-help {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 12px;
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.session-warning {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(3px);
}

.session-warning[hidden] {
    display: none;
}

.session-warning-card {
    width: min(100%, 460px);
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 16px;
    padding: 22px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #dbe5f2;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}

.session-warning-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #d97706;
    background: #fef3c7;
    font-size: 20px;
}

.session-warning-card h3 {
    margin: 0;
    font-size: 18px;
}

.session-warning-card p {
    margin: 8px 0 16px;
    color: #475569;
    line-height: 1.55;
    font-weight: 700;
}

.session-warning-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-panel {
    padding-bottom: 18px;
}

.account-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
}

.account-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    font-size: 28px;
    font-weight: 900;
}

.account-profile h2 {
    margin: 0;
    font-size: 22px;
}

.account-profile p {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.profile-list {
    margin: 0 22px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.profile-list div {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}

.profile-list div:last-child {
    border-bottom: 0;
}

.profile-list span {
    color: var(--muted);
    font-weight: 800;
}

.account-form {
    max-width: 560px;
}

.account-form .field {
    margin-bottom: 14px;
}

.settings-page {
    --settings-blue: #1769d2;
    --settings-blue-soft: #edf5ff;
    display: grid;
    gap: 18px;
    max-width: 1500px;
    margin: 0 auto;
}

.settings-heading { padding-bottom: 20px; }

.settings-heading-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
    padding: 11px 14px;
    border: 1px solid #cfe0f7;
    border-radius: 12px;
    color: #31506f;
    background: linear-gradient(135deg, #f7fbff, #edf5ff);
}

.settings-heading-badge > i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, #2380ed, #175bbb);
    box-shadow: 0 6px 14px rgba(23, 105, 210, .2);
}

.settings-heading-badge span { display: grid; color: #5a6b80; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.settings-heading-badge strong { color: #17395e; font-size: 19px; line-height: 1; }
.settings-alert { margin: 0; }
.settings-form { display: grid; gap: 16px; }

.settings-section {
    overflow: hidden;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 26px rgba(28, 52, 83, .055);
}

.settings-section-header {
    min-height: 76px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e9f2;
    background: linear-gradient(90deg, #fbfdff, var(--surface));
}

.settings-section-header h2 { margin: 0; color: var(--text); font-size: 15px; }
.settings-section-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; font-weight: 600; }

.settings-section-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 16px;
}

.settings-section-icon.garage { color: #0c7a59; background: #e8f8f2; }
.settings-section-icon.theme { color: #6c4ccf; background: #f1edff; }
.settings-section-icon.locale { color: #ba6513; background: #fff2df; }

.settings-section-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #d5e5fb;
    border-radius: 999px;
    color: #2763a6;
    background: #f0f6ff;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.settings-section-body { padding: 20px; }

.settings-logo-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px dashed #bfd0e3;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fbff, var(--surface));
}

.settings-logo-preview {
    display: grid;
    min-height: 76px;
    padding: 12px;
    place-items: center;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #fff;
}

.settings-logo-preview img {
    display: block;
    width: 100%;
    max-width: 150px;
    max-height: 64px;
    object-fit: contain;
}

.settings-logo-copy b { color: var(--text); font-size: 12px; }
.settings-logo-copy p { margin: 5px 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.settings-logo-copy span { color: #718096; font-size: 9.5px; font-weight: 650; }
.settings-logo-actions { display: flex; align-items: flex-end; flex-direction: column; justify-content: center; gap: 8px; }
.settings-logo-actions .btn { min-height: 40px; cursor: pointer; white-space: nowrap; }
.settings-logo-reset { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9.5px; font-weight: 650; cursor: pointer; }
.settings-logo-reset input { width: 15px; height: 15px; accent-color: var(--workspace-accent); }

.garage-settings-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 17px 18px;
}

.settings-col-3 { grid-column: span 3; }
.settings-col-4 { grid-column: span 4; }
.settings-col-6 { grid-column: span 6; }
.settings-col-8 { grid-column: span 8; }
.settings-section .field { min-width: 0; margin: 0; }
.settings-section .field label { margin-bottom: 7px; color: #384b64; font-size: 11px; }

.settings-input-shell { position: relative; }
.settings-input-shell > i { position: absolute; left: 13px; top: 50%; z-index: 1; color: #8090a5; font-size: 12px; transform: translateY(-50%); pointer-events: none; }
.settings-page .settings-section .settings-input-shell input.input { min-height: 42px; padding-left: 38px; border-color: #ccd8e7; border-radius: 9px; background: var(--surface); }
.settings-page .settings-section .settings-input-shell input.input:focus { border-color: #76aef1; box-shadow: 0 0 0 3px rgba(23, 105, 210, .12); }

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

.setting-option {
    position: relative;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    padding: 14px;
    overflow: hidden;
    border: 1px solid #d9e2ed;
    border-radius: 13px;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.setting-option:hover { border-color: #abc7e9; transform: translateY(-1px); }
.setting-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.setting-option input:focus-visible + .theme-preview { outline: 3px solid rgba(23, 105, 210, .28); outline-offset: 3px; }

.theme-preview {
    position: relative;
    min-height: 96px;
    display: block;
    overflow: hidden;
    border: 1px solid #d6dfeb;
    border-radius: 9px;
    background: #eef3f9;
}

.theme-preview::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 23%; background: #fff; border-right: 1px solid #dce4ee; }
.theme-preview::after { content: ""; position: absolute; top: 0; right: 0; left: 23%; height: 18%; background: #fff; border-bottom: 1px solid #dce4ee; }
.theme-preview i, .theme-preview b, .theme-preview em { position: absolute; left: 30%; right: 7%; display: block; border-radius: 4px; }
.theme-preview i { top: 28%; height: 22%; background: #fff; box-shadow: inset 3px 0 0 #3b82f6; }
.theme-preview b { top: 58%; right: 52%; height: 27%; background: #fff; }
.theme-preview em { top: 58%; left: 54%; height: 27%; background: #fff; }

.theme-preview-dark { border-color: #3e4b5f; background: #141c2a; }
.theme-preview-dark::before, .theme-preview-dark::after { border-color: #364257; background: #202b3d; }
.theme-preview-dark i, .theme-preview-dark b, .theme-preview-dark em { background: #273448; }
.theme-preview-dark i { box-shadow: inset 3px 0 0 #60a5fa; }

.theme-option-copy { display: grid; grid-template-columns: 38px minmax(0, 1fr) 20px; align-items: center; gap: 10px; min-width: 0; }
.theme-option-copy > span:nth-child(2) { display: grid; gap: 4px; }
.theme-option-copy b { color: var(--text); font-size: 13px; }
.theme-option-copy small { color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.4; }
.theme-option-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #1769d2; background: #edf5ff; }
.theme-option-check { color: #1d6fd4; font-size: 17px; opacity: 0; transform: scale(.75); transition: opacity .18s ease, transform .18s ease; }
.setting-option.selected { border-color: #76aef1; background: linear-gradient(135deg, var(--surface), #f5f9ff); box-shadow: 0 0 0 3px rgba(23, 105, 210, .1); }
.setting-option.selected .theme-option-check { opacity: 1; transform: scale(1); }

.settings-preference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-preference-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: end; gap: 12px; padding: 14px; border: 1px solid #e0e7f0; border-radius: 11px; background: var(--surface-2); }
.settings-preference-card > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: #356aa7; background: #eaf3ff; font-size: 16px; }
.settings-preference-card .input { min-height: 42px; border-radius: 8px; background: var(--surface); }

.settings-save-bar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px 12px 18px;
    border: 1px solid #cfdae8;
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 12px 32px rgba(26, 48, 80, .14);
    backdrop-filter: blur(10px);
}

.settings-save-bar > div { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 650; }
.settings-save-bar > div i { color: #3978bd; }
.settings-save-button { min-height: 42px; padding-inline: 18px; }

.theme-dark .settings-heading-badge,
.theme-dark .setting-option.selected { background: linear-gradient(135deg, var(--surface), rgba(37, 99, 235, .11)); }
.theme-dark .settings-section-header { background: linear-gradient(90deg, var(--surface-2), var(--surface)); }
.theme-dark .settings-save-bar { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.theme-dark .settings-logo-card { border-color: #36506b; background: linear-gradient(135deg, var(--surface-2), var(--surface)); }

@media (max-width: 1050px) {
    .settings-col-3, .settings-col-4, .settings-col-6, .settings-col-8 { grid-column: span 6; }
    .setting-option { grid-template-columns: 120px minmax(0, 1fr); }
}

@media (max-width: 720px) {
    .settings-heading { align-items: flex-start; flex-direction: column; }
    .settings-heading-badge { width: 100%; }
    .settings-section-header { grid-template-columns: 42px minmax(0, 1fr); padding: 13px 14px; }
    .settings-section-tag { grid-column: 1 / -1; width: max-content; }
    .settings-section-body { padding: 15px; }
    .settings-logo-card { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
    .settings-logo-actions { grid-column: 1 / -1; align-items: stretch; }
    .settings-logo-actions .btn { width: 100%; justify-content: center; }
    .garage-settings-grid, .settings-theme-grid, .settings-preference-grid { grid-template-columns: 1fr; }
    .settings-col-3, .settings-col-4, .settings-col-6, .settings-col-8 { grid-column: auto; }
    .setting-option { grid-template-columns: 105px minmax(0, 1fr); padding: 11px; }
    .theme-preview { min-height: 86px; }
    .theme-option-copy { grid-template-columns: minmax(0, 1fr) 18px; }
    .theme-option-icon { display: none; }
    .settings-save-bar { bottom: 8px; align-items: stretch; flex-direction: column; }
    .settings-save-button { width: 100%; justify-content: center; }
}

.app-footer {
    margin-top: auto;
    padding: 18px 28px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
}

.app-footer b {
    color: #f97316;
    font-weight: 700;
}

.print-title { display: none; }

/* Compact workspace: tối ưu diện tích hiển thị cho màn hình quản lý nghiệp vụ. */
.app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
}

.brand {
    padding: 12px 24px 11px 18px;
}

.nav {
    padding: 10px 8px;
}

.nav a,
.nav-group-title {
    min-height: 38px;
    padding: 0 14px;
    gap: 12px;
    border-radius: 8px;
}

.nav-submenu {
    margin-left: 28px;
}

.nav-submenu a {
    min-height: 34px;
    font-size: 12px;
}

.sidebar-footer {
    padding: 16px 22px;
}

.topbar {
    min-height: 64px;
    padding: 0 24px;
    grid-template-columns: minmax(190px, 280px) minmax(240px, 1fr) auto;
    gap: 18px;
}

.page-title {
    font-size: 18px;
}

.global-search input {
    padding-top: 8px;
    padding-bottom: 8px;
}

.avatar {
    width: 34px;
    height: 34px;
}

.user-trigger {
    padding: 5px 10px 5px 5px;
}

.app {
    max-width: none;
    padding: 14px 16px;
}

.page-header {
    margin-bottom: 10px;
    gap: 12px;
}

.hero {
    margin-bottom: 10px;
    font-size: 20px;
}

.hero:after {
    width: 42px;
    height: 2px;
    margin-top: 6px;
}

.page-subtitle {
    margin-top: 4px;
    font-size: 12px;
}

.actions {
    gap: 8px;
    margin: 10px 0;
}

.btn {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 7px;
}

.small {
    min-height: 30px;
    padding: 5px 8px;
}

.panel,
.form-card {
    border-radius: 8px;
}

.panel {
    margin-top: 12px;
}

.panel-title {
    min-height: 46px;
    padding: 0 12px;
    font-size: 13px;
}

.panel-title .btn {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
}

.form-card {
    padding: 14px;
    margin-bottom: 12px;
}

.filter-card {
    padding: 10px 12px;
}

.smart-filter .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: end;
}

.smart-filter .filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.smart-filter .filter-actions label {
    flex-basis: 100%;
}

.smart-filter .filter-actions .btn {
    width: auto;
    flex: 0 0 auto;
}

.voucher-filter.smart-filter .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.voucher-filter.smart-filter .stock-search-field .input {
    min-width: 0;
}

.form-grid {
    gap: 14px 16px;
}

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

.input,
select,
textarea {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 7px;
}

textarea {
    min-height: 68px;
}

.stats-grid {
    gap: 10px;
}

.stat-card {
    min-height: 96px;
    padding: 12px;
    border-radius: 8px;
    gap: 10px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 15px;
}

.stat-body span {
    margin-bottom: 5px;
    font-size: 10px;
}

.stat-body strong {
    font-size: 22px;
}

.stat-body em {
    margin-top: 6px;
    padding: 3px 7px;
}

.stock-tabs {
    gap: 6px;
    margin: 4px 0 10px;
}

.stock-tabs a {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 7px;
}

.stock-overview-grid {
    gap: 12px;
}

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

.stock-summary-card {
    min-height: 130px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .06), transparent 55%),
        var(--surface);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    overflow: hidden;
    position: relative;
}

.stock-summary-card:after {
    content: "";
    position: absolute;
    right: 22px;
    bottom: 16px;
    width: 118px;
    height: 36px;
    opacity: .72;
    background: linear-gradient(135deg, transparent 0 20%, #bfdbfe 20% 25%, transparent 25% 45%, #bfdbfe 45% 50%, transparent 50% 70%, #67e8f9 70% 75%, transparent 75%);
}

.stock-summary-card.green { border-top-color: var(--green); }
.stock-summary-card.orange { border-top-color: var(--orange); }
.stock-summary-card.purple { border-top-color: var(--purple); }

.summary-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--blue);
    background: #dbeafe;
    font-size: 18px;
    flex: 0 0 auto;
}

.stock-summary-card.green .summary-icon {
    color: #16a34a;
    background: #dcfce7;
}

.stock-summary-card.orange .summary-icon {
    color: #ea580c;
    background: #ffedd5;
}

.stock-summary-card.purple .summary-icon {
    color: #7c3aed;
    background: #ede9fe;
}

.summary-content {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.summary-content span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.summary-content strong {
    display: block;
    margin-top: 7px;
    font-size: 30px;
    line-height: 1.1;
    color: #0f172a;
}

.summary-content em {
    display: inline-flex;
    margin-top: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.stock-summary-card.green .summary-content em {
    color: #15803d;
    background: #dcfce7;
}

.stock-summary-card.orange .summary-content em {
    color: #c2410c;
    background: #ffedd5;
}

.stock-summary-card.purple .summary-content em {
    color: #6d28d9;
    background: #ede9fe;
}

.stock-category-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
}

.strip-title {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 800;
    white-space: nowrap;
}

.category-chip b {
    min-width: 24px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #dbeafe;
    color: var(--blue-dark);
    text-align: center;
}

.stock-filter .form-grid {
    grid-template-columns: 140px 140px 92px;
    align-items: end;
}

.stock-filter-bar {
    display: inline-block;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.stock-filter-bar .form-grid {
    gap: 8px;
}

.stock-filter-bar .field label {
    font-size: 11px;
}

.stock-filter-bar .input {
    height: 32px;
}

.stock-filter-bar .btn {
    min-height: 32px;
}

.stock-filter-full {
    width: 100%;
    margin: 0 0 10px;
    padding: 10px 12px;
}

.stock-filter-full .form-grid {
    grid-template-columns: 140px 140px 82px minmax(0, 1fr);
    gap: 8px;
    align-items: end;
}

.stock-filter-full .field:nth-child(3) {
    width: 82px;
}

.stock-filter-full .btn {
    width: 100%;
}

.voucher-filter {
    padding: 10px 12px;
}

.voucher-filter .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 8px 10px;
    align-items: end;
}

.voucher-filter .stock-search-field .input {
    min-width: 0;
}

.voucher-filter .btn {
    width: auto;
}

.stock-voucher-form {
    padding-top: 12px;
}

.stock-voucher-meta {
    grid-template-columns: 130px 150px 142px minmax(220px, 1fr) 140px 130px;
    align-items: end;
}

.stock-voucher-meta .field {
    min-width: 0;
}

.stock-partner-picker {
    display: grid;
    grid-template-columns: minmax(170px, .9fr) minmax(180px, 1.1fr);
    gap: 6px;
}

.stock-entry-actions {
    margin: 8px 0 10px;
}

.stock-voucher-form > .field {
    margin-top: 10px;
}

.stock-voucher-form > .actions:last-child {
    margin-bottom: 0;
}

th {
    padding: 8px 10px;
    font-size: 11px;
}

td {
    padding: 9px 10px;
}

.table-wrap table {
    font-size: 13px;
}

.table-wrap th {
    height: 34px;
    line-height: 1.2;
    vertical-align: middle;
}

.table-wrap td {
    height: 40px;
    line-height: 1.35;
    vertical-align: middle;
}

.table-wrap td .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 12px;
}

.table-wrap td .btn i {
    font-size: 12px;
}

.table-wrap tbody tr {
    transition: background .12s ease;
}

.compact-table th,
.compact-table td,
.inventory-table th,
.inventory-table td {
    padding: 8px 10px;
}

.compact-table td.num,
.compact-table th.num {
    min-width: 120px;
    text-align: center;
    padding-left: 14px;
    padding-right: 14px;
}

.compact-table td.no-print,
.compact-table th.no-print,
.inventory-table td.no-print,
.inventory-table th.no-print {
    text-align: center;
    white-space: nowrap;
}

.table-wrap td.num,
.table-wrap th.num,
.table-wrap td.money-col,
.table-wrap th.money-col,
.stock-items-table .amount,
.repair-items-table .amount {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.table-wrap td.money-col,
.table-wrap th.money-col {
    min-width: 120px;
    padding-left: 16px;
    padding-right: 16px;
}

.data-table {
    font-size: 13px;
}

.data-table .badge,
.compact-table .badge,
.inventory-table .badge {
    padding: 4px 9px;
    font-size: 11px;
}

.pagination-bar {
    padding: 8px 10px;
    font-size: 12px;
}

.pagination-size .input,
.page-btn {
    height: 28px;
}

.page-btn {
    min-width: 28px;
    border-radius: 7px;
}

.stock-entry-wrap {
    border-radius: 8px;
}

.stock-items-table {
    min-width: 1040px;
}

.stock-items-table th:nth-child(1),
.stock-items-table td:nth-child(1) {
    width: 38px;
}

.stock-items-table th:nth-child(2),
.stock-items-table td:nth-child(2) {
    width: 150px;
}

.stock-items-table th:nth-child(3),
.stock-items-table td:nth-child(3) {
    width: 21%;
}

.stock-items-table th:nth-child(4),
.stock-items-table td:nth-child(4) {
    width: 18%;
}

.stock-items-table th:nth-child(5),
.stock-items-table td:nth-child(5) {
    width: 72px;
}

.stock-items-table th:nth-child(6),
.stock-items-table td:nth-child(6) {
    width: 86px;
}

.stock-items-table th:nth-child(7),
.stock-items-table td:nth-child(7) {
    width: 120px;
}

.stock-items-table th:nth-child(8),
.stock-items-table td:nth-child(8) {
    width: 118px;
}

.stock-items-table th:nth-child(9),
.stock-items-table td:nth-child(9) {
    width: 44px;
}

.stock-items-table input,
.stock-items-table select {
    height: 30px;
    padding: 4px 7px;
    border-radius: 6px;
}

.row-remove {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}

.reception-form {
    gap: 16px;
}

.reception-section {
    padding: 16px;
    border-radius: 10px;
}

.reception-section .section-title {
    margin: -16px -16px 16px;
    padding: 8px 12px;
    border-radius: 10px 10px 0 0;
}

.reception-section .form-grid,
.reception-section .compact-grid {
    gap: 16px 18px;
    align-items: start;
}

.reception-section > .field + .form-grid {
    margin-top: 14px;
}

.reception-section .field {
    min-width: 0;
}

.reception-section .field label {
    margin-bottom: 8px;
    line-height: 1.25;
}

.reception-section .input,
.reception-section select,
.reception-section textarea {
    min-height: 38px;
    padding: 9px 11px;
}

.two-col {
    gap: 16px;
}

.lookup-box,
.vehicle-picker {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 8px;
}

.check-list {
    gap: 6px;
}

.check-row {
    gap: 8px;
}

.repair-items-wrap {
    margin-bottom: 12px;
    border-radius: 8px;
}

.repair-items-table .item-type,
.repair-items-table .item-number {
    height: 32px;
}

.repair-items-table .item-description {
    min-height: 44px;
    line-height: 1.35;
}

.repair-items-table .amount {
    padding-top: 8px;
    padding-bottom: 8px;
}

.app-footer {
    padding: 18px 28px;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
    }
    .brand {
        position: static;
        min-height: 56px;
        flex-basis: 56px;
        width: 220px;
        padding: 10px 18px;
    }
    .nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 8px 8px;
    }
    .nav a {
        border-left: 0;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        padding: 0 14px;
    }
    .nav a.active { border-bottom-color: var(--blue); }
    .sidebar-footer { display: none; }
    .topbar {
        position: static;
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 14px;
    }
    .userbox { justify-content: space-between; }
    .user-menu { left: 0; right: auto; }
}

@media (max-width: 900px) {
    .app { padding: 16px; }
    .grid,
    .stats-grid,
    .stock-summary-grid,
    .dashboard-grid,
    .stock-overview-grid,
    .settings-grid,
    .two-col,
    .condition-grid,
    .form-grid { grid-template-columns: 1fr; }
    .stock-filter .form-grid { grid-template-columns: 1fr; }
    .stock-filter-full .form-grid { grid-template-columns: 1fr; }
    .stock-filter-full .field:nth-child(3) { width: 100%; }
    .stock-category-strip {
        align-items: flex-start;
        flex-direction: column;
    }
    .voucher-filter .form-grid { grid-template-columns: 1fr; }
    .voucher-filter .stock-search-field .input { min-width: 0; }
    .stock-voucher-meta { grid-template-columns: 1fr; }
    .stock-partner-picker { grid-template-columns: 1fr; }
    .hero { font-size: 21px; }
    .page-header { display: block; }
    .page-header .actions { justify-content: flex-start; margin-top: 14px; }
    .panel-title {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 16px;
    }
    .panel-search {
        width: 100%;
        margin-left: 0;
    }
    .panel-search .input {
        width: 100%;
    }
    .card strong { font-size: 22px; }
    td,
    th { font-size: 12px; padding: 8px; }
    .app-footer { display: block; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { padding: 28px; min-height: 360px; }
    .login-copy h1 { font-size: 30px; }
    .login-panel { padding: 18px; }
    .login-help { display: grid; }
    .check-row { grid-template-columns: 1fr; }
    .lookup-row,
    .vehicle-picker,
    .vehicle-smart-row { grid-template-columns: 1fr; }
    .lookup-results { width: calc(100vw - 64px); }
    .pagination-bar {
        align-items: flex-start;
        flex-direction: column;
    }
    .pagination-pages {
        flex-wrap: wrap;
    }
}

@media print {
    .sidebar,
    .topbar,
    .actions,
    .no-print { display: none !important; }
    .app-shell { display: block; }
    .app { padding: 0; }
    .hero { box-shadow: none; }
    .panel,
    .form-card { box-shadow: none; border: 0; }
    .print-title { display: block; text-align: center; }
    .input,
    select,
    textarea { border: 0; }
    .table-wrap { overflow: visible; }
}

/* Cash fund */
.cash-filter .form-grid {
    grid-template-columns: 140px 140px minmax(300px, 1fr) 86px;
    align-items: end;
}

.cash-filter .btn { width: 100%; }

.cash-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.cash-summary-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.cash-summary-card.green { border-top-color: var(--green); }
.cash-summary-card.orange { border-top-color: var(--orange); }
.cash-summary-card.purple { border-top-color: var(--purple); }
.cash-summary-card span,
.cash-summary-card strong,
.cash-summary-card small { display: block; }
.cash-summary-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.cash-summary-card strong {
    margin: 7px 0;
    font-size: 24px;
}
.cash-summary-card small {
    color: var(--muted);
    font-weight: 700;
}
.cash-period { color: var(--muted); font-size: 12px; }

.cash-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.cash-form-section {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.cash-form-section .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cash-form-section .field { margin-bottom: 10px; }
.cash-form-section .field-wide { grid-column: 1 / -1; }

/* Debts */
.debt-filter .form-grid {
    grid-template-columns: 170px 170px minmax(260px, 1fr) auto;
    align-items: end;
}

.debt-overview-grid {
    margin-bottom: 16px;
}

.debt-table td,
.debt-table th {
    vertical-align: middle;
}

.debt-actions {
    min-width: 190px;
    text-align: center;
    white-space: nowrap;
}

.debt-actions .btn {
    margin: 2px;
}

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

/* Assets */
.asset-filter .form-grid {
    grid-template-columns: 170px 170px minmax(260px, 1fr) auto;
    align-items: end;
}

.asset-entry-card .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.asset-entry-card .actions {
    margin-top: 10px;
}

.asset-table th,
.asset-table td {
    vertical-align: middle;
}

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

@media (max-width: 1000px) {
    .cash-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cash-form-grid { grid-template-columns: 1fr; }
    .debt-filter .form-grid,
    .debt-overview-grid,
    .debt-summary-grid,
    .asset-filter .form-grid,
    .asset-entry-card .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .cash-filter .form-grid,
    .cash-summary-grid,
    .cash-form-section .form-grid,
    .debt-filter .form-grid,
    .asset-filter .form-grid { grid-template-columns: 1fr; }
}

/* Interface polish */
.app {
    padding: 18px 22px 24px;
}

.page-header {
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

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

.page-header .actions {
    flex: 0 0 auto;
}

.hero {
    font-size: 22px;
    line-height: 1.18;
}

.page-subtitle {
    max-width: 820px;
    line-height: 1.45;
}

.stock-tabs {
    margin: 0 0 12px;
    padding-bottom: 2px;
}

.filter-card {
    margin-bottom: 14px;
}

.form-card:not(.filter-card) {
    margin-bottom: 14px;
}

.module-form {
    margin-bottom: 14px;
}

.panel {
    margin-top: 14px;
}

.panel + .panel,
.form-card + .panel,
.stock-summary-grid + .panel,
.stock-summary-grid + .form-card {
    margin-top: 14px;
}

.panel-title {
    min-height: 52px;
    padding: 10px 14px;
    align-items: center;
}

.panel-title > span:first-child {
    min-width: 0;
}

.parts-panel-tools,
.panel-title .actions {
    gap: 8px;
}

.form-grid {
    align-items: end;
}

.filter-card .form-grid,
.smart-filter .form-grid,
.voucher-filter .form-grid,
.cash-filter .form-grid,
.debt-filter .form-grid,
.asset-filter .form-grid,
.report-filter .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.filter-card .field,
.smart-filter .field,
.voucher-filter .field,
.cash-filter .field,
.debt-filter .field,
.asset-filter .field,
.report-filter .field {
    min-width: 0;
}

.filter-card .filter-actions,
.smart-filter .filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.filter-card .filter-actions .btn,
.cash-filter .btn,
.debt-filter .btn,
.asset-filter .btn,
.report-filter .btn {
    width: auto;
    min-width: 92px;
}

.stock-summary-grid,
.cash-summary-grid,
.debt-overview-grid,
.debt-summary-grid,
.asset-summary-grid,
.report-summary-grid {
    gap: 12px;
    margin: 14px 0;
}

.stock-summary-card {
    min-height: 116px;
    padding: 14px;
    gap: 12px;
}

.summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.summary-content strong {
    font-size: 26px;
}

.table-wrap {
    border-radius: 0 0 8px 8px;
}

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

.table-wrap th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #475569;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.theme-dark .table-wrap th {
    background: #182235;
    color: #cbd5e1;
}

.table-wrap tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, .62);
}

.theme-dark .table-wrap tbody tr:nth-child(even) {
    background: rgba(31, 41, 55, .48);
}

.table-wrap tbody tr:hover {
    background: #eff6ff;
}

.theme-dark .table-wrap tbody tr:hover {
    background: rgba(37, 99, 235, .16);
}

.table-wrap td {
    border-bottom: 1px solid rgba(226, 232, 240, .82);
}

.theme-dark .table-wrap td {
    border-bottom-color: rgba(59, 74, 98, .72);
}

.table-wrap td:last-child,
.table-wrap th:last-child {
    padding-right: 14px;
    text-align: center;
}

.table-wrap td:last-child {
    white-space: nowrap;
}

.table-wrap td:first-child,
.table-wrap th:first-child {
    padding-left: 14px;
}

.pagination-bar {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.inline-search {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-search .input,
.bulk-inline-form .input {
    min-width: 150px;
}

.parts-panel-title {
    flex-wrap: nowrap;
}

.parts-panel-title > span:first-child {
    flex: 1 1 auto;
}

.parts-panel-tools .inline-search {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
}

.parts-panel-tools .inline-search .input {
    width: 190px;
    min-width: 150px;
}

.parts-panel-tools .inline-search select.input {
    width: 140px;
    min-width: 124px;
}

.parts-panel-tools > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.stock-voucher-meta {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stock-partner-picker {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stock-voucher-form > .actions:last-child {
    padding-top: 4px;
}

@media (min-width: 1180px) {
    .asset-search-field,
    .debt-search-field {
        grid-column: span 2;
    }
}

@media (min-width: 1180px) {
    .voucher-filter {
        padding: 14px 12px 10px;
    }

    .voucher-filter .form-grid {
        grid-template-columns: 168px 168px minmax(260px, 1.4fr) 168px 168px 168px auto;
        gap: 10px 12px;
        align-items: end;
    }

    .voucher-filter .stock-search-field {
        grid-column: auto;
    }

    .voucher-filter .filter-actions {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: end;
        justify-content: flex-end;
    }

    .voucher-filter .filter-actions label {
        display: none;
    }

    .voucher-filter .filter-actions .btn {
        min-width: 92px;
        white-space: nowrap;
    }
}

@media (max-width: 900px) {
    .app {
        padding: 16px;
    }

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

    .page-header .actions {
        width: 100%;
    }

    .page-header .actions .btn {
        flex: 1 1 160px;
    }

    .panel-title {
        align-items: flex-start;
    }

    .parts-panel-tools,
    .inline-search,
    .bulk-inline-form {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .parts-panel-tools .inline-search {
        width: 100%;
        flex-wrap: wrap;
    }

    .parts-panel-tools .btn,
    .bulk-inline-form .btn,
    .inline-search .btn {
        flex: 1 1 140px;
    }
}

@media (max-width: 700px) {
    .app {
        padding: 14px 12px;
    }

    .filter-card .form-grid,
    .smart-filter .form-grid,
    .voucher-filter .form-grid,
    .cash-filter .form-grid,
    .debt-filter .form-grid,
    .asset-filter .form-grid,
    .report-filter .form-grid {
        grid-template-columns: 1fr;
    }

    .page-header .actions .btn,
    .filter-actions .btn,
    .stock-entry-actions .btn,
    .stock-voucher-form > .actions .btn {
        width: 100%;
    }

    .panel-title .btn {
        width: auto;
    }
}

/* Form spacing cleanup */
.form-card:not(.filter-card) .form-grid {
    align-items: start;
}

.filter-card .form-grid,
.smart-filter .form-grid,
.voucher-filter .form-grid,
.cash-filter .form-grid,
.debt-filter .form-grid,
.asset-filter .form-grid,
.report-filter .form-grid,
.stock-voucher-meta {
    align-items: end;
}

.form-card:not(.filter-card) > .field,
.form-card:not(.filter-card) > form > .field,
.form-card:not(.filter-card) .form-grid + .field,
.form-card:not(.filter-card) .table-wrap + .field,
.cash-form-section .form-grid + .field {
    margin-top: 16px;
}

.form-card:not(.filter-card) > .actions,
.form-card:not(.filter-card) > form > .actions,
.form-card:not(.filter-card) .field + .actions {
    margin-top: 18px;
    margin-bottom: 0;
}

.form-card:not(.filter-card) textarea:not(.item-description) {
    display: block;
    min-height: 86px;
}

.module-form form > .field textarea,
.stock-voucher-form > .field textarea,
.cash-form-section > .field textarea {
    min-height: 96px;
}

/* Reports */
.report-filter .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.report-summary-grid {
    margin-bottom: 16px;
}

.report-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 16px;
    align-items: start;
}

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

.report-main-panel {
    grid-row: span 2;
}

.report-table th,
.report-table td {
    vertical-align: middle;
}

.report-table thead th {
    white-space: nowrap;
}

.report-row.level-0 td {
    background: #fff7dd;
    font-weight: 800;
}

.report-row.level-1 td {
    background: #fbfdff;
}

.report-row.profit td {
    background: #ecfdf3;
}

.report-row.loss td {
    background: #fff1f2;
}

.report-indent {
    display: inline-block;
    width: 18px;
}

.report-table .positive {
    color: #047857;
}

.report-table .negative,
.stock-summary-card .negative {
    color: #dc2626;
}

.stock-summary-card .positive {
    color: #047857;
}

.report-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.report-metric-card {
    position: relative;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    padding: 14px 16px;
    background: #fff;
    min-height: 88px;
}

.report-metric-card:after {
    display: none;
}

.report-metric-card.green { border-left-color: #16a34a; }
.report-metric-card.orange { border-left-color: var(--orange); }
.report-metric-card.purple { border-left-color: #7c3aed; }

.report-metric-card .metric-icon {
    position: absolute;
    left: 16px;
    top: 18px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #dbeafe;
    color: #2563eb;
}

.report-metric-card.green .metric-icon { background: #dcfce7; color: #16a34a; }
.report-metric-card.orange .metric-icon { background: #ffedd5; color: #ea580c; }
.report-metric-card.purple .metric-icon { background: #ede9fe; color: #7c3aed; }

.report-metric-card span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.report-metric-card b {
    display: block;
    font-size: 21px;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 0;
}

.report-metric-card em {
    position: relative;
    z-index: 1;
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.report-debt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.report-debt-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
    box-shadow: var(--shadow);
}

.report-debt-card.receivable {
    border-top: 3px solid var(--blue);
}

.report-debt-card.payable {
    border-top: 3px solid var(--orange);
}

.report-debt-card.receivable .debt-card-main {
    background: linear-gradient(135deg, #eff6ff 0%, #fff 72%);
}

.report-debt-card.payable .debt-card-main {
    background: linear-gradient(135deg, #fff7ed 0%, #fff 72%);
}

.debt-card-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.debt-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #dbeafe;
    color: var(--blue);
    font-size: 18px;
}

.report-debt-card.payable .debt-card-icon {
    background: #ffedd5;
    color: var(--orange);
}

.debt-card-head h3 {
    margin: 0 0 3px;
    font-size: 17px;
    line-height: 1.2;
}

.debt-card-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.debt-card-main {
    padding: 16px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fbff 0%, #fff 70%);
    border: 1px solid var(--line);
    margin-bottom: 12px;
}

.debt-card-main span,
.debt-mini-grid span {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
}

.debt-card-main strong {
    display: block;
    font-size: 30px;
    line-height: 1.15;
    color: #0f172a;
}

.debt-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.debt-mini-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    background: #fbfdff;
}

.debt-mini-grid b {
    display: block;
    font-size: 17px;
    color: #0f172a;
}

.debt-progress {
    height: 9px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin: 6px 0 14px;
}

.debt-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), #22c55e);
}

.report-debt-card.payable .debt-progress span {
    background: linear-gradient(90deg, var(--orange), #facc15);
}

@media (max-width: 1100px) {
    .report-grid,
    .report-grid.two,
    .report-debt-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .report-filter .form-grid,
    .report-metric-grid,
    .debt-mini-grid {
        grid-template-columns: 1fr;
    }
}

/* Saved business reports */
.report-range {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.report-range label {
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.report-range .input {
    width: 150px;
    min-height: 34px;
}

.report-sheet-panel {
    overflow: hidden;
    margin-top: 16px;
}

.report-sheet-panel .table-wrap {
    border-radius: 0 0 8px 8px;
}

.report-sheet-table {
    min-width: 980px;
    font-size: 13px;
}

.report-sheet-table th,
.report-sheet-table td {
    border-color: rgba(226, 232, 240, .82);
    height: 42px;
}

.report-sheet-table th {
    background: #f8fafc;
    color: #475569;
    text-align: center;
    font-weight: 900;
}

.report-sheet-table td {
    background: transparent;
}

.report-sheet-table .report-total-row td {
    background: #f8fafc;
    font-weight: 900;
}

.report-sheet-table .report-level-0.report-total-row td {
    background: #eff6ff;
    color: #0f172a;
    border-top: 1px solid #bfdbfe;
    border-bottom: 1px solid #bfdbfe;
}

.report-sheet-table .report-level-1.report-total-row td {
    background: #eef6ff;
}

.report-sheet-table tr.report-level-0.report-total-row.report-section-revenue td {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.report-sheet-table tr.report-level-0.report-total-row.report-section-discount td {
    background: #fff7ed;
    border-color: #fed7aa;
}

.report-sheet-table tr.report-level-0.report-total-row.report-section-net_revenue td {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.report-sheet-table tr.report-level-0.report-total-row.report-section-cogs td {
    background: #fff1f2;
    border-color: #fecdd3;
}

.report-sheet-table tr.report-level-0.report-total-row.report-section-gross_profit td {
    background: #f0fdf4;
    border-color: #86efac;
}

.report-sheet-table tr.report-level-0.report-total-row.report-section-expenses td {
    background: #fefce8;
    border-color: #fde68a;
}

.report-sheet-table tr.report-level-0.report-total-row.report-section-net_profit td {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.report-sheet-table .report-level-2 td:first-child,
.report-sheet-table .report-level-2 td:nth-child(2) {
    background: rgba(248, 250, 252, .62);
}

.report-actions-cell {
    white-space: nowrap;
}

.report-period-cell {
    text-align: center;
}

.report-period-cell b {
    display: inline-flex;
    justify-content: center;
    min-width: 112px;
}

.report-actions-cell .btn {
    margin: 2px;
}

.report-sheet-panel .panel-title .actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.report-draft-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 900;
    vertical-align: middle;
}

.report-form-title {
    align-items: center;
    gap: 12px;
    min-height: 54px;
}

.report-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.report-form-actions label {
    font-weight: 800;
    white-space: nowrap;
}

.report-month-input {
    width: 150px;
    min-height: 34px;
}

.report-period-line {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.report-period-line span {
    font-weight: 800;
}

.editable-report-table .report-amount-input {
    width: 140px;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 6px;
    text-align: right;
    margin-left: auto;
}

.editable-report-table .report-amount-input[readonly] {
    background: transparent;
    border-color: transparent;
    font-weight: 900;
    color: #0f172a;
    pointer-events: none;
}

.report-indent {
    display: inline-block;
    width: 20px;
}

@media (max-width: 900px) {
    .report-range,
    .report-form-actions {
        justify-content: flex-start;
    }

    .report-range .input,
    .report-month-input {
        width: 100%;
    }
}

/* Repair quotes */
.quote-form-panel {
    overflow: hidden;
}

.quote-form-title,
.quote-meta-line,
.quote-submit-actions {
    gap: 10px;
}

.quote-meta-line {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(260px, 1.3fr);
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

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

.quote-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.quote-section .field-wide {
    grid-column: 1 / -1;
}

.quote-toolbar {
    display: flex;
    gap: 8px;
    padding: 0 14px 14px;
    flex-wrap: wrap;
}

.quote-info-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px 12px;
    flex-wrap: wrap;
}

.quote-info-head .section-title {
    margin: 0;
    min-width: 180px;
    text-transform: uppercase;
}

.quote-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #2563eb;
    background: #fff;
}

.quote-tab-btn {
    min-height: 30px;
    padding: 5px 14px;
    border: 0;
    border-right: 1px solid #2563eb;
    border-radius: 0;
    background: #fff;
    color: #0f172a;
    font-weight: 900;
    cursor: pointer;
}

.quote-tab-btn:last-child {
    border-right: 0;
}

.quote-tab-btn.active {
    background: #ff7a00;
    color: #fff;
}

.quote-tab-btn.quote-preview-tab.active {
    background: #facc15;
    color: #111827;
}

.quote-table-wrap {
    border-radius: 0;
}

.quote-items-table {
    min-width: 1180px;
}

.quote-items-table textarea {
    min-height: 46px;
    resize: vertical;
}

.quote-items-table .item-type {
    width: 92px;
}

.quote-items-table .quote-number {
    width: 116px;
}

.quote-items-table .quote-discount {
    width: 118px;
}

.quote-items-table .quote-group-row td {
    background: #fff4ce;
    font-weight: 900;
}

.quote-items-table .quote-group-row .group-total {
    color: #0f172a;
}

.quote-summary-block {
    width: min(520px, calc(100% - 28px));
    margin: 0 14px 14px auto;
    border: 1px solid var(--line);
    border-top: 0;
    background: #fff;
}

.quote-summary-row {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(140px, 180px);
    align-items: center;
    min-height: 34px;
    border-top: 1px solid var(--line);
}

.quote-summary-row span {
    padding: 6px 10px;
    font-weight: 800;
    text-align: right;
}

.quote-summary-row strong,
.quote-summary-row .input {
    min-height: 34px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    padding: 6px 10px;
    text-align: right;
}

.quote-summary-row strong {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.quote-summary-row.total strong {
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
}

.quote-total-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: #fbfdff;
}

.quote-total-grid .total-strong {
    font-weight: 900;
    color: #0f172a;
}

.quote-form-panel > .field,
.quote-submit-actions {
    padding: 0 14px 14px;
}

.quote-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    background: #e0f2fe;
    color: #075985;
}

.quote-status-badge.status-sent {
    background: #dbeafe;
    color: #1d4ed8;
}

.quote-status-badge.status-converted {
    background: #ede9fe;
    color: #6d28d9;
}

.quote-status-badge.status-cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

@media (max-width: 1100px) {
    .quote-meta-line,
    .quote-split-grid,
    .quote-total-grid {
        grid-template-columns: 1fr;
    }

    .quote-summary-block {
        width: calc(100% - 28px);
        margin-left: 14px;
    }

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

    .quote-summary-row span {
        text-align: left;
    }

    .quote-summary-row strong,
    .quote-summary-row .input {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

/* Dense list/table view */
.app {
    max-width: none;
    padding: 18px 20px;
}

.page-header {
    margin-bottom: 12px;
}

.hero {
    font-size: 20px;
}

.hero:after {
    height: 2px;
    margin-top: 6px;
}

.page-subtitle {
    margin-top: 5px;
    font-size: 12px;
}

.stock-tabs {
    gap: 6px;
    margin: 0 0 10px;
}

.stock-tabs a {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 13px;
}

.filter-card {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.filter-card .form-grid,
.smart-filter .form-grid,
.voucher-filter .form-grid,
.cash-filter .form-grid,
.debt-filter .form-grid,
.asset-filter .form-grid,
.report-filter .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 8px 10px;
}

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

.input,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 13px;
}

.btn {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 13px;
}

.panel {
    margin-top: 10px;
    border-radius: 8px;
}

.panel-title {
    min-height: 42px;
    padding: 7px 12px;
    font-size: 14px;
}

.table-wrap {
    max-height: calc(100vh - 260px);
    border-radius: 0 0 8px 8px;
}

.table-wrap table {
    font-size: 13.5px;
}

.compact-table,
.inventory-table,
.data-table {
    table-layout: fixed;
}

.table-wrap th {
    height: 34px;
    padding: 7px 10px;
    font-size: 11.5px;
    letter-spacing: 0;
}

.table-wrap td {
    height: 38px;
    padding: 8px 10px;
    line-height: 1.3;
}

.compact-table th,
.compact-table td,
.inventory-table th,
.inventory-table td {
    padding: 8px 10px;
}

.table-wrap td:first-child,
.table-wrap th:first-child {
    padding-left: 10px;
}

.table-wrap td:last-child,
.table-wrap th:last-child {
    padding-right: 10px;
}

.table-wrap td .btn {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 12px;
}

.data-table .badge,
.compact-table .badge,
.inventory-table .badge,
.badge {
    padding: 4px 8px;
    font-size: 11.5px;
}

.inventory-table {
    min-width: 780px;
}

.inventory-table th:nth-child(1),
.inventory-table td:nth-child(1) {
    width: 110px;
}

.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2) {
    width: auto;
}

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

.inventory-table th:nth-child(4),
.inventory-table td:nth-child(4) {
    width: 86px;
}

.inventory-table th:nth-child(5),
.inventory-table td:nth-child(5),
.inventory-table th:nth-child(6),
.inventory-table td:nth-child(6) {
    width: 104px;
}

.compact-table td,
.inventory-table td,
.data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-table td:not(.no-print):not(.num):not(.money-col),
.inventory-table td:not(.no-print):not(.num):not(.money-col),
.data-table td:not(.no-print):not(.num):not(.money-col) {
    white-space: nowrap;
}

.pagination-bar {
    gap: 10px;
    padding: 8px 10px;
    font-size: 12.5px;
}

.pagination-size .input,
.page-btn {
    height: 26px;
}

.pagination-size .input {
    width: 66px;
    padding: 3px 7px;
}

.page-btn {
    min-width: 26px;
    padding: 0 7px;
    border-radius: 6px;
}

@media (max-width: 900px) {
    .app {
        padding: 14px 12px;
    }

    .table-wrap {
        max-height: none;
    }

    .pagination-bar {
        align-items: flex-start;
    }
}

/* Settlements */

.settlement-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: max-content;
    flex-wrap: wrap;
}

.settlement-list-table {
    min-width: 1280px;
}

.quote-print-sheet.settlement-print-sheet .quote-print-header {
    border-bottom-color: #0f766e;
}

.quote-print-sheet.settlement-print-sheet .quote-print-header h1,
.quote-print-sheet.settlement-print-sheet .quote-print-parties h3 {
    color: #0f766e;
}

.settlement-print-summary .settlement-print-remaining {
    color: #991b1b;
    background: #fee2e2;
    border-bottom: 2px solid #ef4444;
    font-size: 15px;
    font-weight: 900;
}

@media (max-width: 640px) {
    .settlement-row-actions {
        min-width: 0;
    }
}

@media print {
    .quote-print-sheet.settlement-print-sheet {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .settlement-print-summary .settlement-print-remaining {
        color: #000;
        background: #f1f5f9 !important;
        border-bottom: 1.2pt solid #000;
    }
}
