:root {
    --primary: #1D4ED8;
    --secondary: #0F172A;
    --bg: #F1F5F9;
    --text: #0F172A;
    --muted: #64748B;
    --card: #FFFFFF;
    --danger: #B91C1C;
    --success: #047857;
    --border: #E2E8F0;
    --ring: rgba(29, 78, 216, 0.2);
}

* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #64748b;
}

.breadcrumbs a {
    color: #1d4ed8;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

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

.sidebar {
    background: linear-gradient(180deg, #0b1324 0%, #0f172a 100%);
    color: #e2e8f0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 18px 14px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px;
}

.brand-logo-fallback {
    width: 180px;
    height: 60px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #cbd5e1;
    letter-spacing: 0.4px;
}

.brand-text {
    min-width: 0;
}

.brand-title {
    font-weight: 700;
    color: #f8fafc;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-subtitle {
    color: #94a3b8;
    font-size: 12px;
}

.sidebar-nav {
    padding: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    margin-bottom: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(148, 163, 184, 0.14);
    color: #f8fafc;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.25);
    color: #ffffff;
}

.nav-group {
    margin-bottom: 6px;
}

.nav-group summary {
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    font-size: 14px;
}

.nav-group-toggle:hover {
    background: rgba(148, 163, 184, 0.14);
    color: #f8fafc;
}

.nav-caret {
    font-size: 12px;
    color: #94a3b8;
}

.nav-submenu {
    margin-top: 6px;
    padding-left: 10px;
}

.nav-sub-item {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 13px;
    margin-bottom: 5px;
}

.nav-sub-item:hover {
    background: rgba(148, 163, 184, 0.14);
    color: #ffffff;
}

.nav-sub-item.active {
    background: rgba(37, 99, 235, 0.25);
    color: #ffffff;
}

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

.topbar {
    background: linear-gradient(120deg, var(--secondary), #1e293b);
    color: #f8fafc;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-title {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.topbar-sub {
    color: #cbd5e1;
    font-size: 13px;
    margin-top: 2px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-search {
    flex: 1;
    max-width: 520px;
}

.topbar-search input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.65);
    color: #ffffff;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0;
    caret-color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

.topbar-search input::placeholder {
    color: #94a3b8;
}

.topbar-search input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.35);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.icon-svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #0f172a;
}

.notification-menu {
    position: relative;
}

.notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    z-index: 22;
}

.notification-dropdown.open {
    display: block;
}

.notification-head {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.notification-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
}

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

.notification-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.notification-text {
    font-size: 12px;
    color: #475569;
    margin-top: 2px;
}

.notification-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.notification-empty {
    padding: 14px 12px;
    color: #64748b;
    font-size: 13px;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.35);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(120deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.user-inline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    text-align: left;
}

.user-inline strong {
    font-size: 13px;
    color: #f8fafc;
}

.user-inline small {
    font-size: 11px;
    color: #94a3b8;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 260px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    z-index: 20;
    overflow: hidden;
}

.user-dropdown.open {
    display: block;
}

