:root {
    --kd-ink: #1d2939;
    --kd-muted: #667085;
    --kd-soft: #f3f5f7;
    --kd-panel: #ffffff;
    --kd-line: #e4e7ec;
    --kd-primary: #175cd3;
    --kd-primary-dark: #1849a9;
    --kd-accent: #067647;
    --kd-warning: #b54708;
    --kd-danger: #b42318;
    --kd-sidebar: #20262f;
    --kd-shadow: 0 8px 24px rgba(16, 24, 40, .06);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    background: var(--kd-soft);
}

body {
    min-width: 320px;
    color: var(--kd-ink);
    background: var(--kd-soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
    color: var(--kd-primary);
}

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

.kd-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    overflow-y: auto;
    background: var(--kd-sidebar);
    color: #d0d5dd;
}

.kd-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 0 6px 22px;
    color: #fff;
    text-decoration: none;
}

.kd-sidebar-brand:hover {
    color: #fff;
}

.kd-sidebar-logo,
.kd-mobile-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 8px;
    object-fit: cover;
}

.kd-sidebar-brand span {
    min-width: 0;
}

.kd-sidebar-brand strong,
.kd-sidebar-brand small {
    display: block;
}

.kd-sidebar-brand strong {
    font-size: 16px;
    line-height: 1.35;
}

.kd-sidebar-brand small {
    margin-top: 2px;
    color: #98a2b3;
    font-size: 12px;
}

.kd-sidebar-nav {
    display: grid;
    gap: 5px;
}

.kd-sidebar-label {
    padding: 7px 10px 8px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 700;
}

.kd-sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 7px;
    color: #c7ced8;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.kd-sidebar-link i {
    width: 20px;
    color: #98a2b3;
    font-size: 17px;
    text-align: center;
}

.kd-sidebar-link:hover {
    background: #2d3540;
    color: #fff;
}

.kd-sidebar-link.active {
    background: #344054;
    color: #fff;
}

.kd-sidebar-link.active i {
    color: #84adff;
}

.kd-sidebar-footer {
    display: grid;
    gap: 11px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #344054;
}

.kd-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0 6px;
}

.kd-user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eaf2ff;
    color: var(--kd-primary-dark);
    font-size: 13px;
    font-weight: 800;
}

.kd-user-chip strong,
.kd-user-chip small {
    display: block;
}

.kd-user-chip strong {
    color: #f2f4f7;
    font-size: 13px;
}

.kd-user-chip small {
    color: #98a2b3;
    font-size: 11px;
}

.kd-back-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #c7ced8;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.kd-back-link:hover {
    background: #2d3540;
    color: #fff;
}

.kd-mobile-chrome {
    display: none;
}

.kd-main {
    min-width: 0;
    padding: 28px clamp(18px, 3vw, 40px) 40px;
}

.kd-page-content {
    width: min(100%, 1480px);
    margin: 0 auto;
}

.kd-page-header {
    min-height: 58px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.kd-page-header h1 {
    margin: 0;
    color: #101828;
    font-size: 24px;
    font-weight: 750;
    line-height: 1.3;
}

.kd-page-header p {
    margin: 5px 0 0;
    color: var(--kd-muted);
    font-size: 13px;
}

.kd-icon-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--kd-line);
    border-radius: 7px;
    background: #fff;
    color: #475467;
    text-decoration: none;
}

.kd-icon-button:hover {
    background: #f8fafc;
    color: var(--kd-primary);
}

.nav-card,
.table-card,
.stat-card,
.card-box,
.kd-auth-card,
.kd-mobile-panel,
.card {
    border: 1px solid var(--kd-line) !important;
    border-radius: 8px !important;
    background: var(--kd-panel);
    box-shadow: var(--kd-shadow) !important;
}

.kuake-logo,
.header-logo {
    flex-shrink: 0;
    border-radius: 8px !important;
    object-fit: cover;
}

.kuake-logo {
    width: 48px;
    height: 48px;
}

.header-logo {
    width: 64px;
    height: 64px;
}

.kd-brand-title {
    font-size: 18px;
    font-weight: 700;
}

.kd-brand-subtitle {
    color: var(--kd-muted);
    font-size: 13px;
}

.btn {
    border-radius: 7px;
    font-weight: 650;
}

