/* Настройки, workspace, billing, API и related panes */
.settings-modal-dialog {
    max-width: 880px;
    height: min(860px, calc(100vh - 40px));
    margin: 20px auto;
}

.settings-modal-content {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.settings-sidebar {
    width: 232px;
    background: linear-gradient(180deg, #faf8ff 0%, #f6f7fb 100%);
    border-right: 1px solid #ececf3;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.settings-sidebar-header {
    padding: 1.15rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 800;
    color: #312e81;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-bottom: 1px solid #ececf3;
}

.settings-sidebar-header i {
    color: #7c3aed;
}

.settings-nav {
    padding: 0.8rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.13s, color 0.13s, transform 0.13s;
    text-align: left;
}

.settings-nav-item i {
    font-size: 1rem;
}

.settings-nav-item:hover {
    background: #ede9fe;
    color: #5b21b6;
}

.settings-nav-item.active {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.18);
}

.settings-nav-item.active i {
    color: #fff;
}

.settings-body {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 1.15rem 1.15rem 1rem;
    overflow-y: auto;
    background: #fff;
}

.settings-close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.13s, color 0.13s;
}

.settings-close:hover {
    background: #eef2ff;
    color: #4338ca;
}

.settings-pane {
    display: none;
}

.settings-pane.active {
    display: block;
}

.settings-pane-header {
    margin-bottom: 0.9rem;
}

.settings-pane-header h4 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.35rem;
}

.settings-pane-header h4 i {
    color: #7c3aed;
}

.settings-pane-header p {
    font-size: 0.83rem;
    color: #64748b;
    margin: 0;
}

.settings-section {
    margin-bottom: 1rem;
}

.settings-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.7rem;
}

.btn-add-user {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: 1.5px dashed #c5c8d4;
    background: transparent;
    color: #5a5e72;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.13s, color 0.13s, background 0.13s;
}

.btn-add-user:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    background: #f5f3ff;
}

.settings-form-card {
    background: #fff;
    border: 1px solid #ececf3;
    border-radius: 16px;
    padding: 1rem 1rem 0.95rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.settings-label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.settings-input {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    font-size: 0.88rem;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: border-color 0.13s, box-shadow 0.13s, background 0.13s;
    font-family: inherit;
}

.settings-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.settings-input.input-error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.field-hint {
    min-height: 1rem;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #94a3b8;
}

.req-star {
    color: #ef4444;
    font-size: 0.75rem;
}

.btn-settings-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    padding: 0.62rem 1rem;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.13s, box-shadow 0.13s, opacity 0.13s;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.18);
}

.btn-settings-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(21, 128, 61, 0.22);
}

.btn-settings-primary:active {
    transform: translateY(0);
}

.btn-settings-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    padding: 0.58rem 0.95rem;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.13s, background 0.13s, color 0.13s;
}

.btn-settings-ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.manager-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.72rem 0.82rem;
    border: 1px solid #ececf3;
    border-radius: 15px;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.04);
    transition: border-color 0.13s, box-shadow 0.13s, transform 0.13s;
    margin-bottom: 0.55rem;
}

.manager-row:hover {
    border-color: #d8dbe8;
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.08);
}

.manager-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.14);
    overflow: hidden;
}

.manager-avatar.has-image {
    background: #e2e8f0;
    color: transparent;
}

.manager-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.manager-info {
    min-width: 0;
    flex: 1;
}

.manager-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manager-role {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-top: 2px;
}

.manager-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.manager-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 0.7rem;
    font-weight: 700;
}

.manager-email {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-top: 0.12rem;
}

.manager-role-select {
    min-width: 118px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.46rem 0.68rem;
    font-size: 0.76rem;
    color: #334155;
    background: #fff;
    outline: none;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.025);
}

.manager-role-select:hover {
    border-color: #c7d2fe;
}

.manager-role-select:focus {
    border-color: #7c3aed;
}

.owner-badge {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6d28d9;
    flex-shrink: 0;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    padding: 0.28rem 0.58rem;
}

.manager-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.manager-delete-btn,
.manager-edit-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.13s, background 0.13s, color 0.13s;
}

