/* ===================================================================
   Premium Utilitarian Minimalism — 精致极简 (Notion / Linear 风)
   暖白单色画布 · 编辑感衬线标题 · 细线分隔 · 大留白 · muted pastel 点缀
   炭黑实心 CTA · pill 状态标签 · 极淡阴影 · 克制微动效
   改主题只动 :root。
   =================================================================== */

:root {
    /* ----- 画布 / 表面(暖骨白单色) ----- */
    --bg: #f7f6f3;
    --surface: #ffffff;
    --surface-2: #f9f9f8;
    --surface-hover: #f3f2ef;

    /* ----- 文本(炭黑,绝不纯黑;暖灰阶) ----- */
    --text: #2f3437;
    --text-2: #6b6a66;
    --text-3: #9b9a95;
    --text-faint: #b8b7b2;

    /* ----- 边框 / 分隔(极淡暖灰) ----- */
    --border: #eaeaea;
    --border-light: #efeeeb;
    --border-faint: #f0efec;

    /* ----- 主强调 = 炭黑实心 CTA(单色克制) ----- */
    --accent: #1f1e1c;
    --accent-hover: #3a3a37;
    --accent-link: #2f3437;
    --accent-ring: rgba(31,30,28,0.12);

    /* ----- muted pastel 点缀(仅用于语义/标签) ----- */
    --accent-bg: #e1f3fe;          /* pale blue */
    --accent-ink: #1f6c9f;
    --success: #346538;
    --success-bg: #edf3ec;          /* pale green */
    --success-tint: #f4f8f3;
    --danger: #9f2f2d;
    --danger-hover: #b23b38;
    --danger-bg: #fdebec;           /* pale red */
    --danger-ink: #9f2f2d;
    --warning-ink: #956400;
    --warning-bg: #fbf3db;          /* pale yellow */

    /* ----- 圆角(crisp;标签用 pill) ----- */
    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 9999px;

    /* ----- 阴影(几乎不可见,< 0.05 透明度) ----- */
    --shadow-1: 0 1px 2px rgba(0,0,0,0.03);
    --shadow-2: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-pop: 0 12px 40px rgba(0,0,0,0.10);

    /* ----- 间距 ----- */
    --space-page: 32px;
    --app-chrome-h: 101px;          /* nav(53) + tab-bar(~48) */

    /* ----- 字体 ----- */
    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC',
        'Helvetica Neue', system-ui, 'Microsoft YaHei', sans-serif;
    --font-serif: 'Newsreader', 'Songti SC', 'STSongti-SC-Regular', 'Songti TC',
        Georgia, 'Times New Roman', serif;
    --font-mono: 'SF Mono', ui-monospace, 'Geist Mono', 'JetBrains Mono', Menlo, monospace;

    /* ----- z-index scale ----- */
    --z-editor: 1;
    --z-nav: 100;
    --z-modal: 1000;
    --z-modal-content: 1001;
    --z-popup: 1100;
    --z-overlay: 1200;
    --z-toast: 1300;
}

/* ===== Reset & Global ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

/* 编辑感衬线:用于品牌名与各级标题 */
.nav-title,
.login-box h1,
.modal-content h3,
.settings-panel h2,
.template-editor-header h2,
.empty-state-title,
.confirm-title {
    font-family: var(--font-serif);
    letter-spacing: -0.02em;
    font-weight: 600;
}

/* 数字密集处用等宽对齐 */
table,
.item-order,
.detail-grid,
.items-count,
pre,
.detail-message {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}

::selection {
    background: var(--accent-ring);
}