.btn-primary,
.page-item.active .page-link {
    background: var(--kd-primary) !important;
    border-color: var(--kd-primary) !important;
    color: #fff !important;
}

.btn-primary:hover {
    background: var(--kd-primary-dark) !important;
    border-color: var(--kd-primary-dark) !important;
}

.btn-outline-primary {
    color: var(--kd-primary);
    border-color: #b2ccff;
}

.btn-outline-primary:hover {
    background: var(--kd-primary);
    border-color: var(--kd-primary);
}

.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger {
    border-color: var(--kd-line);
}

.card-header {
    background: #fff !important;
    border-bottom: 1px solid var(--kd-line);
    color: var(--kd-ink);
    font-weight: 700;
}

.table {
    --bs-table-hover-bg: #f8fafc;
}

.table thead th {
    padding-top: 11px;
    padding-bottom: 11px;
    border-bottom-color: var(--kd-line);
    background: #f8fafc !important;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

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

.table td {
    border-color: #eef1f4;
}

.form-control,
.form-select {
    min-height: 40px;
    border-color: #d0d5dd;
    border-radius: 7px;
}

.form-control:focus,
.form-select:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 .2rem rgba(23, 92, 211, .12);
}

.form-check-input:checked {
    background-color: var(--kd-primary);
    border-color: var(--kd-primary);
}

code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #eff4ff;
    color: #1849a9;
}

.badge {
    border-radius: 999px;
    font-weight: 700;
    padding: .43em .65em;
}

.bg-success {
    background-color: var(--kd-accent) !important;
}

.bg-warning {
    background-color: #dc8b16 !important;
}

.bg-danger {
    background-color: var(--kd-danger) !important;
}

.bg-info,
.bg-primary {
    background-color: var(--kd-primary) !important;
}

.bg-secondary {
    background-color: #667085 !important;
}

.stat-icon {
    width: 48px !important;
    height: 48px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
    background: #eff4ff !important;
    color: var(--kd-primary) !important;
}

.live-dot,
.status-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 4px rgba(18, 183, 106, .12);
    animation: kdPulse 1.8s infinite;
}

.status-dot-warning {
    background: #f79009;
    box-shadow: 0 0 0 4px rgba(247, 144, 9, .12);
}

@keyframes kdPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

.kd-auth-body,
.kd-mobile-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.kd-auth-card,
.kd-mobile-panel {
    width: 100%;
    max-width: 430px;
    overflow: hidden;
}

.kd-auth-mark,
.kd-mobile-header {
    padding: 26px 26px 20px;
    border-bottom: 1px solid var(--kd-line);
    background: #f8fafc;
    text-align: center;
}

.kd-mobile-header h1,
.kd-auth-mark h1 {
    margin: 12px 0 4px;
    font-size: 20px;
    font-weight: 760;
}

.kd-mobile-header p,
.kd-auth-mark p {
    margin: 0;
    color: var(--kd-muted);
    font-size: 13px;
}

.kd-mobile-content {
    padding: 24px;
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: kdFadeIn .22s ease-out;
}

@keyframes kdFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.kd-info-strip,
.pay-tip,
.scan-tip,
.waiting-tip,
.status-card,
.tips {
    border: 1px solid var(--kd-line);
    border-radius: 8px;
    background: #f8fafc !important;
    color: #405064 !important;
}

.pay-tip {
    border-color: #abefc6;
    background: #ecfdf3 !important;
}

.scan-tip,
.waiting-tip {
    border-color: #fedf89;
    background: #fffaeb !important;
}

.qr-code-container {
    display: inline-block;
    padding: 16px;
    border: 1px solid var(--kd-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--kd-shadow);
}

.kd-result-icon {
    width: 68px;
    height: 68px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    font-size: 30px;
}

.kd-result-icon.success {
    background: #ecfdf3;
    color: var(--kd-accent);
}

.kd-result-icon.danger {
    background: #fef3f2;
    color: var(--kd-danger);
}

#scanner {
    border-color: var(--kd-line) !important;
    background: #111827 !important;
}

.kd-scan-actions {
    display: flex;
    gap: 10px;
}

.kd-scan-actions .btn {
    flex: 1;
}

