/* Patent Takip — YKS öğretmen paneli tarzı, kırmızı marka */

:root {
    --brand: #d45b5b;
    --brand-deep: #c03d3d;
    --brand-soft: #f5d4d4;
    --brand-ink: #7b1e1e;
    --brand-hover: #ad2f2f;
    --glass-bg: rgba(248, 250, 252, 0.92);
    --glass-bg-strong: #f8fafc;
    --glass-border: rgba(30, 41, 59, 0.12);
    --glass-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
    --sidebar-width: 260px;
    --ink: #1a1d26;
    --muted: #64748b;
    --line: rgba(26, 29, 38, 0.1);
    --card: #ffffff;
    --surface: #f1f5f9;
    --accent: var(--brand-deep);
    --accent-soft: rgba(212, 91, 91, 0.14);
    --bg: #f4f5f7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.admin-body {
    background: var(--bg, #f4f5f7);
    min-height: 100vh;
    color: var(--ink);
}

.admin-body.sidebar-open { overflow: hidden; }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

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

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    transition: transform 0.28s ease;
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.125rem 1rem;
    border-bottom: 1px solid rgba(26, 29, 38, 0.06);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--ink);
}

.pt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e07e7e 0%, var(--brand) 50%, var(--brand-deep) 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(192, 61, 61, 0.28);
}

.pt-badge-lg {
    width: 56px;
    height: 56px;
    font-size: 1rem;
    border-radius: 14px;
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.admin-brand-title { font-weight: 700; font-size: 1rem; }

.admin-brand-sub {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.admin-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(26, 29, 38, 0.06);
    color: var(--ink);
    cursor: pointer;
}

.admin-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.75rem 1rem;
}

.admin-nav-label {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.admin-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5068;
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink);
}

.admin-nav-link.active {
    background: rgba(212, 91, 91, 0.16);
    color: var(--brand-ink);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand-deep);
}

.admin-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.admin-nav-link.active .admin-nav-icon {
    background: rgba(212, 91, 91, 0.28);
}

.admin-sidebar-footer {
    padding: 0.75rem 0.75rem 1.25rem;
    border-top: 1px solid rgba(26, 29, 38, 0.06);
}

.admin-sidebar-copy {
    margin: 0.75rem 0 0;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(26, 29, 38, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.admin-topbar-start {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.admin-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(26, 29, 38, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink);
    cursor: pointer;
}

.admin-page-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.admin-page-heading {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-page-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    background: rgba(192, 61, 61, 0.16);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-ink);
    flex-shrink: 0;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.admin-user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    border: 1px solid rgba(26, 29, 38, 0.08);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 500;
}

.admin-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(212, 91, 91, 0.2);
    color: var(--brand-ink);
    overflow: hidden;
}

.admin-logout-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4375rem 0.875rem;
    border-radius: 10px;
    border: 1px solid rgba(192, 61, 61, 0.28);
    background: rgba(212, 91, 91, 0.1);
    color: var(--brand-deep);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.admin-logout-btn:hover {
    background: rgba(212, 91, 91, 0.18);
    color: var(--brand-ink);
}

.admin-content {
    flex: 1;
    padding: 1.5rem 0 2rem;
}

.admin-container {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.admin-container:has(.mk-cols) {
    width: 100%;
    max-width: none;
}

/* Legacy wrap (non-admin / fallback) */
.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 20px 64px;
}

.admin-container > h1:first-of-type {
    display: none;
}
.admin-container > .sub:first-of-type {
    margin-top: 0;
}

h1 { margin: 0 0 8px; font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 700; }
.sub { margin: 0 0 20px; color: var(--muted); font-size: 0.92rem; }
h2 { margin: 0 0 12px; font-size: 1.05rem; font-weight: 700; }
h3 { margin: 0 0 8px; font-size: 0.95rem; font-weight: 600; }

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: 10px;
    background: var(--brand-deep);
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    min-height: 40px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(192, 61, 61, 0.22);
}
.btn:hover, button:hover:not(:disabled) { background: var(--brand-hover); }
.btn.secondary {
    background: #2f3b4a;
    box-shadow: none;
}
.btn.ghost {
    background: rgba(255, 255, 255, 0.75);
    color: var(--brand-ink);
    border: 1px solid rgba(192, 61, 61, 0.28);
    box-shadow: none;
}
.btn.ghost:hover { background: var(--accent-soft); }
.btn-block { width: 100%; }
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}
select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.875rem;
}
select:focus,
input:focus {
    outline: none;
    border-color: rgba(192, 61, 61, 0.45);
    box-shadow: 0 0 0 3px rgba(212, 91, 91, 0.15);
}