a {
    color: var(--accent-link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
a:hover {
    color: var(--text);
    border-bottom-color: var(--text-3);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ===== 微动效 ===== */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    background: var(--bg);
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 56px 48px;
    width: 420px;
    box-shadow: var(--shadow-1);
    text-align: center;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-box h1 {
    font-size: 30px;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.12;
}

.login-box .version {
    color: var(--text-3);
    font-size: 13px;
    margin-bottom: 36px;
    font-weight: 400;
    font-family: var(--font-mono);
}

.login-form input {
    display: block;
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.login-form button {
    width: 100%;
    padding: 11px 16px;
    margin-top: 4px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.08s;
}

.login-form button:hover { background: var(--accent-hover); }
.login-form button:active { transform: scale(0.985); }
.login-form button:disabled { opacity: 0.45; cursor: not-allowed; }

.error-msg {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
}

/* ===== Top Navigation ===== */
.top-nav {
    background: rgba(247,246,243,0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    padding: 0 var(--space-page);
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
}

.nav-left { display: flex; align-items: center; }

.nav-title {
    font-size: 16px;
    color: var(--text);
}

.nav-right { display: flex; align-items: center; gap: 14px; }

.username {
    color: var(--text-3);
    font-size: 13px;
    font-family: var(--font-mono);
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--text-3);
    color: var(--text);
    background: var(--surface-hover);
}

/* ===== Tab Bar — 下划线指示 ===== */
/* ===== 侧栏导航项(复用 .tab-btn + switchTab 机制) ===== */
.tab-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: none;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    text-align: left;
    position: relative;
}

.tab-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: var(--accent);
    border-radius: var(--radius-pill);
    transition: height 0.2s;
}

.tab-btn:hover { background: var(--surface-hover); color: var(--text); }
.tab-btn.active { background: var(--surface-hover); color: var(--text); font-weight: 600; }
.tab-btn.active::before { height: 16px; }

/* ===== Content Area ===== */
.content {
    padding: 32px 40px;
}

.tab-content { display: none; }
.tab-content.active {
    display: block;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
button {
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

/* 主 CTA = 炭黑实心 */
.btn-primary,
.btn-success {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s, transform 0.08s;
}

.btn-primary:hover,
.btn-success:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active,
.btn-success:active { transform: scale(0.98); }
.btn-primary:disabled,
.btn-success:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s, transform 0.08s;
}

.btn-secondary:hover { background: var(--surface-hover); border-color: var(--text-faint); }
.btn-secondary:active { transform: scale(0.98); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s, transform 0.08s;
}

.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-danger:active { transform: scale(0.98); }

.btn-sm {
    background: var(--surface);
    color: var(--text-2);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin: 0 2px;
    transition: all 0.2s;
}

.btn-sm:hover { border-color: var(--text-faint); color: var(--text); background: var(--surface-hover); }

/* ===== Tables — 细线 + 大留白 ===== */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}
.table-container[style*="overflow"],
.table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead { background: var(--surface); }

th {
    padding: 14px 22px;
    text-align: left;
    font-weight: 500;
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 15px 22px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.4;
}

/* 名称列(首列)更醒目 */
tbody td:first-child { color: var(--text); font-weight: 500; }

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

.row-deleted, .row-archived { opacity: 0.4; }

/* ===== Badges — pill + muted pastel ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: var(--border-faint);
    color: var(--text-2);
}

.badge--blue  { background: var(--accent-bg);  color: var(--accent-ink); }
.badge--green { background: var(--success-bg); color: var(--success); }
.badge--amber { background: var(--warning-bg); color: var(--warning-ink); }
.badge--gray  { background: var(--border-faint); color: var(--text-2); }
.badge--purple { background: rgba(139,92,246,0.14); color: #7c3aed; }

/* ===== Tags — pill,描边 ===== */
.tag {
    display: inline-block;
    padding: 2px 9px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 11px;
    margin: 1px 2px;
    color: var(--text-2);
    font-weight: 400;
}

/* ===== Status Badges — pill + 圆点 ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.status-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: var(--radius-pill);
    background: currentColor;
    opacity: 0.8;
}

.status-active    { background: var(--success-bg); color: var(--success); }
.status-deleted, .status-archived { background: var(--danger-bg);  color: var(--danger-ink); }
.status-pending   { background: var(--warning-bg); color: var(--warning-ink); }
.status-running   { background: var(--accent-bg);  color: var(--accent-ink); }
.status-completed { background: var(--success-bg); color: var(--success); }
.status-failed    { background: var(--danger-bg);  color: var(--danger-ink); }

/* ===== Form Controls ===== */
select,
input[type="text"],
input[type="password"],
input[type="number"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Ensure select options are readable in dark theme */
select option {
    background: var(--surface);
    color: var(--text);
    padding: 6px 10px;
}

/* Custom dropdown arrow for selects with -webkit-appearance:none */
.mp-select-wrap {
    position: relative;
    width: 100%;
}
.mp-select-wrap select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 36px;
}
.mp-select-wrap::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-30%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-2);
    pointer-events: none;
}

textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    resize: vertical;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ===== Modal ===== */
.modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31,30,28,0.28);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    width: 480px;
    max-width: 92vw;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: var(--shadow-pop);
    z-index: var(--z-modal-content);
    animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-large { width: 760px; }

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text);
    line-height: 1.15;
}

.modal-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-top: 18px;
}

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



/* ===== Split Button ===== */
.split-btn {
    display: inline-flex;
    position: relative;
    vertical-align: middle;
}
.split-btn-main {
    border-radius: var(--radius) 0 0 var(--radius) !important;
    margin: 0 !important;
}
.split-btn-caret {
    border-radius: 0 var(--radius) var(--radius) 0 !important;
    padding: 0 8px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    min-width: 28px;
    border-left: 1px solid rgba(255,255,255,0.25) !important;
}
.split-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    z-index: var(--z-dropdown, 900);
    overflow: hidden;
}
.split-dropdown-item {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-1);
}
.split-dropdown-item:last-child {
    border-bottom: none;
}
.split-dropdown-item:hover {
    background: var(--surface-hover);
}
.split-dropdown-sub {
    color: var(--text-3);
    font-size: 11px;
}

/* ===== Form Group ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select { width: 100%; }

/* ===== Checkbox List ===== */
.checkbox-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    background: var(--surface-2);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-2);
    transition: background 0.15s;
}

.checkbox-item:hover { background: var(--surface-hover); }

/* ===== Settings Panel ===== */
.settings-panel {
    max-width: 640px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 36px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.settings-panel h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text);
    line-height: 1.15;
}

.settings-panel hr,
.settings-section-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 32px 0;
}

.settings-hint {
    color: var(--text-3);
    font-size: 13px;
    margin: 0 0 18px;
    line-height: 1.6;
}

.settings-hint code {
    color: var(--accent);
    font-size: 12px;
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Menlo', monospace;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    color: var(--text-2);
}
.checkbox-line input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}
.field-stack { display: flex; flex-direction: column; gap: 12px; }
.field-stack > label:first-child { font-weight: 600; color: var(--text); }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.input-full { width: 100%; font-size: 13px; }

.info-box {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-2);
}

.info-box ul { padding-left: 18px; margin-top: 8px; }
.info-box li { color: var(--text-3); margin: 2px 0; }

.info-msg { font-size: 13px; margin-top: 8px; }
.success-msg { color: var(--success); }

/* ===== Detail Grid ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 13px;
    color: var(--text-2);
}

.detail-grid strong { color: var(--text); font-weight: 500; }

.detail-section-label { margin-top: 14px; color: var(--text); }
.detail-message {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    margin-top: 6px;
}

/* ===== Toast — 深色,克制 ===== */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    z-index: var(--z-toast);
    box-shadow: var(--shadow-pop);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-error {
    white-space: normal;
    max-width: 520px;
    text-overflow: initial;
}

.toast-close {
    margin-left: 12px;
    cursor: pointer;
    opacity: 0.7;
    font-size: 15px;
    line-height: 1;
    vertical-align: middle;
}
.toast-close:hover { opacity: 1; }

.toast-info,
.toast-success { background: var(--accent); color: #fff; }
.toast-error   { background: var(--danger); color: #fff; }

@keyframes toastIn {
    from { transform: translate(-50%, -64px); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
}

/* ===== Pre (task detail) ===== */
pre {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    white-space: pre-wrap;
    font-size: 13px;
    color: var(--text-2);
    font-family: var(--font-mono);
    line-height: 1.6;
}

/* ===== Empty State — 编辑感标题 + 大留白 ===== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-3);
}
.empty-state-title {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.2;
}
.empty-state-desc {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 20px;
    line-height: 1.6;
}
.empty-state-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
td.empty-cell { padding: 0; }
td.empty-cell:hover,
tbody tr:hover td.empty-cell { background: transparent; }

/* ===== Skeleton Loading ===== */
.skeleton-bar {
    display: inline-block;
    height: 12px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg,
        rgba(0,0,0,0.04) 25%,
        rgba(0,0,0,0.07) 37%,
        rgba(0,0,0,0.04) 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.3s ease-in-out infinite;
    width: 70%;
    vertical-align: middle;
}
@keyframes skeletonShimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ===== Image Preview Overlay ===== */
.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31,30,28,0.72);
    z-index: var(--z-overlay);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.image-preview-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

/* ===== Confirm Dialog ===== */
.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
}
.confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(31,30,28,0.28);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.confirm-box {
    position: relative;
    margin: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 360px;
    max-width: 90vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    padding: 28px;
    text-align: center;
    animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.confirm-title {
    font-size: 17px;
    margin: 0 0 8px;
    color: var(--text);
}
.confirm-desc {
    font-size: 13px;
    color: var(--text-3);
    margin: 0 0 22px;
    word-break: break-all;
    line-height: 1.6;
}
.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.confirm-actions button { min-width: 76px; }
.confirm-box input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    background: var(--surface-2);
    color: var(--text);
    transition: border-color 0.2s;
}
.confirm-box input[type="text"]:focus {
    border-color: var(--accent);
}

/* ===== Template Editor — 列表区域内切换视图 ===== */
.template-editor-view {
    display: block;
}
.template-editor-inner {
    /* 无宽度限制，跟随 .content padding */
}
.template-editor-header {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
}
.template-editor-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--text);
}
.template-editor-header .spacer { flex: 1; }
.template-editor-header .btn-secondary { margin-right: 16px; }