/* Customer card flow: keep the public page focused and stable on small screens. */
.kd-customer-card-page {
    min-height: 100dvh;
    margin: 0;
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(0, 440px);
    place-items: center;
    justify-content: center;
    background: #f4f6f8 !important;
    color: #101828;
}

.kd-customer-card-page .kd-mobile-panel {
    width: min(100%, 440px);
    max-width: 440px;
    align-self: center;
    border-radius: 8px !important;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .08);
}

.kd-customer-card-page .kd-mobile-header {
    padding: 20px 20px 16px;
}

.kd-customer-card-page .header-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 2px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(16, 24, 40, .12);
}

.kd-customer-card-page .kd-mobile-header h1 {
    margin-top: 10px;
    font-size: 19px;
}

.kd-customer-card-page .kd-mobile-header p {
    font-size: 12px;
}

.kd-customer-card-page .kd-mobile-content {
    padding: 18px 16px 20px;
}

.kd-customer-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 12px;
}

.kd-customer-step {
    position: relative;
    z-index: 0;
    min-width: 0;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #98a2b3;
    font-size: 12px;
    text-align: center;
}

.kd-customer-step::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 14px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 1px;
    background: #eaecf0;
}

.kd-customer-step:last-child::after {
    display: none;
}

.kd-customer-step > span {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d0d5dd;
    border-radius: 50%;
    background: #fff;
    color: #98a2b3;
    font-size: 12px;
    font-weight: 700;
}

.kd-customer-step small {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.2;
}

.kd-customer-step.is-current {
    color: var(--kd-primary);
    font-weight: 700;
}

.kd-customer-step.is-current > span {
    border-color: var(--kd-primary);
    background: var(--kd-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(47, 95, 204, .12);
}

.kd-customer-step.is-complete {
    color: #039855;
}

.kd-customer-step.is-complete > span {
    border-color: #abefc6;
    background: #ecfdf3;
    color: #039855;
}

.kd-customer-step.is-complete::after {
    background: #abefc6;
}

.kd-customer-step.is-failed {
    color: var(--kd-danger);
}

.kd-customer-step.is-failed > span {
    border-color: #fecdca;
    background: #fef3f2;
    color: var(--kd-danger);
}

.kd-customer-status {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid var(--kd-line);
    border-radius: 6px;
    background: #f8fafc;
    color: #475467;
    font-size: 13px;
    line-height: 1.35;
}

.kd-customer-status > i {
    flex: 0 0 auto;
    color: var(--kd-primary);
}

.kd-customer-status.is-success {
    border-color: #abefc6;
    background: #ecfdf3;
    color: #027a48;
}

.kd-customer-status.is-success > i {
    color: #039855;
}

.kd-customer-status.is-failed {
    border-color: #fecdca;
    background: #fef3f2;
    color: #b42318;
}

.kd-customer-status.is-failed > i {
    color: var(--kd-danger);
}

.kd-customer-card-page .form-label {
    margin-bottom: 8px;
    color: #344054;
    font-weight: 650;
}

.kd-customer-card-page .form-control {
    min-height: 50px;
    border-radius: 6px;
    font-size: 16px;
}

.kd-customer-card-page .form-control:focus {
    border-color: var(--kd-primary);
    box-shadow: 0 0 0 3px rgba(47, 95, 204, .14);
}

.kd-customer-action {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.kd-customer-action[aria-busy="true"] {
    cursor: wait;
}

.kd-customer-error {
    margin-top: 14px !important;
    margin-bottom: 0;
    line-height: 1.45;
}

.kd-customer-card-page .qr-code-container {
    width: min(100%, 248px);
    max-width: 100%;
    padding: 10px;
}

.kd-customer-card-page .qr-code-container canvas,
.kd-customer-card-page .qr-code-container img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.kd-customer-card-page .pay-tip,
.kd-customer-card-page .scan-tip,
.kd-customer-card-page .waiting-tip {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px !important;
    line-height: 1.4;
}

.kd-customer-card-page .step .text-center.py-4 {
    padding-top: 8px !important;
    padding-bottom: 4px !important;
}

@media (max-width: 480px) {
    .kd-customer-card-page {
        min-height: 100svh;
        align-items: start !important;
        padding: 18px 12px 24px;
    }

    .kd-customer-card-page .kd-mobile-panel {
        margin: 0;
        align-self: start;
    }

    .kd-customer-card-page .kd-mobile-header {
        padding: 18px 16px 14px;
    }

    .kd-customer-card-page .kd-mobile-content {
        padding: 16px 14px 18px;
    }

    .kd-customer-steps {
        gap: 1px;
    }

    .kd-customer-step {
        min-height: 51px;
    }

    .kd-customer-step > span {
        width: 26px;
        height: 26px;
    }

    .kd-customer-step::after {
        top: 13px;
        left: calc(50% + 15px);
        right: calc(-50% + 15px);
    }

    .kd-customer-step small {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kd-customer-card-page .step.active {
        animation: none;
    }
}

.kd-page-primary-action {
    flex: 0 0 auto;
    min-height: 40px;
    padding-right: 16px;
    padding-left: 16px;
    white-space: nowrap;
}

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

.kd-metric-tile {
    min-width: 0;
    min-height: 126px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 18px;
    border: 1px solid var(--kd-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(16, 24, 40, .04);
}

.kd-metric-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eff4ff;
    color: var(--kd-primary);
    font-size: 19px;
}

.kd-metric-tile[data-tone="green"] .kd-metric-icon {
    background: #ecfdf3;
    color: var(--kd-accent);
}

.kd-metric-tile[data-tone="amber"] .kd-metric-icon {
    background: #fffaeb;
    color: var(--kd-warning);
}

.kd-metric-tile[data-tone="red"] .kd-metric-icon {
    background: #fef3f2;
    color: var(--kd-danger);
}

.kd-metric-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.kd-metric-copy > span {
    color: #475467;
    font-size: 13px;
    font-weight: 650;
}

.kd-metric-copy > strong {
    margin-top: 3px;
    color: #101828;
    font-size: 25px;
    line-height: 1.2;
}

.kd-metric-copy > small {
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: #98a2b3;
    font-size: 11px;
    line-height: 1.45;
}

.kd-work-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--kd-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--kd-shadow);
}

.kd-panel-header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--kd-line);
}