.panel, .item, form.filters {
    background: var(--card);
    border: 1px solid rgba(26, 29, 38, 0.08);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}
form.filters {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    gap: 12px;
    margin-bottom: 20px;
}
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.9rem;
}
.list { display: grid; gap: 14px; }
.item-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px 18px;
    align-items: start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: flex-start;
}
.item-id {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 4.5rem;
}
.item-id-no {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text, #1a1d26);
}
.item-id-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.item-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}
.fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 7.5rem;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}
.fact-date {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 11rem;
}
.fact-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.fact-k {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.fact-v {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text, #1a1d26);
    word-break: break-word;
}
.fact-desc {
    flex: 1 1 14rem;
    min-width: 12rem;
}
.pub-cal {
    display: grid;
    grid-template-rows: auto auto auto;
    justify-items: center;
    min-width: 3.1rem;
    padding: 4px 6px 5px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(192, 61, 61, 0.28);
    overflow: hidden;
    line-height: 1;
}
.pub-month {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-deep);
}
.pub-day {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text, #1a1d26);
    padding: 2px 0;
}
.pub-year {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--muted);
}
.item.is-complete {
    background: #eef8f1;
    border-color: rgba(47, 107, 79, 0.28);
    box-shadow: 0 2px 12px rgba(47, 107, 79, 0.08);
}
.file.is-complete {
    background: #f3faf6;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(47, 107, 79, 0.2);
}
.done-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    margin-right: 0.35em;
    border-radius: 50%;
    background: #2f6b4f;
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}
.item-id .done-tick {
    width: 1.35em;
    height: 1.35em;
    margin: 0 0 2px;
    font-size: 0.7em;
}
.files { margin-top: 12px; display: grid; gap: 10px; }
.file {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.file.is-complete { border-top-color: transparent; }
.file-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}
.file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8e8e8 0%, #f0d0d0 100%);
    border: 1px solid rgba(192, 61, 61, 0.28);
    color: var(--brand-deep);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.file-info { min-width: 0; }
.file-name {
    font-size: 0.95rem;
    font-weight: 650;
    word-break: break-word;
    line-height: 1.35;
}
.file-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.file-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 9999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.file-chip-db {
    background: var(--accent-soft);
    border-color: rgba(192, 61, 61, 0.22);
    color: var(--brand-ink);
}
.file-chip-ok {
    background: #e7f5ec;
    border-color: rgba(47, 107, 79, 0.25);
    color: #2f6b4f;
}
.file-chip-warn {
    background: #fff4e5;
    border-color: rgba(180, 110, 20, 0.28);
    color: #8a5a12;
}
.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}
.import-stages,
.import-progress,
.import-live,
.import-tally,
.import-status,
.import-report {
    grid-column: 1 / -1;
}
.server-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--brand-ink);
    vertical-align: middle;
}