/* ===== App Shell — 侧栏 + 主区 ===== */
.app-shell { display: flex; min-height: 100dvh; }
.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 20px 14px;
}
.sidebar-brand {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    padding: 6px 12px 18px;
    line-height: 1.2;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    padding: 4px 12px;
}
.sidebar-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 14px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sidebar-footer .username {
    font-size: 13px;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
}
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ===== Overview / 概览 ===== */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-2); }
.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-3);
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}
.stat-card .stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.02em;
}
.stat-card .stat-sub { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.overview-section { margin-bottom: 32px; }
.overview-section-title {
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ops-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 8px;
}
.ops-hero h2 {
    font-family: var(--font-serif);
    font-size: 28px;
    line-height: 1.15;
    margin: 2px 0 0;
}
.ops-kicker {
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
}
.ops-date {
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 13px;
}
.ops-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 18px;
}
.ops-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-1);
}
.ops-filter-panel {
    margin-bottom: 18px;
    padding: 14px 18px;
}
.ops-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
}
.ops-filter-title {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 7px;
    white-space: nowrap;
}
.ops-filter-controls {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}
.ops-filter-field {
    display: flex;
    flex: 1 1 128px;
    flex-direction: column;
    gap: 4px;
    max-width: 180px;
    min-width: 118px;
}
.ops-filter-field span {
    color: var(--text-3);
    font-size: 12px;
}
.ops-filter-field select {
    min-height: 34px;
    width: 100%;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 13px;
}
.ops-filter-reset {
    flex: 0 0 auto;
    min-height: 34px;
    white-space: nowrap;
}
.ops-section-subtitle {
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.5;
    margin: -8px 0 14px;
}
.ops-funnel {
    display: grid;
    gap: 8px;
}
.ops-funnel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.ops-funnel-row:last-child { border-bottom: none; }
.ops-funnel-row span {
    color: var(--text-2);
}
.ops-funnel-row strong {
    font-family: var(--font-mono);
    font-size: 18px;
}
.ops-quality-list {
    display: grid;
    gap: 10px;
}
.ops-quality-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 116px;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.ops-quality-row:last-child {
    border-bottom: none;
}
.ops-quality-main {
    min-width: 0;
}
.ops-quality-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.ops-quality-title strong {
    overflow: hidden;
    color: var(--text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ops-quality-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 12px;
}
.ops-quality-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text-3);
    font-size: 12px;
}
.ops-quality-metrics span {
    white-space: nowrap;
}
.ops-quality-rate {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.ops-quality-rate strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.ops-quality-bar {
    width: 100%;
    height: 6px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--border-faint);
}
.ops-quality-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--success);
}
.ops-quality-detail {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}
.ops-quality-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.ops-quality-detail-head strong {
    color: var(--text);
    font-weight: 600;
}
.ops-quality-detail-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.ops-quality-detail-metrics span {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    padding: 3px 9px;
    color: var(--text-2);
    background: var(--surface-2);
    font-size: 12px;
}
.ops-quality-stages {
    display: grid;
    gap: 10px;
}
.ops-quality-stage {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: var(--surface-2);
}
.ops-quality-stage-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.ops-quality-stage-title strong {
    color: var(--text);
    font-size: 13px;
}
.ops-quality-stage-title span {
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 12px;
}
.ops-quality-users {
    display: grid;
    gap: 6px;
}
.ops-quality-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-2);
    font-size: 12px;
}
.ops-quality-user span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ops-quality-user em {
    flex: 0 0 auto;
    color: var(--text-3);
    font-style: normal;
    font-family: var(--font-mono);
}
.ops-list {
    display: grid;
    gap: 10px;
}
.ops-exception-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-2);
    font-size: 13px;
}
.ops-exception-head strong {
    color: var(--text);
    font-weight: 600;
}
.ops-exception-head span {
    color: var(--text-3);
    font-family: var(--font-mono);
}
.ops-history-head {
    align-items: flex-end;
}
.ops-history-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ops-history-tools select {
    min-height: 30px;
    padding: 4px 28px 4px 8px;
    font-size: 12px;
}
.ops-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--surface-2);
}
.ops-exception-body {
    min-width: 0;
}
.ops-list-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-weight: 600;
    color: var(--text);
}
.ops-list-desc,
.ops-list-meta {
    color: var(--text-3);
    font-size: 12px;
}
.ops-failure-reason {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    color: var(--text-2);
    font-size: 12px;
}
.ops-failure-reason strong {
    color: var(--danger);
    font-weight: 600;
}
.ops-failure-reason span {
    color: var(--text-3);
}
.ops-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}
.ops-state-pill {
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.ops-state-processing {
    color: var(--warning-ink);
    background: var(--warning-bg);
}
.ops-sla-pill {
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    border: 1px solid rgba(149, 100, 0, 0.22);
    background: var(--warning-bg);
    color: var(--warning-ink);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.ops-sla-over_24h {
    border-color: rgba(159, 47, 45, 0.28);
    background: var(--danger-bg);
    color: var(--danger);
}
.ops-exception-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.ops-exception-actions .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}
.ops-severity-critical,
.ops-severity-high {
    border-color: rgba(159, 47, 45, 0.25);
    background: var(--danger-bg);
}
.ops-severity-medium {
    border-color: rgba(149, 100, 0, 0.25);
    background: var(--warning-bg);
}
.ops-severity-ok {
    border-color: rgba(52, 101, 56, 0.2);
    background: var(--success-bg);
}
.ops-pill {
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
    white-space: nowrap;
}
.ops-health-grid {
    display: grid;
    gap: 10px;
}
.ops-health-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.ops-health-card div div {
    color: var(--text-3);
    font-size: 12px;
}
.ops-loading {
    color: var(--text-3);
    font-size: 13px;
    padding: 12px 0;
}
.channel-readiness-panel {
    margin-bottom: 14px;
}
.channel-readiness {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 14px;
}
.channel-readiness-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.channel-readiness-row:last-child { border-bottom: none; }
.channel-readiness-row div div {
    color: var(--text-3);
    font-size: 12px;
}
.channel-readiness-row span {
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: 12px;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--text-2);
}
.channel-readiness-row.readiness-fail span {
    background: var(--danger-bg);
    color: var(--danger-ink);
}
.channel-readiness-row.readiness-warn span {
    background: var(--warning-bg);
    color: var(--warning-ink);
}
.channel-readiness-row.readiness-pass span {
    background: var(--success-bg);
    color: var(--success);
}
.delivery-timeline {
    margin-top: 16px;
}
.delivery-timeline-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    padding: 10px 0;
}
.delivery-timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 7px;
    background: var(--text-faint);
}
.delivery-timeline-item.timeline-success .delivery-timeline-dot {
    background: var(--success);
}
.delivery-timeline-item.timeline-failed .delivery-timeline-dot {
    background: var(--danger);
}
.delivery-timeline-item.timeline-warning .delivery-timeline-dot {
    background: var(--warning-ink);
}
.delivery-timeline-body {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}
.delivery-timeline-title {
    font-weight: 600;
    color: var(--text);
}
.delivery-timeline-desc,
.delivery-timeline-time {
    color: var(--text-3);
    font-size: 12px;
}