.kd-panel-header h2 {
    margin: 0;
    color: #101828;
    font-size: 16px;
    font-weight: 750;
}

.kd-panel-header p {
    margin: 4px 0 0;
    color: var(--kd-muted);
    font-size: 12px;
}

.kd-panel-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kd-count-badge {
    min-width: 24px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: 11px;
    font-weight: 750;
}

.kd-live-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #475467;
    font-size: 12px;
}

.kd-live-controls .form-check-label {
    white-space: nowrap;
}

.kd-connection-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.kd-connection-state.is-offline {
    color: var(--kd-warning);
}

.kd-business-table {
    min-width: 820px;
}

.kd-business-table td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.kd-record-identity,
.kd-customer-cell {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.kd-record-identity strong,
.kd-customer-cell strong {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.kd-record-identity code {
    font-size: 12px;
}

.kd-record-identity small,
.kd-customer-cell small {
    color: #98a2b3;
    font-size: 11px;
}

.kd-time-text {
    color: #667085;
    font-size: 12px;
    white-space: nowrap;
}

.kd-action-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kd-action-cluster .kd-icon-button {
    width: 32px;
    height: 32px;
}

.kd-more-button {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--kd-line);
}

.kd-icon-danger {
    color: var(--kd-danger);
}

.kd-icon-danger:hover {
    border-color: #fecdca;
    background: #fef3f2;
    color: #912018;
}

.dropdown-menu {
    border-color: var(--kd-line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .12);
}

.dropdown-item {
    min-height: 36px;
    display: flex;
    align-items: center;
    font-size: 13px;
}

.kd-empty-state {
    min-height: 116px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: #98a2b3;
    font-size: 13px;
    text-align: center;
}

.kd-empty-state i {
    font-size: 24px;
}

.kd-record-tabs {
    display: flex;
    gap: 22px;
    min-height: 48px;
    padding: 0 18px;
    overflow-x: auto;
    border-bottom: 1px solid var(--kd-line);
    scrollbar-width: none;
}

.kd-record-tabs::-webkit-scrollbar {
    display: none;
}

.kd-record-tabs a {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 1px;
    color: #667085;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.kd-record-tabs a::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: transparent;
}

.kd-record-tabs a:hover,
.kd-record-tabs a.active {
    color: var(--kd-primary);
}

.kd-record-tabs a.active::after {
    background: var(--kd-primary);
}

.kd-filter-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--kd-line);
    background: #fcfcfd;
}

