.settings-batch-d-view {
    --settings-border: #d8e0ea;
    --settings-subtle: #f6f8fb;
    --settings-text: #172033;
    --settings-muted: #5e6b7d;
    min-height: calc(100vh - 72px);
    color: var(--settings-text);
    background: #fff;
}

.settings-batch-d-view *,
.settings-batch-d-view *::before,
.settings-batch-d-view *::after {
    box-sizing: border-box;
}

.settings-batch-d-layout {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    min-height: calc(100vh - 72px);
}

.settings-batch-d-sidebar {
    padding: 28px 16px;
    border-right: 1px solid var(--settings-border);
    background: var(--settings-subtle);
}

.settings-batch-d-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px 18px;
    font-size: 1.05rem;
    font-weight: 800;
}

.settings-batch-d-sidebar nav,
.settings-batch-d-category-grid {
    display: grid;
    gap: 6px;
}

.settings-batch-d-nav-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #344258;
    background: transparent;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0;
    text-align: left;
    cursor: pointer;
}

.settings-batch-d-nav-item:hover {
    border-color: #c8d5e5;
    background: #fff;
}

.settings-batch-d-nav-item.active {
    border-color: #a9c2ec;
    color: #154bb3;
    background: #eaf2ff;
}

.settings-batch-d-nav-chevron {
    justify-self: end;
    color: #8390a2;
    font-size: 0.72rem;
}

.settings-batch-d-main {
    min-width: 0;
    padding: 28px clamp(24px, 4vw, 60px) 60px;
}

.settings-batch-d-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1040px;
    margin: 0 auto 26px;
}

.settings-batch-d-page-header h2 {
    margin: 2px 0 0;
    font-size: 1.55rem;
    line-height: 1.3;
    letter-spacing: 0;
}

.settings-batch-d-eyebrow {
    margin: 0;
    color: var(--settings-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.settings-batch-d-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-batch-d-icon-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--settings-border);
    border-radius: 6px;
    color: #40506a;
    background: #fff;
    cursor: pointer;
}

.settings-batch-d-icon-button:hover:not(:disabled) {
    border-color: #97add0;
    color: #174ea6;
    background: #f4f8ff;
}

.settings-batch-d-icon-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.settings-batch-d-back {
    display: none;
}

.settings-batch-d-panel {
    max-width: 1040px;
    margin: 0 auto;
}

.settings-batch-d-section {
    padding: 0;
}

.settings-batch-d-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--settings-border);
}

.settings-batch-d-section-header h3 {
    margin: 0;
    font-size: 1.08rem;
    letter-spacing: 0;
}

.settings-batch-d-section-header p,
.settings-batch-d-inline-form p,
.settings-batch-d-impact p {
    margin: 5px 0 0;
    color: var(--settings-muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.settings-batch-d-plan-row,
.settings-batch-d-usage {
    padding: 22px 0;
    border-bottom: 1px solid var(--settings-border);
}

.settings-batch-d-plan-row,
.settings-batch-d-plan-row > div,
.settings-batch-d-usage > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.settings-batch-d-plan-name {
    font-size: 1.25rem;
    font-weight: 800;
}

.settings-batch-d-progress {
    width: 100%;
    height: 8px;
    margin: 14px 0 8px;
    overflow: hidden;
    border-radius: 4px;
    background: #e3e8ef;
}

.settings-batch-d-progress span {
    display: block;
    height: 100%;
    background: #24724a;
}

.settings-batch-d-usage small {
    color: var(--settings-muted);
}

.settings-batch-d-form {
    display: grid;
    gap: 20px;
    max-width: 720px;
    padding-top: 24px;
}

.settings-batch-d-form-narrow {
    max-width: 520px;
}

.settings-batch-d-form label,
.settings-batch-d-inline-form label,
.settings-batch-d-impact label,
.settings-batch-d-impact-block label {
    display: grid;
    gap: 7px;
    color: #26354a;
    font-size: 0.86rem;
    font-weight: 700;
}

.settings-batch-d-view input,
.settings-batch-d-view textarea,
.settings-batch-d-view select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #b9c6d6;
    border-radius: 6px;
    color: var(--settings-text);
    background: #fff;
    font: inherit;
    letter-spacing: 0;
}

.settings-batch-d-view textarea {
    resize: vertical;
}

.settings-batch-d-view input:focus-visible,
.settings-batch-d-view textarea:focus-visible,
.settings-batch-d-view select:focus-visible,
.settings-batch-d-view button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

.settings-batch-d-view input[readonly] {
    color: #5b6778;
    background: #eef2f6;
}

.settings-batch-d-color-field {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.settings-batch-d-color-field input {
    height: 42px;
    padding: 3px;
}

.settings-batch-d-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--settings-border);
    color: var(--settings-muted);
    font-size: 0.84rem;
}

.settings-batch-d-status-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.settings-batch-d-status-row {
    display: grid;
    grid-template-columns: 82px 12px minmax(160px, 1fr) 110px 40px;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    border-bottom: 1px solid var(--settings-border);
}

.settings-batch-d-order-actions {
    display: flex;
    gap: 5px;
}

.settings-batch-d-order-actions .settings-batch-d-icon-button {
    width: 34px;
    height: 34px;
}

.settings-batch-d-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
}