.manager-delete-btn:hover {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.manager-edit-btn:hover {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.manager-edit-form {
    margin: -0.02rem 0 0.65rem;
    padding: 0.78rem 0.82rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.medit-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.medit-col {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.medit-col .settings-input {
    min-height: 38px;
    padding-right: 2.7rem;
    padding-top: 0.48rem;
    padding-bottom: 0.48rem;
}


.medit-btns {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.settings-stat-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.settings-stat {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.settings-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
}

.settings-stat-label {
    font-size: 0.78rem;
    color: #aaa;
}

.settings-loading {
    padding: 1.5rem;
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
}

.settings-empty {
    padding: 1.5rem;
    text-align: center;
    color: #bbb;
    font-size: 0.85rem;
}

.settings-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.settings-info-item {
    background: #f7f8fa;
    border: 1px solid #ebebee;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.settings-info-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #aaa;
    margin-bottom: 0.3rem;
}

.settings-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a2e;
}

.settings-body::-webkit-scrollbar {
    width: 5px;
}

.settings-body::-webkit-scrollbar-track {
    background: transparent;
}

.settings-body::-webkit-scrollbar-thumb {
    background: #e0e0e5;
    border-radius: 4px;
}

#dashboard-settings .settings-section,
#board-settings .settings-section,
#warehouse-settings .settings-section,
#billing-settings .settings-section,
#api-settings .settings-section {
    padding: 1rem 1.1rem;
    border: 1px solid #ececf3;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    margin-bottom: 1rem;
}

#dashboard-settings .settings-section-title,
#board-settings .settings-section-title,
#warehouse-settings .settings-section-title,
#billing-settings .settings-section-title,
#api-settings .settings-section-title {
    font-size: 0.82rem;
    margin-bottom: 0.85rem;
}

.settings-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#board-statuses-list table,
#dashboard-statuses-list table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

#board-statuses-list thead th,
#dashboard-statuses-list thead th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #aaa;
    font-weight: 700;
    padding: 0.4rem 0.6rem 0.7rem;
    border-bottom: 1px solid #f0f0f3;
    text-align: left;
}

#board-statuses-list tbody tr:hover,
#dashboard-statuses-list tbody tr:hover {
    background: #fafbff;
}

#board-statuses-list tbody td,
#dashboard-statuses-list tbody td {
    padding: 0.5rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f5f5f8;
}

#board-statuses-list .settings-input,
#dashboard-statuses-list .settings-input {
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
}

#board-statuses-list .board-status-key {
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #6366f1;
}

.settings-section-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    margin-top: -0.25rem;
}

#general-settings .settings-section {
    padding: 1rem 1.1rem;
    border: 1px solid #ececf3;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    margin-bottom: 1rem;
}

#general-settings .settings-section-title {
    font-size: 0.82rem;
    margin-bottom: 0.85rem;
}

#general-settings .settings-section-desc {
    margin-top: 0;
    margin-bottom: 0.9rem;
    font-size: 0.8rem;
    line-height: 1.45;
}

#general-settings .ref-business-grid,
#general-settings .ref-currency-grid {
    gap: 0.9rem;
}

#general-settings .ref-currency-other-wrap {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid #ececf3;
}

#general-settings .ref-phone-presets {
    gap: 0.65rem;
}

.ref-currency-grid,
.ref-phone-presets,
.ref-business-grid,
.billing-plans-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ref-currency-card,
.ref-business-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 116px;
    min-height: 104px;
    padding: 14px 12px;
    border: 1.5px solid #e0e3ea;
    border-radius: 14px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.13s, background 0.13s, box-shadow 0.13s;
    user-select: none;
}

.ref-currency-card--more {
    border-style: dashed;
}

.ref-currency-card--secondary {
    width: 104px;
    min-height: 98px;
}

.ref-currency-card:hover,
.ref-business-card:hover {
    border-color: #a5b4fc;
    background: #f5f3ff;
}

.ref-currency-card.active,
.ref-business-card.active {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.ref-currency-symbol {
    font-size: 1.45rem;
    font-weight: 700;
    color: #4f46e5;
    line-height: 1;
    margin-bottom: 6px;
}

.ref-currency-card.active .ref-currency-symbol {
    color: #4338ca;
}

.ref-currency-code {
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.04em;
}

.ref-currency-name {
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 4px;
    line-height: 1.35;
}

.ref-currency-other-title {
    margin-bottom: 0.7rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ref-phone-preset {
    background: transparent;
    border: 1.5px solid #e0e3ea;
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
}

.ref-phone-preset:hover {
    background: #f5f3ff;
    border-color: #a5b4fc;
}

.ref-phone-preset.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.ref-date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.ref-date-preset {
    background: transparent;
    border: 1.5px solid #e0e3ea;
    border-radius: 12px;
    padding: 0.65rem 0.95rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s, color 0.13s, box-shadow 0.13s;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.03);
}

.ref-date-preset:hover {
    background: #f5f3ff;
    border-color: #a5b4fc;
    color: #334155;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.08);
}

.ref-date-preset.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #312e81;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.ref-business-card {
    width: 172px;
    min-height: 108px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
    text-align: left;
}