.kd-filter-bar .form-select {
    width: auto;
    min-width: 140px;
    font-size: 13px;
}

.kd-search-field {
    position: relative;
    flex: 1 1 300px;
    min-width: 220px;
}

.kd-search-field i {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    color: #98a2b3;
    transform: translateY(-50%);
}

.kd-search-field .form-control {
    padding-left: 38px;
    font-size: 13px;
}

.kd-selection-bar {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 18px;
    border-bottom: 1px solid #b2ccff;
    background: #eff4ff;
    color: #344054;
    font-size: 13px;
}

.kd-selection-bar[hidden] {
    display: none;
}

.kd-selection-bar > div {
    display: flex;
    gap: 7px;
}

.kd-link-preview {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    color: var(--kd-primary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kd-pagination-wrap {
    display: flex;
    justify-content: center;
    padding: 14px 18px;
    border-top: 1px solid var(--kd-line);
}

.kd-mobile-records {
    background: #fff;
}

.kd-mobile-record {
    padding: 15px 16px;
    border-bottom: 1px solid var(--kd-line);
}

.kd-mobile-record:last-child {
    border-bottom: 0;
}

.kd-mobile-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.kd-mobile-record-head > div,
.kd-mobile-record-head > label {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kd-mobile-record-head label {
    cursor: pointer;
}

.kd-mobile-record-head code {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kd-mobile-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.kd-mobile-record-grid > div {
    min-width: 0;
}

.kd-mobile-record-grid span,
.kd-mobile-record-grid strong {
    display: block;
}

.kd-mobile-record-grid span {
    margin-bottom: 3px;
    color: #98a2b3;
    font-size: 11px;
}

.kd-mobile-record-grid strong {
    overflow-wrap: anywhere;
    color: #475467;
    font-size: 12px;
    font-weight: 650;
}

.kd-mobile-wide {
    grid-column: 1 / -1;
}

.kd-mobile-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
}

.kd-mobile-actions .kd-icon-button {
    width: 32px;
    height: 32px;
    margin-left: auto;
}

.modal-content {
    overflow: hidden;
    border: 1px solid var(--kd-line);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(16, 24, 40, .18);
}

.modal-header,
.modal-footer {
    border-color: var(--kd-line);
}

.kd-modal-subtitle {
    margin: 3px 0 0;
    color: var(--kd-muted);
    font-size: 12px;
}

.kd-generated-links {
    max-height: 410px;
    overflow-y: auto;
    border: 1px solid var(--kd-line);
    border-radius: 7px;
}

.kd-generated-link-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 7px 10px;
    border-bottom: 1px solid #eef1f4;
}

.kd-generated-link-row:last-child {
    border-bottom: 0;
}

.kd-generated-link-number {
    color: #98a2b3;
    font-size: 11px;
    font-weight: 700;
}

.kd-generated-link-row code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kd-generated-link-row .kd-icon-button {
    width: 32px;
    height: 32px;
}

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

.kd-detail-grid > div {
    min-width: 0;
    padding: 13px 0;
    border-bottom: 1px solid #eef1f4;
}

.kd-detail-grid span,
.kd-detail-grid strong {
    display: block;
}

.kd-detail-grid span {
    margin-bottom: 4px;
    color: #98a2b3;
    font-size: 11px;
}

.kd-detail-grid strong {
    overflow-wrap: anywhere;
    color: #344054;
    font-size: 13px;
}

.kd-detail-wide {
    grid-column: 1 / -1;
}

.kd-detail-actions {
    flex-wrap: wrap;
}

.kd-json-viewer {
    min-height: 220px;
    max-height: 420px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    border: 1px solid var(--kd-line);
    border-radius: 7px;
    background: #101828;
    color: #e4e7ec;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.kd-inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #667085;
    font-size: 12px;
}

.kd-token-preview {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.kd-toast-region {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1090;
    width: min(340px, calc(100vw - 28px));
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.kd-toast {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    border: 1px solid #abefc6;
    border-radius: 7px;
    background: #ecfdf3;
    color: #05603a;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .14);
    font-size: 13px;
    font-weight: 650;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}

.kd-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.kd-toast-danger {
    border-color: #fecdca;
    background: #fef3f2;
    color: #912018;
}

.kd-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(420px, 1.35fr);
    gap: 18px;
    align-items: start;
}

.kd-date-label,
.kd-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667085;
    font-size: 12px;
    white-space: nowrap;
}

.kd-today-overview {
    padding: 20px;
}

.kd-today-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 52px;
    border-bottom: 1px solid #eef1f4;
}

.kd-today-stat span {
    color: #667085;
    font-size: 13px;
}

.kd-today-stat strong {
    color: #101828;
    font-size: 22px;
}

.kd-progress-block {
    padding-top: 18px;
}

.kd-progress-block > div:first-child {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #667085;
    font-size: 12px;
}

.kd-progress-block strong {
    color: #344054;
}

.kd-progress-block .progress {
    height: 7px;
    background: #eaecf0;
}

.kd-progress-block .progress-bar {
    background: var(--kd-accent);
}

.kd-dashboard-orders {
    min-height: 280px;
}

.kd-dashboard-order-row {
    display: grid;
    grid-template-columns: minmax(110px, .8fr) minmax(150px, 1fr) auto 18px;
    align-items: center;
    gap: 14px;
    min-height: 66px;
    padding: 10px 18px;
    border-bottom: 1px solid #eef1f4;
    color: inherit;
    text-decoration: none;
}

.kd-dashboard-order-row:last-child {
    border-bottom: 0;
}

.kd-dashboard-order-row:hover {
    background: #f8fafc;
    color: inherit;
}

.kd-dashboard-order-row > .bi-chevron-right {
    color: #98a2b3;
}

.kd-page-alert {
    display: flex;
    align-items: center;
    border-radius: 7px;
    box-shadow: none;
}

.kd-settings-panel {
    max-width: 1040px;
}

.kd-settings-form {
    margin: 0;
}

.kd-settings-section {
    padding: 22px;
    border-bottom: 1px solid var(--kd-line);
}

.kd-section-heading {
    margin-bottom: 17px;
}

.kd-section-heading h3 {
    margin: 0;
    color: #101828;
    font-size: 15px;
    font-weight: 750;
}

.kd-section-heading p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 12px;
}

