/* EMO Ankara yönetim paneli. Görsel dil Stitch tasarımından gelir: lacivert omurga, keskin köşe, ince kenarlık. */

@font-face {
    font-family: "Instrument Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/instrument-serif-latin-ext-400-normal.woff2) format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Instrument Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/instrument-serif-latin-400-normal.woff2) format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --navy: #002b49;
    --primary: #0b4a72;
    --accent: #006398;
    --hover: #083856;
    --amber: #f59e0b;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --bg: #f8fafc;
    --soft: #f1f5f9;
    --panel: #ffffff;
    --ok: #047857;
    --ok-bg: #ecfdf5;
    --warn: #b45309;
    --warn-bg: #fffbeb;
    --err: #b91c1c;
    --err-bg: #fef2f2;
    --sidebar-width: 248px;
    --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--navy); }
small { font-size: 13px; font-weight: 400; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.mono--wrap { overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lead { color: var(--text); margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 13px; }
.section-gap { margin-top: 24px; }
.section-gap--bottom { margin-bottom: 24px; }

.skip-link {
    position: absolute;
    left: 8px;
    top: -48px;
    z-index: 20;
    padding: 8px 14px;
    background: var(--amber);
    color: var(--ink);
    font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* Kabuk */
.shell { display: flex; min-height: 100vh; }
.workspace { flex: 1; min-width: 0; }
.main { max-width: 1120px; margin: 0 auto; padding: 28px 32px 56px; }

/* Yan menü */
.sidebar {
    position: sticky;
    top: 0;
    flex: none;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    background: var(--navy);
    color: #e2e8f0;
}
.sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand__tile { display: flex; flex: none; padding: 4px; background: #fff; }
.brand__tile img { width: 34px; height: auto; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__org { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.brand__sub { font-size: 12px; font-weight: 600; color: #93ccff; }

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    cursor: pointer;
}

.nav { padding: 12px 0 24px; }
.nav__section {
    padding: 18px 16px 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.nav__user { padding: 0 16px 8px; color: #fff; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: #e2e8f0;
    font: inherit;
    font-weight: 500;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.nav__link:hover { background: var(--primary); color: #fff; }
.nav__link.is-current { background: var(--accent); border-left-color: var(--amber); color: #fff; font-weight: 700; }

/* Sayfa başlığı */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 20px; border-bottom: 2px solid var(--navy); }
.page-title { display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.page-title__mark { width: 10px; height: 22px; background: var(--navy); }

/* Panel */
.panel { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.panel--pad { padding: 24px; }
.panel--narrow { max-width: 620px; }
.panel__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--navy);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.panel__bar--light { background: var(--soft); color: var(--navy); border-bottom: 1px solid var(--line); }
.panel__mark { width: 10px; height: 10px; background: var(--amber); }
.panel__body { padding: 22px 20px; }
.panel-title { color: var(--ink); font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.panel-title + .hint { margin-bottom: 14px; }

/* Uyarılar */
.alert { padding: 11px 14px; margin-bottom: 16px; border: 1px solid var(--line-strong); border-left-width: 4px; background: var(--soft); color: var(--ink); font-size: 14px; }
.alert--success { background: var(--ok-bg); border-color: #a7f3d0; border-left-color: var(--ok); }
.alert--warning { background: var(--warn-bg); border-color: #fde68a; border-left-color: var(--warn); }
.alert--error { background: var(--err-bg); border-color: #fecaca; border-left-color: var(--err); }

.secret { padding: 16px; margin-bottom: 16px; background: var(--warn-bg); border: 1px solid #fde68a; border-left: 4px solid var(--amber); }
.secret__title { color: var(--ink); font-weight: 700; margin-bottom: 8px; }
.secret__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.secret__value { padding: 8px 12px; background: #fff; border: 1px solid var(--line-strong); color: var(--ink); font-family: var(--mono); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }

/* Düğmeler */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 20px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--primary); color: #fff; }
.btn--ghost { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--soft); color: var(--ink); }
.btn--wide { width: 100%; }
.link { font-weight: 700; text-decoration: none; font-size: 14px; }
.link:hover { text-decoration: underline; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar--between { justify-content: space-between; }
.toolbar--between .lead { margin-bottom: 0; }

/* Form */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > label, .field > legend { color: var(--ink); font-size: 14px; font-weight: 600; }
.field > legend { padding: 0 0 6px; }
input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    color: var(--ink);
    font: inherit;
}
input[type="url"], input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    color: var(--ink);
    font: inherit;
}
textarea { display: block; resize: vertical; line-height: 1.5; }
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 99, 152, .15); }
.has-error textarea { border-color: var(--err); }
input[type="file"] { width: 100%; padding: 8px 0; color: var(--text); font: inherit; font-size: 14px; }
input[type="color"] { width: 72px; height: 44px; padding: 3px; background: #fff; border: 1px solid var(--line-strong); cursor: pointer; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 99, 152, .15); }
.has-error input { border-color: var(--err); }
.field__error { color: var(--err); font-size: 13px; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.check small { display: block; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* Çipler */
.chip {
    display: inline-block;
    padding: 2px 8px;
    margin: 1px 2px 1px 0;
    background: var(--soft);
    border: 1px solid var(--line);
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.chip--navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip--ok { background: var(--ok-bg); border-color: #a7f3d0; color: var(--ok); }
.chip--warn { background: var(--warn-bg); border-color: #fde68a; color: var(--warn); }
.chip--off { background: var(--soft); border-color: var(--line-strong); color: var(--muted); }

/* Tablo: dar ekranda her satır kart olur. */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    padding: 10px 16px;
    background: var(--soft);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    text-align: left;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table strong { color: var(--ink); }
.table__actions { text-align: right; white-space: nowrap; }

/* Satır listesi */
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row__main { min-width: 0; }
.row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; font-weight: 700; }
.row__text { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* Panel kartları */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.module-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    color: inherit;
    text-decoration: none;
}
.module-card:hover { border-color: var(--primary); color: inherit; }
.module-card__icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 6px; background: var(--soft); color: var(--navy); }
.module-card:hover .module-card__icon { background: var(--navy); color: #fff; }
.module-card__title { color: var(--ink); font-weight: 700; }
.module-card__text { color: var(--muted); font-size: 14px; padding-right: 22px; }
.module-card__arrow { position: absolute; right: 16px; bottom: 16px; color: var(--accent); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.facts > div { padding: 14px 20px; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: 0; }
.facts dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.facts dd { color: var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

/* Ana sayfa kartları: kapak görünümü ana sitenin portal-card.css dosyasından gelir. */
.cover-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 230px)); gap: 28px 24px; }
.cover-list__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: 14px; }
.card-editor { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 28px; }
.card-editor__preview { position: sticky; top: 24px; }
.card-editor__label { margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.card-editor__danger { max-width: calc(100% - 308px); }

/* Elektro Haber sayıları */
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; }
.dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 112px;
    padding: 20px;
    background: var(--bg);
    border: 2px dashed var(--line-strong);
    text-align: center;
}
/* Dosya alanı bölgenin tamamını kaplar: sürükle bırak ve tıklama tarayıcının kendi özelliğidir. */
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.is-over { background: var(--soft); border-color: var(--accent); }
.dropzone:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 99, 152, .15); }
.dropzone.has-problem { background: var(--err-bg); border-color: var(--err); }
.dropzone__text { color: var(--ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.upload-progress { display: grid; gap: 4px; color: var(--text); font-size: 13px; }
.upload-progress[hidden] { display: none; }
.upload-progress progress { width: 100%; height: 10px; accent-color: var(--navy); }
.field__error[hidden] { display: none; }
.issue-preview { display: flex; align-items: center; justify-content: center; min-height: 300px; background: var(--soft); border: 1px solid var(--line); }
.issue-preview__image { width: 100%; height: auto; }
.issue-preview__image[hidden], .issue-preview__empty[hidden] { display: none; }
.issue-preview__empty { padding: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.table--issues td { vertical-align: middle; }
.table__thumb { width: 72px; padding-right: 0; }
.issue-thumb { display: block; width: 44px; height: 62px; object-fit: cover; box-shadow: 0 0 0 1px var(--line-strong); }
.issue-thumb--empty { display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--muted); font-size: 10px; text-align: center; }
.table__sub { display: block; color: var(--muted); font-size: 13px; }

.error-detail { padding: 10px; margin: 12px 0 0; background: var(--soft); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Giriş ekranı */
.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.auth__box { width: 100%; max-width: 420px; }
.auth__logos { display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 20px; }
.auth__logos img { height: 90px; width: auto; }
.auth__foot { margin-top: 16px; color: var(--muted); font-size: 12px; text-align: center; }
.auth .hint:first-child { margin-bottom: 14px; }

/* Tablet ve mobil */
@media (max-width: 900px) {
    .shell { display: block; }
    .sidebar { position: static; width: auto; height: auto; overflow: visible; }
    .sidebar__head { padding: 10px 16px; border-bottom: 0; }
    .nav-toggle { display: inline-flex; }
    .nav { padding: 0 0 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
    .nav--collapsible:not(.is-open) { display: none; }
    .main { padding: 20px 16px 48px; }
    .card-editor { grid-template-columns: minmax(0, 1fr); }
    .card-editor__preview { position: static; order: -1; width: min(70%, 260px); margin-inline: auto; }
    .card-editor__danger { max-width: none; }
}

@media (max-width: 720px) {
    .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .table, .table tbody, .table tr, .table td { display: block; }
    .table tr { padding: 10px 16px; border-bottom: 1px solid var(--line); }
    .table tr:last-child { border-bottom: 0; }
    .table td { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 4px 0; border: 0; }
    .table td[data-label]::before { content: attr(data-label); flex: 0 0 92px; color: var(--muted); font-size: 12px; font-weight: 600; }
    /* Sayı listesinde kapak solda, bilgiler sağda: uzun listede az yer kaplar. */
    .table--issues tr { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; }
    .table--issues td { grid-column: 2; padding: 2px 0; }
    .table--issues td[data-label]::before { flex-basis: 56px; }
    .table--issues .table__thumb { grid-column: 1; grid-row: 1 / span 5; width: auto; padding: 2px 0 0; }
    .table__actions { justify-content: flex-end; }
    .row { flex-direction: column; align-items: stretch; }
    .row .btn { width: 100%; }
    .facts > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .facts > div:last-child { border-bottom: 0; }
    .panel--pad { padding: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
    .btn, .nav__link, .module-card, .module-card__icon { transition: background-color .15s, border-color .15s, color .15s; }
}