.ref-business-card--readonly {
    cursor: default;
    opacity: 0.72;
}

.ref-business-card--readonly.active {
    opacity: 1;
}

.ref-phone-custom {
    max-width: 360px;
}

.ref-phone-custom .settings-input {
    max-width: none !important;
}

#general-settings .ref-currency-card,
#general-settings .ref-business-card {
    border-color: #e7e7f1;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.03);
}

#general-settings .ref-currency-card:hover,
#general-settings .ref-business-card:hover {
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.08);
}

#general-settings .ref-phone-preset {
    border-radius: 12px;
    padding: 0.65rem 0.95rem;
    background: #fff;
    border-color: #e7e7f1;
    color: #475569;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.03);
}

#general-settings .ref-phone-preset.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #312e81;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

#general-settings .ref-phone-preset:hover {
    background: #f5f3ff;
    border-color: #a5b4fc;
    color: #334155;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.08);
}

#users-settings .settings-section,
#workspace-settings .settings-section {
    padding: 1rem 1.1rem;
    border: 1px solid #ececf3;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    margin-bottom: 1rem;
}

#users-settings .settings-section-title,
#workspace-settings .settings-section-title {
    font-size: 0.82rem;
    margin-bottom: 0.85rem;
}

#users-settings .settings-section-desc,
#workspace-settings .settings-section-desc,
#billing-settings .settings-section-desc,
#api-settings .settings-section-desc {
    margin-top: 0;
    margin-bottom: 0.9rem;
    font-size: 0.8rem;
    line-height: 1.45;
}

#general-settings .settings-actions-row {
    margin-top: 1rem;
}

.billing-plan-card,
.billing-current-card {
    background: #fff;
    border: 1px solid #ececf3;
    border-radius: 16px;
    padding: 0.95rem 1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.billing-current-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.billing-current-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
    min-width: 0;
    flex: 1 1 auto;
}

.billing-current-left > div:last-child {
    min-width: 0;
    flex: 1 1 auto;
}

.billing-plan-badge {
    flex-shrink: 0;
    white-space: nowrap;
}

.billing-plan-header,
.billing-current-left,
.billing-usage-row,
.api-key-row,
.api-endpoint-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.api-key-row {
    flex-wrap: wrap;
}

.billing-plan-name,
.billing-current-name,
.billing-plans-title,
.api-upsell-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.billing-plan-trial,
.billing-current-sub,
.api-upsell-desc,
.api-ep-desc {
    font-size: 0.78rem;
    color: #64748b;
}

.billing-plan-badge,
.billing-popular-badge,
.billing-tile-current-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.22rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.billing-plan-badge,
.billing-tile-current-label {
    background: #eef2ff;
    color: #4f46e5;
}

.billing-popular-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #fef3c7;
    color: #b45309;
}

.billing-limits,
.billing-usage-block,
.api-endpoints-list,
.billing-tile-features {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.billing-limit-meta,
.billing-limit-row,
.billing-usage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.billing-limit-label,
.billing-usage-label {
    font-size: 0.78rem;
    color: #64748b;
}

.billing-limit-value,
.billing-usage-val {
    font-size: 0.78rem;
    font-weight: 600;
    color: #7c3aed;
}

.billing-limit-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.billing-limit-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #6366f1);
}

.billing-contact {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: #64748b;
}

.billing-contact a {
    color: #7c3aed;
    font-weight: 700;
    text-decoration: none;
}

.billing-contact a:hover,
.billing-tile-contact-btn:hover {
    text-decoration: underline;
}

.billing-current-icon,
.billing-tile-icon,
.api-upsell-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f3ff;
    color: #7c3aed;
    font-size: 1rem;
    flex-shrink: 0;
}

.billing-notice {
    margin-top: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    border-radius: 12px;
    padding: 0.72rem 0.85rem;
    font-size: 0.8rem;
}

.billing-notice i {
    flex-shrink: 0;
    margin-top: 2px;
}

