:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #dce3ee;
    --primary: #275efe;
    --primary-dark: #1747d1;
    --success: #12805c;
    --warning: #b26a00;
    --danger: #b42318;
    --shadow: 0 14px 40px rgba(35, 47, 72, .08);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: radial-gradient(circle at top right, #e7edff 0, transparent 35%), var(--bg);
    color: var(--ink);
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 56px; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin-bottom: 24px; padding: 18px 22px; border: 1px solid rgba(255,255,255,.8);
    border-radius: 22px; background: rgba(255,255,255,.82); backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
.topbar > div { display: flex; gap: 14px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #1c4ed8, #6c63ff); font-weight: 800; letter-spacing: .5px; }
h1 { margin: 0; font-size: clamp(20px, 3vw, 28px); line-height: 1.15; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.panel, .auth-card, .notes-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px;
}
.auth-card { max-width: 520px; margin: 80px auto; }
.auth-card h2, .panel h2 { margin: 6px 0 4px; }
.auth-card p { color: var(--muted); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.step-badge { display: inline-block; color: var(--primary); background: #eef2ff; border: 1px solid #dce4ff; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.security-note { color: var(--success); font-size: 13px; font-weight: 600; }
.account-grid { display: grid; grid-template-columns: 1fr 48px 1fr; gap: 18px; align-items: stretch; }
fieldset { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 18px; min-width: 0; }
legend { padding: 0 8px; font-weight: 800; }
label { display: block; font-weight: 650; margin-bottom: 14px; }
input, select {
    width: 100%; margin-top: 6px; border: 1px solid #cdd6e4; border-radius: 11px; padding: 11px 12px; color: var(--ink); background: #fff; outline: none;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(39,94,254,.12); }
.inline-fields { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 12px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check-row input { width: auto; margin: 0; }
.help { color: var(--muted); font-size: 13px; margin: -4px 0 0; }
.direction-arrow { display: grid; place-items: center; font-size: 32px; color: var(--primary); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 750; cursor: pointer; transition: .2s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(.98); }
.btn:disabled { opacity: .65; cursor: wait; transform: none; }
.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { color: #fff; background: var(--success); }
.btn-warning { color: #fff; background: var(--warning); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-ghost { color: var(--ink); background: #edf1f7; }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; border: 1px solid; }
.alert-success { color: #075f42; background: #ecfdf3; border-color: #a6f4c5; }
.alert-warning { color: #7a4b00; background: #fffaeb; border-color: #fedf89; }
.alert-danger { color: #8a1c13; background: #fef3f2; border-color: #fecdca; }
.hidden { display: none !important; }
.toolbar-mini { display: flex; flex-wrap: wrap; gap: 10px; }
.link-btn { color: var(--primary); background: transparent; border: 0; cursor: pointer; font-weight: 700; padding: 5px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid #e8edf4; text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td:first-child, th:first-child { width: 86px; text-align: center; }
td input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
td small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.run-options { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 16px; border-radius: 14px; background: #f8fafc; }
.run-options label { min-width: 240px; margin: 0; }
.run-options p { color: var(--muted); margin: 0; }
.progress-track { height: 18px; background: #e8edf5; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #275efe, #715cff); transition: width .25s ease; }
.progress-percent { text-align: right; margin-top: 6px; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 18px 0; }
.stats-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.stats-grid span { display: block; color: var(--muted); font-size: 12px; }
.stats-grid strong { font-size: 24px; }
.current-line { padding: 12px 14px; background: #f7f9fc; border-radius: 12px; }
.status-badge { border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 800; }
.status-idle { background: #eef2f6; color: #475467; }
.status-ready { background: #eef4ff; color: #3538cd; }
.status-running { background: #ecfdf3; color: #027a48; }
.status-paused { background: #fffaeb; color: #b54708; }
.status-completed { background: #dcfae6; color: #05603a; }
.status-error { background: #fef3f2; color: #b42318; }
.folder-progress { display: grid; gap: 10px; }
.folder-row-progress { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.folder-row-progress > div:first-child { display: flex; justify-content: space-between; gap: 14px; }
.folder-row-progress span, .folder-row-progress small { color: var(--muted); }
.mini-track { height: 8px; background: #edf1f6; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.mini-track i { display: block; height: 100%; background: var(--primary); }
.failed-box { margin-top: 18px; padding: 16px; border-radius: 14px; background: #fef3f2; color: #8a1c13; max-height: 300px; overflow: auto; }
.failed-box h3 { margin-top: 0; }
.notes-card h3 { margin-top: 0; }
.notes-card li { margin: 6px 0; }
@media (max-width: 860px) {
    .account-grid { grid-template-columns: 1fr; }
    .direction-arrow { transform: rotate(90deg); height: 30px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .panel-heading, .run-options { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
    .page-shell { width: min(100% - 18px, 1180px); padding-top: 10px; }
    .topbar { align-items: flex-start; padding: 14px; }
    .topbar p { display: none; }
    .brand-mark { width: 44px; height: 44px; }
    .panel, .auth-card, .notes-card { padding: 16px; border-radius: 17px; }
    .inline-fields { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}


/* v1.2.0 — canlı hata günlüğü */
.log-controls { display: grid; grid-template-columns: 170px 170px auto 1fr; gap: 12px; align-items: end; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.log-controls label { margin: 0; }
.log-auto { align-self: center; margin-bottom: 3px !important; }
.log-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 16px 0; }
.diagnostic-grid > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.diagnostic-grid span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.diagnostic-grid strong { display: block; margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.diag-ok { color: var(--success); }
.diag-bad { color: var(--danger); }
.log-summary { margin: 12px 0; color: var(--muted); font-size: 13px; }
.log-table-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.log-table { min-width: 920px; }
.log-table thead { position: sticky; top: 0; z-index: 2; background: #f8fafc; }
.log-table th:first-child, .log-table td:first-child { width: 165px; text-align: left; }
.log-table th:nth-child(2) { width: 100px; }
.log-table th:nth-child(3) { width: 32%; }
.log-row td { vertical-align: top; }
.log-row.log-critical { background: #fff1f0; }
.log-row.log-error { background: #fff8f7; }
.log-row.log-warning { background: #fffdf5; }
.log-time { white-space: nowrap; color: var(--muted); font-size: 12px; }
.log-message { font-weight: 650; overflow-wrap: anywhere; }
.log-level { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.level-critical, .level-error { color: #b42318; background: #fee4e2; }
.level-warning { color: #b54708; background: #fef0c7; }
.level-info { color: #175cd3; background: #dbeafe; }
.level-debug { color: #475467; background: #eaecf0; }
.log-table details summary { color: var(--primary); cursor: pointer; font-weight: 650; font-size: 12px; }
.log-table pre { max-width: 520px; max-height: 260px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 9px; background: #111827; color: #e5e7eb; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.log-empty { padding: 34px !important; text-align: center !important; color: var(--muted); }
.log-help { margin-top: 12px; }
.muted { color: var(--muted); }
@media (max-width: 1040px) {
    .log-controls { grid-template-columns: 1fr 1fr; }
    .log-actions { justify-content: flex-start; grid-column: 1 / -1; }
    .diagnostic-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
    .log-controls { grid-template-columns: 1fr; }
    .log-actions { grid-column: auto; }
    .diagnostic-grid { grid-template-columns: 1fr 1fr; }
}

/* v1.3.0 — tümü / belirli yıllar aktarım filtresi */
.date-filter-card { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcff; }
.date-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.date-filter-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.date-filter-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { display: flex; align-items: flex-start; gap: 11px; min-width: 0; margin: 0; padding: 14px; border: 1px solid #d7deea; border-radius: 14px; background: #fff; cursor: pointer; transition: .18s ease; }
.choice-card:hover { border-color: #9eb3ff; transform: translateY(-1px); }
.choice-card.active { border-color: var(--primary); background: #f2f5ff; box-shadow: 0 0 0 3px rgba(39,94,254,.08); }
.choice-card input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.choice-card span { min-width: 0; }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.year-filter-fields { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 14px 18px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #d8dfeb; }
.year-filter-fields label { margin: 0; }
.year-filter-fields > .help { grid-column: 1 / -1; margin: -2px 0 0; }
.field-caption { display: block; margin-bottom: 6px; font-weight: 650; }
.year-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; }
.year-chip { border: 1px solid #cbd5e1; border-radius: 999px; padding: 7px 11px; color: #344054; background: #fff; cursor: pointer; font-weight: 700; }
.year-chip:hover { border-color: var(--primary); color: var(--primary); }
.year-chip.selected { border-color: var(--primary); color: #fff; background: var(--primary); }
.job-filter-summary { margin: -4px 0 16px; color: var(--muted); font-size: 13px; font-weight: 650; }
@media (max-width: 760px) {
    .date-filter-choices, .year-filter-fields { grid-template-columns: 1fr; }
    .year-filter-fields > .help { grid-column: auto; }
}

/* v1.4.0 — toplu kullanıcı ve mesaj paketi görünümü */
.bulk-server-grid,
.bulk-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 16px;
}

.bulk-server-grid fieldset {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    background: #fbfdff;
}

.bulk-list-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
}

.bulk-list-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.bulk-list-heading p,
.bulk-list-heading strong {
    margin: 0;
}

.bulk-list-heading p {
    margin-top: 5px;
    color: var(--muted);
    font-size: .9rem;
}

#bulkAccountsText {
    width: 100%;
    min-height: 190px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .86rem;
    line-height: 1.55;
    white-space: pre;
}

.bulk-count {
    margin-top: 8px;
    color: var(--muted);
    font-size: .88rem;
    text-align: right;
}

.file-link {
    display: inline-flex;
    cursor: pointer;
}

.file-link input[type="file"] {
    display: none;
}

.date-filter-card.compact {
    margin: 0;
    display: grid;
    gap: 10px;
    align-content: start;
}

.date-filter-card.compact > strong {
    margin-bottom: 2px;
}

.bulk-status-table td {
    vertical-align: middle;
}

.bulk-status-table td:nth-child(2),
.bulk-status-table td:nth-child(3) {
    min-width: 180px;
}

.bulk-status-table td:nth-child(5) {
    min-width: 210px;
}

.bulk-status-table .status-badge {
    white-space: nowrap;
}

.bulk-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.run-options label {
    min-width: 200px;
}

@media (max-width: 980px) {
    .bulk-server-grid,
    .bulk-options-grid {
        grid-template-columns: 1fr;
    }

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

    .bulk-list-heading {
        flex-direction: column;
    }
}