/* ===== Segment 控件 ===== */
.seg-control {
    display: inline-flex;
    padding: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    gap: 2px;
    margin-bottom: 20px;
}
.seg-btn {
    padding: 6px 18px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.18s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ===== 课程交付工作台 · Zone 信息架构重构 ===== */
.ops-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ops-health-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ops-health-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: var(--radius-pill);
    font-size: 12px; font-weight: 500; line-height: 1.4;
    border: 1px solid var(--border); background: var(--surface);
}
.ops-health-badge .status-icon { width: 7px; height: 7px; }
.ops-health-badge-ok { color: #1f8a4d; background: #eefaf2; border-color: #d6f0e0; }
.ops-health-badge-err { color: var(--danger-ink); background: var(--danger-bg); border-color: #f5d6d4; }
.ops-health-badge-pending { color: var(--text-2); background: var(--surface-2); }

/* Zone 分区锚点 */
.ops-zone { margin-bottom: 30px; }
.ops-zone-header {
    display: flex; align-items: baseline; gap: 10px;
    margin-bottom: 14px; padding-left: 2px;
}
.ops-zone-num {
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    color: var(--text-3); letter-spacing: 0.04em;
}
.ops-zone-title { font-family: var(--font-serif); font-size: 16px; color: var(--text); letter-spacing: -0.01em; }
.ops-zone-hint { font-size: 12px; color: var(--text-3); }

/* Zone 2 两栏：漏斗 + 今日待办 */
.ops-zone-body-2col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
.ops-panel-focus { box-shadow: var(--shadow-2); }
.ops-zone-today .overview-grid { margin-bottom: 18px; }

/* 可点击统计卡（钻取到异常中心） */
.stat-card-clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.stat-card-clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: var(--border); }

/* Zone 3 异常处理中心 */
.ops-exception-center { padding: 0; overflow: hidden; }
.ops-exception-tabs { margin: 0 0 0 0; padding: 10px 14px 0; width: 100%; display: flex; gap: 4px; border-bottom: 1px solid var(--border-light); border-radius: 0; background: transparent; }
.ops-exception-tabs .seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.ops-tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--radius-pill); font-size: 11px; font-weight: 600;
    background: var(--danger-bg); color: var(--danger-ink);
}
.ops-exception-tabs .seg-btn.active .ops-tab-badge { background: var(--danger); color: #fff; }
.ops-extab-filters { padding: 12px 14px 0; border-bottom: 1px solid var(--border-light); }
[data-extab-pane] { padding: 16px 18px; }
.ops-extab-filters .ops-filter-bar { margin: 0; }
.ops-extab-filters .ops-filter-title { display: none; }

/* 今日待办清单 */
.ops-todo-list { display: flex; flex-direction: column; gap: 6px; }
.ops-todo-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 11px; border-radius: var(--radius-sm);
    background: var(--surface-2); border-left: 3px solid var(--border);
}
.ops-todo-row.ops-severity-critical { border-left-color: var(--danger); }
.ops-todo-row.ops-severity-high { border-left-color: #e08a3c; }
.ops-todo-row.ops-severity-medium { border-left-color: var(--warning-ink); }
.ops-todo-title { font-size: 13px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-todo-more {
    margin-top: 10px; width: 100%; padding: 8px;
    background: none; border: 1px dashed var(--border); border-radius: var(--radius-sm);
    color: var(--text-2); font-size: 12px; cursor: pointer; font-family: inherit;
}
.ops-todo-more:hover { color: var(--text); border-color: var(--border); background: var(--surface-hover); }

@media (max-width: 880px) {
    .ops-zone-body-2col { grid-template-columns: 1fr; }
    .ops-health-badges { justify-content: flex-start; }
    .ops-hero-right { align-items: flex-start; }
}


/* ===== 任务弹窗两栏 ===== */
.task-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.task-form-2col .form-col { min-width: 0; }

/* ===== Responsive ===== */
@media (max-width: 880px) {
    .app-shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        z-index: var(--z-nav);
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-brand { padding: 0 8px 0 4px; font-size: 15px; white-space: nowrap; }
    .sidebar-nav { flex: 1; flex-direction: row; align-items: center; gap: 2px; overflow-x: auto; }
    .nav-group { flex-direction: row; gap: 2px; }
    .nav-group + .nav-group { margin-top: 0; margin-left: 8px; }
    .nav-group-label { display: none; }
    .tab-btn { width: auto; }
    .tab-btn.active::before { display: none; }
    .sidebar-footer { border-top: none; padding-top: 0; margin-top: 0; margin-left: auto; }
    .sidebar-footer .username { display: none; }
    .ops-layout { grid-template-columns: 1fr; }
    .ops-filter-bar { align-items: stretch; flex-direction: column; }
    .ops-filter-title { margin-bottom: 0; }
    .ops-filter-field { max-width: none; }
    .ops-filter-reset { align-self: flex-start; }
    .ops-hero { align-items: flex-start; flex-direction: column; }
    .ops-quality-row { grid-template-columns: 1fr; align-items: stretch; }
    .ops-quality-rate { width: 100%; }
}
@media (max-width: 768px) {
    .toolbar { flex-direction: column; align-items: flex-start; }
    .content { padding: 20px 16px; }
    .modal-content { width: 95vw; padding: 24px; }
    .modal-large { width: 95vw; }
    .task-form-2col { grid-template-columns: 1fr; gap: 16px; }
    .detail-grid { grid-template-columns: 1fr; }
    .login-box { width: 92vw; padding: 40px 28px; }
    .overview-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    th, td { padding: 12px 14px; }
}

/* ===== Join Way Cards ===== */
.join-way-card { background: white; border: 1px solid var(--border); border-radius: 5px; padding: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 16px; }
.join-way-info { flex: 1; min-width: 0; }
.join-way-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.join-way-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.join-way-badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; background: #f0f0f0; color: var(--text-2); }
.join-way-badge.accent { background: var(--accent-bg, #e1f3fe); color: var(--accent-ink, #1f6c9f); }
.join-way-qr { width: 80px; height: 80px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.join-way-qr img { width: 100%; height: 100%; object-fit: cover; }
.join-way-qr .placeholder { font-size: 11px; color: var(--text-3); }
.join-way-actions { display: flex; gap: 6px; flex-shrink: 0; }
.group-select-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; padding: 8px; }
.group-select-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }

/* ADB diagnostics card */
.ops-health-card-wide { grid-column: 1 / -1; }
.ops-health-card-body { flex: 1; min-width: 0; }
.ops-diag-summary { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.ops-diag-stats { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.ops-diag-issues { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ops-diag-issue { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 12px; }
.ops-diag-issue-critical { background: rgba(220,53,69,0.08); border-left: 3px solid var(--danger); }
.ops-diag-issue-high { background: rgba(255,159,28,0.08); border-left: 3px solid #ff9f1c; }
.ops-diag-issue-medium { background: rgba(255,193,7,0.08); border-left: 3px solid #ffc107; }
.ops-diag-issue span { color: var(--text-3); }
.ops-diag-breakdown { margin-top: 6px; }
.ops-diag-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 2px 0; }
.ops-diag-cat { font-weight: 600; }
.ops-diag-hint { color: var(--text-3); text-align: right; }

/* Operations report */
.ops-report-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ops-report-controls input[type="date"] { padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; color: var(--text); background: var(--surface); }
.ops-report-range { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.ops-report-funnel { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.ops-report-funnel-item { display: flex; flex-direction: column; gap: 2px; }
.ops-report-funnel-item span { font-size: 12px; color: var(--text-3); }
.ops-report-funnel-item strong { font-size: 18px; }
.ops-report-rates { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-bottom: 14px; }
.ops-report-section-title { font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.ops-report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ops-report-table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text-3); font-weight: 500; font-size: 12px; }
.ops-report-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-light); }
.ops-report-exceptions { font-size: 13px; color: var(--text-2); }
.ops-report-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ops-report-tag { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border-light); font-size: 12px; }

/* Critical alert banner */
.ops-critical-alert { border: 1px solid var(--danger); border-left: 4px solid var(--danger); background: rgba(220,53,69,0.06); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 14px; }
.ops-critical-alert-header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.ops-critical-alert-header strong { font-size: 15px; color: var(--danger); }
.ops-critical-alert-header span { font-size: 12px; color: var(--text-3); }
.ops-critical-alert-row { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 4px; }
.ops-critical-alert-title { font-size: 13px; font-weight: 600; }
.ops-critical-alert-desc { font-size: 12px; color: var(--text-3); }

.ops-critical-alert-cta {
    display: block; width: 100%; margin-top: 10px; padding: 9px;
    background: var(--danger); color: #fff; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.ops-critical-alert-cta:hover { background: var(--danger-hover); }