.billing-notice-warn {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.billing-notice-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.billing-plan-badge-warn {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}

.billing-plan-badge-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.billing-status-card {
    margin-top: 0.8rem;
    padding: 0.9rem 0.95rem;
    border-radius: 14px;
    border: 1px solid #fde68a;
    background: linear-gradient(180deg, #fffdf5 0%, #fff7e8 100%);
}

.billing-status-card-danger {
    border-color: #fca5a5;
    background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
}

.billing-status-card-soft {
    background: linear-gradient(180deg, #fffef8 0%, #fff9ef 100%);
}

.billing-status-card__main {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.billing-status-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    font-size: 1rem;
    flex-shrink: 0;
}

.billing-status-card-danger .billing-status-card__icon {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.billing-status-card__title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.billing-status-card__text {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.45;
}

.billing-status-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    margin-top: 0.75rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.billing-status-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: #64748b;
}

.billing-status-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.billing-plans-grid {
    gap: 1rem;
}

.billing-plan-tile {
    position: relative;
    flex: 1 1 240px;
    min-width: 240px;
    background: #fff;
    border: 1.5px solid #ececf3;
    border-radius: 18px;
    padding: 0.92rem;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.billing-plan-tile.current {
    border-color: #c7d2fe;
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.12);
}

.billing-plan-tile.popular {
    border-color: #fde68a;
}

.billing-tile-name {
    font-size: 0.94rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0.85rem;
}

.billing-tile-tagline {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.billing-tile-features {
    list-style: none;
    padding: 0;
    margin: 0.85rem 0 0;
    flex: 1 1 auto;
    min-height: 0;
}

.billing-tile-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: #475569;
}

.billing-tile-features li i {
    color: #10b981;
    margin-top: 2px;
}

.billing-request-actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.billing-request-actions .billing-tile-upgrade-btn,
.billing-request-actions .billing-tile-contact-btn {
    margin-top: 0;
}

.billing-tile-upgrade-btn,
.billing-tile-contact-btn,
.billing-tile-downgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    margin-top: 0.9rem;
    border-radius: 10px;
    padding: 0.72rem 0.95rem;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    align-self: stretch;
    flex-shrink: 0;
    text-decoration: none;
}

.billing-tile-upgrade-btn {
    border: none;
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    color: #fff;
}

.billing-tile-contact-btn {
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
}

.billing-tile-downgrade-btn {
    border: 1.5px solid #fecaca;
    background: #fff;
    color: #dc2626;
}

.billing-tile-downgrade-btn:hover {
    background: #fef2f2;
}

.dg-viol-box {
    margin-top: 0.85rem;
    border: 1px solid #fecaca;
    background: linear-gradient(180deg, #fff7f7 0%, #fff 100%);
    border-radius: 14px;
    padding: 0.9rem;
    color: #7f1d1d;
}

.dg-viol-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    font-weight: 800;
    color: #991b1b;
}

.dg-viol-text {
    margin-top: 0.45rem;
    font-size: 0.77rem;
    line-height: 1.45;
    color: #7f1d1d;
}

.dg-viol-body {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.55rem;
}

.dg-viol-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    border-radius: 12px;
    padding: 0.7rem 0.75rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #fee2e2;
    font-size: 0.79rem;
    line-height: 1.4;
    color: #7f1d1d;
}

.dg-viol-row i {
    flex-shrink: 0;
    margin-top: 0.08rem;
    color: #dc2626;
}

.dg-viol-row small {
    display: inline-block;
    margin-top: 0.16rem;
    font-size: 0.74rem;
    color: #9f1239;
}

.dg-viol-hint {
    margin-top: 0.7rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #9f1239;
}

.billing-invoice-modal-content {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}

.billing-invoice-modal-header {
    padding: 1.15rem 1.25rem 0.9rem;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(180deg, #faf8ff 0%, #ffffff 100%);
}

.billing-invoice-modal-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.billing-invoice-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ede9fe 0%, #eef2ff 100%);
    color: #6d28d9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.billing-invoice-modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.billing-invoice-modal-sub {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: #64748b;
}

.billing-invoice-modal-body {
    padding: 1.1rem 1.25rem 1rem;
}

.billing-invoice-sheet {
    border: 1px solid #e7eaf1;
    border-radius: 16px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.billing-invoice-sheet-top {
    padding: 1rem 1rem 0.95rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    border-bottom: 1px dashed #d7deea;
}

.billing-invoice-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.billing-invoice-plan {
    margin-top: 0.35rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.billing-invoice-meta {
    margin-top: 0.25rem;
    font-size: 0.83rem;
    color: #64748b;
}

.billing-invoice-total-wrap {
    text-align: right;
}

.billing-invoice-total {
    margin-top: 0.35rem;
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 800;
    color: #111827;
}

.billing-invoice-rows {
    padding: 0.55rem 1rem 0.7rem;
}

.billing-invoice-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.72rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.86rem;
    color: #475569;
}

.billing-invoice-row:last-child {
    border-bottom: none;
}

.billing-invoice-row strong {
    color: #0f172a;
    font-weight: 700;
    text-align: right;
}

.billing-invoice-row-discount strong {
    color: #047857;
}

.billing-invoice-note {
    margin-top: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.85rem 0.95rem;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.5;
}

.billing-invoice-note i {
    color: #6366f1;
    margin-top: 0.05rem;
}

.billing-invoice-modal-footer {
    padding: 0 1.25rem 1.15rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
}

.icon-picker-modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.icon-picker-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #ececf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.icon-picker-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.icon-picker-title i {
    color: #7c3aed;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.2rem 1.2rem;
}

.icon-picker-item {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    padding: 0.9rem 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: border-color 0.13s, background 0.13s, transform 0.13s;
}

.icon-picker-item i {
    font-size: 1.25rem;
    color: #6366f1;
}

.icon-picker-item span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
}

