:root {
    --bg: #edf2f4;
    --surface: #ffffff;
    --surface-soft: #f7fafc;
    --text: #1f2937;
    --muted: #6b7280;
    --muted-strong: #475569;
    --line: #e5eaef;
    --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
    --sidebar: #16263a;
    --sidebar-dark: #132033;
    --sidebar-line: rgba(255, 255, 255, 0.06);
    --sidebar-text: rgba(255, 255, 255, 0.78);
    --sidebar-muted: rgba(255, 255, 255, 0.48);
    --accent: #2f67f6;
    --accent-dark: #2555d8;
    --success: #17a34a;
    --danger: #e11d48;
    --warning: #f59e0b;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

svg {
    display: block;
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 258px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-dark) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.16);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--sidebar-line);
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5fd6ff;
}

.brand-icon.large {
    width: 52px;
    height: 52px;
    color: #2f67f6;
}

.brand-svg,
.svg-icon,
.search-svg,
.caret-icon {
    width: 100%;
    height: 100%;
}

.brand-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
}

.brand-subtitle {
    margin-top: 2px;
    font-size: 11px;
    color: var(--sidebar-muted);
    letter-spacing: 0.04em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.menu-link,
.submenu-link {
    border-radius: 12px;
}

.menu-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding: 12px 14px;
    border: 0;
    background: transparent;
    color: var(--sidebar-text);
    transition: 0.2s ease;
    min-width: 0;
}

.menu-link:hover,
.menu-toggle:hover,
.submenu-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.menu-link.active,
.menu-group.open > .menu-link {
    background: #2f67f6;
    color: #fff;
    box-shadow: 0 12px 24px rgba(47, 103, 246, 0.26);
}

.menu-main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.menu-link > span:last-child,
.menu-main > span:last-child,
.submenu-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: currentColor;
}

.menu-group .menu-link.active .menu-icon,
.menu-group.open > .menu-link .menu-icon {
    color: #fff;
}

.menu-caret {
    width: 15px;
    height: 15px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.menu-group.open .menu-caret {
    transform: rotate(90deg);
}

.submenu {
    display: grid;
    gap: 6px;
    padding: 0 0 8px 44px;
}

.menu-group:not(.open) .submenu {
    display: none;
}

.submenu-link {
    display: block;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
}

.submenu-link.active {
    background: rgba(47, 103, 246, 0.16);
    color: #fff;
}

.sidebar-bottom {
    padding: 14px 10px 16px;
    border-top: 1px solid var(--sidebar-line);
}

.logout-link {
    color: #ff9cab;
}

.main-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 26px;
    background: linear-gradient(90deg, #061830 0%, #021225 100%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(2, 18, 37, 0.24);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(15, 144, 255, 0.18));
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 10px 24px rgba(5, 20, 40, 0.18);
}

.mobile-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.topbar-heading h1 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.topbar-heading h1,
.topbar-heading h1 * {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #ffd166;
}

.topbar-heading h1 span {
    color: #7dd3fc;
}

.topbar-heading p {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.66);
}

.serial-col {
    width: 58px;
}

.bike-id-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.search-box {
    min-width: 250px;
    width: min(280px, 100%);
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(64, 64, 255, 0.22), rgba(13, 206, 195, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(5, 20, 40, 0.16);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.78);
}

