* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
}

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

/* 侧边栏 */
.sidebar {
    width: 292px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.logo {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h2 {
    font-size: 20px;
    font-weight: 600;
}

.nav-menu {
    flex: 1;
    padding: 14px 0 18px;
    overflow-y: auto;
}

.nav-section {
    padding: 8px 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-section:last-child {
    border-bottom: 0;
}

.nav-section-title {
    padding: 0 8px 7px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(52, 152, 219, 0.3);
    color: white;
    box-shadow: inset 4px 0 0 #3498db;
}

.nav-item .icon {
    flex: 0 0 24px;
    font-size: 20px;
    text-align: center;
}

.nav-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.nav-label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.nav-desc {
    color: rgba(255, 255, 255, 0.46);
    font-size: 12px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item:hover .nav-desc,
.nav-item.active .nav-desc {
    color: rgba(255, 255, 255, 0.72);
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

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

.btn-refresh {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-refresh:hover {
    background: #2980b9;
}

/* 页面内容 */
.page-content {
    display: none;
    padding: 30px;
    overflow-y: auto;
}

.page-content.active {
    display: block;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

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

.stat-row .label {
    color: #7f8c8d;
    font-size: 14px;
}

.stat-row .value {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
}

/* 配置面板 */
.config-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.config-panel h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.config-panel h4 {
    margin: 10px 0;
    color: #34495e;
    font-size: 14px;
    font-weight: 600;
}

/* 国家配置卡片 */
.country-card {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    transition: border-color 0.2s;
}

.country-card:hover {
    border-color: #3498db;
}

.country-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    cursor: pointer;
    user-select: none;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.country-card.collapsed .country-card-header {
    border-radius: 8px;
}

.country-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.country-card-title .country-code {
    font-weight: 700;
    font-size: 15px;
    color: #2c3e50;
}

.country-card-title .country-summary {
    font-size: 12px;
    color: #7f8c8d;
}

.country-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-delete-country {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 20px;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s;
}

.btn-delete-country:hover {
    background: #fde8e8;
}

.country-card-toggle {
    font-size: 12px;
    color: #95a5a6;
    transition: transform 0.2s;
}

.country-card-body {
    padding: 12px 15px;
    border-top: 1px solid #e9ecef;
}

.country-card.collapsed .country-card-body {
    display: none;
}

.country-card-default {
    border-color: #3498db;
    border-width: 2px;
}

.country-card-default .country-card-header {
    background: #e8f4fc;
}

/* 动态规则卡片（国家卡片内部） */
.rule-card {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.rule-card:hover {
    border-color: #3498db;
}

.rule-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.rule-card-header h4 {
    margin: 0;
    color: #333;
    font-size: 14px;
}

.rule-card-header .btn-delete-rule {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 18px;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s;
}

.rule-card-header .btn-delete-rule:hover {
    background: #fde8e8;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: end;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-item label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.config-item input,
.config-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.config-item input:focus,
.config-item select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 账号选择区域 */
.advertiser-select-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.advertiser-search {
    display: flex;
    gap: 10px;
}

.advertiser-search input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    max-width: 300px;
}

.advertiser-search input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.advertiser-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.advertiser-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.advertiser-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.advertiser-checkbox-item:hover {
    border-color: #3498db;
    background: #f0f7ff;
}

.advertiser-checkbox-item .advertiser-checkbox {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.advertiser-checkbox-item .advertiser-id {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #2c3e50;
}

.advertiser-checkbox-item .campaign-count {
    color: #7f8c8d;
    font-size: 12px;
    flex-shrink: 0;
}

.advertiser-checkbox-item:has(.advertiser-checkbox:checked) {
    border-color: #3498db;
    background: #e8f4fc;
}

.advertiser-checkbox-item:has(.advertiser-checkbox:checked) .advertiser-id {
    color: #2980b9;
    font-weight: 600;
}

.product-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    flex-shrink: 0;
}

.product-rr {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.product-rtv {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.product-sr {
    background: #f3e5f5;
    color: #6a1b9a;
    border: 1px solid #ce93d8;
}

.product-ruby {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.product-bn {
    background: #e0f2f1;
    color: #00695c;
    border: 1px solid #80cbc4;
}

.advertiser-checkbox-item.paused {
    opacity: 0.55;
}

.advertiser-name {
    font-size: 11px;
    color: #7f8c8d;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 2px;
    color: #1565c0;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    flex-shrink: 0;
}

.advertiser-list .loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #666;
    background: transparent;
    border: none;
}

/* 账号筛选器 */
.advertiser-filters {
    padding: 6px 0;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.filter-label {
    font-size: 12px;
    color: #888;
    min-width: 36px;
    flex-shrink: 0;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.filter-chip {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.5;
}

.filter-chip:hover {
    border-color: #3498db;
    color: #3498db;
}

.filter-chip.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.filter-apply-btn {
    font-size: 12px;
    padding: 3px 12px;
    border-radius: 4px;
    border: 1px solid #3498db;
    background: #3498db;
    color: #fff;
    cursor: pointer;
    margin-left: 8px;
}

.filter-apply-btn:hover {
    background: #2980b9;
}

/* 过滤器 */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.btn-primary {
    padding: 10px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

/* 表格 */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #34495e;
    color: white;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.data-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table td {
    padding: 15px;
    font-size: 14px;
    vertical-align: middle;
}

.data-table td.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
}

.rule-summary {
    min-width: 260px;
    max-width: 520px;
    color: #2c3e50;
}

.rule-summary-title {
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
}

.rule-summary-meta {
    color: #536577;
    font-size: 12px;
    line-height: 1.7;
}

.rule-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.rule-summary-tags span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #eef5fb;
    color: #2f6f9f;
    font-size: 12px;
    line-height: 1;
    padding: 5px 8px;
}

.rule-summary-muted .rule-summary-title,
.rule-summary-muted .rule-summary-meta {
    color: #7f8c8d;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.paused {
    background: #fff3cd;
    color: #856404;
}

.status-badge.disabled {
    background: #f8d7da;
    color: #721c24;
}

/* App标签 */
.app-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-transform: uppercase;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: opacity 0.2s;
}

.btn-sm:hover {
    opacity: 0.8;
}

.btn-budget {
    background: #3498db;
    color: white;
}

.btn-budget.btn-disabled,
.btn-sm.btn-budget.btn-disabled,
.btn-sm.btn-budget:disabled {
    background: #bdc3c7 !important;
    color: #7f8c8d !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none;
}

.btn-budget.btn-disabled:hover,
.btn-sm.btn-budget.btn-disabled:hover,
.btn-sm.btn-budget:disabled:hover {
    opacity: 0.6 !important;
    background: #bdc3c7 !important;
}

.btn-enable {
    background: #27ae60;
    color: white;
}

.btn-disable {
    background: #e74c3c;
    color: white;
}

.btn-view {
    background: #9b59b6;
    color: white;
}

.btn-view:hover {
    background: #8e44ad;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    position: relative;
}

/* Task configuration can contain long nested rules; keep its actions reachable. */
.task-management-page .modal-content {
    margin: 24px auto;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-cancel {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-submit {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.btn-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-submit:disabled:hover {
    opacity: 0.7;
}

.btn-cancel:disabled {
    background: #ecf0f1;
    color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-cancel:disabled:hover {
    opacity: 0.7;
}

.loading-spinner {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

input:disabled {
    background: #ecf0f1;
    color: #95a5a6;
    cursor: not-allowed;
}

/* 翻页控件 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-top: 24px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.page-btn {
    padding: 10px 20px;
    background: white;
    color: #667eea;
    border: 2px solid white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 80px;
}

.page-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.page-btn:active:not(:disabled) {
    transform: translateY(0);
}

.page-btn:disabled {
    background: rgba(255, 255, 255, 0.5);
    color: rgba(102, 126, 234, 0.4);
    cursor: not-allowed;
    opacity: 0.6;
    border-color: rgba(255, 255, 255, 0.5);
}

.page-info {
    padding: 10px 20px;
    font-size: 15px;
    color: white;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.page-size-select {
    padding: 10px 16px;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    background: white;
    color: #667eea;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-size-select:hover {
    background: #667eea;
    color: white;
}

.page-size-select:focus {
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

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

    .filters {
        flex-direction: column;
    }

    .filters input,
    .filters select {
        width: 100%;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px;
    }
    
    .page-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    min-width: 250px;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toast.error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

#toast-message {
    display: block;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

/* 子Tab样式 */
.sub-tabs {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sub-tab {
    padding: 14px 28px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    color: #7f8c8d;
}

.sub-tab:hover {
    background: #dfe6e9;
    color: #2c3e50;
}

.sub-tab.active {
    background: white;
    border-bottom: 3px solid #3498db;
    color: #3498db;
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0 0 8px 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #7f8c8d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #bdc3c7;
    font-weight: bold;
}

/* 使用广告系列预算的样式（红色标记） */
.budget-from-campaign {
    color: #e74c3c;
    font-weight: 600;
    cursor: help;
}

/* 预算提示说明 */
.budget-hint {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 自动化调度器配置工作台 */
.scheduler-page {
    max-width: 1560px;
    margin: 0 auto;
    width: 100%;
    padding-top: 18px;
}

@media (min-width: 841px) {
    .task-management-page .sidebar {
        width: 232px;
    }
}

.shutdown-workspace {
    background: #f6f8fb;
    border: 1px solid #dfe7f0;
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(24, 43, 74, 0.08);
    margin-bottom: 22px;
    overflow: hidden;
}

.shutdown-multipage .scheduler-workspace,
.shutdown-multipage .scheduler-legacy {
    display: none;
}

.shutdown-page-view {
    display: none;
}

body[data-shutdown-view="library"] .shutdown-library-view,
body[data-shutdown-view="builder"] .shutdown-builder-view,
body[data-shutdown-view="history"] .shutdown-history-view {
    display: block;
}

.shutdown-page-tabs {
    border-bottom: 1px solid #dce5ef;
    display: flex;
    gap: 34px;
    margin-bottom: 20px;
    padding: 0 2px;
}

.shutdown-page-tabs a {
    border-bottom: 3px solid transparent;
    color: #344e6c;
    font-size: 14px;
    font-weight: 650;
    padding: 12px 14px 14px;
    text-decoration: none;
}

.shutdown-page-tabs a.active {
    border-bottom-color: #1677e8;
    color: #0969d4;
}

.shutdown-demo-banner {
    align-items: center;
    background: #eef7ff;
    border: 1px solid #cfe4f8;
    border-radius: 10px;
    color: #42617f;
    display: flex;
    gap: 12px;
    margin: 0 0 16px;
    padding: 11px 14px;
}

.shutdown-demo-banner span {
    background: #1677e8;
    border-radius: 999px;
    color: #fff;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 750;
    padding: 5px 9px;
}

.shutdown-demo-banner p { font-size: 12px; line-height: 1.5; margin: 0; }

.shutdown-library-view,
.shutdown-history-view {
    background: #fff;
    border: 1px solid #dfe7f0;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(24, 43, 74, 0.07);
    overflow: hidden;
}

.shutdown-library-filters,
.shutdown-history-filters {
    align-items: end;
    background: #fbfcfe;
    border-bottom: 1px solid #e4ebf3;
    display: grid;
    gap: 14px;
    grid-template-columns: 180px 220px minmax(260px, 1fr) auto;
    padding: 20px 24px;
}

.shutdown-library-filters label,
.shutdown-history-filters label {
    color: #5c728a;
    display: grid;
    font-size: 12px;
    font-weight: 650;
    gap: 7px;
}

.shutdown-library-filters input,
.shutdown-library-filters select,
.shutdown-history-filters input,
.shutdown-history-filters select {
    background: #fff;
    border: 1px solid #cbd7e4;
    border-radius: 7px;
    color: #263f5d;
    font: inherit;
    min-height: 40px;
    padding: 8px 11px;
}

.shutdown-library-table-wrap,
.shutdown-history-table-wrap {
    overflow-x: auto;
    padding: 0 24px;
}

.shutdown-library-table {
    border-collapse: collapse;
    min-width: 740px;
    width: 100%;
}

.shutdown-history-table-wrap .shutdown-library-table { min-width: 640px; }
.shutdown-history-table-wrap .shutdown-library-table th:first-child,
.shutdown-history-table-wrap .shutdown-library-table td:first-child { white-space: nowrap; width: 148px; }

.shutdown-library-table th,
.shutdown-library-table td {
    border-bottom: 1px solid #e8edf3;
    color: #465f79;
    font-size: 12px;
    padding: 15px 13px;
    text-align: left;
    vertical-align: middle;
}

.shutdown-library-table th {
    background: #f7f9fc;
    color: #60758c;
    font-size: 11px;
    letter-spacing: .02em;
}

.shutdown-rule-name {
    color: #0874df;
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.shutdown-library-table td > small {
    color: #8b9bac;
    display: block;
    margin-top: 4px;
}

.shutdown-platform-dot {
    background: #1483e9;
    border-radius: 50%;
    display: inline-block;
    height: 9px;
    margin-right: 7px;
    width: 9px;
}

.shutdown-platform-dot.tiktok { background: #111827; }

.shutdown-mode,
.shutdown-run-status {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 9px;
}

.shutdown-mode.dry { background: #eaf4ff; color: #1370c9; }
.shutdown-mode.live { background: #e4f7ed; color: #238057; }

.shutdown-toggle {
    background: #bdc9d6;
    border: 0;
    border-radius: 99px;
    cursor: pointer;
    height: 22px;
    padding: 3px;
    width: 40px;
}

.shutdown-toggle i {
    background: #fff;
    border-radius: 50%;
    display: block;
    height: 16px;
    transition: transform .18s ease;
    width: 16px;
}

.shutdown-toggle.on { background: #1684ee; }
.shutdown-toggle.on i { transform: translateX(18px); }

.shutdown-row-actions { display: flex; gap: 12px; }
.shutdown-row-actions a,
.shutdown-row-actions button { background: none; border: 0; color: #0874df; cursor: pointer; font: inherit; padding: 0; text-decoration: none; }
.shutdown-library-total { color: #75899e; font-size: 12px; margin: 0; padding: 18px 25px; }

.shutdown-unavailable-state {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 7px;
    justify-content: center;
    min-height: 150px;
    padding: 20px;
    text-align: center;
}

.shutdown-unavailable-state strong { color: #314e6b; font-size: 15px; }
.shutdown-unavailable-state p { color: #607890; line-height: 1.55; margin: 0; max-width: 520px; }
.shutdown-unavailable-state small { color: #93a2b1; }

.shutdown-stepper {
    background: #f7faff;
    border-bottom: 1px solid #dfe8f1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    list-style: none;
    margin: 0;
    padding: 17px 28px;
}

.shutdown-stepper li { position: relative; }
.shutdown-stepper li:not(:last-child)::after { background: #bfd0e2; content: ""; height: 2px; left: calc(50% + 34px); position: absolute; right: calc(-50% + 34px); top: 18px; }
.shutdown-stepper li.complete::after { background: #2584e8; }
.shutdown-stepper button { align-items: flex-start; background: none; border: 0; color: #60768c; cursor: pointer; display: flex; font: inherit; gap: 11px; padding: 0; position: relative; text-align: left; z-index: 1; }
.shutdown-stepper b { align-items: center; background: #fff; border: 1px solid #afc2d6; border-radius: 50%; display: flex; height: 36px; justify-content: center; width: 36px; }
.shutdown-stepper span { display: grid; font-size: 13px; font-weight: 700; gap: 3px; }
.shutdown-stepper small { color: #91a0b0; font-size: 10px; font-weight: 500; }
.shutdown-stepper .active button { color: #086fd8; }
.shutdown-stepper .active b,
.shutdown-stepper .complete b { background: #167de5; border-color: #167de5; color: #fff; }

.shutdown-builder-layout { grid-template-columns: minmax(220px, .72fr) minmax(500px, 1.8fr) minmax(270px, .86fr); }
.shutdown-builder-view[data-step="2"] .shutdown-builder-layout,
.shutdown-builder-view[data-step="3"] .shutdown-builder-layout,
.shutdown-builder-view[data-step="4"] .shutdown-builder-layout {
    grid-template-columns: minmax(520px, 1.8fr) minmax(280px, .82fr);
}
.shutdown-builder-view[data-step="2"] .shutdown-navigation,
.shutdown-builder-view[data-step="3"] .shutdown-navigation,
.shutdown-builder-view[data-step="4"] .shutdown-navigation {
    display: none;
}
.shutdown-step-copy { color: #71859a; font-size: 13px; line-height: 1.6; }
.shutdown-scene-summary { background: #f5f9fd; border: 1px solid #d9e6f2; border-radius: 10px; display: grid; gap: 7px; margin-top: 18px; padding: 18px; }
.shutdown-scene-summary strong { color: #1a4f84; }
.shutdown-scene-summary span,
.shutdown-scene-summary small { color: #71859a; }
.shutdown-builder-actions { align-items: center; display: flex; justify-content: space-between; padding-top: 24px; }
.shutdown-builder-actions > div { display: flex; gap: 10px; }
.shutdown-confirm-card { align-items: flex-start; background: #edf8f3; border: 1px solid #c9e8d8; border-radius: 12px; display: flex; gap: 14px; margin-top: 18px; padding: 20px; }
.shutdown-confirm-card h4 { color: #21694b; margin: 0 0 6px; }
.shutdown-confirm-card p { color: #557866; line-height: 1.55; margin: 0; }
.shutdown-confirm-icon { align-items: center; background: #31a66f; border-radius: 50%; color: #fff; display: flex; flex: 0 0 auto; height: 30px; justify-content: center; width: 30px; }
.shutdown-blocked-state { align-items: flex-start; display: flex; flex-direction: column; gap: 12px; padding: 28px 4px; }
.shutdown-blocked-state h3 { color: #8d2d2d; margin: 0; }
.shutdown-blocked-state p { color: #687d92; line-height: 1.6; margin: 0; }

.shutdown-history-shell { display: grid; grid-template-columns: minmax(0, 1fr) 0; min-height: 650px; position: relative; transition: grid-template-columns .2s ease; }
.shutdown-history-shell:has(.shutdown-run-detail.open) { grid-template-columns: minmax(0, 1fr) 380px; }
.shutdown-history-main { min-width: 0; }
.shutdown-history-filters { grid-template-columns: 180px 180px minmax(220px, 1fr) auto; }
.shutdown-run-detail { background: #fff; border-left: 1px solid #dde6ef; min-width: 0; overflow: hidden; padding: 0; position: relative; }
.shutdown-run-detail.open { padding: 26px 22px; }
.shutdown-drawer-close { background: none; border: 0; color: #60768c; cursor: pointer; font-size: 25px; position: absolute; right: 16px; top: 12px; }
.shutdown-run-detail h3 { color: #183452; margin: 14px 32px 5px 0; }
.shutdown-run-time { color: #7a8da1; font-size: 12px; }
.shutdown-run-detail section { border-top: 1px solid #e5ebf1; margin-top: 20px; padding-top: 17px; }
.shutdown-run-detail h4 { color: #2d4865; margin: 0 0 12px; }
.shutdown-run-detail dl { display: grid; font-size: 12px; gap: 9px; grid-template-columns: 88px 1fr; margin: 0; }
.shutdown-run-detail dt { color: #7e90a3; }
.shutdown-run-detail dd { color: #344f6a; margin: 0; overflow-wrap: anywhere; }
.shutdown-run-detail pre { background: #142436; border-radius: 8px; color: #dce8f5; font-size: 11px; max-height: 260px; overflow: auto; padding: 13px; white-space: pre-wrap; }
.shutdown-run-error { background: #fff0f0; border-radius: 7px; color: #a53838; padding: 10px; }
.shutdown-run-status { background: #eef2f6; color: #687c91; gap: 6px; }
.shutdown-run-status i { background: currentColor; border-radius: 50%; height: 7px; width: 7px; }
.shutdown-run-status.success { background: #e1f6eb; color: #208158; }
.shutdown-run-status.failed { background: #ffeded; color: #cc3d3d; }
.shutdown-run-status.running { background: #fff4df; color: #b67816; }

@media (max-width: 1100px) {
    .shutdown-library-filters,
    .shutdown-history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shutdown-builder-layout { grid-template-columns: 220px minmax(0, 1fr); }
    .shutdown-builder-view[data-step="2"] .shutdown-builder-layout,
    .shutdown-builder-view[data-step="3"] .shutdown-builder-layout,
    .shutdown-builder-view[data-step="4"] .shutdown-builder-layout { grid-template-columns: minmax(0, 1fr); }
    .shutdown-builder-layout .shutdown-inspector { border-left: 0; border-top: 1px solid #e0e8f1; grid-column: 1 / -1; }
    .shutdown-history-shell:has(.shutdown-run-detail.open) { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 700px) {
    .shutdown-demo-banner { align-items: flex-start; flex-direction: column; }
    .shutdown-page-tabs { gap: 4px; overflow-x: auto; }
    .shutdown-page-tabs a { flex: 0 0 auto; padding-inline: 11px; }
    .shutdown-library-filters,
    .shutdown-history-filters { grid-template-columns: 1fr; padding: 16px; }
    .shutdown-library-table-wrap,
    .shutdown-history-table-wrap { padding: 0 12px; }
    .shutdown-library-table { min-width: 0; }
    .shutdown-library-table thead { display: none; }
    .shutdown-library-table,
    .shutdown-library-table tbody,
    .shutdown-library-table tr,
    .shutdown-library-table td { display: block; width: 100%; }
    .shutdown-library-table tbody { padding: 12px 0; }
    .shutdown-library-table tbody tr:not(.shutdown-state-row) { border: 1px solid #e1e8f0; border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
    .shutdown-library-table tbody td { align-items: flex-start; border-bottom: 1px solid #edf1f5; display: flex; gap: 12px; justify-content: space-between; padding: 11px 13px; text-align: right; }
    .shutdown-library-table tbody td:last-child { border-bottom: 0; }
    .shutdown-library-table tbody td::before { color: #8091a2; content: ""; flex: 0 0 74px; font-size: 11px; font-weight: 700; text-align: left; }
    .shutdown-library-table-wrap .shutdown-library-table td:nth-child(1)::before { content: "规则名称"; }
    .shutdown-library-table-wrap .shutdown-library-table td:nth-child(2)::before { content: "平台"; }
    .shutdown-library-table-wrap .shutdown-library-table td:nth-child(3)::before { content: "场景"; }
    .shutdown-library-table-wrap .shutdown-library-table td:nth-child(4)::before { content: "作用范围"; }
    .shutdown-library-table-wrap .shutdown-library-table td:nth-child(5)::before { content: "运行模式"; }
    .shutdown-library-table-wrap .shutdown-library-table td:nth-child(6)::before { content: "启用状态"; }
    .shutdown-library-table-wrap .shutdown-library-table td:nth-child(7)::before { content: "操作"; }
    .shutdown-history-table-wrap .shutdown-library-table td:nth-child(1)::before { content: "执行时间"; }
    .shutdown-history-table-wrap .shutdown-library-table td:nth-child(2)::before { content: "任务名称"; }
    .shutdown-history-table-wrap .shutdown-library-table td:nth-child(3)::before { content: "平台"; }
    .shutdown-history-table-wrap .shutdown-library-table td:nth-child(4)::before { content: "执行模式"; }
    .shutdown-history-table-wrap .shutdown-library-table td:nth-child(5)::before { content: "执行状态"; }
    .shutdown-history-table-wrap .shutdown-library-table td:nth-child(6)::before { content: "触发来源"; }
    .shutdown-history-table-wrap .shutdown-library-table td:nth-child(7)::before { content: "操作"; }
    .shutdown-library-table tbody td.shutdown-empty { display: block; text-align: left; }
    .shutdown-library-table tbody td.shutdown-empty::before { content: none; }
    .shutdown-row-actions { flex-wrap: wrap; justify-content: flex-end; }
    .shutdown-stepper { grid-template-columns: repeat(4, minmax(58px, 1fr)); padding: 14px 12px; }
    .shutdown-stepper button { justify-content: center; }
    .shutdown-stepper span { display: none; }
    .shutdown-stepper li:not(:last-child)::after { left: calc(50% + 18px); right: calc(-50% + 18px); }
    .shutdown-builder-layout { display: block; }
    .shutdown-navigation { border-bottom: 1px solid #e0e8f1; border-right: 0; }
    .shutdown-history-shell,
    .shutdown-history-shell:has(.shutdown-run-detail.open) { display: block; }
    .shutdown-run-detail { border-left: 0; bottom: 0; box-shadow: 0 -12px 35px rgba(17, 37, 62, .18); left: 0; max-height: 82vh; overflow-y: auto; position: fixed; right: 0; transform: translateY(110%); transition: transform .2s ease; z-index: 1200; }
    .shutdown-run-detail.open { padding: 24px 18px; transform: translateY(0); }
    .shutdown-builder-actions { align-items: stretch; gap: 12px; flex-direction: column; }
    .shutdown-builder-actions > div { justify-content: flex-end; }
}

.shutdown-hero {
    align-items: flex-start;
    background: #fff;
    border-bottom: 1px solid #e5ebf2;
    display: flex;
    gap: 28px;
    justify-content: space-between;
    padding: 24px 26px 21px;
}

.shutdown-hero h2 {
    color: #132b4f;
    font-size: 26px;
    line-height: 1.15;
    margin: 0;
}

.shutdown-hero > div:first-child > p:last-child {
    color: #60768f;
    font-size: 14px;
    line-height: 1.55;
    margin: 7px 0 0;
    max-width: 700px;
}

.shutdown-hero-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: flex-end;
}

.shutdown-safe-badge {
    background: #edf8f3;
    border: 1px solid #c8e8d7;
    border-radius: 999px;
    color: #26734f;
    font-size: 12px;
    font-weight: 650;
    padding: 8px 11px;
}

.shutdown-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(480px, 1.9fr) minmax(260px, 0.9fr);
    min-height: 690px;
}

.shutdown-navigation,
.shutdown-editor,
.shutdown-inspector {
    min-width: 0;
}

.shutdown-navigation {
    background: #f9fbfd;
    border-right: 1px solid #e0e8f1;
    padding: 20px 16px;
}

.shutdown-editor {
    background: #fff;
    padding: 22px 24px;
}

.shutdown-inspector {
    border-left: 1px solid #e0e8f1;
    padding: 20px 17px;
}

.shutdown-panel-heading,
.shutdown-editor-heading,
.shutdown-section-heading,
.shutdown-check-title {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.shutdown-panel-heading h3,
.shutdown-editor-heading h3,
.shutdown-inspector-heading h3 {
    color: #182f50;
    font-size: 18px;
    margin: 0;
}

.shutdown-task-count {
    align-items: center;
    background: #eaf2fb;
    border-radius: 7px;
    color: #28669f;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    min-width: 30px;
}

.shutdown-scenes {
    display: grid;
    gap: 5px;
    margin-top: 16px;
}

.shutdown-scene,
.shutdown-task {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #415b78;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 11px;
    text-align: left;
    width: 100%;
}

.shutdown-scene:hover,
.shutdown-task:hover {
    background: #eef4fa;
}

.shutdown-scene.active,
.shutdown-task.selected {
    background: #e8f1fc;
    border-color: #b8d3ed;
    color: #174f84;
}

.shutdown-scene span,
.shutdown-task span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.shutdown-scene strong,
.shutdown-task strong {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shutdown-scene small,
.shutdown-task small {
    color: #8495a8;
    font-size: 11px;
}

.shutdown-scene em,
.shutdown-task em {
    background: #edf1f5;
    border-radius: 999px;
    color: #6e8195;
    flex: 0 0 auto;
    font-size: 11px;
    font-style: normal;
    padding: 3px 7px;
}

.shutdown-task em.enabled {
    background: #e1f3ea;
    color: #24714d;
}

.shutdown-saved-heading {
    align-items: center;
    border-top: 1px solid #e4eaf1;
    color: #647b94;
    display: flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: space-between;
    margin: 19px 5px 7px;
    padding-top: 16px;
}

.shutdown-task-list {
    display: grid;
    gap: 5px;
}

.shutdown-empty {
    color: #7890a8;
    font-size: 13px;
    line-height: 1.55;
    margin: 0;
    padding: 14px 6px;
}

.shutdown-load-warning {
    background: #fff8e8;
    border: 1px solid #f0dfb8;
    border-radius: 7px;
    color: #7b6127;
    font-size: 12px;
    line-height: 1.45;
    margin: 0 0 7px;
    padding: 8px 10px;
}

.shutdown-editor-heading {
    border-bottom: 1px solid #e8edf3;
    padding-bottom: 18px;
}

.shutdown-editor-heading p:last-child {
    color: #71859a;
    font-size: 13px;
    margin: 6px 0 0;
}

.shutdown-platform,
.shutdown-config-key {
    background: #eef4fb;
    border-radius: 6px;
    color: #456782;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 8px;
}

.shutdown-form-section {
    border-bottom: 1px solid #edf1f5;
    padding: 20px 0;
}

.shutdown-form-section h4,
.shutdown-check-card h4 {
    color: #263f5d;
    font-size: 14px;
    margin: 0;
}

.shutdown-section-heading p {
    color: #8292a4;
    font-size: 12px;
    margin: 4px 0 0;
}

.shutdown-form-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 15px;
}

.shutdown-field,
.shutdown-switch {
    display: grid;
    gap: 7px;
}

.shutdown-field-wide {
    grid-column: 1 / -1;
}

.shutdown-field > span {
    color: #425b74;
    font-size: 12px;
    font-weight: 650;
}

.shutdown-field input,
.shutdown-field select {
    background: #fff;
    border: 1px solid #cbd7e4;
    border-radius: 7px;
    color: #213a55;
    font: inherit;
    min-height: 39px;
    padding: 8px 10px;
    width: 100%;
}

.shutdown-field input:focus,
.shutdown-field select:focus {
    border-color: #4a88c7;
    box-shadow: 0 0 0 3px rgba(74, 136, 199, 0.13);
    outline: 0;
}

.shutdown-field small,
.shutdown-switch small {
    color: #8797a8;
    font-size: 11px;
    line-height: 1.4;
}

.shutdown-switch {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    grid-template-columns: auto 1fr;
    padding: 10px 11px;
}

.shutdown-switch span {
    display: grid;
    gap: 3px;
}

.shutdown-switch strong {
    color: #38516c;
    font-size: 12px;
}

.shutdown-form-actions {
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    padding-top: 19px;
}

.shutdown-inspector-heading {
    border-bottom: 1px solid #e0e7ef;
    padding: 1px 4px 16px;
}

.shutdown-check-card {
    background: #fff;
    border: 1px solid #e0e7ef;
    border-radius: 10px;
    margin-top: 13px;
    padding: 14px;
}

.shutdown-check-title span {
    background: #edf2f7;
    border-radius: 999px;
    color: #60768c;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 7px;
}

.shutdown-check-title span.passed {
    background: #e3f4eb;
    color: #24714d;
}

.shutdown-check-title span.warning {
    background: #fff1d8;
    color: #946214;
}

.shutdown-scope-list,
.shutdown-issue-list {
    list-style: none;
    margin: 11px 0 0;
    padding: 0;
}

.shutdown-scope-list li {
    border-top: 1px solid #edf1f5;
    display: grid;
    gap: 5px;
    padding: 9px 0;
}

.shutdown-scope-list span {
    color: #8393a4;
    font-size: 11px;
}

.shutdown-scope-list strong {
    color: #334e69;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.shutdown-issue-list li {
    color: #8a5c13;
    font-size: 12px;
    line-height: 1.45;
    padding: 4px 0 4px 14px;
    position: relative;
}

.shutdown-issue-list li::before {
    content: "•";
    left: 0;
    position: absolute;
}

.shutdown-check-copy,
.shutdown-example p,
.shutdown-safety-note p {
    color: #74879b;
    font-size: 12px;
    line-height: 1.5;
    margin: 10px 0 0;
}

.shutdown-example {
    margin-top: 12px;
}

.shutdown-example strong,
.shutdown-safety-note strong {
    color: #34516d;
    font-size: 12px;
    line-height: 1.45;
}

.shutdown-safety-note {
    background: #edf5fc;
    border: 1px solid #d0e2f2;
    border-radius: 10px;
    margin-top: 13px;
    padding: 14px;
}

.scheduler-workspace,
.scheduler-legacy {
    background: #fff;
    border: 1px solid #e7edf4;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(29, 51, 84, 0.06);
}

.scheduler-workspace {
    overflow: hidden;
}

.scheduler-hero {
    align-items: flex-start;
    border-bottom: 1px solid #edf1f6;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 20px 26px 18px;
}

.scheduler-eyebrow {
    color: #7890aa;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.scheduler-hero h2 {
    color: #182b4a;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.scheduler-hero-copy {
    color: #66809d;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 5px;
    max-width: 680px;
}

.scheduler-hero-actions,
.scheduler-toolbar,
.scheduler-toggle-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.scheduler-button {
    background: #fff;
    border: 1px solid #cbd8e6;
    border-radius: 8px;
    color: #294666;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    padding: 10px 14px;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.scheduler-button:hover {
    border-color: #76a4d4;
    box-shadow: 0 4px 10px rgba(66, 124, 185, 0.12);
}

.scheduler-button-primary {
    background: #1f6fbe;
    border-color: #1f6fbe;
    color: #fff;
}

.scheduler-button-primary:hover {
    background: #175d9f;
    border-color: #175d9f;
}

.scheduler-button-quiet {
    background: #f8fbff;
}

.scheduler-tabs {
    align-items: stretch;
    background: #f8faff;
    border-bottom: 1px solid #e8eef6;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 0 20px;
}

.scheduler-tab {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    color: #66809d;
    cursor: pointer;
    display: flex;
    flex: 1 0 180px;
    font-size: 13px;
    font-weight: 650;
    gap: 8px;
    justify-content: center;
    padding: 13px 12px 10px;
}

.scheduler-tab strong {
    align-items: center;
    background: #e5edf7;
    border-radius: 999px;
    color: #59728f;
    display: inline-flex;
    font-size: 11px;
    justify-content: center;
    min-width: 24px;
    padding: 3px 7px;
}

.scheduler-tab:hover,
.scheduler-tab.active {
    color: #1c67af;
}

.scheduler-tab.active {
    background: #fff;
    border-bottom-color: #2878c4;
}

.scheduler-tab.active strong {
    background: #d9ebfd;
    color: #1465ae;
}

.scheduler-workbench {
    align-items: stretch;
    background: #f6f9fd;
    display: grid;
    grid-template-columns: minmax(270px, 0.34fr) minmax(0, 0.66fr);
    min-height: 590px;
}

.scheduler-list-panel {
    background: #fbfcfe;
    border-right: 1px solid #e6edf5;
    padding: 22px 16px;
}

.scheduler-list-heading,
.scheduler-preview-heading,
.scheduler-editor-heading,
.scheduler-legacy-heading {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.scheduler-list-heading {
    border-bottom: 1px solid #e8eef5;
    margin: 0 4px 12px;
    padding: 0 0 15px;
}

.scheduler-list-heading h3,
.scheduler-preview-heading h3,
.scheduler-editor-heading h3,
.scheduler-legacy-heading h3 {
    color: #223c5c;
    font-size: 16px;
    line-height: 1.3;
}

.scheduler-count {
    align-items: center;
    background: #eaf2fb;
    border-radius: 8px;
    color: #236aac;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
    min-width: 28px;
    padding: 6px 9px;
}

.scheduler-list {
    display: grid;
    gap: 8px;
    max-height: 650px;
    overflow-y: auto;
    padding: 1px 4px 10px;
}

.scheduler-list-item {
    background: #fff;
    border: 1px solid #e3ebf4;
    border-radius: 10px;
    color: #3e5875;
    cursor: pointer;
    display: grid;
    gap: 7px;
    padding: 13px;
    text-align: left;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.scheduler-list-item:hover {
    border-color: #9fc4e8;
    box-shadow: 0 5px 12px rgba(42, 105, 166, 0.1);
    transform: translateY(-1px);
}

.scheduler-list-item.selected {
    background: #f0f7ff;
    border-color: #4e91cf;
    box-shadow: inset 3px 0 0 #2b78c1;
}

.scheduler-list-item-top {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    min-width: 0;
}

.scheduler-list-item-top strong {
    color: #274565;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-status,
.scheduler-preview-state {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.2;
    padding: 5px 8px;
    white-space: nowrap;
}

.scheduler-status.enabled,
.scheduler-preview-state.passed {
    background: #e3f5ea;
    color: #237c50;
}

.scheduler-status.disabled,
.scheduler-preview-state.failed {
    background: #f3edf0;
    color: #815266;
}

.scheduler-preview-state {
    background: #edf2f7;
    color: #637a94;
}

.scheduler-list-item-meta,
.scheduler-list-item-cron {
    color: #7088a2;
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-list-item-cron {
    color: #94a5b7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
}

.scheduler-editor-panel {
    background: #fff;
    min-width: 0;
    padding: 19px 22px;
}

.scheduler-editor-heading {
    border-bottom: 1px solid #eaf0f6;
    margin-bottom: 10px;
    padding-bottom: 12px;
}

.scheduler-editor-heading p {
    color: #6f87a1;
    font-size: 13px;
    line-height: 1.35;
    margin-top: 3px;
}

.scheduler-toolbar {
    border-bottom: 1px solid #edf2f7;
    justify-content: flex-end;
    margin-bottom: 11px;
    padding: 0 0 11px;
}

.scheduler-toolbar-note {
    color: #7c91a8;
    font-size: 12px;
    margin-right: auto;
}

.scheduler-form-top {
    margin-bottom: 14px;
    max-width: 520px;
}

.scheduler-card-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scheduler-card {
    border: 1px solid #e6edf5;
    border-radius: 11px;
    padding: 13px;
}

.scheduler-card:nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1;
}

.scheduler-card-heading {
    margin-bottom: 9px;
}

.scheduler-card h4,
.scheduler-preview-grid h4 {
    color: #294867;
    font-size: 14px;
    line-height: 1.35;
}

.scheduler-card-heading p {
    color: #8195a9;
    font-size: 11px;
    line-height: 1.3;
    margin-top: 2px;
}

.scheduler-form-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scheduler-scope-card .scheduler-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scheduler-scope-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.scheduler-scope-picker {
    border: 1px solid #e1eaf4;
    border-radius: 8px;
    min-width: 0;
    padding: 9px;
}

.scheduler-scope-picker-head,
.scheduler-scope-picker-actions,
.scheduler-country-rule-head,
.scheduler-country-rule-heading,
.scheduler-rule-row {
    align-items: center;
    display: flex;
    gap: 7px;
}

.scheduler-scope-picker-head {
    color: #526f8d;
    font-size: 12px;
    justify-content: space-between;
    margin-bottom: 7px;
}

.scheduler-scope-picker-head label,
.scheduler-inline-check {
    color: #6e849b;
    font-size: 12px;
    white-space: nowrap;
}

.scheduler-scope-picker-actions input {
    border: 1px solid #ccd9e7;
    border-radius: 6px;
    color: #264360;
    font-size: 12px;
    min-width: 0;
    padding: 5px 7px;
    width: 100%;
}

.scheduler-link-button,
.scheduler-remove-button {
    background: transparent;
    border: 0;
    color: #2878bb;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    padding: 4px 0;
    white-space: nowrap;
}

.scheduler-remove-button,
.scheduler-button-danger {
    color: #af4556;
}

.scheduler-scope-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 9px;
    margin-top: 8px;
    max-height: 116px;
    overflow: auto;
}

.scheduler-scope-options label {
    color: #516f8d;
    cursor: pointer;
    font-size: 12px;
}

.scheduler-scope-options input {
    margin-right: 3px;
}

.scheduler-scope-empty {
    color: #899caf;
    font-size: 12px;
}

.scheduler-rule-list {
    display: grid;
    gap: 7px;
    margin: 7px 0;
}

.scheduler-rule-row {
    background: #f8fbff;
    border: 1px solid #e3edf7;
    border-radius: 7px;
    flex-wrap: wrap;
    padding: 7px;
}

.scheduler-rule-row label,
.scheduler-country-rule-head label {
    color: #6a829a;
    display: grid;
    font-size: 11px;
    gap: 3px;
}

.scheduler-rule-row input,
.scheduler-country-rule-head input {
    border: 1px solid #ccd9e7;
    border-radius: 5px;
    color: #294867;
    font-size: 12px;
    min-width: 68px;
    padding: 4px 6px;
    width: 82px;
}

.scheduler-rule-row .scheduler-inline-check {
    align-items: center;
    display: flex;
    margin-top: 14px;
}

.scheduler-country-rule-heading {
    justify-content: space-between;
    margin-top: 15px;
}

.scheduler-country-rule-heading h5,
.scheduler-card h5 {
    color: #526f8d;
    font-size: 12px;
    margin: 0;
}

.scheduler-country-rule-card {
    border-top: 1px dashed #dbe6f0;
    margin-top: 9px;
    padding-top: 9px;
}

.scheduler-country-rule-head {
    justify-content: space-between;
}

.automation-scope-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 14px 0 8px;
}

.automation-config-editor {
    border: 1px solid #e3ebf4;
    border-radius: 10px;
    margin: 16px 0;
    padding: 12px;
}

.automation-config-editor-head h4 {
    color: #294867;
    font-size: 14px;
}

.automation-config-editor-head p,
.automation-config-empty {
    color: #8296ab;
    font-size: 12px;
    line-height: 1.45;
    margin: 4px 0 10px;
}

.automation-config-node {
    background: #fbfdff;
    border: 1px solid #e8eff6;
    border-radius: 8px;
    margin-top: 8px;
    padding: 9px;
}

.automation-config-node-head,
.automation-config-primitive {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.automation-config-node-head h5 {
    color: #526f8d;
    font-size: 12px;
    margin: 0;
}

.automation-config-node-head > div {
    display: flex;
    gap: 8px;
}

.automation-config-children {
    display: grid;
    gap: 7px;
    margin-top: 7px;
}

.automation-config-leaf {
    display: grid;
    flex: 1;
    gap: 3px;
}

.automation-config-leaf span {
    color: #6a829a;
    font-size: 11px;
}

.automation-config-leaf input:not([type="checkbox"]) {
    border: 1px solid #ccd9e7;
    border-radius: 6px;
    color: #294867;
    font-size: 12px;
    min-width: 0;
    padding: 6px 7px;
    width: 100%;
}

.automation-config-leaf input[type="checkbox"] {
    accent-color: #2576be;
    height: 15px;
    width: 15px;
}

.automation-task-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 15px;
    margin: 12px 0;
}

.automation-task-flags label {
    color: #526f8d;
    font-size: 13px;
}

.scheduler-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.scheduler-field > span {
    color: #526f8d;
    font-size: 12px;
    font-weight: 650;
}

.scheduler-field input,
.scheduler-field select {
    background: #fff;
    border: 1px solid #ccd9e7;
    border-radius: 7px;
    color: #264360;
    font-size: 13px;
    min-width: 0;
    outline: none;
    padding: 7px 9px;
    width: 100%;
}

.scheduler-field input:focus,
.scheduler-field select:focus {
    border-color: #4c92d0;
    box-shadow: 0 0 0 3px rgba(72, 142, 205, 0.12);
}

.scheduler-field small,
.scheduler-toggle small {
    color: #8499ae;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
}

.scheduler-toggle-row {
    align-items: stretch;
    gap: 8px;
}

.scheduler-toggle {
    align-items: flex-start;
    border: 1px solid #e1eaf4;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex: 1 1 150px;
    gap: 9px;
    min-width: 0;
    padding: 8px;
}

.scheduler-toggle input {
    accent-color: #2576be;
    height: 15px;
    margin-top: 1px;
    width: 15px;
}

.scheduler-toggle span {
    display: grid;
    gap: 3px;
}

.scheduler-toggle strong {
    color: #476580;
    font-size: 12px;
}

.scheduler-preview-panel {
    border-top: 1px solid #e6edf5;
    padding: 24px 28px 27px;
}

.scheduler-preview-heading {
    margin-bottom: 16px;
}

.scheduler-preview-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.scheduler-preview-metrics article {
    background: #f8fbff;
    border: 1px solid #e3edf7;
    border-radius: 9px;
    display: grid;
    gap: 7px;
    padding: 13px 15px;
}

.scheduler-preview-metrics span {
    color: #7c92a9;
    font-size: 12px;
}

.scheduler-preview-metrics strong {
    color: #27517d;
    font-size: 19px;
    line-height: 1.1;
}

.scheduler-preview-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.scheduler-safety-list h5 {
    color: #627d99;
    font-size: 12px;
    margin: 11px 0 5px;
}

.scheduler-safety-list ul {
    color: #6e8196;
    font-size: 12px;
    line-height: 1.6;
    padding-left: 18px;
}

.scheduler-safety-result {
    border-radius: 7px;
    font-size: 12px;
    font-weight: 650;
    margin-top: 9px;
    padding: 9px 10px;
}

.scheduler-safety-result.passed {
    background: #edf9f1;
    color: #287d52;
}

.scheduler-safety-result.failed {
    background: #fcf1f3;
    color: #9a485f;
}

.scheduler-preview-table {
    border: 1px solid #e3ebf4;
    border-collapse: separate;
    border-radius: 8px;
    border-spacing: 0;
    margin-top: 9px;
    overflow: hidden;
    width: 100%;
}

.scheduler-preview-table th,
.scheduler-preview-table td {
    border-bottom: 1px solid #edf2f6;
    color: #55718e;
    font-size: 12px;
    padding: 9px 10px;
    text-align: left;
}

.scheduler-preview-table th {
    background: #f8fbfe;
    color: #6a839e;
    font-weight: 650;
}

.scheduler-preview-table tr:last-child td {
    border-bottom: 0;
}

.scheduler-table-empty,
.scheduler-empty {
    color: #7890aa;
    font-size: 13px;
    line-height: 1.6;
    padding: 18px 7px;
}

.scheduler-error {
    color: #a05b68;
}

.scheduler-empty .scheduler-button {
    margin-top: 10px;
}

.scheduler-legacy {
    margin-top: 20px;
    padding: 21px 24px;
}

.scheduler-legacy-heading {
    align-items: center;
}

.scheduler-legacy .filters {
    border: 1px solid #edf1f6;
    box-shadow: none;
    margin-top: 18px;
}

.scheduler-legacy .table-container {
    border: 1px solid #e3ebf4;
    box-shadow: none;
}

.read-only-banner {
    align-items: flex-start;
    background: #fff8e6;
    border-bottom: 1px solid #f1dfb2;
    border-top: 1px solid #f6e7bd;
    color: #785c15;
    display: flex;
    gap: 10px;
    line-height: 1.5;
    padding: 10px 24px;
}

.read-only-banner strong {
    color: #6d4f08;
    flex: 0 0 auto;
}

.read-only-cell {
    color: #7b8fa5;
    display: inline-block;
    font-size: 12px;
    line-height: 1.5;
}

.preview-readonly-disabled,
.preview-readonly-disabled:hover {
    cursor: not-allowed !important;
    filter: grayscale(0.4);
    opacity: 0.46;
}

.preview-readonly-field {
    background: #f6f8fb !important;
    color: #5d7186 !important;
    cursor: not-allowed;
}

@media (max-width: 1120px) {
    .shutdown-layout {
        grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1.6fr);
    }

    .shutdown-inspector {
        border-left: 0;
        border-top: 1px solid #e0e8f1;
        grid-column: 1 / -1;
    }

    #shutdown-inspector {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .shutdown-inspector-heading,
    .shutdown-safety-note {
        grid-column: 1 / -1;
    }

    .scheduler-workbench {
        grid-template-columns: minmax(250px, 0.38fr) minmax(0, 0.62fr);
    }

    .scheduler-card-grid,
    .scheduler-preview-grid,
    .automation-scope-grid {
        grid-template-columns: 1fr;
    }

    .scheduler-card:nth-last-child(1):nth-child(odd) {
        grid-column: auto;
    }
}

@media (max-width: 840px) {
    .scheduler-page {
        padding: 16px;
    }

    .scheduler-hero,
    .scheduler-workbench {
        display: block;
    }

    .shutdown-hero,
    .shutdown-layout {
        display: block;
    }

    .shutdown-hero-actions {
        justify-content: flex-start;
        margin-top: 16px;
    }

    .shutdown-navigation,
    .shutdown-inspector {
        border: 0;
        border-bottom: 1px solid #e0e8f1;
    }

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

    #shutdown-inspector {
        display: block;
    }

    .scheduler-hero-actions {
        margin-top: 17px;
    }

    .scheduler-list-panel {
        border-bottom: 1px solid #e6edf5;
        border-right: 0;
    }

    .scheduler-list {
        max-height: 340px;
    }

    .scheduler-preview-metrics,
    .scheduler-form-grid,
    .scheduler-scope-card .scheduler-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .container {
        display: block;
    }

    .shutdown-scenes,
    .shutdown-form-grid {
        grid-template-columns: 1fr;
    }

    .shutdown-hero,
    .shutdown-editor,
    .shutdown-inspector,
    .shutdown-navigation {
        padding-left: 15px;
        padding-right: 15px;
    }

    .sidebar {
        display: block;
        width: 100%;
    }

    .logo {
        display: none;
    }

    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 0;
        scrollbar-width: thin;
    }

    .nav-section {
        display: contents;
    }

    .nav-section-title {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
        justify-content: center;
        padding: 10px 13px;
        border-radius: 0;
    }

    .nav-item.active {
        border-bottom: 3px solid #3498db;
        border-left: 0;
        box-shadow: none;
    }

    .nav-item .icon {
        flex-basis: auto;
    }

    .nav-text,
    .nav-item span:not(.icon) {
        display: none;
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        min-width: 78px;
    }

    .sidebar .nav-menu .nav-item span.nav-text,
    .sidebar .nav-menu .nav-item span.nav-label {
        display: block;
    }

    .nav-item .nav-label {
        font-size: 10px;
        line-height: 1.2;
        max-width: 76px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-item .nav-desc {
        display: none;
    }

    .header {
        gap: 10px;
        padding: 14px 16px;
    }

    .header h1 {
        font-size: 20px;
    }

    .btn-refresh {
        padding: 8px 10px;
    }

    .scheduler-hero,
    .scheduler-editor-panel,
    .scheduler-preview-panel,
    .scheduler-legacy {
        padding-left: 16px;
        padding-right: 16px;
    }

    .scheduler-preview-metrics,
    .scheduler-form-grid,
    .scheduler-scope-card .scheduler-form-grid {
        grid-template-columns: 1fr;
    }

    .scheduler-editor-heading,
    .scheduler-preview-heading,
    .scheduler-legacy-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