.kd-switch-list {
    border-top: 1px solid #eef1f4;
}

.kd-setting-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 74px;
    padding: 13px 2px;
    border-bottom: 1px solid #eef1f4;
    cursor: pointer;
}

.kd-setting-switch > span:first-child {
    min-width: 0;
}

.kd-setting-switch strong,
.kd-setting-switch small {
    display: block;
}

.kd-setting-switch strong {
    color: #344054;
    font-size: 13px;
}

.kd-setting-switch small {
    margin-top: 4px;
    color: #667085;
    font-size: 12px;
    line-height: 1.5;
}

.kd-setting-switch .form-check {
    flex: 0 0 auto;
    margin: 0;
    padding-left: 2.6em;
}

.kd-advanced-settings {
    border-bottom: 1px solid var(--kd-line);
}

.kd-advanced-settings summary {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 22px;
    cursor: pointer;
    list-style: none;
}

.kd-advanced-settings summary::-webkit-details-marker {
    display: none;
}

.kd-advanced-settings summary > span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kd-advanced-settings summary > span > i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f2f4f7;
    color: #475467;
}

.kd-advanced-settings summary strong,
.kd-advanced-settings summary small {
    display: block;
}

.kd-advanced-settings summary strong {
    color: #344054;
    font-size: 13px;
}

.kd-advanced-settings summary small {
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
}

.kd-details-chevron {
    color: #98a2b3;
    transition: transform .18s ease;
}

.kd-advanced-settings[open] .kd-details-chevron {
    transform: rotate(180deg);
}

.kd-advanced-body {
    padding: 0 22px 22px;
}

.kd-settings-actions {
    display: flex;
    justify-content: flex-end;
    padding: 16px 22px;
    background: #fcfcfd;
}