.icon-picker-item:hover {
    border-color: #c7d2fe;
    background: #f5f3ff;
}

.icon-picker-item.active {
    border-color: #7c3aed;
    background: #f5f3ff;
}

.icon-picker-trigger {
    width: 36px;
    height: 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #6366f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-picker-trigger:hover {
    border-color: #c7d2fe;
    background: #f5f3ff;
}

.dash-settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.dash-status-row {
    display: grid;
    grid-template-columns: 18px 34px minmax(0, 1fr) 58px 78px;
    align-items: center;
    gap: 0.55rem;
    padding: 0.58rem 0.68rem;
    border: 1px solid #ececf3;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.035);
}

.dash-status-order {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
}

.dash-status-icon-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.dash-status-main {
    min-width: 0;
    display: flex;
    align-items: center;
}

.dash-status-meta {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin-bottom: 0.35rem;
}

.dash-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-status-key-text {
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-status-label-wrap {
    position: relative;
    min-height: 34px;
    display: flex;
    align-items: center;
    width: 100%;
}

.dash-status-label {
    display: block;
    width: 100%;
    min-height: 34px;
    height: 34px;
    padding: 0.45rem 2.1rem 0.45rem 0.68rem;
    font-size: 0.83rem;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-status-label[readonly] {
    background: #fff;
    color: #0f172a;
    cursor: default;
}

.dash-status-label::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.dash-status-label-edit-btn {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #94a3b8;
    border-radius: 6px;
}

.dash-status-label-wrap.is-editing .dash-status-label-edit-btn,
.dash-status-label-wrap:hover .dash-status-label-edit-btn {
    color: #64748b;
}

.dash-status-color-wrap,
.dash-status-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-status-color-popover-wrap {
    position: relative;
    width: 100%;
}

.dash-status-color-trigger {
    width: 100%;
    height: 34px;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    padding: 0;
    background: #fff;
    cursor: pointer;
    position: relative;
}

.dash-status-color-trigger::after {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--dash-status-color, #64748b);
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 1px 4px rgba(15, 23, 42, 0.18);
}

.dash-status-color {
    display: none;
}

.dash-status-color-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    width: 170px;
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    padding: 10px;
    border: 1px solid #e6e8ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.dash-status-color-popover.is-open {
    display: grid;
}

.dash-status-color-option {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: var(--dash-palette-color, #64748b);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.dash-status-color-option.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--dash-palette-color, #64748b);
}

.dash-status-switch,
.board-status-switch {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.dash-status-switch .form-check-input,
.board-status-switch .form-check-input {
    width: 2.2rem;
    height: 1.15rem;
    margin: 0;
}

.board-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.board-status-label {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 760px) {
    .dash-status-row {
        grid-template-columns: 16px 30px minmax(0, 1fr) 52px 70px;
        gap: 0.45rem;
        padding: 0.58rem 0.62rem;
    }

    .dash-status-order {
        font-size: 0.68rem;
    }

    .dash-status-icon-btn {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .dash-status-meta {
        margin-bottom: 0;
    }

    .dash-status-label {
        min-height: 30px;
        height: 30px;
        padding: 0.36rem 1.85rem 0.36rem 0.56rem;
        font-size: 0.78rem;
    }

    .dash-status-label-wrap {
        min-height: 30px;
    }

    .dash-status-label-edit-btn {
        right: 0.38rem;
        width: 20px;
        height: 20px;
    }

    .dash-status-color-wrap,
    .dash-status-toggle {
        width: 100%;
    }

    .dash-status-color-trigger,
    .dash-status-switch {
        height: 30px;
    }

    .board-status-row,
    .wh-cat-row {
        grid-template-columns: 16px minmax(0, 1fr) 78px;
        gap: 0.45rem;
        padding: 0.62rem 0.66rem;
    }

    .board-status-main::before,
    .wh-cat-label-wrap::before {
        left: -0.45rem;
    }

    .board-status-toggle,
    .wh-cat-toggle-wrap {
        align-items: center;
        text-align: center;
        gap: 0.18rem;
        font-size: 0.58rem;
    }

    .board-status-label,
    .wh-cat-input {
        font-size: 0.78rem;
    }

    .board-status-switch,
    .wh-cat-toggle-wrap .dash-status-switch {
        height: 30px;
    }
}

.ws-info-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #ececf3;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    margin-bottom: 1rem;
}

.ws-info-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.22);
    overflow: hidden;
}

.ws-info-badge {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%);
    color: #6d28d9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.08);
    flex-shrink: 0;
}

