.admin-shell-body {
    margin: 0;
    background: #f4f6f8;
    color: #142033;
}

.admin-shell {
    min-height: 100vh;
    display: flex;
}

.admin-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #162033 0%, #0f1725 100%);
    color: #f7f9fc;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-brand-kicker,
.admin-topbar-kicker,
.admin-nav-label,
.admin-step-kicker,
.admin-stat-label {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
}

.admin-brand-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.admin-brand-text {
    color: rgba(247, 249, 252, 0.72);
    line-height: 1.5;
    font-size: .95rem;
}

.admin-nav-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-nav-label {
    color: rgba(247, 249, 252, 0.5);
    font-weight: 600;
}

.admin-nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(247, 249, 252, 0.86);
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.admin-nav-link:hover,
.admin-nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(1px);
}

.admin-nav-link.is-active {
    color: #0f1725;
    background: #f2c45a;
    font-weight: 600;
}

.admin-sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 28px 32px 32px;
}

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

.admin-topbar-kicker {
    color: #677286;
    font-weight: 600;
    margin-bottom: 6px;
}

.admin-page-title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 700;
}

.admin-breadcrumbs .breadcrumb {
    margin-bottom: 20px;
}

.admin-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.admin-action-row,
.admin-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-lead {
    max-width: 840px;
    color: #546174;
    line-height: 1.6;
    font-size: 1rem;
}

.admin-card,
.admin-stat-card,
.admin-step-card {
    background: #fff;
    border: 1px solid #dce3ea;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 37, 0.04);
}

.admin-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid #e8edf2;
}

.admin-card-body {
    padding: 22px;
}

.form-label {
    font-weight: 700;
}

.active-models-section {
    padding: 24px;
    border-radius: 16px;
    box-shadow: none;
}

.active-models-section-default { background: #f3f6fb; }
.active-models-section-router { background: #eef2ff; }
.active-models-section-title-generator { background: #e6f8f5; }
.active-models-section-handlers { background: #fff4dc; }

.active-models-section-title {
    margin-bottom: 4px;
    color: #172033;
    font-size: 1.05rem;
    font-weight: 700;
}

.active-models-section-lead {
    margin-bottom: 20px;
    color: #687386;
    font-size: .875rem;
}

.active-models-fallbacks {
    margin: 22px -4px 24px;
    padding: 18px 20px;
    border: 1px solid #e9c670;
    border-radius: 12px;
    background: #fff9eb;
}

.active-models-subsection {
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(74, 85, 104, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
}

.active-models-subsection:last-child { margin-bottom: 0; }
.active-models-subsection.row { margin-left: 0; margin-right: 0; }
.active-models-subsection .mb-3:last-child,
.active-models-subsection .form-group:last-child { margin-bottom: 0; }
.active-models-section-default .active-models-subsection { background: #fcfdff; }
.active-models-section-router .active-models-subsection { background: #fafbff; }
.active-models-section-title-generator .active-models-subsection { background: #f7fffd; }
.active-models-section-handlers .active-models-subsection { background: #fffdf7; }
.active-models-section-handlers .handler-model-row { background: #fff8e7; }

@media (max-width: 767px) {
    .active-models-section { padding: 18px; }
}

.admin-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.admin-step-card {
    height: 100%;
    padding: 20px;
}

.admin-step-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.admin-stat-card {
    height: 100%;
    padding: 20px;
}

.admin-stat-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.admin-stat-link .admin-stat-card {
    height: 100%;
}

.admin-stat-link:hover,
.admin-stat-link:focus {
    color: inherit;
}

.admin-stat-link:hover .admin-stat-card,
.admin-stat-link:focus .admin-stat-card {
    border-color: #9fb0c2;
    box-shadow: 0 10px 28px rgba(15, 23, 37, 0.08);
    transform: translateY(-1px);
}

.admin-stat-label {
    color: #6c7789;
    font-weight: 700;
    margin-bottom: 10px;
}

.admin-stat-value {
    font-size: 2rem;
    line-height: 1;
    font-weight: 700;
    margin-bottom: 10px;
}

.admin-stat-note {
    color: #6c7789;
    font-size: .9rem;
}

.admin-table {
    margin-bottom: 0;
}

.admin-table th {
    background: #f8fafc;
}

.admin-grid-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    color: #546174;
}

.admin-config-preview {
    margin: 0;
    padding: 16px 18px;
    background: #0f1725;
    color: #eef3f8;
    border-radius: 14px;
    overflow: auto;
    font-size: .92rem;
    line-height: 1.55;
}

.admin-io-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-io-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: .85rem;
    line-height: 1.25;
}

.admin-io-label {
    min-width: 34px;
    font-weight: 700;
    color: #4b5a6f;
    text-transform: lowercase;
}

.admin-io-values {
    color: #1d2a3b;
    word-break: break-word;
}

.admin-io-arrow {
    color: #4b5a6f;
    font-weight: 700;
    font-size: .95rem;
    line-height: 1;
}

.chat-workflow-step {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e5eaf0;
    border-radius: 10px;
    background: #f8fafc;
}

.chat-workflow-step:last-child {
    margin-bottom: 0;
}

.chat-workflow-step-line {
    margin-bottom: 2px;
    color: #172033;
    font-size: .9rem;
}

.chat-workflow-step-arrow {
    margin: 1px 0;
    color: #7a8797;
    font-size: .9rem;
    line-height: 1;
}

.admin-dot-inactive {
    color: #bcc5d0 !important;
}
.admin-dot-inactive:hover {
    color: #8a96a6 !important;
}

.admin-bulk-select {
    width: min(280px, 100%);
}

.admin-quick-form {
    min-width: 420px;
}

.admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.admin-quick-grid label {
    margin: 0;
    font-size: .86rem;
    color: #4c596b;
}

.admin-service-model-form {
    max-width: 760px;
}

@media (max-width: 991px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
    }

    .admin-main {
        padding: 20px 16px 28px;
    }

    .admin-topbar,
    .admin-page-header {
        flex-direction: column;
    }
}