.card-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.import-stages {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    gap: 0;
    width: 100%;
    margin: 4px 0 6px;
    padding: 0;
    position: relative;
}
.import-stages::before {
    content: "";
    position: absolute;
    top: 14px;
    left: calc(10% + 2px);
    right: calc(10% + 2px);
    height: 2px;
    background: var(--line);
    z-index: 0;
    pointer-events: none;
}
.import-stages li {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    min-height: 64px;
    padding: 0 4px;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 0;
}
.stage-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}
.stage-label {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.stage-meta {
    display: block;
    width: 100%;
    min-height: 1em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.65rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.import-stages.is-reading [data-step="reading"],
.import-stages.is-txt [data-step="reading"],
.import-stages.is-txt [data-step="txt"],
.import-stages.is-db [data-step="reading"],
.import-stages.is-db [data-step="txt"],
.import-stages.is-db [data-step="db"],
.import-stages.is-verify [data-step="reading"],
.import-stages.is-verify [data-step="txt"],
.import-stages.is-verify [data-step="db"],
.import-stages.is-verify [data-step="verify"],
.import-stages.is-done [data-step] {
    color: var(--brand-ink);
}
.import-stages.is-reading [data-step="reading"] .stage-dot,
.import-stages.is-txt [data-step="reading"] .stage-dot,
.import-stages.is-txt [data-step="txt"] .stage-dot,
.import-stages.is-db [data-step="reading"] .stage-dot,
.import-stages.is-db [data-step="txt"] .stage-dot,
.import-stages.is-db [data-step="db"] .stage-dot,
.import-stages.is-verify [data-step="reading"] .stage-dot,
.import-stages.is-verify [data-step="txt"] .stage-dot,
.import-stages.is-verify [data-step="db"] .stage-dot,
.import-stages.is-verify [data-step="verify"] .stage-dot,
.import-stages.is-done [data-step] .stage-dot {
    background: var(--accent-soft);
    border-color: rgba(192, 61, 61, 0.45);
    color: var(--brand-ink);
}
.import-stages.is-reading [data-step="reading"] .stage-dot,
.import-stages.is-txt [data-step="txt"] .stage-dot,
.import-stages.is-db [data-step="db"] .stage-dot,
.import-stages.is-verify [data-step="verify"] .stage-dot,
.import-stages.is-done [data-step="done"] .stage-dot {
    background: var(--brand);
    border-color: var(--brand-deep);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(212, 91, 91, 0.18);
}
.import-stages.is-error li { color: #8a1f1f; }
.import-stages.is-error .stage-dot {
    border-color: #e0b4b4;
    color: #8a1f1f;
}

.import-progress {
    height: 6px;
    min-height: 6px;
    background: #ebe7df;
    border-radius: 9999px;
    margin: 0 0 6px;
    overflow: hidden;
}
.import-progress[hidden] {
    display: block !important;
    visibility: hidden;
}
.import-progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-deep));
    transition: width .2s ease;
}
.pdf-restart-wrap {
    margin: 0 0 8px;
}
.pdf-restart-wrap .btn {
    font-size: 0.82rem;
}
.import-live {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 6px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 0.82rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.import-live .live-item strong {
    color: var(--ink);
    font-weight: 700;
}
.import-status {
    font-size: 0.82rem;
    color: var(--muted);
    min-height: 1.25em;
    margin-bottom: 6px;
}
.import-status.error { color: #8a1f1f; font-weight: 600; }
.import-tally {
    display: none !important;
}
.import-report {
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid rgba(192, 61, 61, 0.28);
    border-radius: 10px;
    background: #fff8f8;
    font-size: 0.85rem;
    color: var(--ink);
}
.import-report[hidden] { display: none; }
.import-report.is-ok {
    border-color: rgba(47, 107, 79, 0.3);
    background: #f3faf6;
}
.import-report.is-error {
    border-color: rgba(138, 31, 31, 0.35);
    background: #fff5f5;
}
.import-report-title {
    font-weight: 700;
    margin: 0 0 6px;
    font-size: 0.88rem;
}
.import-report.is-ok .import-report-title { color: #2f6b4f; }
.import-report:not(.is-ok) .import-report-title { color: var(--brand-ink); }
.import-error-step {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: var(--muted);
}
.import-error-detail {
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(138, 31, 31, 0.18);
    color: #8a1f1f;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow: auto;
}
.import-error-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #6b3a3a;
    font-weight: 600;
}
.import-report ul {
    margin: 0;
    padding-left: 1.1rem;
    max-height: 180px;
    overflow: auto;
}
.import-report li { margin: 2px 0; }
.import-report .rpt-meta { color: var(--muted); font-size: 0.78rem; }

.error, .empty {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.error { border-color: #c45c5c; color: #8a1f1f; background: #fff8f8; }
.pager { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.status { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; min-height: 1.2em; }
.status.error { color: #8a1f1f; }

.marks-list {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    max-height: 60vh;
    overflow: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}
.mk-hits-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 18px 0 8px;
    flex-wrap: wrap;
}
.mk-hits-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.marks-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}
.marks-list .hit-body { flex: 1; min-width: 0; }
.marks-list .mark-code { color: var(--muted); margin-right: 6px; font-size: 0.8rem; }
.marks-list .hit-oran {
    flex: 0 0 auto;
    min-width: 3.2em;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--muted);
}
.marks-list .hit-oran.is-rated { color: var(--brand-deep); }
.marks-list .hit-oran.is-pending { color: var(--muted); font-weight: 500; }
.marks-list .hit-oran.is-high { color: #8a1f1f; }
.marks-list .hit-oran.is-mid { color: #9a6b1f; }
.marks-list .hit-oran.is-low { color: #2f6b4f; }
.marks-list .hit-del {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 6px;
}
.marks-list .hit-del:hover {
    color: #8a1f1f;
    background: #fff0f0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 29, 38, 0.45);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2000;
}
.modal-backdrop.open { display: flex; }
.modal {
    width: min(920px, 100%);
    max-height: min(92vh, 960px);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}
.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.modal-head h2 { margin: 0 0 4px; font-size: 1.1rem; }
.modal-head p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.modal-body { padding: 16px 18px 24px; }

.reader-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}
.progress {
    height: 6px;
    background: #ebe7df;
    border-radius: 9999px;
    margin-bottom: 14px;
    overflow: hidden;
    display: none;
}
.progress.visible { display: block; }
.progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-deep));
    transition: width .15s linear;
}
.page-view {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow: auto;
    text-align: center;
    margin-bottom: 14px;
    display: none;
}
.page-view.has-image { display: block; }
.page-view canvas { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.page-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.92rem;
    line-height: 1.55;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    max-height: 280px;
    overflow: auto;
}

/* Login */
.login-body {
    min-height: 100vh;
    margin: 0;
    background: #f5e8e8;
}
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
}
.login-brand-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 50%),
        linear-gradient(135deg, #e07e7e 0%, #d45b5b 48%, #c03d3d 100%);
    color: #fff;
}
.login-brand-inner { max-width: 360px; }
.login-brand-inner h1 {
    margin: 1rem 0 0.5rem;
    font-size: 2rem;
    color: #fff;
}
.login-brand-inner p {
    margin: 0;
    opacity: 0.92;
    line-height: 1.5;
    font-size: 0.95rem;
}
.login-form-panel {
    display: grid;
    place-items: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse at 100% 0%, rgba(212, 91, 91, 0.1) 0%, transparent 45%),
        linear-gradient(165deg, #efd9d9 0%, #f5e8e8 50%, #ebe4e4 100%);
}
.login-card {
    width: min(420px, 100%);
    padding: 1.75rem 1.5rem;
    border-radius: 16px;
}
.login-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}
.login-card .field { margin-bottom: 14px; }

