@font-face {
    font-family: "Noto Sans SC";
    src: url("../fonts/NotoSansSC-EasyPrinter.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

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

:root {
    --primary: #1890FF;
    --primary-dark: #096DD9;
    --primary-light: #E6F7FF;
    --success: #52C41A;
    --warning: #FAAD14;
    --error: #FF4D4F;
    --bg: #F0F2F5;
    --card-bg: #FFFFFF;
    --text: #1F1F1F;
    --text-secondary: #8C8C8C;
    --border: #E8E8E8;
    --sidebar-bg: #001529;
    --sidebar-text: #FFFFFFB3;
    --sidebar-active: #1890FF;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
    /* Apple platforms resolve the system faces first; Windows and offline
       deployments use the bundled OFL-licensed Noto Sans SC subset. */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Noto Sans SC", "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

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

.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-logo {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-logo .logo-text {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
}

.sidebar-logo .logo-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-group-title {
    padding: 12px 12px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.35);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ep-theme-switcher { position: relative; }
.ep-theme-trigger { display: inline-flex; align-items: center; gap: 6px; }
.ep-theme-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ep-theme-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 10010; min-width: 190px; padding: 7px; background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #d0d5dd); border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.16); }
.ep-theme-menu-heading { padding: 5px 10px 3px; color: var(--text-tertiary, #98a2b3); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.ep-theme-menu button[data-theme-choice], .ep-theme-menu button[data-appearance-choice] { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text-primary, #111827); text-align: left; cursor: pointer; }
.ep-theme-menu button[data-theme-choice]:hover, .ep-theme-menu button[data-theme-choice][aria-checked="true"], .ep-theme-menu button[data-appearance-choice]:hover, .ep-theme-menu button[data-appearance-choice][aria-checked="true"] { background: var(--bg-tertiary, #f2f4f7); }
.ep-theme-menu button[data-theme-choice][aria-checked="true"]::after, .ep-theme-menu button[data-appearance-choice][aria-checked="true"]::after { content: '✓'; float: right; }
.ep-theme-status { min-height: 18px; padding: 3px 10px; color: var(--text-secondary, #667085); font-size: 11px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.online {
    background: #F6FFED;
    color: var(--success);
}

.status-badge.online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.content-area {
    padding: 24px;
    flex: 1;
}

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

.page-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.error .stat-value { color: var(--error); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #389E0D; }

.btn-danger {
    background: var(--error);
    color: #fff;
}
.btn-danger:hover { background: #CF1322; }

.btn-default {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-default:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }

.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #FAFAFA;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

tr:hover td {
    background: #F5F7FA;
}

.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.pill-success { background: #F6FFED; color: var(--success); }
.pill-warning { background: #FFFBE6; color: var(--warning); }
.pill-error { background: #FFF1F0; color: var(--error); }
.pill-info { background: #E6F7FF; color: var(--primary); }
.pill-default { background: #F5F5F5; color: var(--text-secondary); }
.pill-processing { background: #E6F7FF; color: var(--primary); }

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.flash-messages {
    margin-bottom: 16px;
}

.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash.success { background: #F6FFED; border: 1px solid #B7EB8F; color: #389E0D; }
.flash.error { background: #FFF1F0; border: 1px solid #FFA39E; color: #CF1322; }
.flash.warning { background: #FFFBE6; border: 1px solid #FFE58F; color: #D48806; }
.flash.info { background: #E6F7FF; border: 1px solid #91D5FF; color: #096DD9; }

.printer-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.printer-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.printer-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.printer-name {
    font-weight: 600;
    font-size: 15px;
}

.printer-meta {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
}

.printer-actions {
    display: flex;
    gap: 8px;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: #FAFAFA;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone .upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-zone .upload-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-zone .upload-hint {
    color: var(--text-secondary);
    font-size: 13px;
}

.file-info {
    background: #F5F7FA;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    display: none;
    align-items: center;
    gap: 12px;
}

.file-info.show { display: flex; }

.qr-container {
    text-align: center;
    padding: 32px;
}

.qr-container img {
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.qr-url {
    font-size: 14px;
    color: var(--text-secondary);
    word-break: break-all;
    margin-bottom: 16px;
    background: #F5F7FA;
    padding: 10px 16px;
    border-radius: 6px;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1890FF 0%, #001529 100%);
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 12px;
}

.login-logo h1 { font-size: 24px; }
.login-logo p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

.mobile-upload {
    max-width: 600px;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

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

.badge-default-badge {
    background: var(--primary);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .content-area { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .printer-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .printer-actions { width: 100%; flex-wrap: wrap; }
}

.copyright-footer {
    text-align: center;
    padding: 20px 0 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.copyright-footer a {
    color: var(--primary);
    text-decoration: none;
}

.device-list {
    margin-top: 12px;
}

.device-item {
    background: #F5F7FA;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.device-item.usb {
    border-left: 3px solid var(--primary);
}

.device-item.network {
    border-left: 3px solid var(--success);
}

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

.device-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.device-uri {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

.device-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    margin-left: 8px;
}

.device-badge.network {
    background: #F6FFED;
    color: var(--success);
}

.scan-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.scan-btn.scanning {
    pointer-events: none;
    opacity: 0.7;
}

.driver-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.driver-status.found {
    background: #F6FFED;
    color: var(--success);
}

.driver-status.notfound {
    background: #FFF1F0;
    color: var(--error);
}

.download-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.download-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.download-card .dl-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.download-card .dl-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.download-card .dl-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.network-print-info {
    background: #E6F7FF;
    border: 1px solid #91D5FF;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.network-print-info h4 {
    color: var(--primary);
    margin-bottom: 8px;
}

.network-print-info code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    word-break: break-all;
}

.install-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.install-status.show { display: block; }
.install-status.success { background: #F6FFED; color: var(--success); border: 1px solid #B7EB8F; }
.install-status.error { background: #FFF1F0; color: var(--error); border: 1px solid #FFA39E; }
.install-status.loading { background: #E6F7FF; color: var(--primary); border: 1px solid #91D5FF; }

/* Enterprise admin baseline: quiet surfaces, clear hierarchy, restrained motion. */
:root { --primary: #1677ff; --primary-dark: #0958d9; --primary-light: #e6f4ff; --bg: #f5f7fa; --border: #d9dfe8; --shadow: 0 1px 2px rgba(16,24,40,.04); }
body { color: #1f2937; }
.sidebar { width: 216px; background: #172033; }
.main-content { margin-left: 216px; }
.sidebar-logo { padding: 18px 16px; }
.nav-item { border-radius: 4px; }
.nav-item.active { background: #1677ff; }
.topbar { height: 54px; box-shadow: 0 1px 0 rgba(16,24,40,.03); }
.content-area { padding: 20px 24px; }
.card, .stat-card { border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); }
.card { padding: 18px; }
.card-header { margin-bottom: 14px; padding-bottom: 10px; }
.page-title { font-size: 20px; }
.btn { border-radius: 4px; box-shadow: none; }
.status-badge, .pill { border-radius: 4px; }
.modal-content { border-radius: 6px; box-shadow: 0 8px 28px rgba(16,24,40,.16); }
.supplies-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:12px; }
.supply-card { border:1px solid var(--border); border-radius:6px; padding:14px; background:#fff; }
.supply-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.supply-meta, .supply-foot { color:var(--text-secondary); font-size:12px; margin-top:4px; }
.supply-row { margin-top:12px; }
.supply-row-title { display:flex; justify-content:space-between; gap:10px; font-size:13px; margin-bottom:5px; }
.supply-row-detail { color:var(--text-secondary); font-size:12px; margin-bottom:5px; }
.supply-status.normal { color:#389e0d; }.supply-status.warning { color:#d48806; }.supply-status.critical { color:#cf1322; }.supply-status.unknown { color:var(--text-secondary); }
.supply-recommendations { margin-top:7px; font-size:12px; }.supply-recommendations a { color:var(--primary); margin-right:10px; text-decoration:none; }
.supply-track { height:7px; background:#edf0f4; border-radius:3px; overflow:hidden; }
.supply-fill { display:block; height:100%; background:var(--success); border-radius:3px; }
.supply-fill.warning { background:var(--warning); }
.supply-fill.critical { background:var(--error); }
.supply-empty { color:var(--text-secondary); font-size:13px; line-height:1.7; padding:12px 0; }

/* ============================================================
   EasyPrinter fnOS 1.6.9 unified UI
   ============================================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #16a34a;
    --warning: #d97706;
    --error: #dc2626;
    --bg: #f5f7fb;
    --bg-tertiary: #f8fafc;
    --card-bg: #ffffff;
    --text: #111827;
    --text-primary: #111827;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --border-color: #e2e8f0;
    --sidebar-bg: #172238;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #2563eb;
    --shadow: 0 1px 3px rgba(15,23,42,.05), 0 1px 2px rgba(15,23,42,.03);
    --shadow-lg: 0 16px 40px rgba(15,23,42,.12);
}
body { background:var(--bg); color:var(--text); font-size:14px; }
.sidebar { width:224px; background:var(--sidebar-bg); }
.main-content { margin-left:224px; min-width:0; }
.sidebar-logo { min-height:68px; padding:15px 16px; }
.sidebar-logo .logo-icon { width:38px; height:38px; border-radius:10px; background:linear-gradient(145deg,#3b82f6,#2563eb); }
.sidebar-logo .logo-text { font-size:16px; letter-spacing:.1px; }
.sidebar-nav { padding:8px 9px 16px; }
.nav-group-title { padding:15px 11px 6px; font-size:10px; letter-spacing:.08em; color:#72809a; }
.nav-item { min-height:40px; padding:9px 11px; border-radius:8px; color:#c7d2e3; gap:11px; margin-bottom:3px; }
.nav-item:hover { background:rgba(255,255,255,.07); }
.nav-item.active { background:#2563eb; box-shadow:0 5px 14px rgba(37,99,235,.24); }
.nav-item .nav-icon { width:22px; font-size:16px; font-weight:700; color:inherit; }
.sidebar-footer { padding:11px 16px; }
.sidebar-version { color:#708099; font-size:11px; text-align:center; }
.topbar { height:60px; padding:0 26px; border-bottom:1px solid var(--border); }
.topbar-title { font-size:16px; color:#0f172a; }
.content-area { padding:24px 28px; max-width:1680px; width:100%; margin:0 auto; }
.page-header { margin-bottom:18px; }
.page-header-row { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.page-title { font-size:22px; line-height:1.3; font-weight:700; color:#0f172a; }
.page-subtitle { margin-top:5px; color:var(--text-secondary); line-height:1.7; }
.card, .stat-card, .printer-card { border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); background:#fff; }
.card { padding:20px; margin-bottom:16px; }
.card-header { min-height:38px; margin-bottom:16px; padding-bottom:13px; }
.card-title { color:#0f172a; font-size:15px; font-weight:700; }
.btn { min-height:34px; border-radius:8px; padding:7px 14px; justify-content:center; }
.btn-sm { min-height:30px; padding:5px 10px; }
.btn-lg { min-height:44px; padding:10px 20px; }
.btn-primary { box-shadow:0 4px 10px rgba(37,99,235,.14); }
.btn-default { border-color:#d8e0ea; background:#fff; }
.form-input,.form-select,.form-textarea { min-height:38px; border-radius:8px; border-color:#d8e0ea; color:#0f172a; }
th { background:#f8fafc; color:#475569; }
th,td { border-color:#edf1f5; }
.pill { border-radius:999px; padding:3px 9px; font-weight:600; }
.pill-info { background:#eff6ff; color:#2563eb; }
.pill-success { background:#ecfdf3; color:#15803d; }
.pill-warning { background:#fff7ed; color:#c2410c; }
.pill-error { background:#fef2f2; color:#b91c1c; }
.empty-state { display:flex; align-items:center; justify-content:center; gap:16px; min-height:180px; text-align:left; padding:32px; }
.empty-state .empty-icon { margin:0; font-size:42px; }
.compact-empty { min-height:110px; justify-content:flex-start; padding:20px 4px; }
.info-banner { display:flex; align-items:flex-start; gap:12px; border:1px solid #bfdbfe; background:#eff6ff; border-radius:12px; padding:14px 16px; color:#334155; font-size:13px; line-height:1.65; }
.info-banner-icon { flex:0 0 24px; width:24px; height:24px; display:grid; place-items:center; border-radius:50%; background:#2563eb; color:#fff; font-weight:700; }
.field-hint { font-size:11px; color:var(--text-secondary); }

/* Consumables */
.supply-printer-list { display:grid; gap:16px; }
.supply-printer-panel { padding:20px; }
.supply-printer-header { display:flex; justify-content:space-between; align-items:center; gap:16px; padding-bottom:16px; border-bottom:1px solid var(--border); }
.printer-info.compact .printer-icon { width:42px; height:42px; font-size:20px; }
.supply-header-actions { display:flex; align-items:center; gap:8px; }
.supply-usage-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:16px 0; }
.mini-stat { border:1px solid var(--border); background:#f8fafc; border-radius:10px; padding:11px 13px; }
.mini-stat span { display:block; color:var(--text-secondary); font-size:11px; }
.mini-stat strong { display:block; margin-top:3px; color:#0f172a; font-size:16px; }
.supply-model-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:12px; }
.supply-model-card { width:100%; appearance:none; border:1px solid var(--border); border-radius:12px; background:#fff; padding:15px; text-align:left; color:inherit; font:inherit; cursor:pointer; transition:border-color .15s,box-shadow .15s,transform .15s; }
.supply-model-card:hover { border-color:#93c5fd; box-shadow:0 8px 22px rgba(37,99,235,.08); transform:translateY(-1px); }
.supply-model-card.selected { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.09); }
.supply-model-top { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.supply-model-code { font-size:17px; font-weight:800; color:#0f172a; }
.supply-model-name { margin-top:2px; font-size:12px; color:var(--text-secondary); line-height:1.5; }
.supply-status { white-space:nowrap; font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px; }
.supply-status.normal { background:#ecfdf3; color:#15803d; }.supply-status.warning{background:#fff7ed;color:#c2410c}.supply-status.critical{background:#fef2f2;color:#b91c1c}
.supply-level-row { margin-top:14px; display:flex; align-items:baseline; justify-content:space-between; }
.supply-level-row strong { font-size:24px; line-height:1; color:#0f172a; }.supply-level-row span { font-size:11px; color:var(--text-secondary); }
.supply-track { height:7px; background:#edf2f7; border-radius:999px; overflow:hidden; margin-top:8px; }
.supply-fill { height:100%; background:var(--success); border-radius:999px; }.supply-fill.warning{background:var(--warning)}.supply-fill.critical{background:var(--error)}
.supply-model-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:12px; font-size:11px; color:var(--text-secondary); }
.supply-model-metrics span { padding:6px 7px; border-radius:7px; background:#f8fafc; }.supply-model-metrics b { color:#334155; }
.supply-model-action { margin-top:12px; padding-top:10px; border-top:1px solid #eef2f7; font-size:12px; color:#2563eb; font-weight:700; }
.goods-panel { margin-top:16px; padding-top:16px; border-top:1px solid var(--border); }
.goods-panel-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px; }
.goods-placeholder { min-height:86px; display:flex; align-items:center; justify-content:center; padding:18px; border:1px dashed #dbe3ed; border-radius:10px; background:#f8fafc; color:var(--text-secondary); text-align:center; line-height:1.6; }
.goods-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.goods-card { min-width:0; border:1px solid var(--border); border-radius:11px; padding:12px; background:#fff; }
.goods-image { width:100%; height:140px; object-fit:contain; border-radius:8px; background:#fff; }.goods-image.placeholder{display:grid;place-items:center;background:#f8fafc;font-size:38px}
.goods-title { margin-top:9px; min-height:40px; max-height:40px; overflow:hidden; line-height:1.55; font-size:13px; }
.goods-price-row { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:7px; }.goods-price-row strong{font-size:17px;color:#dc2626}
.goods-url,.url-box { margin-top:4px; padding:7px 9px; background:#f8fafc; border:1px solid #edf1f5; border-radius:7px; color:#64748b; font-size:11px; word-break:break-all; max-height:51px; overflow:auto; }
.goods-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:9px; }
.spinner { width:15px; height:15px; border:2px solid #bfdbfe; border-top-color:#2563eb; border-radius:50%; display:inline-block; margin-right:8px; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.modal-backdrop { position:fixed; inset:0; z-index:9999; background:rgba(15,23,42,.55); align-items:center; justify-content:center; padding:18px; }
.modal-card { width:min(440px,96vw); background:#fff; border-radius:14px; padding:20px; box-shadow:var(--shadow-lg); }
.modal-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }.modal-title{font-size:18px;font-weight:800}.purchase-title{font-size:13px;line-height:1.6;margin:13px 0 8px}.purchase-qr{text-align:center}.purchase-qr img{width:230px;max-width:80vw;padding:8px;background:#fff;border:1px solid var(--border);border-radius:10px}.modal-actions{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:12px}

/* Windows-style local print page */
.local-print-body { min-height:100vh; background:#f5f7fb; }
.local-print-topbar { height:64px; background:#fff; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; padding:0 max(20px,calc((100vw - 1180px)/2)); position:sticky; top:0; z-index:20; }
.local-brand { display:flex; align-items:center; gap:10px; color:#0f172a; text-decoration:none; }.local-brand-icon{width:36px;height:36px;border-radius:9px;background:#2563eb;color:#fff;display:grid;place-items:center;font-size:20px}.local-brand b{display:block;font-size:15px}.local-brand small{display:block;color:#94a3b8;font-size:10px;margin-top:1px}
.local-top-actions { display:flex; align-items:center; gap:10px; }
.local-print-shell { width:min(1180px,calc(100% - 32px)); margin:0 auto; padding:28px 0 22px; }
.local-print-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:20px; }.local-print-heading h1{font-size:26px;line-height:1.25;margin:0}.local-print-heading p{color:#64748b;margin-top:6px}.local-qr-mini{display:flex;align-items:center;gap:9px;padding:8px 10px;background:#fff;border:1px solid var(--border);border-radius:10px;color:#64748b;font-size:11px}.local-qr-mini img{width:50px;height:50px}
.local-print-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(340px,.8fr); gap:18px; align-items:start; }
.local-file-card,.local-settings-card { margin:0; align-self:start; }
/* Keep the file chooser and print settings on the same row baseline.  A
   sticky settings card used its viewport offset after scrolling and made the
   two panels appear misaligned. */
.local-settings-card{position:static}
.section-kicker { color:#2563eb; font-size:12px; font-weight:800; letter-spacing:.04em; margin-bottom:14px; }
.windows-upload-zone { min-height:300px; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:38px 24px; border:1.5px dashed #cbd5e1; background:#fbfdff; }
.windows-upload-zone.dragover,.windows-upload-zone:hover { border-color:#60a5fa; background:#eff6ff; }.upload-file-icon{width:58px;height:58px;border-radius:15px;background:#eff6ff;color:#2563eb;display:grid;place-items:center;font-size:31px;font-weight:300;margin-bottom:13px}.windows-upload-zone .upload-text{font-size:17px;font-weight:800}.upload-subtext{font-size:13px;color:#64748b;margin-top:4px}.windows-upload-zone .upload-hint{margin:8px 0 16px;max-width:520px;line-height:1.6}
.selected-file { margin-top:12px; padding:12px 13px; border:1px solid var(--border); border-radius:10px; background:#f8fafc; display:flex; align-items:center; gap:11px; }.selected-file[hidden]{display:none}.selected-file-icon{width:38px;height:38px;border-radius:9px;background:#fff;border:1px solid var(--border);display:grid;place-items:center}.selected-file-main{min-width:0;flex:1}.selected-file-main strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.selected-file-main span{display:block;color:#64748b;font-size:11px;margin-top:2px}.icon-btn{border:0;background:transparent;color:#64748b;font-size:22px;cursor:pointer;width:32px;height:32px;border-radius:7px}.icon-btn:hover{background:#e2e8f0}
.preview-card { margin-top:14px; border:1px solid var(--border); border-radius:10px; overflow:hidden; }.preview-card[hidden]{display:none}.preview-card-head{height:42px;display:flex;justify-content:space-between;align-items:center;padding:0 13px;background:#f8fafc;border-bottom:1px solid var(--border)}.preview-card-head span{font-size:11px;color:#64748b}.preview-stage{min-height:420px;height:auto;padding:18px;background:#e9eef5;display:flex;align-items:flex-start;justify-content:center;overflow:hidden}.preview-stage iframe{width:100%;height:100%;border:0;background:#fff}.preview-stage img{display:block;width:100%;max-width:900px;height:auto;max-height:none;object-fit:contain}
.compact-form-row { grid-template-columns:1fr 1fr; gap:10px; }.local-settings-card .form-group{margin-bottom:13px}.capability-line{min-height:20px;margin-top:5px;color:#64748b;font-size:11px}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:14px}.copies-row .form-label{margin:0}.stepper{display:grid;grid-template-columns:36px 54px 36px;border:1px solid #d8e0ea;border-radius:8px;overflow:hidden;background:#fff}.stepper button{border:0;background:#f8fafc;cursor:pointer;font-size:18px}.stepper input{width:54px;height:36px;border:0;border-left:1px solid #e2e8f0;border-right:1px solid #e2e8f0;text-align:center;font-weight:700;outline:0;-moz-appearance:textfield}.stepper input::-webkit-inner-spin-button{display:none}.page-range-input{height:38px}.local-print-submit{width:100%;margin-top:2px}.local-print-submit:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}.local-safe-tip{margin-top:12px;color:#64748b;font-size:11px;line-height:1.6;background:#f8fafc;border-radius:8px;padding:9px 10px}
.upload-progress{margin-top:13px}.progress-label{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#64748b}.progress-track{height:7px;background:#e2e8f0;border-radius:999px;overflow:hidden;margin-top:7px}.progress-track span{display:block;height:100%;width:0;background:#2563eb;border-radius:999px;transition:width .15s}.print-result{margin-top:12px;padding:12px;border-radius:9px;display:flex;flex-direction:column;gap:3px;font-size:12px}.print-result.success{background:#ecfdf3;color:#166534;border:1px solid #bbf7d0}.print-result.error{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}.print-result a{color:inherit;font-weight:700;margin-top:4px}.local-print-footer{text-align:center;padding:8px 0 24px;color:#94a3b8;font-size:11px}

@media (max-width: 980px) {
  .supply-usage-grid { grid-template-columns:repeat(2,1fr); }
  .local-print-grid { grid-template-columns:1fr; }
  .local-settings-card { position:static; }
  .local-qr-mini { display:none; }
}
@media (max-width:768px) {
  .main-content { margin-left:0; }
  .content-area { padding:16px; }
  .page-header-row,.supply-printer-header { flex-direction:column; align-items:stretch; }
  .supply-header-actions { justify-content:space-between; }
  .supply-model-grid { grid-template-columns:1fr; }
  .local-print-topbar { padding:0 14px; }.local-top-actions .pill{display:none}.local-print-shell{width:min(100% - 20px,1180px);padding-top:18px}.local-print-heading h1{font-size:22px}.local-print-heading p{font-size:12px}.compact-form-row{grid-template-columns:1fr}.preview-stage{min-height:260px;padding:10px}.local-file-card,.local-settings-card{padding:16px}.windows-upload-zone{min-height:250px;padding:26px 16px}.supply-usage-grid{grid-template-columns:1fr 1fr}.supply-model-metrics{grid-template-columns:1fr}.goods-grid{grid-template-columns:1fr}
}

/* 1.6.9 two-stage full-page preview */
.preview-card.preview-ready{border-color:#bfdbfe}.local-print-submit:disabled{opacity:.55;cursor:not-allowed}

/* EasyPrinter fnOS 1.6.9 - full-page raster preview, adaptive goods cards and compact tips */
.preview-card-head{gap:12px}.preview-card-head>strong{white-space:nowrap}.preview-pager{display:flex;align-items:center;justify-content:center;gap:8px;margin-left:auto}.preview-pager[hidden]{display:none}.preview-pager span{min-width:58px;text-align:center;color:#475569;font-weight:700}.preview-nav-btn{width:28px;height:28px;border:1px solid #d8e0ea;border-radius:7px;background:#fff;color:#334155;font-size:20px;line-height:24px;cursor:pointer}.preview-nav-btn:hover:not(:disabled){border-color:#93c5fd;color:#2563eb;background:#eff6ff}.preview-nav-btn:disabled{opacity:.35;cursor:not-allowed}.preview-page-image{display:block;width:100%;max-width:900px;height:auto;max-height:none;object-fit:contain;box-shadow:0 8px 28px rgba(15,23,42,.13);background:#fff}.preview-page-image.loading-page{opacity:.55}.local-safe-tip{padding:7px 10px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.goods-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,430px),1fr));gap:14px}.goods-card{display:grid;grid-template-columns:146px minmax(0,1fr);grid-template-areas:"image body";gap:14px;padding:14px;align-items:start;min-height:190px;transition:border-color .15s,box-shadow .15s,transform .15s}.goods-card:hover{border-color:#bfdbfe;box-shadow:0 10px 26px rgba(37,99,235,.08);transform:translateY(-1px)}.goods-image{grid-area:image;width:146px;height:146px;border:1px solid #edf1f5;border-radius:10px}.goods-body{grid-area:body;min-width:0;display:flex;flex-direction:column;min-height:146px}.goods-title{margin-top:0;min-height:auto;max-height:44px;font-size:13px;font-weight:600;color:#0f172a}.goods-price-row{margin-top:8px}.goods-meta-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px;font-size:11px;color:#64748b}.goods-sales{display:inline-flex;align-items:center;gap:4px}.goods-reason{margin-top:8px;padding:8px 9px;border-radius:8px;background:#f8fafc;color:#475569;font-size:11px;line-height:1.5}.goods-reason strong{color:#2563eb}.goods-actions{margin-top:auto;padding-top:10px}.goods-platform{white-space:nowrap}.goods-panel-head .page-subtitle:empty{display:none}

.log-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:14px}.log-toolbar .form-input,.log-toolbar .form-select{min-height:34px;height:34px}.log-toolbar .log-search{min-width:220px;flex:1}.runtime-log{background:#0f172a;color:#dbeafe;border-radius:10px;border:1px solid #1e293b;min-height:430px;max-height:70vh;overflow:auto;padding:14px 16px;font:12px/1.65 Consolas,Monaco,'Courier New',monospace;white-space:pre-wrap;word-break:break-all}.runtime-log .empty-log{color:#94a3b8}.log-source-tabs{display:flex;gap:6px;flex-wrap:wrap}.log-source-tabs a{text-decoration:none}

@media (max-width: 720px){.goods-card{grid-template-columns:104px minmax(0,1fr);gap:11px;min-height:154px}.goods-image{width:104px;height:104px}.goods-body{min-height:104px}.goods-actions{grid-template-columns:1fr}.preview-card-head{flex-wrap:wrap;height:auto;min-height:42px;padding:7px 10px}.preview-pager{order:3;width:100%;margin-left:0}.local-safe-tip{font-size:10px}.runtime-log{min-height:360px}}

/* EasyPrinter fnOS 1.6.9 - clean preview and printer-aware paper/image layout */
.preview-card[hidden]{display:none!important}.preview-stage:empty{display:none}.preview-page-image{max-width:100%;margin:0 auto}.selected-file{position:relative;z-index:1}.preview-card{position:relative;z-index:0}

/* ============================================================
   Automatic system dark mode
   Follows the browser/OS preference and updates live when the
   system theme changes. No persisted application setting needed.
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --primary: #60a5fa;
        --primary-dark: #3b82f6;
        --primary-light: #172554;
        --success: #4ade80;
        --warning: #fbbf24;
        --error: #f87171;
        --bg: #0f172a;
        --bg-tertiary: #1e293b;
        --card-bg: #111c2f;
        --text: #e5edf8;
        --text-primary: #e5edf8;
        --text-secondary: #9fb0c6;
        --text-tertiary: #74849a;
        --border: #2a3a51;
        --border-color: #2a3a51;
        --input-bg: #0f1a2b;
        --sidebar-bg: #0b1322;
        --sidebar-text: #c8d4e4;
        --sidebar-active: #2563eb;
        --shadow: 0 1px 3px rgba(0,0,0,.34), 0 1px 2px rgba(0,0,0,.24);
        --shadow-lg: 0 20px 55px rgba(0,0,0,.45);
    }

    html, body { background:#0f172a; color:var(--text); }
    body { color:var(--text) !important; }
    .main-content, .content-area, .local-print-body { background:var(--bg) !important; }
    .sidebar { background:var(--sidebar-bg) !important; border-right:1px solid #1d2a3d; }
    .sidebar-logo, .sidebar-footer { border-color:#1d2a3d; }
    .nav-group-title, .sidebar-version { color:#6f8098; }
    .nav-item { color:#b9c7d9; }
    .nav-item:hover { background:rgba(148,163,184,.12); color:#f8fafc; }
    .nav-item.active { color:#fff; }

    .topbar,
    .local-print-topbar {
        background:#111c2f !important;
        border-color:var(--border) !important;
        box-shadow:0 1px 0 rgba(255,255,255,.02);
    }
    .topbar-title,
    .page-title,
    .card-title,
    .local-brand,
    .local-print-heading h1,
    .mini-stat strong,
    .supply-model-code,
    .supply-level-row strong,
    .goods-title,
    .selected-file-main strong,
    .preview-card-head > strong,
    .modal-title,
    .feedback-title,
    .vc-join-title { color:var(--text-primary) !important; }
    .page-subtitle,
    .printer-meta,
    .field-hint,
    .supply-model-name,
    .supply-level-row span,
    .supply-model-metrics,
    .goods-meta-row,
    .selected-file-main span,
    .preview-card-head span,
    .capability-line,
    .progress-label,
    .local-print-footer,
    .local-print-heading p,
    .local-brand small,
    .upload-subtext,
    .vc-pairing-meta,
    .vc-join-subtitle { color:var(--text-secondary) !important; }

    .card,
    .stat-card,
    .printer-card,
    .supply-card,
    .supply-printer-panel,
    .supply-model-card,
    .goods-card,
    .modal-card,
    .modal-content,
    .login-box,
    .download-card,
    .feedback-dialog,
    .vc-join-dialog {
        background:var(--card-bg) !important;
        color:var(--text-primary) !important;
        border-color:var(--border) !important;
        box-shadow:var(--shadow);
    }

    .card-header,
    .supply-printer-header,
    .goods-panel,
    .supply-model-action,
    th, td { border-color:var(--border) !important; }
    th { background:#18253a !important; color:#a9b8ca !important; }
    tr:hover td { background:#172338 !important; }

    .btn-default,
    .preview-nav-btn {
        background:#172338 !important;
        color:#dbe7f5 !important;
        border-color:#33465f !important;
    }
    .btn-default:hover,
    .preview-nav-btn:hover:not(:disabled) {
        background:#1d3150 !important;
        border-color:#60a5fa !important;
        color:#93c5fd !important;
    }
    .menu-toggle { color:#dbe7f5; }

    .form-input,
    .form-select,
    .form-textarea,
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
    select,
    textarea {
        background:var(--input-bg) !important;
        color:var(--text-primary) !important;
        border-color:#33465f !important;
    }
    .form-input::placeholder,
    .form-textarea::placeholder,
    input::placeholder,
    textarea::placeholder { color:#6f8098 !important; }
    option { background:#111c2f; color:#e5edf8; }

    .status-badge.online,
    .pill-success,
    .driver-status.found,
    .install-status.success,
    .print-result.success,
    .supply-status.normal {
        background:#123020 !important;
        color:#6ee7a0 !important;
        border-color:#245b3b !important;
    }
    .pill-warning,
    .flash.warning,
    .supply-status.warning {
        background:#362711 !important;
        color:#facc6b !important;
        border-color:#6d4d16 !important;
    }
    .pill-error,
    .driver-status.notfound,
    .install-status.error,
    .print-result.error,
    .supply-status.critical,
    .flash.error {
        background:#3a191c !important;
        color:#fca5a5 !important;
        border-color:#6b2a31 !important;
    }
    .pill-info,
    .pill-processing,
    .install-status.loading,
    .flash.info,
    .network-print-info,
    .info-banner {
        background:#132b4c !important;
        color:#b8d8ff !important;
        border-color:#284f7d !important;
    }
    .pill-default { background:#202d40 !important; color:#aab8ca !important; }
    .flash.success { background:#123020 !important; color:#86efac !important; border-color:#245b3b !important; }

    .upload-zone,
    .windows-upload-zone,
    .file-info,
    .selected-file,
    .preview-card-head,
    .qr-url,
    .device-item,
    .mini-stat,
    .supply-model-metrics span,
    .goods-placeholder,
    .goods-url,
    .url-box,
    .goods-reason,
    .local-safe-tip,
    .feedback-file,
    .feedback-privacy,
    .vc-join-detail {
        background:var(--bg-tertiary) !important;
        color:var(--text-primary);
        border-color:var(--border) !important;
    }
    .upload-zone:hover,
    .upload-zone.dragover,
    .windows-upload-zone:hover,
    .windows-upload-zone.dragover { background:#172b48 !important; border-color:#4c8ed8 !important; }
    .upload-file-icon,
    .printer-icon,
    .device-badge { background:#172b48 !important; color:#7db7ff !important; }
    .device-badge.network { background:#123020 !important; color:#6ee7a0 !important; }
    .selected-file-icon { background:#172338 !important; border-color:var(--border) !important; }
    .icon-btn { color:#a9b8ca !important; }
    .icon-btn:hover { background:#26364d !important; }

    .supply-track,
    .progress-track { background:#26364d !important; }
    .goods-image.placeholder { background:#1b293d !important; }
    .goods-image { border-color:var(--border) !important; }
    .goods-title { color:var(--text-primary) !important; }
    .goods-reason { color:#afbdd0 !important; }
    .goods-reason strong { color:#7db7ff !important; }
    .supply-model-metrics b { color:#d3deeb !important; }
    .preview-pager span { color:#bac7d8 !important; }

    .local-qr-mini {
        background:var(--card-bg) !important;
        color:var(--text-secondary) !important;
        border-color:var(--border) !important;
    }
    .stepper { background:var(--input-bg) !important; border-color:#33465f !important; }
    .stepper button { background:#172338 !important; color:#e5edf8 !important; }
    .stepper input { background:var(--input-bg) !important; color:#e5edf8 !important; border-color:#33465f !important; }

    .preview-card { border-color:var(--border) !important; }
    .preview-card.preview-ready { border-color:#356aa6 !important; }
    .preview-stage { background:#1c293a !important; }
    /* The document preview itself intentionally stays paper-white. */
    .preview-stage iframe,
    .preview-page-image,
    .purchase-qr img,
    .qr-container img,
    .local-qr-mini img { background:#fff !important; }

    .network-print-info code { background:#0f1a2b !important; color:#dbeafe !important; }
    .runtime-log { background:#08111f !important; border-color:#26364d !important; color:#dbeafe !important; }
    .runtime-log .empty-log { color:#7f90a6 !important; }

    .login-container { background:linear-gradient(135deg,#12233f 0%,#07111f 100%) !important; }
    .login-box { box-shadow:0 24px 70px rgba(0,0,0,.48); }
    .login-logo h1 { color:var(--text-primary); }

    .modal-backdrop,
    .feedback-overlay,
    .vc-join-overlay { background:rgba(2,6,23,.72) !important; }
    .feedback-field select,
    .feedback-field input[type=text],
    .feedback-field input:not([type]),
    .feedback-field textarea { background:var(--input-bg) !important; color:var(--text-primary) !important; border-color:#33465f !important; }
    .feedback-close { color:#a9b8ca !important; }
    .feedback-message.error,
    .vc-join-error { color:#fca5a5 !important; }
    .feedback-message.success { color:#86efac !important; }

    ::selection { background:#1d4ed8; color:#fff; }
    * { scrollbar-color:#52647c #101b2b; }
}

/* User-selected appearance overrides.  The default remains OS-following; these
   rules only activate after a browser-local choice from the theme menu. */
html[data-ep-appearance="dark"] {
    color-scheme: dark;
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-light: #172554;
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;
    --bg: #0f172a;
    --bg-tertiary: #1e293b;
    --card-bg: #111c2f;
    --text: #e5edf8;
    --text-primary: #e5edf8;
    --text-secondary: #9fb0c6;
    --text-tertiary: #74849a;
    --border: #2a3a51;
    --border-color: #2a3a51;
    --input-bg: #0f1a2b;
    --sidebar-bg: #0b1322;
    --sidebar-text: #c8d4e4;
}
html[data-ep-appearance="dark"] body.theme-classic,
html[data-ep-appearance="dark"] body.theme-classic .main-content,
html[data-ep-appearance="dark"] body.theme-classic .content-area,
html[data-ep-appearance="dark"] body.theme-classic .local-print-body { background: #0f172a !important; color: #e5edf8 !important; }
html[data-ep-appearance="dark"] body.theme-classic .sidebar { background: #0b1322 !important; border-right-color: #1d2a3d !important; }
html[data-ep-appearance="dark"] body.theme-classic .topbar,
html[data-ep-appearance="dark"] body.theme-classic .local-print-topbar { background: #111c2f !important; border-color: #2a3a51 !important; }
html[data-ep-appearance="dark"] body.theme-classic .card,
html[data-ep-appearance="dark"] body.theme-classic .stat-card,
html[data-ep-appearance="dark"] body.theme-classic .printer-card,
html[data-ep-appearance="dark"] body.theme-classic .modal-card,
html[data-ep-appearance="dark"] body.theme-classic .modal-content,
html[data-ep-appearance="dark"] body.theme-classic .feedback-dialog,
html[data-ep-appearance="dark"] body.theme-classic .vc-join-dialog { background: #111c2f !important; color: #e5edf8 !important; border-color: #2a3a51 !important; }
html[data-ep-appearance="dark"] body.theme-classic input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-ep-appearance="dark"] body.theme-classic select,
html[data-ep-appearance="dark"] body.theme-classic textarea { background: #0f1a2b !important; color: #e5edf8 !important; border-color: #33465f !important; }
html[data-ep-appearance="dark"] body.theme-classic .page-title,
html[data-ep-appearance="dark"] body.theme-classic .card-title,
html[data-ep-appearance="dark"] body.theme-classic .topbar-title { color: #e5edf8 !important; }
html[data-ep-appearance="dark"] body.theme-classic .page-subtitle,
html[data-ep-appearance="dark"] body.theme-classic .form-help,
html[data-ep-appearance="dark"] body.theme-classic .field-hint { color: #9fb0c6 !important; }

@media (prefers-color-scheme: dark) {
    html[data-ep-appearance="light"] {
        color-scheme: light;
        --primary: #1890ff;
        --primary-dark: #096dd9;
        --primary-light: #e6f7ff;
        --bg: #f0f2f5;
        --bg-tertiary: #f8fafc;
        --card-bg: #fff;
        --text: #1f1f1f;
        --text-primary: #1f1f1f;
        --text-secondary: #8c8c8c;
        --text-tertiary: #98a2b3;
        --border: #e8e8e8;
        --border-color: #e8e8e8;
        --input-bg: #fff;
        --sidebar-bg: #001529;
    }
    html[data-ep-appearance="light"] body.theme-classic,
    html[data-ep-appearance="light"] body.theme-classic .main-content,
    html[data-ep-appearance="light"] body.theme-classic .content-area,
    html[data-ep-appearance="light"] body.theme-classic .local-print-body { background: #f0f2f5 !important; color: #1f1f1f !important; }
    html[data-ep-appearance="light"] body.theme-classic .sidebar { background: #001529 !important; border-right-color: rgba(255,255,255,.08) !important; }
    html[data-ep-appearance="light"] body.theme-classic .topbar,
    html[data-ep-appearance="light"] body.theme-classic .local-print-topbar { background: #fff !important; border-color: #e8e8e8 !important; }
    html[data-ep-appearance="light"] body.theme-classic .card,
    html[data-ep-appearance="light"] body.theme-classic .stat-card,
    html[data-ep-appearance="light"] body.theme-classic .printer-card,
    html[data-ep-appearance="light"] body.theme-classic .modal-card,
    html[data-ep-appearance="light"] body.theme-classic .modal-content,
    html[data-ep-appearance="light"] body.theme-classic .feedback-dialog,
    html[data-ep-appearance="light"] body.theme-classic .vc-join-dialog { background: #fff !important; color: #1f1f1f !important; border-color: #e8e8e8 !important; }
    html[data-ep-appearance="light"] body.theme-classic input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    html[data-ep-appearance="light"] body.theme-classic select,
    html[data-ep-appearance="light"] body.theme-classic textarea { background: #fff !important; color: #1f1f1f !important; border-color: #d9e0ea !important; }
}

/* Classic Dark page-specific surfaces.  These close the remaining light
   fallbacks without changing intentional paper/QR preview white areas. */
html[data-ep-appearance="dark"] body.theme-classic .scanner-mode-tabs,
html[data-ep-appearance="dark"] body.theme-classic .scanner-empty,
html[data-ep-appearance="dark"] body.theme-classic .scanner-device-summary,
html[data-ep-appearance="dark"] body.theme-classic .scanner-job-details,
html[data-ep-appearance="dark"] body.theme-classic .scanner-output-row,
html[data-ep-appearance="dark"] body.theme-classic .scanner-message,
html[data-ep-appearance="dark"] body.theme-classic .scanner-result-tools,
html[data-ep-appearance="dark"] body.theme-classic .scanner-project-create,
html[data-ep-appearance="dark"] body.theme-classic .scanner-project-list-item,
html[data-ep-appearance="dark"] body.theme-classic .scanner-history-item,
html[data-ep-appearance="dark"] body.theme-classic .scanner-project-pending,
html[data-ep-appearance="dark"] body.theme-classic .scanner-project-batch-item,
html[data-ep-appearance="dark"] body.theme-classic .guide-tabs a,
html[data-ep-appearance="dark"] body.theme-classic .ep-technical-details > summary,
html[data-ep-appearance="dark"] body.theme-classic .ep-settings-disclosure-body,
html[data-ep-appearance="dark"] body.theme-classic .ep-account-extras > summary,
html[data-ep-appearance="dark"] body.theme-classic .ep-subtle-panel,
html[data-ep-appearance="dark"] body.theme-classic .info-banner,
html[data-ep-appearance="dark"] body.theme-classic .notice,
html[data-ep-appearance="dark"] body.theme-classic .ep-diagnostic-grid > a,
html[data-ep-appearance="dark"] body.theme-classic .empty-state,
html[data-ep-appearance="dark"] body.theme-classic input[type="file"] {
    background: #111c2f !important;
    color: #c8d4e4 !important;
    border-color: #2a3a51 !important;
}
html[data-ep-appearance="dark"] body.theme-classic .scanner-mode-tab,
html[data-ep-appearance="dark"] body.theme-classic .scanner-project-list-item,
html[data-ep-appearance="dark"] body.theme-classic .guide-tabs a,
html[data-ep-appearance="dark"] body.theme-classic .empty-state strong,
html[data-ep-appearance="dark"] body.theme-classic .empty-state p {
    color: #e5edf8 !important;
}
html[data-ep-appearance="dark"] body.theme-classic .scanner-mode-tab:hover:not(.is-active):not([aria-selected="true"]),
html[data-ep-appearance="dark"] body.theme-classic .guide-tabs a:hover {
    background: #172b48 !important;
    color: #fff !important;
}
html[data-ep-appearance="dark"] body.theme-classic .scanner-mode-tab.is-active,
html[data-ep-appearance="dark"] body.theme-classic .scanner-mode-tab[aria-selected="true"] {
    background: #263f66 !important;
    color: #fff !important;
    border-color: #4c8ed8 !important;
}
html[data-ep-appearance="dark"] body.theme-classic input[type="file"]::file-selector-button {
    background: #172b48 !important;
    color: #e5edf8 !important;
    border-color: #2a3a51 !important;
}

/* Auto mode must receive the same Classic Dark page-surface fixes while the
   system is dark.  Manual Light/Dark remain controlled by the explicit blocks
   above; this media query does not alter the original Classic theme rules on
   light systems. */
@media (prefers-color-scheme: dark) {
    html[data-ep-appearance="auto"] body.theme-classic .scanner-mode-tabs,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-empty,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-device-summary,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-job-details,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-output-row,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-message,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-result-tools,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-project-create,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-project-list-item,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-history-item,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-project-pending,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-project-batch-item,
    html[data-ep-appearance="auto"] body.theme-classic .guide-tabs a,
    html[data-ep-appearance="auto"] body.theme-classic .ep-technical-details > summary,
    html[data-ep-appearance="auto"] body.theme-classic .ep-settings-disclosure-body,
    html[data-ep-appearance="auto"] body.theme-classic .ep-account-extras > summary,
    html[data-ep-appearance="auto"] body.theme-classic .ep-subtle-panel,
    html[data-ep-appearance="auto"] body.theme-classic .info-banner,
    html[data-ep-appearance="auto"] body.theme-classic .notice,
    html[data-ep-appearance="auto"] body.theme-classic .ep-diagnostic-grid > a,
    html[data-ep-appearance="auto"] body.theme-classic .empty-state,
    html[data-ep-appearance="auto"] body.theme-classic input[type="file"] {
        background: #111c2f !important;
        color: #c8d4e4 !important;
        border-color: #2a3a51 !important;
    }
    html[data-ep-appearance="auto"] body.theme-classic .scanner-mode-tab,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-project-list-item,
    html[data-ep-appearance="auto"] body.theme-classic .guide-tabs a,
    html[data-ep-appearance="auto"] body.theme-classic .empty-state strong,
    html[data-ep-appearance="auto"] body.theme-classic .empty-state p {
        color: #e5edf8 !important;
    }
    html[data-ep-appearance="auto"] body.theme-classic .scanner-mode-tab:hover:not(.is-active):not([aria-selected="true"]),
    html[data-ep-appearance="auto"] body.theme-classic .guide-tabs a:hover {
        background: #172b48 !important;
        color: #fff !important;
    }
    html[data-ep-appearance="auto"] body.theme-classic .scanner-mode-tab.is-active,
    html[data-ep-appearance="auto"] body.theme-classic .scanner-mode-tab[aria-selected="true"] {
        background: #263f66 !important;
        color: #fff !important;
        border-color: #4c8ed8 !important;
    }
    html[data-ep-appearance="auto"] body.theme-classic input[type="file"]::file-selector-button {
        background: #172b48 !important;
        color: #e5edf8 !important;
        border-color: #2a3a51 !important;
    }
}