.settings-batch-d-status-dot.is-blue { background: #2563eb; }
.settings-batch-d-status-dot.is-green { background: #168354; }
.settings-batch-d-status-dot.is-red { background: #c73939; }
.settings-batch-d-status-dot.is-purple { background: #7c3aed; }
.settings-batch-d-status-dot.is-orange { background: #c35d12; }
.settings-batch-d-status-dot.is-yellow { background: #c38b09; }

.settings-batch-d-status-name {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.settings-batch-d-status-name small {
    padding: 2px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #5f6b7b;
    font-size: 0.7rem;
}

.settings-batch-d-usage-count {
    color: var(--settings-muted);
    font-size: 0.82rem;
    text-align: right;
}

.settings-batch-d-impact,
.settings-batch-d-member-action {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #d5aa58;
    border-radius: 6px;
    background: #fff9e9;
}

.settings-batch-d-impact strong,
.settings-batch-d-impact-block > strong {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-batch-d-impact ol {
    display: grid;
    gap: 5px;
    max-width: 520px;
    margin: 14px 0;
    padding-left: 24px;
}

.settings-batch-d-impact ol li span {
    float: right;
    color: var(--settings-muted);
}

.settings-batch-d-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 16px;
}

.settings-batch-d-view .btn-danger {
    border: 1px solid #b4232d;
    color: #fff;
    background: #b4232d;
}

.settings-batch-d-field-error {
    min-height: 20px;
    margin: 0;
    color: #b4232d;
    font-size: 0.84rem;
}

.settings-batch-d-table-wrap {
    overflow-x: auto;
}

.settings-batch-d-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.settings-batch-d-table th,
.settings-batch-d-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--settings-border);
    text-align: left;
    vertical-align: middle;
}

.settings-batch-d-table th {
    color: var(--settings-muted);
    background: var(--settings-subtle);
    font-size: 0.76rem;
}

.settings-batch-d-table td:first-child strong,
.settings-batch-d-table td:first-child small {
    display: block;
}

.settings-batch-d-table td:first-child small {
    margin-top: 3px;
    color: var(--settings-muted);
}

.settings-batch-d-table-actions {
    text-align: right !important;
}

.settings-batch-d-role {
    white-space: nowrap;
    cursor: help;
}

.settings-batch-d-role i {
    color: #718096;
    font-size: 0.72rem;
}

.settings-batch-d-state {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.settings-batch-d-state.is-active { color: #17643d; background: #e5f5eb; }
.settings-batch-d-state.is-invited { color: #1758a8; background: #e8f1ff; }
.settings-batch-d-state.is-expired { color: #a23a27; background: #ffede8; }
.settings-batch-d-state.is-disabled { color: #536070; background: #e9edf2; }

.settings-batch-d-inline-form {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) repeat(3, minmax(150px, 1fr));
    align-items: end;
    gap: 14px;
}

.settings-batch-d-inline-form .settings-batch-d-inline-actions {
    grid-column: 1 / -1;
}

.settings-batch-d-loading,
.settings-batch-d-empty {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 220px;
    color: var(--settings-muted);
    text-align: center;
}

.settings-batch-d-loading {
    grid-template-columns: auto auto;
    align-content: center;
}

.settings-batch-d-mobile-overview {
    max-width: 680px;
    margin: 0 auto;
    padding: 22px 16px 80px;
}

@media (max-width: 900px) {
    .settings-batch-d-layout {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .settings-batch-d-main {
        padding-right: 24px;
        padding-left: 24px;
    }

    .settings-batch-d-inline-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .settings-batch-d-view {
        min-height: calc(100vh - 62px);
        padding-bottom: 70px;
    }

    .settings-batch-d-layout {
        display: block;
        min-height: auto;
    }

    .settings-batch-d-sidebar {
        display: none;
    }

    .settings-batch-d-main {
        padding: 18px 16px 48px;
    }

    .settings-batch-d-page-header {
        margin-bottom: 20px;
    }

    .settings-batch-d-page-header h2 {
        font-size: 1.25rem;
    }

    .settings-batch-d-back {
        display: inline-grid;
    }

    .settings-batch-d-category-grid {
        gap: 8px;
    }

    .settings-batch-d-category-grid .settings-batch-d-nav-item {
        min-height: 58px;
        border-color: var(--settings-border);
        background: #fff;
    }

    .settings-batch-d-section-header,
    .settings-batch-d-plan-row,
    .settings-batch-d-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-batch-d-section-header .btn,
    .settings-batch-d-form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .settings-batch-d-status-row {
        grid-template-columns: 76px 10px minmax(0, 1fr) 36px;
        gap: 8px;
        padding: 8px 0;
    }

    .settings-batch-d-status-name {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .settings-batch-d-usage-count {
        grid-column: 3;
        text-align: left;
    }

    .settings-batch-d-status-row > [data-status-delete] {
        grid-column: 4;
        grid-row: 1 / span 2;
    }

    .settings-batch-d-table,
    .settings-batch-d-table tbody,
    .settings-batch-d-table tr,
    .settings-batch-d-table td {
        display: block;
        width: 100%;
    }

    .settings-batch-d-table thead {
        display: none;
    }

    .settings-batch-d-table tr {
        padding: 14px 0;
        border-bottom: 1px solid var(--settings-border);
    }

    .settings-batch-d-table td {
        padding: 4px 0;
        border: 0;
    }

    .settings-batch-d-table-actions {
        padding-top: 10px !important;
        text-align: left !important;
    }

    .settings-batch-d-inline-form {
        grid-template-columns: 1fr;
    }

    .settings-batch-d-inline-actions {
        flex-direction: column-reverse;
    }

    .settings-batch-d-inline-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