.mk-global {
    margin: 0 0 14px;
}
.mk-global-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.mk-global-log {
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 0.85rem;
}
.mk-log-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}
.mk-log-row:last-child { border-bottom: 0; }
.mk-log-row.is-info { background: #faf8f8; color: var(--muted); }
.mk-log-row.is-error { background: #fff8f8; }
.mk-log-main {
    min-width: 0;
    word-break: break-word;
}
.mk-log-meta {
    color: var(--muted);
    font-size: 0.75rem;
    margin-top: 2px;
}
.mk-log-oran {
    min-width: 3.2em;
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--muted);
    padding-top: 2px;
}
.mk-log-oran.is-pending { font-weight: 500; }
.mk-log-oran.is-high { color: #8a1f1f; }
.mk-log-oran.is-mid { color: #9a6b1f; }
.mk-log-oran.is-low { color: #2f6b4f; }

.mk-cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 12px;
    align-items: stretch;
    min-height: calc(100vh - 160px);
}
.mk-col {
    margin: 0;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    max-height: calc(100vh - 140px);
    overflow: hidden;
}
.mk-col-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}
.mk-col-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.mk-col-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.mk-col-tools-row { margin-bottom: 8px; }
.mk-col-tools .btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
}
.mk-col-tools .btn.is-active {
    background: var(--brand-deep);
    color: #fff;
    border-color: var(--brand-deep);
}
.mk-col-search {
    width: 100%;
    margin-bottom: 8px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.875rem;
}
.mk-col-hint {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.82rem;
}
.mk-col-list {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.mk-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    border-left: 3px solid transparent;
}
.mk-item:last-child { border-bottom: 0; }
.mk-item:hover { background: var(--accent-soft); }
.mk-item.is-selected {
    background: var(--accent-soft);
    border-left-color: var(--brand-deep);
}
.mk-item-title {
    font-weight: 600;
    font-size: 0.92rem;
    word-break: break-word;
}
.mk-item-sub {
    color: var(--muted);
    font-size: 0.78rem;
    word-break: break-word;
}
.mk-item-links {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.mk-item-links a {
    font-size: 0.78rem;
    color: var(--brand-deep);
    text-decoration: underline;
    cursor: pointer;
}
.mk-item-links a:hover { opacity: 0.85; }
.mk-item-links a.is-danger { color: #8a1f1f; }
.mk-hits-acc {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mk-bulten {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.mk-bulten > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    background: linear-gradient(180deg, #fff 0%, #faf6f6 100%);
}
.mk-bulten > summary::-webkit-details-marker { display: none; }
.mk-bulten > summary::before {
    content: '';
    width: 0.4em;
    height: 0.4em;
    border-right: 2px solid var(--brand-deep);
    border-bottom: 2px solid var(--brand-deep);
    transform: rotate(-45deg);
    flex: 0 0 auto;
}
.mk-bulten[open] > summary::before { transform: rotate(45deg); }
.mk-bulten-meta {
    margin-left: auto;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.78rem;
}
.mk-bulten-body { border-top: 1px solid var(--line); }
.mk-hit-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.88rem;
}
.mk-hit-row:last-child { border-bottom: 0; }
.mk-hit-body { flex: 1; min-width: 0; }
.mk-hit-oran {
    flex: 0 0 auto;
    min-width: 3.2em;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--muted);
}
.mk-hit-oran.is-pending { font-weight: 500; }
.mk-hit-oran.is-high { color: #8a1f1f; }
.mk-hit-oran.is-mid { color: #9a6b1f; }
.mk-hit-oran.is-low { color: #2f6b4f; }
.mk-hit-del {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 6px;
}
.mk-hit-del:hover { color: #8a1f1f; background: #fff0f0; }

/* legacy tree (unused) keep minimal */
.mk-layout { display: none; }

@media (max-width: 1200px) {
    .mk-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mk-col { max-height: none; min-height: 280px; }
}
@media (max-width: 860px) {
    .mk-cols { grid-template-columns: 1fr; }
    .mk-layout { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-panel { min-height: 220px; padding: 2rem 1.5rem; }
}

#toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.toast-item {
    pointer-events: auto;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(28, 36, 48, 0.12);
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.35;
    animation: toast-in .2s ease-out;
}
.toast-item strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--muted);
    font-weight: 600;
}
.toast-item.info { border-left: 3px solid var(--brand-deep); }
.toast-item.error { border-left: 3px solid #8a1f1f; background: #fff8f8; }
.toast-item.success { border-left: 3px solid var(--brand-deep); }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-105%);
    }
    .admin-sidebar.is-open {
        transform: translateX(0);
    }
    .admin-sidebar-close { display: flex; }
    .admin-menu-toggle { display: flex; }
    .admin-main { margin-left: 0; }
}

@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-panel { min-height: 220px; padding: 2rem 1.5rem; }
}

@media (max-width: 720px) {
    form.filters { grid-template-columns: 1fr; }
    button, .btn { width: 100%; }
    .item-head { grid-template-columns: 1fr; }
    .item-actions { justify-content: stretch; }
    .file-head {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .file-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }
    .import-stages { font-size: 0.65rem; }
    .stage-label { font-size: 0.65rem; }
    .admin-user-name { display: none; }
    .admin-container { padding: 0 1rem; }
}

/* Ayarlar */
.panel-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 600;
}
.ayar-form label,
.panel label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}
.ayar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 14px;
}
.ayar-form input,
.ayar-form select,
.ayar-alici-add input,
.ayar-cron-row input,
#cronToken {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}
.ayar-alici-add {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.ayar-alici-add input { flex: 1; min-width: 200px; }
.ayar-cron-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.ayar-cron-row input { flex: 1; font-family: ui-monospace, monospace; font-size: 0.8rem; }
.ayar-cron-example {
    margin: 12px 0 0;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: 8px;
    font-size: 0.78rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.status.ok { color: #166534; }