.ws-info-main {
    min-width: 0;
    flex: 1;
}

.ws-name-display-row,
.ws-name-edit-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.ws-name-display-row {
    min-width: 0;
}

.ws-info-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-name-edit-icon-btn,
.ws-name-save-btn,
.ws-name-cancel-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.13s, background 0.13s, color 0.13s;
    flex-shrink: 0;
}

.ws-name-edit-icon-btn:hover,
.ws-name-save-btn:hover {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #4f46e5;
}

.ws-name-cancel-btn:hover {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.ws-name-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    font-size: 0.92rem;
    color: #0f172a;
    outline: none;
    background: #fff;
}

.ws-name-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.ws-info-slug {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #94a3b8;
    word-break: break-word;
}

.ws-logo-upload-wrap {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    flex-shrink: 0;
}

.ws-logo-upload-wrap .ws-info-avatar {
    transition: transform 0.13s, box-shadow 0.13s;
}

.ws-logo-upload-wrap:hover .ws-info-avatar {
    transform: scale(1.03);
}

.ws-logo-overlay {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(15, 23, 42, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.13s;
}

.ws-logo-upload-wrap:hover .ws-logo-overlay {
    opacity: 1;
}

.ws-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.ws-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem 1rem;
    border: 1px solid #ececf3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.03);
}

.ws-detail-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ws-detail-label i {
    color: #7c3aed;
}

.ws-detail-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.ws-danger-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #fecaca;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}

.ws-danger-copy {
    min-width: 0;
    flex: 1;
}

.ws-danger-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.94rem;
    font-weight: 800;
    color: #991b1b;
}

.ws-danger-title i {
    color: #dc2626;
}

.ws-danger-text {
    margin-top: 0.45rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #7f1d1d;
}

.ws-danger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    border-radius: 12px;
    background: #dc2626;
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.18);
    flex-shrink: 0;
}

.ws-danger-btn:hover {
    background: #b91c1c;
}