@media (max-width: 1199.98px) {
    .kd-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kd-filter-bar {
        flex-wrap: wrap;
    }

    .kd-search-field {
        flex-basis: 100%;
    }

    .kd-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .kd-admin-shell {
        display: block;
    }

    .kd-sidebar {
        display: none;
    }

    .kd-business-cards-view .kd-metric-grid,
    .kd-business-cards-view .kd-pending-panel {
        display: none;
    }

    .kd-mobile-chrome {
        position: sticky;
        top: 0;
        z-index: 1020;
        display: block;
        border-bottom: 1px solid var(--kd-line);
        background: rgba(255, 255, 255, .98);
    }

    .kd-mobile-brandbar {
        height: 54px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 14px;
    }

    .kd-mobile-brand {
        display: flex;
        align-items: center;
        gap: 9px;
        color: #101828;
        font-size: 15px;
        font-weight: 750;
        text-decoration: none;
    }

    .kd-mobile-logo {
        width: 32px;
        height: 32px;
    }

    .kd-mobile-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 0 8px 7px;
    }

    .kd-mobile-nav a {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 36px;
        border-radius: 6px;
        color: #667085;
        font-size: 12px;
        font-weight: 650;
        text-decoration: none;
    }

    .kd-mobile-nav a.active {
        background: #eff4ff;
        color: var(--kd-primary);
    }

    .kd-main {
        padding: 18px 14px 28px;
    }

    .kd-page-header {
        min-height: 0;
        margin-bottom: 16px;
    }

    .kd-page-header h1 {
        font-size: 21px;
    }

    .kd-panel-header {
        min-height: 68px;
    }

    .kd-records-header {
        border-bottom: 0;
    }

    .kd-filter-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kd-filter-bar .kd-search-field {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .kd-filter-bar .form-select {
        width: 100%;
        min-width: 0;
    }

    .kd-settings-panel {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .kd-mobile-body,
    .kd-auth-body {
        align-items: stretch;
        padding: 14px;
    }

    .kd-mobile-panel,
    .kd-auth-card {
        margin: auto 0;
    }

    .kd-mobile-content {
        padding: 20px;
    }

    .kd-mobile-nav a {
        gap: 4px;
        font-size: 11px;
    }

    .kd-page-header {
        gap: 10px;
    }

    .kd-page-header p {
        max-width: 190px;
    }

    .kd-page-primary-action {
        min-height: 38px;
        padding-right: 12px;
        padding-left: 12px;
        font-size: 13px;
    }

    .kd-metric-grid {
        gap: 9px;
    }

    .kd-metric-tile {
        min-height: 112px;
        display: block;
        padding: 13px;
    }

    .kd-metric-icon {
        width: 34px;
        height: 34px;
        margin-bottom: 9px;
        font-size: 16px;
    }

    .kd-metric-copy > strong {
        font-size: 21px;
    }

    .kd-metric-copy > small {
        display: none;
    }

    .kd-panel-header {
        align-items: flex-start;
        padding: 14px 15px;
    }

    .kd-live-controls {
        display: grid;
        justify-items: end;
        gap: 8px;
    }

    .kd-record-tabs {
        gap: 18px;
        padding: 0 15px;
    }

    .kd-filter-bar {
        grid-template-columns: 1fr;
        padding: 12px 15px;
    }

    .kd-filter-bar .kd-search-field {
        grid-column: auto;
    }

    .kd-selection-bar {
        align-items: flex-start;
        padding: 10px 15px;
    }

    .kd-selection-bar > div {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .kd-detail-grid {
        grid-template-columns: 1fr;
    }

    .kd-detail-wide {
        grid-column: auto;
    }

    .kd-detail-actions .btn {
        flex: 1 1 calc(50% - 8px);
    }

    .kd-generated-link-row {
        grid-template-columns: 25px minmax(0, 1fr) 34px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .kd-toast-region {
        right: 14px;
        bottom: 14px;
    }

    .kd-dashboard-order-row {
        grid-template-columns: minmax(95px, .8fr) minmax(120px, 1fr) auto;
        gap: 9px;
        padding-right: 15px;
        padding-left: 15px;
    }

    .kd-dashboard-order-row > .bi-chevron-right {
        display: none;
    }

    .kd-settings-section,
    .kd-advanced-settings summary {
        padding-right: 16px;
        padding-left: 16px;
    }

    .kd-advanced-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .kd-setting-switch {
        gap: 12px;
    }

    .kd-setting-switch small {
        max-width: 235px;
    }

    .kd-settings-actions {
        padding: 14px 16px;
    }

    .kd-settings-actions .btn {
        width: 100%;
    }
}