.user-dropdown-head {
    padding: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.user-dropdown-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.user-dropdown-email {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.user-dropdown-link {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: #0f172a;
    font-size: 14px;
}

.user-dropdown-link:hover {
    background: #f1f5f9;
}

.danger-link {
    color: #b91c1c;
}

.btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    background: linear-gradient(120deg, var(--primary), #2563eb);
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.btn.secondary {
    background: #475569;
}

.btn.danger {
    background: var(--danger);
}

.card {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    margin-bottom: 18px;
}

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

.charts-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.chart-canvas {
    width: 100%;
    height: 220px;
    display: block;
    margin-top: 8px;
}

.mix-legend {
    margin-top: 10px;
}

.legend-item {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    padding: 6px 0;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-label {
    color: #334155;
}

.legend-value {
    color: #0f172a;
    font-weight: 700;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 8px;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: #475569;
    font-weight: 700;
    background: #f8fafc;
}

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #e2e8f0;
    color: #0f172a;
}

.status-pill-muted {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
}

.card-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-bar {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    background: #f8fafc;
    margin-bottom: 14px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px 16px;
}

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

.filter-field input[type="text"],
.filter-field input[type="date"],
.filter-field select {
    width: 100%;
    margin-bottom: 0;
    padding: 9px 10px;
    font-size: 13px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.table-meta {
    font-size: 13px;
    margin-bottom: 10px;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 16px 20px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.table-toolbar-page-wrap {
    margin-left: auto;
}

.column-picker-toolbar {
    position: relative;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}

.column-picker-summary {
    list-style: none;
    cursor: pointer;
    padding: 9px 12px;
    font-weight: 700;
    color: #334155;
}

.column-picker-summary::-webkit-details-marker {
    display: none;
}

.column-picker-toolbar[open] .column-picker-summary {
    border-bottom: 1px solid var(--border);
}

.column-picker-panel {
    padding: 10px 12px 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px 14px;
    min-width: min(420px, 92vw);
}

.column-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.column-picker-hint {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    line-height: 1.35;
}

#clients-results {
    scroll-margin-top: 24px;
}

.clients-table-panel {
    transition: opacity 0.15s ease;
}

.clients-table-panel.clients-table-panel-loading {
    opacity: 0.55;
    pointer-events: none;
}

.clients-col-hidden {
    display: none !important;
}

.clients-table-hscroll-wrap {
    margin-top: 4px;
}

.hscroll-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.hscroll-bar-row--bottom {
    margin-top: 10px;
    margin-bottom: 0;
    justify-content: center;
    gap: 20px;
}

.hscroll-arrow {
    flex: 0 0 auto;
    width: 36px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.hscroll-arrow:hover:not(:disabled) {
    background: #e2e8f0;
}

.hscroll-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.hscroll-proxy-outer {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
    border-radius: 6px;
    background: #e2e8f0;
    scrollbar-width: thin;
}

.hscroll-proxy-inner {
    height: 1px;
    pointer-events: none;
}

.clients-table-hscroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.clients-table-hscroll:focus {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.clients-table-hscroll .clients-data-table {
    min-width: 1020px;
    width: max-content;
    max-width: none;
}

.clients-table-hscroll .data-table th.clients-sticky-left,
.clients-table-hscroll .data-table td.clients-sticky-left {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 6px 0 10px -8px rgba(15, 23, 42, 0.35);
}

.clients-table-hscroll .data-table thead th.clients-sticky-left,
.clients-table-hscroll .data-table thead th.clients-sticky-left-2 {
    z-index: 5;
    background: #f8fafc;
}

.clients-table-hscroll .data-table th.clients-sticky-left-2,
.clients-table-hscroll .data-table td.clients-sticky-left-2 {
    position: sticky;
    left: var(--clients-sticky-1-w, 132px);
    z-index: 2;
    background: #fff;
    box-shadow: 6px 0 10px -8px rgba(15, 23, 42, 0.25);
}

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

.td-actions {
    white-space: normal;
    max-width: 520px;
    overflow-x: visible;
}

.table-actions-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.action-sep {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 12px;
    user-select: none;
    flex-shrink: 0;
}

.action-inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

/* Prevent long client values from getting clipped on the right side */
.clients-table-hscroll .clients-data-table td[data-clients-col="email"],
.clients-table-hscroll .clients-data-table td[data-clients-col="owner"],
.clients-table-hscroll .clients-data-table td[data-clients-col="town"],
.clients-table-hscroll .clients-data-table td.clients-sticky-left-2 {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.action-link {
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.action-link:hover {
    text-decoration: underline;
}

.action-link-primary {
    color: #0f766e;
}

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

.btn.table-action-btn {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    white-space: nowrap;
}

.btn.sm {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.flash {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.flash-ok {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-err {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.client-view-head {
    align-items: flex-start;
}

.client-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.detail-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.detail-status-row > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-grid {
    margin-top: 8px;
}

.detail-block-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.detail-dl {
    display: grid;
    grid-template-columns: minmax(100px, 34%) 1fr;
    gap: 6px 12px;
    font-size: 14px;
    margin: 0;
}

.detail-dl dt {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.detail-dl dd {
    margin: 0;
    color: #0f172a;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.doc-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: #fafafa;
}

.doc-card h4 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.doc-thumb-link {
    display: inline-block;
    max-width: 100%;
}

.doc-thumb {
    max-width: 100%;
    max-height: 160px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: contain;
    background: #fff;
}

.doc-thumb-wrap {
    margin-bottom: 10px;
}

.client-file-slot {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
    background: #fafafa;
}

.client-file-slot-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.client-file-preview {
    min-height: 100px;
    max-width: 220px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px;
}

.client-file-preview-img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 6px;
}

.client-file-preview-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.client-file-upload-field {
    margin-top: 8px;
    margin-bottom: 0;
}

.client-file-upload-field input[type="file"] {
    font-size: 13px;
    max-width: 100%;
}

/* --- Customer registration / edit: sections & professional uploads --- */
.customer-registration-form-card,
.client-registration-form-card,
.customer-edit-form-card,
.merchant-registration-form-card {
    overflow: hidden;
}

.merchant-register-meta {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}

.merchant-fields-grid,
.merchant-registration-form .merchant-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}

@media (max-width: 1100px) {
    .merchant-fields-grid,
    .merchant-registration-form .merchant-form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .merchant-fields-grid,
    .merchant-registration-form .merchant-form-row {
        grid-template-columns: 1fr;
    }
}

.merchant-registration-form .merchant-form-row .col-md-4 {
    min-width: 0;
}

.customer-form-section {
    margin-top: 0;
    margin-bottom: 28px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--border);
}

.customer-form-section:last-of-type,
.customer-documents-section {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.customer-form-section-head {
    margin-bottom: 16px;
}

.customer-form-section-head .detail-block-title {
    margin-bottom: 6px;
}

.customer-form-section-lead {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    max-width: 720px;
}

.detail-block-title--compact {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 12px !important;
}

.customer-documents-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.customer-documents-section .customer-form-section-head {
    margin-bottom: 18px;
}

.customer-upload-subsection {
    margin-bottom: 24px;
}

.customer-upload-subsection:last-child {
    margin-bottom: 0;
}

.customer-upload-subsection-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.customer-upload-subsection-lead {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.4;
}

.customer-upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

.customer-upload-grid > * {
    min-width: 0;
}

/* Multi-column document cards (minmax(0,1fr) avoids single-column collapse in nested grids) */
.customer-upload-grid--cols-2 {
    grid-template-columns: minmax(0, 1fr);
}

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

@media (min-width: 640px) {
    .customer-upload-grid--cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (min-width: 1024px) {
    .customer-upload-grid--cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.customer-upload-grid--edit {
    margin-top: 8px;
}

.customer-upload-grid--edit-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

@media (min-width: 640px) {
    .customer-upload-grid--edit-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .customer-upload-grid--edit-cols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.customer-upload-tile {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.08),
        0 10px 28px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.customer-upload-tile:hover {
    border-color: #cbd5e1;
    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.08),
        0 16px 40px rgba(15, 23, 42, 0.06);
}

.customer-upload-tile--required {
    border-top: 3px solid var(--primary);
}

.customer-upload-tile--required .customer-upload-tile-head {
    padding-top: 15px;
}

.customer-upload-tile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
    padding: 16px 16px 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #f1f5f9;
}

.customer-upload-tile-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.customer-upload-tile-hint {
    margin: 0;
    padding: 0 16px 12px;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
}

.customer-upload-tile .customer-upload-zone {
    padding: 0 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.customer-upload-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

.customer-upload-badge--required {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.customer-upload-badge--optional {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.customer-upload-zone {
    position: relative;
    border-radius: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

/* File input overlays only .customer-upload-zone-visual so the filename strip below stays visible */
.customer-upload-zone-face {
    position: relative;
    display: block;
    flex: 1;
    min-height: 140px;
    margin: 0;
    padding: 0;
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.customer-upload-zone-face:hover {
    border-color: #64748b;
    background: #f1f5f9;
}

.customer-upload-zone:focus-within .customer-upload-zone-face {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.customer-upload-zone.is-dragover .customer-upload-zone-face {
    border-color: var(--primary);
    background: #eff6ff;
    border-style: solid;
}

.customer-upload-zone-visual .customer-upload-input {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 2rem;
}

.customer-upload-zone-visual {
    display: block;
    position: relative;
    z-index: 1;
    min-height: 118px;
    pointer-events: none;
}

/* Two columns: drag-drop | device (flex is more reliable than grid here) */
.customer-upload-zone-bi {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    min-height: 118px;
}

.customer-upload-zone-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 10px;
}

.customer-upload-zone-col--drop {
    background: rgba(37, 99, 235, 0.06);
}

.customer-upload-zone-col--device {
    background: rgba(15, 23, 42, 0.04);
}

.customer-upload-zone-or {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    width: 40px;
    min-width: 40px;
}

.customer-upload-zone-or-line {
    flex: 1 1 auto;
    width: 1px;
    min-height: 14px;
    max-height: 40px;
    background: linear-gradient(180deg, transparent, #cbd5e1, transparent);
}

.customer-upload-zone-or-text {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.customer-upload-zone-graphic {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 10px;
    background-color: rgba(37, 99, 235, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231d4ed8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
}

.customer-upload-drop-heading {
    font-size: 13px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 2px;
}

.customer-upload-drop-line {
    font-size: 11px;
    line-height: 1.35;
    color: #64748b;
    max-width: 140px;
}

.customer-upload-device-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 10px;
    background-color: rgba(15, 23, 42, 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23334155' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10.5 1.5H8.25A2.25 2.25 0 006 3.75v16.5a2.25 2.25 0 002.25 2.25h7.5A2.25 2.25 0 0018 20.25V9M10.5 1.5H18a2.25 2.25 0 012.25 2.25V9M10.5 1.5V8.25A2.25 2.25 0 0012.75 10.5H18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
}

.customer-upload-device-heading {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.customer-upload-device-line {
    font-size: 11px;
    line-height: 1.35;
    color: #64748b;
    max-width: 140px;
}

.customer-upload-meta {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    padding: 10px 12px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    margin: 0;
}

@media (max-width: 480px) {
    .customer-upload-zone-bi {
        flex-direction: column;
    }

    .customer-upload-zone-or {
        flex-direction: row;
        width: 100%;
        min-width: unset;
        height: auto;
        padding: 8px 12px;
        border-left: none;
        border-right: none;
        border-top: 1px solid #e2e8f0;
        border-bottom: 1px solid #e2e8f0;
    }

    .customer-upload-zone-or-line {
        flex: 1 1 auto;
        height: 1px;
        min-height: 1px;
        max-height: none;
        width: auto;
        background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
    }
}

.customer-upload-zone-face .customer-upload-filename {
    position: relative;
    z-index: 2;
    display: block;
    margin: 0 12px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #047857;
    word-break: break-all;
    padding: 8px 10px;
    background: #ecfdf5;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
    pointer-events: none;
}

.customer-upload-foot-hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
}

.customer-form-footer.filter-actions {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Edit customer: document slots in grid */
.customer-doc-slot {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0 !important;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.06),
        0 8px 24px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.customer-doc-slot:hover {
    border-color: #cbd5e1;
    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.08),
        0 16px 40px rgba(15, 23, 42, 0.05);
}

.customer-doc-slot-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #f1f5f9;
}

.customer-doc-slot-top .client-file-slot-title {
    margin: 0;
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

.customer-doc-status {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 6px;
}

.customer-doc-status--ok {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.customer-doc-status--warn {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.customer-doc-status--muted {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.customer-doc-slot-preview-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 0;
    padding: 12px 14px;
}

.customer-doc-preview.client-file-preview {
    flex: 1;
    min-width: 140px;
    min-height: 100px;
    max-width: 100%;
    margin-bottom: 0;
}

.customer-doc-view-btn {
    flex-shrink: 0;
}

.customer-doc-slot-upload {
    margin-top: auto;
    padding: 0 12px 14px;
    border-top: 1px dashed #e2e8f0;
    background: #fafbfc;
}

.customer-doc-upload-label {
    margin: 0;
    padding: 12px 2px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    .customer-upload-grid--cols-2,
    .customer-upload-grid--cols-3,
    .customer-upload-grid--edit-cols {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .customer-doc-slot-preview-row {
        flex-direction: column;
        align-items: stretch;
    }

    .customer-doc-view-btn {
        width: 100%;
    }
}

body.pewa-doc-modal-open {
    overflow: hidden;
}

.pewa-doc-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.pewa-doc-modal[hidden] {
    display: none !important;
}

.pewa-doc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

.pewa-doc-modal-panel {
    position: relative;
    z-index: 1;
    width: min(96vw, 920px);
    max-height: min(90vh, 860px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pewa-doc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.pewa-doc-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.pewa-doc-modal-close {
    border: 0;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #334155;
}

.pewa-doc-modal-close:hover {
    background: #e2e8f0;
}

.pewa-doc-modal-body {
    flex: 1;
    min-height: 320px;
    max-height: min(72vh, 720px);
    overflow: auto;
    padding: 12px;
    background: #f8fafc;
}

.pewa-doc-modal-frame {
    width: 100%;
    min-height: 480px;
    height: min(68vh, 680px);
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.pewa-doc-modal-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.muted.small {
    font-size: 12px;
    margin-top: 8px;
}

.callout {
    padding: 12px 14px;
    border-radius: 10px;
    margin: 12px 0;
    font-size: 14px;
}

.callout-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.action-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 16px;
}

.action-panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: #f8fafc;
}

.action-panel h4 {
    margin: 0 0 10px;
    font-size: 14px;
}

.action-panel-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.reject-form {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

.reject-form label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #475569;
}

.reject-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Form rows: client register/edit use .client-edit-form; customer edit uses .detail-block only */
.client-edit-form .form-field,
.detail-block .form-field {
    margin-bottom: 12px;
}

.client-edit-form .form-field label,
.detail-block .form-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #475569;
}

.client-edit-form .form-field-label,
.detail-block .form-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #475569;
}

.client-edit-form .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.detail-block .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    background: #fff;
    margin-bottom: 0;
}

.client-edit-form .form-field select,
.detail-block .form-field select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    background: #fff;
    margin-bottom: 0;
}

.client-edit-form .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus,
.detail-block .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus,
.client-edit-form .form-field select:focus,
.detail-block .form-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.req {
    color: #b91c1c;
    font-weight: 700;
}

.credential-pick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 8px;
}

.credential-pick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.table-toolbar label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.table-toolbar-search-input {
    width: min(100%, 320px);
    min-width: 200px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 0;
}

.table-toolbar-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.table-toolbar-select {
    min-width: 88px;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 0;
    background: #fff;
}

@media (max-width: 600px) {
    .table-toolbar-search-input {
        width: 100%;
    }
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.page-link:hover {
    background: #dbeafe;
}

.page-link.current {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

.page-link.disabled {
    color: #94a3b8;
    background: #f1f5f9;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 4px;
    color: #94a3b8;
    font-size: 13px;
}

.hero-card {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
}

.identity-meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 70px;
    height: 70px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 50%;
    right: -18px;
    top: -18px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.2px;
}

.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
    margin-bottom: 8px;
}

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

.error {
    color: #7f1d1d;
    margin-bottom: 14px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 12px;
}

/* Avoid global label/input rules — they fight toolbars, filters, and .form-field layouts.
   Use .filter-field, .table-toolbar, .client-edit-form / .detail-block .form-field, .login-form, .topbar-search */

.login-box {
    width: 470px;
    max-width: 100%;
    margin: 70px auto;
}

.login-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.18), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.08), transparent 45%),
        linear-gradient(165deg, #f1f5f9 0%, #e2e8f0 50%, #f8fafc 100%);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

.login-page-inner {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 32px;
    box-sizing: border-box;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 12px 40px rgba(15, 23, 42, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 36px 32px 28px;
    box-sizing: border-box;
}

.login-logo-block {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.login-logo-img {
    max-width: 200px;
    height: auto;
    max-height: 64px;
    object-fit: contain;
    display: block;
}

.login-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 56px;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(15, 23, 42, 0.04));
    border-radius: 10px;
}

.login-heading {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--secondary);
    text-align: center;
}

.login-sub {
    margin: 0 0 22px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--muted);
    text-align: center;
}

.login-brand .login-heading {
    margin-bottom: 6px;
}

.login-brand .login-sub {
    margin-bottom: 22px;
}

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

.login-form .form-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 6px;
}

.login-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.login-label-row label {
    margin-bottom: 0;
}

.login-forgot-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.login-forgot-link:hover {
    text-decoration: underline;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    font-size: 0.9375rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.login-form input::placeholder {
    color: #94a3b8;
}

.btn-login {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-align: center;
}

.login-alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 18px;
}

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

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

.login-alert code {
    font-size: 0.8em;
    word-break: break-all;
}

.login-legal {
    margin: 22px 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #94a3b8;
    text-align: center;
}

.login-footer-note {
    margin: 20px 0 0;
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
}

.login-back {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.875rem;
}

.login-back a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.login-back a:hover {
    text-decoration: underline;
}

.section-title {
    margin: 0 0 6px;
}

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

    .sidebar {
        padding: 12px;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 6px;
    }

    .nav-item {
        margin-bottom: 0;
    }

    .hero-card {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

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

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .topbar-search {
        width: 100%;
        max-width: none;
    }

    .user-menu-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar-right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }

    .user-dropdown {
        width: 100%;
        left: 0;
        right: auto;
    }

    .notification-dropdown {
        width: 100%;
        left: 0;
        right: auto;
    }
}

/* Customer registration: individual vs corporate */
.customer-reg-kind-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.customer-reg-kind-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.customer-list-reg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.customer-type-pill--ind {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.customer-type-pill--corp {
    background: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

.customer-table-entity {
    font-weight: 700;
    color: #0f172a;
}

.customer-table-rep {
    margin-top: 2px;
}

/* Admin customer registration: activation handled by customer */
.customer-activation-hint {
    margin: 0 0 20px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    color: #334155;
}