.api-upsell-card {
    border: 1px solid #ececf3;
    border-radius: 16px;
    padding: 1rem;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.api-overview-grid,
.api-endpoints-grid,
.api-examples-grid,
.api-notes-grid {
    display: grid;
    gap: 0.85rem;
}

.api-overview-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

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

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

.api-key-block {
    border: 1px solid #ececf3;
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
}

.api-key-block--single {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.api-auth-card,
.api-endpoint-card,
.api-note-card {
    border: 1px solid #ececf3;
    border-radius: 16px;
    padding: 1rem;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.api-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.8rem;
}

.api-block-title,
.api-note-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
}

.api-block-sub {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #64748b;
}

.api-key-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.api-auth-steps {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.api-auth-step {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #334155;
}

.api-auth-step-num {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 800;
    flex-shrink: 0;
}

.api-upsell-btn {
    flex-shrink: 0;
}

.api-key-code,
.api-code-block code,
.api-endpoint-row > code,
.api-key-hint code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
}

.api-key-code,
.api-code-block {
    display: block;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    overflow-x: auto;
}

.api-key-code {
    margin: 0;
}

.api-copy-btn,
.api-regen-btn {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.api-copy-btn,
.api-regen-btn,
.api-endpoint-top {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.api-example {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.api-swagger {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.api-swagger-item {
    border: 1px solid #ececf3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.api-swagger-summary {
    list-style: none;
    display: grid;
    grid-template-columns: 64px minmax(180px, 280px) minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
}

.api-swagger-summary::-webkit-details-marker {
    display: none;
}

.api-swagger-summary code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #0f172a;
}

.api-swagger-desc {
    font-size: 0.8rem;
    color: #64748b;
}

.api-swagger-body {
    padding: 0 1rem 1rem;
}

.api-endpoint-top {
    justify-content: flex-start;
    margin-bottom: 0.45rem;
}

.api-note-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}

.api-copy-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.api-regen-btn:hover {
    border-color: #f59e0b;
    color: #d97706;
}

.api-regen-btn:disabled {
    opacity: .5;
    cursor: default;
}

.api-key-hint,
.api-example-label,
.api-ep-desc {
    font-size: 0.78rem;
    color: #64748b;
}

.api-method {
    min-width: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.api-method.get { background: #dcfce7; color: #15803d; }
.api-method.post { background: #dbeafe; color: #1d4ed8; }
.api-method.put { background: #fef3c7; color: #b45309; }
.api-method.del { background: #fee2e2; color: #dc2626; }

@media (max-width: 760px) {
    .settings-modal-dialog {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100vh;
        max-height: none;
    }

    .settings-modal-content {
        flex-direction: column;
        border-radius: 0;
        box-shadow: none;
    }

    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ececf3;
        background: linear-gradient(180deg, #faf8ff 0%, #ffffff 100%);
    }

    .settings-sidebar-header {
        justify-content: flex-start;
        padding: 0.95rem 1rem 0.65rem;
    }

    .settings-nav {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0 1rem 0.95rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .settings-nav::-webkit-scrollbar {
        display: none;
    }

    .settings-nav-item {
        justify-content: flex-start;
        flex: 0 0 auto;
        padding: 0.65rem 0.8rem;
        min-height: 42px;
        min-width: max-content;
        white-space: nowrap;
        border: 1px solid #e9e7f4;
        background: #fff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    }

    .settings-nav-item span {
        display: inline;
    }

    .settings-body {
        padding: 0.95rem 0.9rem calc(1.2rem + env(safe-area-inset-bottom));
    }

    .settings-close {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 20;
        margin: 0;
        width: 38px;
        height: 38px;
        border-radius: 999px;
        background: rgba(248, 250, 252, 0.96);
        border: 1px solid #e2e8f0;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
        opacity: 1;
    }

    .settings-close::before,
    .settings-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 14px;
        height: 1.8px;
        background: #475569;
        border-radius: 999px;
        transform-origin: center;
    }

    .settings-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .settings-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .settings-pane-header {
        margin-bottom: 0.75rem;
        padding-right: 3rem;
    }

    .settings-pane-header h4 {
        font-size: 1rem;
    }

    .settings-pane-header p {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .settings-section,
    #dashboard-settings .settings-section,
    #board-settings .settings-section,
    #warehouse-settings .settings-section,
    #billing-settings .settings-section,
    #api-settings .settings-section,
    #general-settings .settings-section,
    #users-settings .settings-section,
    #workspace-settings .settings-section {
        padding: 0.9rem;
        border-radius: 16px;
        margin-bottom: 0.85rem;
    }

    .settings-form-card {
        padding: 0.9rem;
        border-radius: 14px;
    }

    .settings-actions-row {
        gap: 0.6rem;
    }

    .settings-actions-row .btn-settings-primary,
    .settings-actions-row .btn-settings-ghost {
        flex: 1 1 calc(50% - 0.3rem);
        justify-content: center;
        min-height: 42px;
    }

    .btn-add-user {
        width: 100%;
        justify-content: center;
        padding: 0.72rem 0.95rem;
    }

    .manager-row {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.65rem;
        padding: 0.8rem;
        border-radius: 14px;
    }

    .manager-role-select,
    .owner-badge {
        width: 100%;
    }

    .manager-actions {
        margin-left: auto;
    }

    .billing-plans-grid {
        gap: 0.75rem;
    }

    .billing-plan-tile {
        min-width: 100%;
        width: 100%;
    }

    .billing-current-card,
    .billing-usage-row,
    .api-key-row {
        flex-wrap: wrap;
    }

    .billing-current-left {
        width: 100%;
    }

    .billing-plan-badge {
        margin-left: auto;
    }

    .api-key-code {
        width: 100%;
    }

    .api-overview-grid,
    .api-endpoints-grid,
    .api-examples-grid,
    .api-notes-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .api-block-head,
    .api-key-actions {
        flex-wrap: wrap;
    }

    .api-swagger-summary {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .api-copy-btn,
    .api-regen-btn {
        flex: 1 1 calc(50% - 0.375rem);
        justify-content: center;
    }

    .api-code-block {
        font-size: 0.74rem;
        padding: 0.85rem;
        border-radius: 14px;
    }

    .ws-info-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        border-radius: 16px;
    }

    .ws-name-display-row,
    .ws-name-edit-row,
    .ws-danger-card {
        width: 100%;
    }

    .ws-danger-card {
        flex-direction: column;
        align-items: stretch;
    }

    .ws-danger-btn {
        align-self: center;
    }

    .settings-stat-row {
        gap: 0.55rem;
    }

    .settings-stat {
        min-width: 0;
        flex: 1 1 100%;
    }

    .api-copy-btn,
    .api-regen-btn,
    .ws-danger-btn {
        min-height: 42px;
    }
}

@media (max-width: 600px) {
    .api-upsell-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-info-grid,
    .medit-fields,
    .ws-details-grid {
        grid-template-columns: 1fr;
    }

    .settings-sidebar-header {
        padding-right: 4.25rem;
    }

    .settings-sidebar-header span {
        max-width: 180px;
        line-height: 1.2;
    }

    .settings-actions-row .btn-settings-primary,
    .settings-actions-row .btn-settings-ghost,
    .api-copy-btn,
    .api-regen-btn {
        flex-basis: 100%;
        width: 100%;
    }

    .api-key-actions {
        width: 100%;
    }

    .billing-current-card,
    .billing-plan-tile,
    .api-key-block,
    .ws-danger-card,
    .manager-row {
        border-radius: 14px;
    }

    .settings-body {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }
}

/* Warehouse categories settings */
.settings-upgrade-banner {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    background: #fef9ee;
    border: 1px solid #fde68a;
    border-radius: 10px;
    font-size: .85rem;
    color: #92400e;
    margin-bottom: 1rem;
}

.settings-upgrade-banner i {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    flex-shrink: 0;
}

#warehouse-settings .settings-section-desc {
    margin-top: 0;
    margin-bottom: 0.9rem;
    font-size: 0.8rem;
    line-height: 1.45;
}

#board-settings .settings-pane-header,
#warehouse-settings .settings-pane-header {
    margin-bottom: 1.05rem;
}

#board-settings .settings-pane-header h4,
#warehouse-settings .settings-pane-header h4 {
    font-size: 1.12rem;
    letter-spacing: -0.01em;
}

#board-settings .settings-pane-header p,
#warehouse-settings .settings-pane-header p {
    max-width: 680px;
    font-size: 0.84rem;
    line-height: 1.55;
}

.board-settings-list,
#warehouse-categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.board-status-row,
.wh-cat-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 98px;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid #e7eaf2;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background 0.15s;
}

.board-status-row:hover,
.wh-cat-row:hover {
    border-color: #d8dff0;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.board-status-order,
.wh-cat-order {
    font-size: 0.72rem;
    font-weight: 800;
    color: #9aa4b2;
    text-align: center;
}

.board-status-main,
.wh-cat-main {
    min-width: 0;
    position: relative;
}

.board-status-main::before,
.wh-cat-label-wrap {
    position: relative;
}

.board-status-main::before,
.wh-cat-label-wrap::before {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: -0.65rem;
    width: 3px;
    height: calc(100% - 0.3rem);
    border-radius: 999px;
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    opacity: 0.65;
}

.board-status-meta,
.wh-cat-meta {
    display: flex;
    align-items: center;
    gap: 0.48rem;
    margin-bottom: 0.42rem;
}

.wh-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.wh-cat-field-label {
    display: block;
    margin: 0;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.wh-cat-input,
.board-status-label {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.wh-cat-input {
    width: 100%;
    min-height: 38px;
    border: 1.5px solid #dfe6f1;
    border-radius: 12px;
    padding: 0.62rem 0.78rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.13s, box-shadow 0.13s, background 0.13s, color 0.13s;
}

.wh-cat-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
    outline: none;
}

.wh-cat-input:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.wh-cat-toggle-wrap,
.board-status-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.64rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.wh-cat-toggle-label {
    line-height: 1;
}

.wh-cat-toggle-wrap .dash-status-switch,
.board-status-switch {
    min-width: 74px;
    height: 36px;
    border-radius: 12px;
}

.board-settings-note,
.wh-cat-note {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0.35rem 0 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid #e6edf5;
    border-radius: 14px;
    background: #f8fafc;
    font-size: 0.79rem;
    line-height: 1.5;
    color: #64748b;
}

.board-settings-note i,
.wh-cat-note i {
    color: #16a34a;
    margin-top: 0.1rem;
}

@media (max-width: 767.98px) {
    .wh-cat-row {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .wh-cat-toggle-wrap {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        padding-top: 0.15rem;
        border-top: 1px solid #f1f5f9;
    }

    .wh-cat-label-wrap::before {
        left: -0.45rem;
    }
}
