/* ============================================================
   ManhwaScanner Dashboard — Linear Dark
   Clean, modern, dark SaaS aesthetic
   ============================================================ */

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

:root {
    --bg: #09090b;
    --surface: #18181b;
    --surface2: #1f1f23;
    --surface3: #27272a;
    --border: #1e1e22;
    --border2: #2a2a2f;
    --text: #fafafa;
    --text2: #a1a1aa;
    --muted: #52525b;
    --accent: #6366f1;
    --accent-dim: rgba(99, 102, 241, 0.08);
    --accent-soft: rgba(99, 102, 241, 0.15);
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.08);
    --amber: #eab308;
    --amber-dim: rgba(234, 179, 8, 0.08);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.08);
    --sans: "DM Sans", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body.light {
    --bg: #f5f5f4;
    --surface: #ffffff;
    --surface2: #f0f0ef;
    --surface3: #e8e8e7;
    --border: #e4e4e3;
    --border2: #d4d4d3;
    --text: #1a1a18;
    --text2: #737372;
    --muted: #a3a3a1;
    --accent: #4f46e5;
    --accent-dim: rgba(79, 70, 229, 0.06);
    --accent-soft: rgba(79, 70, 229, 0.12);
    --green: #16a34a;
    --green-dim: rgba(22, 163, 74, 0.06);
    --amber: #d97706;
    --amber-dim: rgba(217, 119, 6, 0.06);
    --red: #dc2626;
    --red-dim: rgba(220, 38, 38, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

html, body {
    height: 100%;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#loadingScreen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.4s var(--ease);
}

.spin {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font: 500 11px var(--mono);
    color: var(--muted);
}

.loading-dots::after {
    content: ".";
    animation: pulse 1.5s steps(1, end) infinite;
    display: inline-block;
    width: 12px;
    text-align: left;
}

/* ==================== MODALS ==================== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 380px;
    max-width: calc(100vw - 24px);
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.2s var(--ease);
}

.modal h2 {
    font: 700 16px var(--sans);
    margin-bottom: 6px;
    color: var(--text);
}

.modal p {
    color: var(--text2);
    font: 400 12px var(--sans);
    margin-bottom: 18px;
    line-height: 1.5;
}

.modal input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    padding: 10px 12px;
    font: 400 13px var(--sans);
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.2s var(--ease);
}

.modal input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.modal-actions .btn-soft,
.modal-actions .btn-primary {
    flex: 1;
}

/* ==================== BUTTONS ==================== */

.btn-primary {
    width: 100%;
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 9px 16px;
    font: 600 11px var(--sans);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-soft {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 7px 14px;
    font: 500 11px var(--sans);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.btn-soft:hover {
    border-color: var(--border2);
    color: var(--text);
}

.btn-mini {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 3px 10px;
    font: 500 10px var(--mono);
    cursor: pointer;
    min-height: 24px;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.btn-mini:hover {
    border-color: var(--text2);
    color: var(--text);
}

.btn-mini.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-mini.active-green {
    background: var(--green);
    color: #000;
    border-color: var(--green);
}

.btn-mini.active-red {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-page {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 4px 11px;
    font: 500 11px var(--mono);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.btn-page:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-page.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-page:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 3px 8px;
    font: 500 9px var(--mono);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.btn-delete:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-dim);
}

.btn-add {
    height: 34px;
    width: auto;
    padding: 0 16px;
    flex-shrink: 0;
}

.btn-group {
    display: flex;
    gap: 3px;
}

/* ==================== LAYOUT ==================== */

.app-shell {
    height: 100vh;
    overflow: hidden;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ==================== TOPBAR ==================== */

.topbar {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 3px 8px;
    font: 500 10px var(--mono);
    outline: none;
    cursor: pointer;
    height: 24px;
    border-radius: var(--r-sm);
    appearance: none;
    transition: border-color 0.15s var(--ease);
}

.topbar-select:focus {
    border-color: var(--accent);
}

.topbar-toggle {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 3px 10px;
    font: 500 10px var(--mono);
    cursor: pointer;
    height: 24px;
    display: flex;
    align-items: center;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.topbar-toggle:hover {
    border-color: var(--border2);
    color: var(--text);
}

.brand-dot {
    width: 8px;
    height: 8px;
    background: var(--muted);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s var(--ease);
}

.brand-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px var(--green-dim);
}

.brand-dot.offline {
    background: var(--red);
    box-shadow: 0 0 6px var(--red-dim);
}

#topStatusText {
    font: 600 10px var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text2);
}

.topbar-time {
    font: 400 11px var(--mono);
    color: var(--muted);
}

/* ==================== ALERT ==================== */

.alert {
    display: none;
    background: var(--amber-dim);
    border: 1px solid color-mix(in srgb, var(--amber) 20%, var(--border));
    border-left: 3px solid var(--amber);
    padding: 10px 14px;
    font: 400 11px var(--mono);
    color: var(--amber);
    margin-bottom: 12px;
    border-radius: var(--r-sm);
}

/* ==================== MAIN CONTENT ==================== */

.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 40px;
    animation: fadeIn 0.3s var(--ease);
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
}

.app-main::-webkit-scrollbar { width: 5px; }
.app-main::-webkit-scrollbar-track { background: transparent; }
.app-main::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }

/* ==================== CRON BAR ==================== */

.cron-bar {
    display: flex;
    align-items: center;
    gap: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 20px;
    margin-bottom: 16px;
    animation: fadeSlideUp 0.3s var(--ease);
}

.cron-countdown-block {
    flex-shrink: 0;
}

.cron-countdown {
    font: 700 36px var(--mono);
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.03em;
}

.cron-label {
    font: 600 9px var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
}

.cron-meta {
    flex-shrink: 0;
}

.cron-meta-item {
    display: flex;
    flex-direction: column;
}

.cron-value {
    font: 500 12px var(--mono);
    color: var(--text2);
}

.cron-sub {
    font: 400 10px var(--mono);
    color: var(--muted);
    margin-top: 2px;
}

.cron-stats {
    display: flex;
    gap: 32px;
    margin-left: auto;
}

.cron-stat {
    text-align: right;
}

.cron-stat-value {
    font: 700 22px var(--mono);
    line-height: 1;
    margin-bottom: 4px;
}

.cron-stat-value.g { color: var(--green); }
.cron-stat-value.a { color: var(--amber); }
.cron-stat-value.r { color: var(--red); }

.cron-stat-label {
    font: 600 8px var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cron-run-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 7px 14px;
    font: 600 10px var(--sans);
    cursor: pointer;
    flex-shrink: 0;
    height: 32px;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.cron-run-btn:hover {
    background: var(--accent);
    color: #fff;
}

.cron-run-btn:active {
    transform: scale(0.97);
}

.g { color: var(--green); }
.a { color: var(--amber); }
.r { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }

/* ==================== KPIs ==================== */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px;
    transition: all 0.2s var(--ease);
    animation: fadeSlideUp 0.3s var(--ease) both;
}

.kpi:hover {
    border-color: var(--border2);
    background: var(--surface2);
}

.kpi-label {
    font: 600 9px var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.kpi-value {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 26px;
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.02em;
}

.kpi-sub {
    font: 400 10px var(--mono);
    color: var(--muted);
    margin-top: 6px;
}

.stat-value { }

.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-value.red { color: var(--red); }

/* ==================== CHARTS GRID ==================== */

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

/* ==================== PANEL ==================== */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.2s var(--ease);
    animation: fadeSlideUp 0.3s var(--ease) both;
}

.panel:hover {
    border-color: var(--border2);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title {
    font: 600 10px var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 2px 8px;
    font: 500 10px var(--mono);
    outline: none;
    cursor: pointer;
    height: 22px;
    border-radius: var(--r-sm);
    appearance: none;
    transition: border-color 0.15s var(--ease);
}

.panel-select:focus {
    border-color: var(--accent);
}

.panel-body {
    padding: 14px;
    flex: 1;
}

.panel-body--tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px;
}

.panel--tools {
    min-height: 0;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-toolbar input[type=search] {
    flex: 1;
    min-width: 80px;
}

.panel-toolbar--multi {
    flex-wrap: wrap;
}

.panel-add {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

/* ==================== CHARTS ==================== */

.chart-box {
    height: 180px;
    position: relative;
}

.chart-box--small {
    height: 100px;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 400 10px var(--mono);
    color: var(--muted);
    background: var(--surface2);
    border-radius: var(--r-sm);
}

/* ==================== LISTS ==================== */

.list-scroll {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
}

.list-scroll::-webkit-scrollbar { width: 4px; }
.list-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }

.list-plain {
    list-style: none;
    padding: 0;
    margin: 0;
}

.log-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: start;
    gap: 10px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s var(--ease);
}

.log-item:hover { background: var(--surface2); }

.log-time {
    font: 400 10px var(--mono);
    color: var(--muted);
    padding-top: 1px;
}

.log-msg-text {
    font: 400 11px var(--mono);
    color: var(--text2);
    line-height: 1.5;
    word-break: break-word;
}

.log-tag {
    font: 600 8px var(--mono);
    padding: 2px 7px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
}

.log-tag.sent { background: var(--green-dim); color: var(--green); }
.log-tag.failed { background: var(--red-dim); color: var(--red); }
.log-tag.skipped { background: var(--amber-dim); color: var(--amber); }
.log-tag.info { background: var(--accent-dim); color: var(--accent); }

.recent-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s var(--ease);
}

.recent-item:hover { background: var(--surface2); }

.recent-cover {
    width: 36px;
    height: 48px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.recent-cover-placeholder {
    width: 36px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 500 8px var(--mono);
    color: var(--muted);
    background: var(--surface2);
    border-radius: 4px;
    flex-shrink: 0;
    overflow: hidden;
}

.recent-info {
    min-width: 0;
}

.recent-title {
    font: 600 12px var(--sans);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.recent-chapter {
    font: 400 10px var(--mono);
    color: var(--muted);
}

.recent-time {
    font: 400 10px var(--mono);
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.manga-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 4px;
    align-items: center;
    padding: 4px 12px;
    border-bottom: 1px solid var(--border);
    min-height: 34px;
    transition: background 0.15s var(--ease);
}

.manga-item:hover { background: var(--surface2); }

.manga-index {
    font: 500 10px var(--mono);
    color: var(--muted);
}

.manga-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.manga-item-title {
    font: 500 12px var(--sans);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manga-item-title mark {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0 3px;
    border-radius: 2px;
}

.manga-item-sub {
    font: 400 10px var(--mono);
    color: var(--muted);
}

/* ==================== DATA GRID ==================== */

.data-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.panel--logs .list-scroll { max-height: 280px; }
.panel--recent .list-scroll { max-height: 310px; }
.panel--whitelist .list-scroll { max-height: 340px; }

/* ==================== BADGES ==================== */

.badge {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    font: 500 9px var(--mono);
    padding: 2px 8px;
    letter-spacing: 0.03em;
    border-radius: var(--r-sm);
}

.source-badge {
    font: 600 8px var(--mono);
    padding: 2px 7px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
}

.source-ikiru { background: var(--green-dim); color: var(--green); }
.source-shinigami { background: var(--amber-dim); color: var(--amber); }

.status-pill {
    font: 400 10px var(--mono);
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.status-pill.active { color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.status-pill.invalid { color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.status-pill.warning { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }

/* ==================== PAGINATION ==================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface2);
}

#pageNumbers {
    display: flex;
    gap: 4px;
}

/* ==================== FORMS ==================== */

input[type=text],
input[type=search],
input[type=password],
select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 10px;
    font: 400 12px var(--sans);
    outline: none;
    border-radius: var(--r-sm);
    transition: border-color 0.15s var(--ease);
    height: 28px;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

select {
    appearance: none;
    cursor: pointer;
}

input[type=search]::placeholder {
    color: var(--muted);
}

/* ==================== TOOL BUTTONS ==================== */

.tool-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text2);
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}

.tool-btn:hover {
    border-color: var(--border2);
    color: var(--text);
}

.tool-btn:active {
    transform: scale(0.97);
}

.tool-btn--warn:hover {
    border-color: color-mix(in srgb, var(--red) 30%, var(--border));
    color: var(--red);
}

.tool-icon {
    font-size: 14px;
    line-height: 1;
}

.tool-label {
    font: 600 8px var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ==================== SECTIONS ==================== */

.whitelist-item-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.whitelist-cover,
.whitelist-cover-placeholder { display: none; }

.panel--whitelist .list-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 340px;
    align-content: flex-start;
}

.wl-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    cursor: default;
    white-space: nowrap;
    font: 500 11px var(--sans);
    color: var(--text);
    transition: background 0.12s, border-color 0.12s;
}

.wl-chip:hover {
    background: var(--surface3);
    border-color: var(--border2);
}

.wl-chip .manga-index {
    font: 600 9px var(--mono);
    color: var(--muted);
    flex-shrink: 0;
}

.wl-chip .manga-item-title {
    font-weight: 600;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wl-chip .source-badge {
    font-size: 8px;
    padding: 1px 4px;
}

.wl-chip .btn-mini,
.wl-chip .btn-delete {
    padding: 1px 5px;
    font-size: 9px;
    min-width: auto;
    border-radius: 3px;
}

.panel--whitelist .list-scroll .manga-item:not(.wl-chip) {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 4px;
    align-items: center;
    padding: 3px 12px;
    border-bottom: 1px solid var(--border);
    min-height: 32px;
}

/* ==================== SKELETON ==================== */

.skeleton-shimmer {
    height: 8px;
    background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: 4px;
}

/* ==================== EMPTY STATES ==================== */

.empty {
    padding: 24px;
    text-align: center;
    font: 400 12px var(--sans);
    color: var(--muted);
}

.enhanced-empty {
    padding: 28px 20px;
    text-align: center;
}

.empty-icon {
    display: block;
    font-size: 22px;
    margin-bottom: 8px;
}

.empty-title {
    font: 600 13px var(--sans);
    color: var(--text2);
    margin-bottom: 4px;
}

.empty-subtitle {
    font: 400 11px var(--sans);
    color: var(--muted);
}

.error-state {
    color: var(--red);
}

.error-icon {
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
}

/* ==================== TIMELINE ==================== */

.timeline-group {
    padding: 6px 14px;
    font: 600 9px var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
}

/* ==================== STATUS INDICATORS ==================== */

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

.status-indicator-dot.error {
    background: var(--red);
}

.status-indicator-dot.warning {
    background: var(--amber);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

.status-dot.offline {
    background: var(--red);
}

/* ==================== TOAST ==================== */

.toast-container {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 999;
    display: grid;
    gap: 8px;
    max-width: 300px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    font: 400 11px var(--sans);
    color: var(--text);
    box-shadow: var(--shadow-md);
    border-radius: var(--r-sm);
    animation: fadeSlideUp 0.25s var(--ease);
}

.toast.success { border-left-color: var(--green); color: var(--green); }
.toast.error { border-left-color: var(--red); color: var(--red); }
.toast.warn { border-left-color: var(--amber); color: var(--amber); }
.toast.info { border-left-color: var(--accent); }

/* ==================== TERMINAL ==================== */

.terminal-line {
    padding: 5px 14px;
    font: 400 10px var(--mono);
    color: var(--text2);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.terminal-time {
    color: var(--muted);
    flex-shrink: 0;
}

.terminal-msg {
    word-break: break-word;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }
    .charts-grid .panel:nth-child(4) { grid-column: auto; }
    .charts-grid .panel:nth-child(5) { grid-column: auto; }
}

@media (max-width: 880px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .data-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .charts-grid { grid-template-columns: 1fr; }
    .app-main { padding: 12px 14px 40px; }
    .cron-bar { flex-wrap: wrap; gap: 14px; }
    .cron-stats { margin-left: 0; }
    .cron-run-btn { width: 100%; }
}

@media (max-width: 640px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .panel-add { grid-template-columns: 1fr; }
    .topbar { padding: 0 12px; }
}

@media (max-width: 400px) {
    .cron-countdown { font-size: 28px; }
    .kpi-value { font-size: 18px; }
    .kpi-row { gap: 6px; }
}