.search-box:focus-within {
    border-color: rgba(29, 229, 192, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(5, 20, 40, 0.16), 0 0 0 3px rgba(29, 229, 192, 0.12);
}

.search-box input,
.search-box input[type="text"],
.search-box input[type="search"] {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    appearance: none;
    -webkit-appearance: none;
}

.search-box input:focus,
.search-box input[type="text"]:focus,
.search-box input[type="search"]:focus {
    border: 0;
    box-shadow: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box input[type="search"]::-webkit-search-decoration,
.search-box input[type="search"]::-webkit-search-cancel-button,
.search-box input[type="search"]::-webkit-search-results-button,
.search-box input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.icon-circle {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffd34e;
}

.icon-circle .svg-icon {
    width: 18px;
    height: 18px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.user-meta strong {
    display: block;
    font-size: 13px;
}

.user-meta small {
    color: rgba(255, 255, 255, 0.54);
}

.avatar-chip {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #3a7bfd;
    color: #fff;
    font-weight: 800;
}

.page-content {
    padding: 26px;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
}

.alert-success {
    background: rgba(23, 163, 74, 0.1);
    border-color: rgba(23, 163, 74, 0.18);
    color: #166534;
}

.alert-error,
.alert-danger {
    background: rgba(225, 29, 72, 0.1);
    border-color: rgba(225, 29, 72, 0.18);
    color: #9f1239;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.18);
    color: #92400e;
}

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

.page-head h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
}

.page-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.page-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(90deg, var(--accent) 0%, #3770f7 100%);
    box-shadow: 0 12px 24px rgba(47, 103, 246, 0.26);
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(90deg, #1e4bd5 0%, #2f67f6 100%);
}

.btn-outline {
    color: var(--accent-dark);
    background: #fff;
    border: 1px solid #cfd8e3;
}

.btn-block {
    width: 100%;
}

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

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

.stat-card {
    min-height: 102px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 18px;
    color: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.stat-copy span {
    display: block;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.88;
}

.stat-copy strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
}

.stat-copy strong small {
    font-size: 13px;
    opacity: 0.8;
}

.stat-icon {
    width: 32px;
    height: 32px;
    opacity: 0.18;
}

.stat-icon .svg-icon {
    width: 100%;
    height: 100%;
}

.aqua { background: #21a7e7; }
.mustard { background: #edb200; }
.orange { background: #ff7919; }
.red { background: #e92c2c; }
.green { background: #17af49; }
.blue { background: #2f67f6; }
.amber { background: #d98400; }
.magenta { background: #d20a59; }

.dashboard-grid,
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 24px;
}

.content-grid.two-col-wide {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.panel-card {
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(203, 213, 225, 0.42);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
}

.card-head h3,
.side-panel-head h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.card-head p,
.side-panel-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.card-total {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 14px;
    background: #f5f8fb;
    font-size: 18px;
    font-weight: 800;
    color: var(--muted-strong);
}

.text-link {
    color: #4264e6;
    font-weight: 700;
    font-size: 13px;
}

.table-card {
    padding-bottom: 12px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    padding: 0 18px 16px;
}

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

.table-wrap th,
.table-wrap td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table-wrap th {
    font-size: 12px;
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.table-wrap td strong,
.list-card strong,
.mini-list-item strong,
.summary-item strong,
.user-chip strong {
    font-weight: 800;
}

.table-wrap td small,
.list-card small,
.mini-list-item small,
.summary-item span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.table-wrap tbody tr:last-child td {
    border-bottom: 0;
}

.empty-state {
    padding: 22px 10px;
    text-align: center;
    color: var(--muted);
}

.side-panel {
    padding-bottom: 16px;
}

.side-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 20px;
    background: linear-gradient(90deg, #03172f 0%, #041932 100%);
    color: #fff;
}

.side-panel-head-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.side-panel-head .text-link {
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
}

.lightning {
    color: #ffd44a;
    font-size: 18px;
}

.stack-form,
.form-grid,
.installer-form,
.auth-form {
    padding: 20px;
}

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

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

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

.form-grid > label,
.form-grid > .full {
    align-self: start;
}

.stack-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
}

label > span {
    color: var(--muted-strong);
    font-weight: 700;
    font-size: 13px;
}

.supplier-field-with-meta {
    align-content: start;
}

.supplier-meta-fields {
    display: grid;
    gap: 12px;
    margin-top: 2px;
}

.supplier-meta-field {
    display: grid;
    gap: 6px;
}

.supplier-meta-field small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 14px 15px;
    border-radius: 16px;
    border: 1px solid #dce5ef;
    outline: 0;
    background: #fff;
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #8ab2ff;
    box-shadow: 0 0 0 4px rgba(47, 103, 246, 0.12);
}

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

input[readonly],
textarea[readonly] {
    background: #f4f7fb;
    color: var(--text);
    cursor: not-allowed;
}

.bike-entry-form .compact-textarea {
    min-height: 68px;
}

.bike-entry-form {
    gap: 14px 16px;
}

.bike-entry-form label {
    gap: 6px;
}

.bike-entry-form input[type="text"],
.bike-entry-form input[type="number"],
.bike-entry-form input[type="date"],
.bike-entry-form select,
.bike-entry-form textarea {
    padding: 12px 14px;
    border-radius: 14px;
}

.bike-entry-form .supplier-meta-fields {
    gap: 10px;
    margin-top: 8px;
}

.bike-entry-form .compact-notes-field {
    grid-column: auto;
}

.bike-entry-form .compact-textarea {
    min-height: 52px;
    resize: none;
}

.bike-sale-entry-card {
    max-width: 1020px;
}

.bike-sale-entry-form {
    gap: 16px 18px;
    padding-top: 12px;
}

.sale-select-panel {
    padding: 0;
}

.sale-select-grid {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
}

.sale-select-panel label {
    gap: 8px;
}

.form-section-title {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bike-sale-entry-form input[type="text"],
.bike-sale-entry-form input[type="number"],
.bike-sale-entry-form input[type="date"],
.bike-sale-entry-form select {
    padding: 12px 14px;
    border-radius: 12px;
}

.field-highlight-success,
.field-highlight-danger,
.field-highlight-neutral,
.field-highlight-warning,
.field-highlight-primary {
    font-weight: 800;
}

.field-highlight-success[readonly] {
    background: #ecf9f2;
    border-color: #d5efe1;
    color: #20895f;
}

.field-highlight-danger[readonly] {
    background: #fff1f1;
    border-color: #f2dede;
    color: #b05b5b;
}

.field-highlight-neutral[readonly] {
    background: #f4f7fb;
    border-color: #dbe5f0;
    color: #475569;
}

.field-highlight-warning[readonly] {
    background: #fff7e6;
    border-color: #f5e3b7;
    color: #a06700;
}

.field-highlight-primary[readonly] {
    background: #edf3ff;
    border-color: #d4e0ff;
    color: #2555d8;
}

.sale-confirm-btn {
    min-height: 50px;
    border-radius: 14px;
}

.bike-overview-grid {
    align-items: start;
}

.bike-overview-body {
    padding: 0 20px 20px;
}

.bike-overview-hero {
    padding: 4px 0 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}

.bike-overview-hero h4 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.15;
}

.bike-overview-hero p {
    margin: 0;
    color: var(--muted-strong);
    font-size: 14px;
    line-height: 1.6;
}

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

.info-box {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.info-box small {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.info-box strong,
.info-box span {
    display: block;
    color: var(--text);
    font-size: 16px;
    line-height: 1.45;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.summary-item strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.summary-item .muted {
    display: block;
    line-height: 1.35;
}

.mini-list,
.list-stack,
.summary-stack {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.mini-list {
    padding-top: 8px;
}

.mini-list h4 {
    margin: 0;
    font-size: 16px;
}

.mini-list-item,
.list-card,
.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

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

.summary-item {
    align-items: flex-start;
}

.muted {
    color: var(--muted);
}

.dashboard-ledger-summary {
    padding-top: 0;
}

.customer-ledger-search-form {
    position: relative;
    z-index: 6;
    padding-bottom: 8px;
}

.customer-ledger-search-input {
    padding-right: 48px;
}

.customer-ledger-search-help {
    margin: 0;
}

.customer-ledger-search-dropdown {
    position: absolute;
    top: calc(100% - 8px);
    left: 20px;
    right: 20px;
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 10px;
    border: 1px solid #dce5ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(3, 23, 47, 0.12);
}

.customer-ledger-search-empty {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fbff;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 700;
}

.customer-ledger-search-empty.is-error {
    background: #fff1f1;
    color: #b05b5b;
}

.customer-ledger-search-option {
    width: 100%;
    border: 1px solid #e4ebf3;
    border-radius: 16px;
    background: #f8fbff;
    padding: 12px 14px;
    text-align: left;
    display: grid;
    gap: 4px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.customer-ledger-search-option:hover,
.customer-ledger-search-option.active {
    border-color: rgba(33, 97, 215, 0.35);
    background: rgba(33, 97, 215, 0.08);
    transform: translateY(-1px);
}

.customer-ledger-search-option .option-title {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 15px;
}

.customer-ledger-search-option .option-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.customer-ledger-search-option .option-due {
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
}

.dashboard-ledger-list {
    padding-top: 0;
}

.dashboard-ledger-list .mini-list-item {
    align-items: flex-start;
}

.dashboard-ledger-list .list-meta {
    min-width: 104px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-stock,
.badge-cash {
    background: rgba(23, 163, 74, 0.12);
    color: #15803d;
}

.badge-sold,
.badge-emi,
.alert.badge-emi {
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 20px;
    padding: 18px 20px;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.filter-bar label {
    min-width: 180px;
}


.auth-body,
.installer-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    background: radial-gradient(circle at top, #1b3560 0%, #081427 45%, #07101d 100%);
}

.auth-shell,
.installer-shell {
    width: min(100%, 1120px);
}

.auth-panel,
.installer-card {
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(2, 18, 37, 0.34);
    overflow: hidden;
}

.auth-panel {
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1fr);
}

.auth-brand,
.installer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 26px 30px;
    background: linear-gradient(135deg, #edf4ff 0%, #f7fbff 100%);
    border-bottom: 1px solid var(--line);
}

.auth-copy {
    padding: 26px 30px 0;
}

.auth-copy h2,
.installer-header h1 {
    margin: 8px 0 0;
}

.auth-card {
    padding-bottom: 18px;
}

.eyebrow {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e9f0ff;
    color: #2455dd;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.demo-note {
    margin: 0 20px 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fbff;
    color: var(--muted-strong);
    border: 1px solid var(--line);
}

.installer-card {
    padding-bottom: 6px;
}

.installer-form {
    padding: 26px 26px 18px;
}

.form-section {
    margin-bottom: 22px;
    padding: 20px;
    border-radius: 20px;
    background: #f8fbfd;
    border: 1px solid var(--line);
}

.form-section h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.auth-brand h1,
.installer-header h1 {
    font-size: 28px;
}

.auth-brand p,
.installer-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.compact {
    width: fit-content;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #dce5ef;
    background: #fff;
    color: var(--accent-dark);
    font-weight: 700;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.table-action-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.table-action-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.table-action-green {
    background: linear-gradient(180deg, #2fcb8d 0%, #17b26b 100%);
}

.table-action-blue {
    background: linear-gradient(180deg, #4d8df7 0%, #2f67f6 100%);
}

.table-action-dark {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
}

.table-action-amber {
    background: linear-gradient(180deg, #f8b84c 0%, #f59e0b 100%);
}

.table-action-svg {
    width: 15px;
    height: 15px;
}

.print-sheet {
    padding: 0 18px 18px;
}

.print-paper {
    max-width: 940px;
    margin: 0 auto;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
}

.invoice-banner {
    margin: -4px 0 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.invoice-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 18px 18px;
}

.invoice-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px dashed var(--line);
}

.invoice-head h3 {
    margin: 0;
    font-size: 26px;
}

.invoice-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.invoice-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--accent-dark);
    font-weight: 800;
}

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

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

.invoice-card {
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.invoice-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.invoice-card strong {
    display: block;
    font-size: 16px;
    line-height: 1.55;
    word-break: break-word;
}

.invoice-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.invoice-card-wide {
    grid-column: span 2;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

.invoice-table th,
.invoice-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.invoice-table th {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
}

.invoice-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.invoice-note {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fbfcfe;
    border: 1px solid var(--line);
}

.invoice-note strong {
    display: block;
    margin-bottom: 6px;
}


.classic-print-paper {
    max-width: 820px;
    padding: 22px 34px 46px;
    border-radius: 0;
    border: 1px solid #111827;
    box-shadow: none;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
}

.classic-invoice-banner {
    margin-bottom: 16px;
}

.classic-invoice-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.classic-invoice-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 15px;
}

.classic-invoice-title {
    margin: 0 0 20px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    text-decoration: underline;
}

.classic-customer-block {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.classic-invoice-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
}

.classic-invoice-table th,
.classic-invoice-table td {
    border: 1px solid #111;
    padding: 8px 10px;
    vertical-align: top;
}

.classic-invoice-table th {
    text-align: center;
    font-weight: 700;
}

.classic-col-qty {
    width: 80px;
}

.classic-col-price {
    width: 140px;
}

.classic-product-cell {
    line-height: 1.55;
    min-height: 170px;
}

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

.classic-text-center {
    text-align: center;
    vertical-align: middle !important;
}

.classic-text-right {
    text-align: right;
    vertical-align: middle !important;
}

.classic-total-label {
    text-align: right;
    font-weight: 700;
}

.classic-total-amount {
    font-weight: 700;
}

.classic-words-row {
    font-style: italic;
    line-height: 1.45;
}

.classic-signatures {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 72px;
}

.classic-signature-box {
    width: 200px;
    text-align: center;
    font-size: 13px;
}

.classic-signature-box-right {
    margin-left: auto;
}

.classic-signature-line {
    display: block;
    width: 100%;
    border-top: 1px solid #111;
    margin-bottom: 6px;
}

@page {
    size: A4 portrait;
    margin: 12mm;
}

@media print {
    body {
        background: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    .topbar,
    .page-head,
    .print-actions,
    .alert {
        display: none !important;
    }

    .app-layout,
    .main-panel {
        display: block;
        min-height: auto;
    }

    .page-content,
    .print-sheet {
        padding: 0 !important;
        margin: 0 !important;
    }

    .print-paper {
        max-width: none;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .classic-print-paper {
        padding: 0;
    }

    .classic-signatures {
        page-break-inside: avoid;
    }
}

.actions-col {
    width: 110px;
}

@media (max-width: 860px) {
    .invoice-grid,
    .invoice-grid-customer,
    .invoice-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .invoice-card-wide {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .invoice-head {
        flex-direction: column;
    }

    .invoice-grid,
    .invoice-grid-customer,
    .invoice-summary {
        grid-template-columns: 1fr;
    }

    .invoice-card-wide {
        grid-column: span 1;
    }

    .print-paper {
        padding: 18px;
        border-radius: 18px;
    }

    .table-action-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 1340px) {
    .stats-grid,
    .compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .app-layout::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(3, 10, 23, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
        z-index: 45;
    }

    body.mobile-menu-open .app-layout::before {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(82vw, 320px);
        height: 100dvh;
        z-index: 50;
        transform: translateX(-108%);
        transition: transform 0.24s ease;
    }

    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .main-panel {
        min-width: 0;
    }

    .dashboard-grid,
    .content-grid,
    .content-grid.two-col-wide,
    .auth-panel {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 860px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px 12px;
        padding: 10px 18px;
    }

    .page-head,
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-left,
    .topbar-actions {
        width: auto;
    }

    .topbar-left {
        min-width: 0;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        justify-content: end;
        gap: 10px;
        min-width: 0;
    }

    .search-box {
        min-width: 0;
        width: 100%;
    }

    .user-meta {
        display: none;
    }

    .page-content {
        padding: 18px;
    }

    .stats-grid,
    .compact-grid,
    .form-grid.two-col {
        grid-template-columns: 1fr;
    }

    .card-head,
    .mini-list-item,
    .list-card,
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
    }
}


@media (max-width: 860px) {
    .bike-info-grid {
        grid-template-columns: 1fr;
    }

    .bike-entry-form .compact-notes-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 540px) {
    .brand-block,
    .page-content,
    .stack-form,
    .form-grid,
    .table-wrap,
    .card-head,
    .side-panel-head,
    .auth-brand,
    .auth-copy,
    .auth-form,
    .installer-header,
    .installer-form {
        padding-left: 16px;
        padding-right: 16px;
    }

    .topbar {
        padding: 8px 14px;
        gap: 8px 10px;
    }

    .sidebar {
        width: min(88vw, 320px);
    }

    .topbar-left {
        align-items: flex-start;
        gap: 10px;
    }

    .topbar-heading h1 {
        font-size: 12px;
    }

    .topbar-heading p {
        display: none;
    }

    .mobile-menu-toggle {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .search-box {
        height: 36px;
        padding: 0 12px;
    }

    .icon-circle,
    .avatar-chip {
        width: 34px;
        height: 34px;
    }

    .user-meta {
        display: none;
    }
}


.ledger-search-shell {
    display: grid;
    gap: 16px;
}

.ledger-search-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.ledger-search-copy {
    flex: 1 1 auto;
    display: grid;
    gap: 8px;
}

.ledger-search-copy small {
    color: #365cc8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ledger-search-copy input {
    width: 100%;
    height: 58px;
    padding: 0 18px;
    border-radius: 16px;
    border: 2px solid rgba(59, 130, 246, 0.65);
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    background: #fff;
}

.ledger-search-copy input:focus {
    outline: none;
    border-color: #2f67f6;
    box-shadow: 0 0 0 4px rgba(47, 103, 246, 0.12);
}

.ledger-search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ledger-load-btn {
    min-width: 108px;
    color: #fff;
    background: linear-gradient(180deg, #1f2e4e 0%, #17263d 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.ledger-print-btn {
    min-width: 54px;
    padding: 0;
    color: #fff;
    background: linear-gradient(180deg, #3779ff 0%, #2f67f6 100%);
    box-shadow: 0 10px 22px rgba(47, 103, 246, 0.24);
}

.ledger-inline-note {
    padding: 14px 18px;
    border-left: 4px solid #2f67f6;
    border-radius: 8px;
    background: #dfeafe;
    color: #1f4aa8;
    font-size: 14px;
    font-weight: 700;
}

.ledger-inline-error {
    border-left-color: #dc2626;
    background: #fee2e2;
    color: #991b1b;
}

.ledger-design-card {
    overflow: hidden;
    border-radius: 28px;
    background: #fff;
    border: 1px solid rgba(203, 213, 225, 0.48);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.ledger-hero-block,
.ledger-closing-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    color: #fff;
    background: linear-gradient(90deg, #081735 0%, #0a1d47 50%, #10285d 100%);
}

.ledger-overline {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    opacity: 0.8;
    text-transform: uppercase;
}

.ledger-hero-block h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
    text-transform: uppercase;
}

.ledger-hero-block p {
    margin: 8px 0 0;
    color: rgba(226, 232, 240, 0.9);
    font-weight: 500;
}

.ledger-due-copy {
    text-align: right;
}

.ledger-due-copy span {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    color: rgba(226, 232, 240, 0.84);
    text-transform: uppercase;
}

.ledger-due-copy strong {
    display: block;
    color: #ff4d78;
    font-size: 28px;
    line-height: 1.1;
}

.ledger-summary-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid #e5e7eb;
}

.ledger-summary-box {
    padding: 18px 20px;
    text-align: center;
    border-right: 1px solid #e5e7eb;
    background: #fff;
}

.ledger-summary-box:last-child {
    border-right: 0;
}

.ledger-summary-box span {
    display: block;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.ledger-summary-box strong {
    display: block;
    color: #0f172a;
    font-size: 20px;
    line-height: 1.15;
}

.ledger-summary-box strong.is-green,
.ledger-closing-row .is-green,
.text-green {
    color: #21a47b;
}

.ledger-summary-box strong.is-blue,
.text-blue {
    color: #2f67f6;
}

.ledger-design-table-wrap {
    padding-top: 18px;
    padding-bottom: 14px;
}

.ledger-design-table th,
.ledger-design-table td {
    padding: 16px 12px;
}

.ledger-design-table th {
    color: #94a3b8;
}

.ledger-design-table td {
    color: #334155;
}

.ledger-design-table td strong {
    font-size: 15px;
}

.ledger-delete-form {
    margin: 0;
}

.ledger-delete-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: rgba(244, 63, 94, 0.12);
    color: #f43f5e;
    font-size: 14px;
    cursor: pointer;
}

.ledger-delete-btn:hover {
    background: rgba(244, 63, 94, 0.18);
}

.ledger-closing-row {
    align-items: center;
    padding-top: 18px;
    padding-bottom: 18px;
}

.ledger-closing-row span,
.ledger-closing-row strong {
    flex: 1 1 0;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
}

.ledger-closing-row span {
    color: rgba(255, 255, 255, 0.95);
}

.ledger-closing-row strong {
    color: #d7e1f0;
    font-size: 18px;
}

.ledger-closing-row .is-red {
    color: #ff4d78;
}

@media (max-width: 920px) {
    .ledger-search-card,
    .ledger-hero-block,
    .ledger-closing-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ledger-due-copy {
        text-align: left;
    }

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

    .ledger-summary-box:nth-child(2n) {
        border-right: 0;
    }

    .ledger-summary-box:nth-child(-n+2) {
        border-bottom: 1px solid #e5e7eb;
    }
}

@media (max-width: 640px) {
    .ledger-search-card,
    .ledger-search-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ledger-load-btn,
    .ledger-print-btn {
        width: 100%;
    }

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

    .ledger-summary-box {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .ledger-summary-box:last-child {
        border-bottom: 0;
    }
}


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

.table-action-red {
    border: 0;
    background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%);
}

.customer-directory-shell {
    display: grid;
    gap: 22px;
}

.customer-directory-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 22px;
    align-items: center;
}

.panel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-dark);
}

.customer-directory-hero h3,
.customer-directory-card-head h3,
.customer-profile-top h3 {
    margin: 10px 0 8px;
    font-size: 26px;
    line-height: 1.2;
}

.customer-directory-hero p,
.customer-directory-card-head p,
.customer-profile-top p,
.customer-profile-empty p {
    margin: 0;
    color: var(--muted);
}

.customer-directory-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.directory-stat-card {
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    border: 1px solid #d9e5ff;
}

.directory-stat-card span,
.profile-metric span,
.customer-profile-meta span,
.customer-profile-note span,
.customer-directory-search-form label span,
.customer-directory-table-summary span,
.customer-cell-main span,
.customer-cell-stack span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.directory-stat-card strong,
.profile-metric strong,
.customer-profile-meta strong,
.customer-cell-main strong,
.customer-cell-stack strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    line-height: 1.2;
    color: var(--text);
}

.directory-stat-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.customer-directory-grid {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.customer-directory-side {
    display: grid;
    gap: 22px;
}

.customer-directory-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.customer-entry-form textarea {
    min-height: 92px;
}

.customer-code-field input[readonly] {
    background: #f8fafc;
    color: var(--muted-strong);
    font-weight: 700;
}

.customer-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.customer-profile-panel {
    overflow: hidden;
}

.customer-profile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.customer-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.profile-metric,
.customer-profile-meta > div {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.profile-metric strong {
    font-size: 20px;
}

.customer-profile-meta {
    display: grid;
    gap: 12px;
}

.customer-profile-meta strong {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
}

.customer-profile-note {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f6fb 100%);
    border: 1px solid var(--line);
}

.customer-profile-note p {
    margin: 8px 0 0;
    color: var(--text);
}

.customer-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.customer-profile-empty {
    min-height: 240px;
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 8px 4px;
}

.customer-directory-table-head {
    margin-bottom: 18px;
}

.customer-directory-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
}

.customer-directory-search-form label {
    min-width: 260px;
}

.customer-directory-search-form input {
    width: 100%;
    margin-top: 8px;
}

.customer-directory-search-actions {
    display: flex;
    gap: 10px;
}

.customer-directory-table-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.customer-directory-table th {
    white-space: nowrap;
}

.customer-cell-main,
.customer-cell-stack {
    display: grid;
    gap: 4px;
}

.customer-cell-main strong,
.customer-cell-stack strong {
    margin-top: 0;
    font-size: 14px;
}

.customer-address-cell {
    max-width: 250px;
    color: var(--muted-strong);
}

.customer-directory-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 1200px) {
    .customer-directory-hero,
    .customer-directory-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .customer-directory-stats,
    .customer-profile-grid {
        grid-template-columns: 1fr;
    }

    .customer-directory-card-head,
    .customer-profile-top,
    .customer-directory-search-form,
    .customer-directory-table-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .customer-directory-search-form label {
        min-width: 0;
    }

    .customer-directory-search-actions,
    .customer-profile-actions,
    .customer-entry-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.text-success {
    color: #12935f;
}

.text-danger {
    color: #d24646;
}

.partner-ledger-layout {
    display: grid;
    gap: 22px;
}

.partner-ledger-filter-card {
    overflow: visible;
}

.partner-ledger-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    padding: 0 20px 20px;
}

.partner-ledger-stat {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.85);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.partner-ledger-stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.partner-ledger-stat strong {
    display: block;
    font-size: 20px;
    color: var(--text);
}

.partner-ledger-board {
    padding-bottom: 6px;
}

.partner-ledger-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.partner-ledger-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.partner-ledger-title h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.partner-ledger-title p {
    margin: 6px 0 0;
    color: var(--muted);
}

.partner-ledger-title-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #edf4ff 0%, #f7fbff 100%);
    color: var(--accent-dark);
    border: 1px solid rgba(145, 171, 220, 0.45);
    flex: 0 0 auto;
}

.partner-ledger-title-icon svg {
    width: 28px;
    height: 28px;
}

.partner-ledger-list-btn svg {
    width: 18px;
    height: 18px;
}

.partner-ledger-table-wrap {
    padding-top: 12px;
}

.partner-ledger-table thead th {
    background: #f8fafc;
    color: #1f2937;
    font-size: 14px;
    padding-top: 18px;
    padding-bottom: 18px;
}

.partner-ledger-table tbody td {
    font-size: 15px;
}

.partner-ledger-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.035);
}

@media (max-width: 1100px) {
    .partner-ledger-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .partner-ledger-board-head,
    .partner-ledger-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .partner-ledger-summary-grid {
        grid-template-columns: 1fr;
    }

    .partner-ledger-list-btn {
        width: 100%;
    }
}

.btn-dark {
    color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.balance-print-head {
    display: none;
}

.balance-sheet-shell {
    margin-bottom: 24px;
}

.balance-sheet-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.balance-side-stack {
    display: grid;
    gap: 18px;
}

.balance-ledger-card {
    overflow: hidden;
}

.balance-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    color: #fff;
}

.balance-card-top-green {
    background: linear-gradient(90deg, #0c9a67 0%, #11b37a 100%);
}

.balance-card-top-blue {
    background: linear-gradient(90deg, #24384f 0%, #334b65 100%);
}

.balance-card-kicker {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.balance-card-top h3 {
    margin: 0;
    font-size: 30px;
    line-height: 1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.balance-card-top-icon {
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.88);
}

.balance-card-top-icon .svg-icon {
    width: 100%;
    height: 100%;
}

.balance-card-body {
    padding: 14px 18px 16px;
}

.balance-line-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 4px;
    border-bottom: 1px solid #edf2f7;
}

.balance-line-item:last-child {
    border-bottom: 0;
}

.balance-line-item-compact {
    padding-top: 14px;
    padding-bottom: 14px;
}

.balance-line-item-total,
.balance-line-item-grand {
    background: #f8fbfd;
    border: 1px solid #edf2f7;
    border-radius: 18px;
    padding: 16px 14px;
}

.balance-line-item-grand {
    background: #f3fbf6;
}

.balance-divider {
    height: 1px;
    margin: 16px 2px;
    background: #2b35420f;
}

.balance-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex: 0 0 42px;
}

.balance-icon .svg-icon {
    width: 18px;
    height: 18px;
}

.balance-line-copy {
    min-width: 0;
}

.balance-line-copy strong {
    display: block;
    font-size: 16px;
    line-height: 1.3;
}

.balance-line-copy small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.balance-line-amount {
    margin-left: auto;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    text-align: right;
    white-space: nowrap;
}

.balance-line-amount-strong {
    font-size: 22px;
}

.balance-line-amount.is-positive {
    color: #0f9f6a;
}

.balance-line-amount.is-negative {
    color: #b42318;
}

.tone-blue {
    color: #2f67f6;
    background: rgba(47, 103, 246, 0.1);
}

.tone-pink {
    color: #d94682;
    background: rgba(217, 70, 130, 0.1);
}

.tone-mint {
    color: #0f9f6a;
    background: rgba(15, 159, 106, 0.12);
}

.tone-violet {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
}

.tone-amber {
    color: #b7791f;
    background: rgba(245, 158, 11, 0.12);
}

.tone-negative {
    color: #b42318;
    background: rgba(225, 29, 72, 0.1);
}

.balance-note-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #eef6ff 0%, #e6f0ff 100%);
    border: 1px solid #c9d9f8;
    box-shadow: var(--shadow-soft);
}

.balance-note-icon {
    width: 22px;
    height: 22px;
    color: #4264e6;
    flex: 0 0 22px;
    margin-top: 2px;
}

.balance-note-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.balance-note-card p {
    margin: 0;
    color: #334155;
}

.balance-note-card p + p {
    margin-top: 6px;
    font-weight: 700;
    color: #0f172a;
}

@media (max-width: 1180px) {
    .balance-sheet-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .balance-card-top h3 {
        font-size: 24px;
    }

    .balance-card-body {
        padding: 12px 14px 14px;
    }

    .balance-line-item {
        gap: 12px;
        align-items: flex-start;
    }

    .balance-line-amount {
        font-size: 16px;
    }

    .balance-line-amount-strong {
        font-size: 18px;
    }
}

@media print {
    .balance-print-head {
        display: block;
        margin-bottom: 12px;
    }

    .balance-print-head h2 {
        margin: 0;
        font-size: 28px;
    }

    .balance-print-head p {
        margin: 6px 0 0;
        color: #475569;
    }

    .balance-sheet-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .balance-ledger-card,
    .balance-note-card {
        box-shadow: none;
    }

    .balance-line-item {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .balance-card-top,
    .balance-card-body {
        padding-left: 14px;
        padding-right: 14px;
    }

    .balance-card-top {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .balance-card-top h3 {
        font-size: 24px;
    }
}

.balance-sheet-compact .balance-card-top {
    padding: 14px 16px;
}

.balance-sheet-compact .balance-card-kicker {
    margin-bottom: 4px;
    font-size: 10px;
    letter-spacing: 0.06em;
}

.balance-sheet-compact .balance-card-top h3 {
    font-size: 24px;
    text-transform: none;
}

.balance-sheet-compact .balance-card-body {
    padding: 10px 14px 14px;
}

.balance-sheet-compact .balance-line-item {
    gap: 10px;
    padding: 11px 2px;
}

.balance-sheet-compact .balance-line-item-total,
.balance-sheet-compact .balance-line-item-grand {
    border-radius: 14px;
    padding: 12px 10px;
}

.balance-sheet-compact .balance-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
}

.balance-sheet-compact .balance-icon .svg-icon {
    width: 15px;
    height: 15px;
}

.balance-sheet-compact .balance-line-copy strong,
.balance-sheet-compact .balance-note-card strong {
    font-size: 14px;
    font-weight: 600;
}

.balance-sheet-compact .balance-line-copy small,
.balance-sheet-compact .balance-note-card p {
    margin-top: 2px;
    font-size: 12px;
}

.balance-sheet-compact .balance-line-amount {
    font-size: 16px;
    font-weight: 700;
}

.balance-sheet-compact .balance-line-amount-strong {
    font-size: 18px;
}

.balance-sheet-compact .balance-note-card {
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
}

.manual-bank-page {
    overflow: visible;
}

.manual-bank-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px 10px;
}

.manual-bank-toolbar h3 {
    margin: 0;
    font-size: 20px;
}

.manual-bank-toolbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.manual-bank-add-btn {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #63b8ff 0%, #3f94e6 100%);
    color: #fff;
    box-shadow: 0 16px 30px rgba(63, 148, 230, 0.24);
}

.manual-bank-add-btn .svg-icon {
    width: 24px;
    height: 24px;
}

.manual-bank-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px 10px;
}

.manual-bank-pill {
    min-width: 168px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f6f8fb;
    border: 1px solid #e5eaef;
}

.manual-bank-pill span {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
}

.manual-bank-pill strong {
    font-size: 16px;
    font-weight: 700;
}

.manual-bank-pill.is-accent {
    background: #eef4ff;
    border-color: #cbd8ff;
}

.manual-bank-table-wrap {
    padding-top: 4px;
}

.manual-bank-modal[hidden] {
    display: none;
}

.manual-bank-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
}

.manual-bank-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}

.manual-bank-modal-dialog {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.manual-bank-modal-card {
    width: min(100%, 480px);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.26);
    border: 1px solid rgba(203, 213, 225, 0.7);
    overflow: hidden;
}

.manual-bank-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 10px;
}

.manual-bank-modal-head h3 {
    margin: 0;
    font-size: 18px;
}

.manual-bank-modal-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.manual-bank-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
}

.manual-bank-form {
    display: grid;
    gap: 12px;
    padding: 0 20px 20px;
}

.manual-bank-form label {
    gap: 6px;
}

.manual-bank-form label > span {
    font-size: 13px;
    font-weight: 600;
}

.manual-bank-form input,
.manual-bank-form select {
    padding: 12px 14px;
    border-radius: 14px;
    border: 2px solid #24384f;
}

.manual-bank-form-actions {
    display: flex;
    gap: 10px;
    padding-top: 4px;
}

.manual-bank-modal-open {
    overflow: hidden;
}

@media (max-width: 780px) {
    .manual-bank-toolbar,
    .manual-bank-summary {
        padding-left: 14px;
        padding-right: 14px;
    }

    .manual-bank-form-actions {
        flex-direction: column;
    }

    .manual-bank-form-actions .btn {
        width: 100%;
    }
}

@media print {
    .manual-bank-modal,
    #open-manual-bank-modal,
    #open-manual-bank-modal-secondary {
        display: none !important;
    }
}

.settings-tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.backup-panel-card,
.backup-restore-card {
    overflow: hidden;
}

.backup-card-head {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.backup-panel-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.25fr);
}

.backup-tips-column,
.backup-files-column {
    padding: 12px 18px 18px;
}

.backup-tips-column {
    border-right: 1px solid var(--line);
}

.backup-tip-block {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.backup-tip-block strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.backup-tip-block p,
.backup-tip-footnote {
    margin: 0;
    color: var(--muted-strong);
    line-height: 1.7;
}

.backup-tip-footnote {
    padding-top: 14px;
}

.backup-empty-state {
    padding: 26px 0;
    color: var(--muted);
}

.backup-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.backup-file-row:last-child {
    border-bottom: 0;
}

.backup-file-main {
    min-width: 0;
}

.backup-file-link {
    display: block;
    color: var(--accent-dark);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backup-file-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.backup-file-delete-form {
    flex: 0 0 auto;
}

.backup-delete-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(225, 29, 72, 0.45);
    background: #fff;
    color: #c81e4a;
    font-weight: 700;
}

.backup-delete-btn:hover {
    background: rgba(225, 29, 72, 0.06);
}

.backup-restore-form {
    padding-top: 0;
}

.backup-restore-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #92400e;
    line-height: 1.7;
}

.backup-restore-note strong {
    display: inline-block;
    margin-right: 6px;
}

.backup-restore-actions {
    display: flex;
    justify-content: flex-start;
}

@media (max-width: 980px) {
    .backup-panel-grid {
        grid-template-columns: 1fr;
    }

    .backup-tips-column {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 640px) {
    .backup-card-head,
    .backup-file-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .backup-file-delete-form,
    .backup-delete-btn,
    .backup-restore-actions .btn {
        width: 100%;
    }
}


.permission-builder {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.permission-builder-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.permission-builder-head span {
    color: #64748b;
    font-size: 13px;
}

.permission-group-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
}

.permission-group-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #0f172a;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.permission-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.permission-check span {
    margin: 0;
    font-weight: 500;
}

.permission-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    margin: 0 6px 6px 0;
}

.permission-chip.muted {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.developer-credit {
    position: fixed;
    right: 12px;
    bottom: 10px;
    z-index: 1200;
    font-size: 11px;
    line-height: 1.2;
    color: #64748b;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.78);
    padding: 5px 8px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
}

.developer-credit:hover {
    color: #0f172a;
    text-decoration: underline;
}

@media (max-width: 640px) {
    .developer-credit {
        right: 10px;
        bottom: 8px;
        font-size: 10px;
        padding: 4px 7px;
    }
}

