/* =========================================================
   ÖSRM · Öğrenci Şikayet Raporlama Merkezi
   Stil dosyası
   ========================================================= */

:root {
    --bg: #eef2fa;
    --surface: #ffffff;
    --surface-soft: #f7f9fe;
    --ink: #111b33;
    --ink-soft: #2a3550;
    --muted: #68738f;
    --line: #e1e7f4;
    --primary: #2f5bea;
    --primary-dark: #2246c4;
    --primary-soft: #e8edff;
    --accent: #10b3a3;
    --accent-soft: #e2f8f5;
    --danger: #dc3e5a;
    --danger-soft: #fdeaee;
    --warning: #c47b16;
    --warning-soft: #fdf3e0;
    --success: #188a5e;
    --success-soft: #e4f7ee;
    --input-border: #d7def0;
    --hover-surface: #fafcff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(17, 27, 51, .06), 0 6px 18px rgba(17, 27, 51, .05);
    --shadow-md: 0 12px 34px rgba(17, 27, 51, .10);
    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

/* ---------------------------------------------------------
   Koyu tema
   --------------------------------------------------------- */

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0a1120;
    --surface: #121b2e;
    --surface-soft: #0e1626;
    --ink: #e9effc;
    --ink-soft: #c8d3e8;
    --muted: #92a0bd;
    --line: #23314c;
    --primary: #6d8cff;
    --primary-dark: #4a6ff0;
    --primary-soft: #1a2a52;
    --accent: #3fd8c6;
    --accent-soft: #103a38;
    --danger: #ff7a91;
    --danger-soft: #3a1722;
    --warning: #f0b45c;
    --warning-soft: #3a2a12;
    --success: #4edea3;
    --success-soft: #0f3a2c;
    --input-border: #2b3b5c;
    --hover-surface: #16213a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .38), 0 8px 22px rgba(0, 0, 0, .26);
    --shadow-md: 0 16px 40px rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 110% -10%, #dfe8ff 0%, rgba(223, 232, 255, 0) 60%),
        radial-gradient(700px 380px at -10% 0%, #dff6f2 0%, rgba(223, 246, 242, 0) 55%),
        var(--bg);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    margin: 0 0 6px;
    line-height: 1.25;
    letter-spacing: -.015em;
}

h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

p { margin: 0 0 10px; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 22px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------------------------------------------------------
   Üst çubuk
   --------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    flex-shrink: 0;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), #5a7dff);
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 8px 18px rgba(47, 91, 234, .32);
}

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

.brand-text strong {
    font-size: 18px;
    letter-spacing: .04em;
}

.brand-text small {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .02em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav a {
    color: var(--ink-soft);
    padding: 9px 13px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.nav a:hover {
    background: var(--surface-soft);
    text-decoration: none;
}

.nav a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.userbox {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.user-chip:hover { text-decoration: none; border-color: var(--input-border); }

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, #17306b, #2f5bea);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .04em;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.user-meta strong {
    font-size: 13px;
    font-weight: 600;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta small {
    font-size: 11px;
    color: var(--muted);
}

.logout-form { margin: 0; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--ink-soft);
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.theme-toggle:hover {
    background: var(--surface-soft);
    border-color: var(--input-border);
}

.theme-toggle:active { transform: scale(.96); }

.guest-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* ---------------------------------------------------------
   Sayfa düzeni
   --------------------------------------------------------- */

.page {
    padding-top: 30px;
    padding-bottom: 56px;
    min-height: calc(100vh - 150px);
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-head h1 { margin-bottom: 2px; }

.page-head .subtitle {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.footer {
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .6);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    color: var(--muted);
    font-size: 12.5px;
}

.footer-version { opacity: .75; }

.footer-links {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-link {
    color: var(--muted);
    font-size: 12.5px;
}

.footer-link:hover { color: var(--primary); }

/* ---------------------------------------------------------
   Kartlar
   --------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.card-head h2,
.card-head h3 {
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-body.tight { padding: 0; }

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }

/* ---------------------------------------------------------
   İstatistik kartları
   --------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    right: -24px;
    top: -24px;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--primary-soft);
    opacity: .7;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 17px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.stat.green .stat-icon { background: var(--accent-soft); color: #0a8a7d; }
.stat.amber .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat.red .stat-icon { background: var(--danger-soft); color: var(--danger); }

.stat-value {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------
   Butonlar
   --------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4b74ff);
    color: #fff;
    box-shadow: 0 8px 18px rgba(47, 91, 234, .25);
}

.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #3b64ec); }

.btn-outline {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink-soft);
}

.btn-outline:hover { border-color: var(--input-border); background: var(--surface-soft); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}

.btn-ghost:hover { background: var(--surface-soft); color: var(--ink); }

.btn-danger {
    background: var(--danger-soft);
    color: #b3233e;
    border-color: #f7c9d3;
}

.btn-danger:hover { background: #fbdde4; }

.btn-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: #bfeeda;
}

.btn-success:hover { background: #d5f2e4; }

.btn-sm {
    padding: 6px 11px;
    font-size: 12.5px;
    border-radius: 9px;
}

.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------
   Formlar
   --------------------------------------------------------- */

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field.full { grid-column: 1 / -1; }

.form-grid[hidden],
[data-student-admin-fields][hidden] {
    display: none !important;
}

input[type="file"] {
    width: 100%;
    padding: 9px 11px;
    border: 1px dashed var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 6px 10px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

/* Hızlı ekleme formları */
.form-grid.cols-add-4 {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
}

.form-grid.cols-add-5 {
    grid-template-columns: 2fr 1.4fr 1.4fr 1.2fr auto;
    align-items: end;
}

.field > span,
.field > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.field .hint {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="search"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 91, 234, .14);
}

input[readonly],
input[disabled],
select[disabled],
textarea[disabled] {
    background: var(--surface-soft);
    color: var(--muted);
    cursor: not-allowed;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    user-select: none;
}

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

.check-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px dashed var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.check-box .check { font-weight: 600; }

.char-counter {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}

.char-counter.over { color: var(--danger); }

/* ---------------------------------------------------------
   Çoklu öğrenci seçimi ve etiketler
   --------------------------------------------------------- */

.student-picker-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.student-picker-controls input[type="search"] {
    flex: 1 1 220px;
    min-width: 180px;
}

.student-picker-controls select {
    flex: 2 1 280px;
    min-width: 200px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chips:empty {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    font-size: 13px;
    line-height: 1.3;
}

.chip-main { font-weight: 600; }

.chip-sub {
    color: var(--muted);
    font-size: 12px;
}

.chip button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    font-family: inherit;
}

.chip button:hover { color: var(--danger); }

.student-picker-status {
    margin: 6px 0 0;
    color: var(--danger);
    min-height: 0;
}

.student-picker-status:empty { display: none; }


.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-bar .field {
    min-width: 150px;
    flex: 1 1 150px;
}

.filter-bar .field.grow { flex: 2 1 220px; }

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 1px;
}

.form-errors {
    background: var(--danger-soft);
    border: 1px solid #f6c6d1;
    color: #a01e38;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 13.5px;
}

.form-errors ul { margin: 0; padding-left: 18px; }
.form-errors li { margin: 2px 0; }

/* ---------------------------------------------------------
   Uyarılar
   --------------------------------------------------------- */

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success { background: var(--success-soft); color: #106945; border-color: #bfeeda; }
.alert-danger  { background: var(--danger-soft);  color: #a01e38; border-color: #f6c6d1; }
.alert-warning { background: var(--warning-soft); color: #8d5a09; border-color: #f2dfb8; }
.alert-info    { background: var(--primary-soft); color: #1f43b5; border-color: #cdd9ff; }

/* ---------------------------------------------------------
   Tablolar
   --------------------------------------------------------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    padding: 12px 16px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover-surface); }

.table .name {
    font-weight: 600;
    color: var(--ink);
}

.table .sub {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.table .cell-note {
    max-width: 330px;
    color: var(--ink-soft);
}

.row-link { cursor: pointer; }

.empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--muted);
}

.empty strong {
    display: block;
    color: var(--ink-soft);
    margin-bottom: 4px;
}

/* ---------------------------------------------------------
   Etiketler
   --------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary { background: var(--primary-soft); border-color: #d3ddff; color: #2445b8; }
.badge-green   { background: var(--accent-soft);   border-color: #c4efe9; color: #087c71; }
.badge-amber   { background: var(--warning-soft);  border-color: #f2dfb8; color: #8d5a09; }
.badge-red     { background: var(--danger-soft);   border-color: #f6c6d1; color: #a01e38; }
.badge-gray    { background: var(--surface-soft); border-color: var(--line); color: var(--muted); }

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ---------------------------------------------------------
   Giriş ekranı
   --------------------------------------------------------- */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 30px 18px;
    background:
        radial-gradient(900px 500px at 85% 10%, #1d3b8f 0%, rgba(29, 59, 143, 0) 60%),
        radial-gradient(700px 500px at 5% 90%, #0c7c76 0%, rgba(12, 124, 118, 0) 60%),
        linear-gradient(135deg, #0b1430 0%, #111f45 55%, #0c1b3d 100%);
}

.auth-card {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    width: 100%;
    max-width: 960px;
    background: var(--surface);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(4, 10, 28, .55);
}

.auth-aside {
    position: relative;
    padding: 46px 42px;
    color: #eaf0ff;
    background:
        radial-gradient(500px 300px at 110% -10%, rgba(16, 179, 163, .45) 0%, rgba(16, 179, 163, 0) 60%),
        linear-gradient(150deg, #1b3aa0 0%, #14286b 55%, #0d1c4b 100%);
    display: flex;
    flex-direction: column;
}

.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 46px 46px;
    pointer-events: none;
}

.auth-aside > * { position: relative; z-index: 1; }

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.auth-logo .brand-mark {
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.auth-logo strong {
    font-size: 19px;
    letter-spacing: .05em;
}

.auth-logo small {
    display: block;
    font-size: 11.5px;
    color: rgba(234, 240, 255, .7);
    letter-spacing: .02em;
}

.auth-aside h1 {
    font-size: 30px;
    line-height: 1.2;
    margin-bottom: 14px;
    color: #fff;
    letter-spacing: -.02em;
}

.auth-aside .lead {
    color: rgba(234, 240, 255, .78);
    font-size: 14.5px;
    margin-bottom: 26px;
}

.auth-list {
    list-style: none;
    margin: auto 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.auth-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: rgba(234, 240, 255, .85);
}

.auth-list .tick {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(16, 179, 163, .28);
    color: #6ff0e3;
    font-size: 11px;
    margin-top: 1px;
}

.auth-form {
    padding: 46px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.auth-form .muted { margin-bottom: 22px; }

.auth-hint {
    margin-top: 20px;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    margin-bottom: 18px;
}

.segmented label {
    position: relative;
    cursor: pointer;
    text-align: center;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    transition: all .15s ease;
}

.segmented input:checked + span {
    background: var(--surface);
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.segmented input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(47, 91, 234, .18);
}

.auth-form .field { margin-bottom: 14px; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-theme {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .26);
    color: #fff;
}

.auth-theme:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .42);
}

/* ---------------------------------------------------------
   Detay sayfası
   --------------------------------------------------------- */

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
}

.detail-head .code {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--muted);
    text-transform: uppercase;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border-bottom: 1px solid var(--line);
}

.detail-item {
    background: var(--surface);
    padding: 16px 24px;
}

.detail-item.wide { grid-column: span 3; }

.detail-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.detail-body {
    padding: 24px;
}

.note {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    font-size: 14.5px;
    color: var(--ink-soft);
    white-space: pre-wrap;
    word-break: break-word;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.timeline-item .t-main { min-width: 0; }
.timeline-item .t-main strong { display: block; font-size: 13.5px; }
.timeline-item .t-main span { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------
   Sayfalama
   --------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}

.pagination .info {
    font-size: 12.5px;
    color: var(--muted);
}

.pages {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pages a,
.pages span {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.pages a:hover { background: var(--surface-soft); text-decoration: none; }
.pages .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pages .disabled { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------
   Modal
   --------------------------------------------------------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(9, 16, 36, .55);
    backdrop-filter: blur(3px);
}

.modal.open { display: flex; }

.modal-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 40px);
    overflow: auto;
    animation: pop .16s ease-out;
}

@keyframes pop {
    from { transform: translateY(8px) scale(.985); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; }

.modal-close {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
}

.modal-close:hover { background: var(--surface-soft); color: var(--ink); }

.modal-body { padding: 20px; }

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
}

/* ---------------------------------------------------------
   Kurulum
   --------------------------------------------------------- */

.setup-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 18px;
}

.setup-card {
    width: 100%;
    max-width: 620px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.setup-head {
    padding: 30px 32px 24px;
    background: linear-gradient(140deg, #17306b, #2f5bea);
    color: #fff;
}

.setup-head h1 { font-size: 24px; margin-bottom: 6px; }
.setup-head p { margin: 0; color: rgba(255, 255, 255, .78); font-size: 13.5px; }

.setup-body-inner { padding: 28px 32px 32px; }

.setup-steps {
    margin: 0 0 22px;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13.5px;
}

.setup-steps li { margin-bottom: 5px; }

code {
    background: #f1f4fb;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 12.5px;
    font-family: Consolas, "Courier New", monospace;
}

/* ---------------------------------------------------------
   Koyu tema ince ayarları
   --------------------------------------------------------- */

html[data-theme="dark"] body {
    background:
        radial-gradient(900px 420px at 110% -10%, rgba(47, 91, 234, .22) 0%, rgba(47, 91, 234, 0) 60%),
        radial-gradient(700px 380px at -10% 0%, rgba(16, 179, 163, .14) 0%, rgba(16, 179, 163, 0) 55%),
        var(--bg);
}

html[data-theme="dark"] .topbar { background: rgba(12, 19, 34, .86); }
html[data-theme="dark"] .footer { background: rgba(12, 19, 34, .7); }

html[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #3f63e8, #5e80ff);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #3457d6, #4c6ff0);
}

html[data-theme="dark"] .btn-outline:hover { border-color: #3a4f78; }

html[data-theme="dark"] .btn-danger {
    color: #ffb3c0;
    border-color: #5c2a38;
}

html[data-theme="dark"] .btn-danger:hover { background: #4a1d2b; }

html[data-theme="dark"] .btn-success {
    color: #8ff0c8;
    border-color: #1f5a47;
}

html[data-theme="dark"] .btn-success:hover { background: #144a38; }

html[data-theme="dark"] .nav a.active { color: #b9c8ff; }
html[data-theme="dark"] .stat-icon { color: #b9c8ff; }
html[data-theme="dark"] .stat.green .stat-icon { color: #7ef0d8; }
html[data-theme="dark"] .segmented input:checked + span { color: #b9c8ff; }

html[data-theme="dark"] .alert-success { color: #8ff0c8; border-color: #1f5a47; }
html[data-theme="dark"] .alert-danger { color: #ffb3c0; border-color: #5c2a38; }
html[data-theme="dark"] .alert-warning { color: #ffd28a; border-color: #5a4318; }
html[data-theme="dark"] .alert-info { color: #bccaff; border-color: #31427a; }

html[data-theme="dark"] .form-errors {
    color: #ffb3c0;
    border-color: #5c2a38;
}

html[data-theme="dark"] .badge-primary { color: #bccaff; border-color: #31427a; }
html[data-theme="dark"] .badge-green { color: #8ff0d8; border-color: #1f5a4c; }
html[data-theme="dark"] .badge-amber { color: #ffd58a; border-color: #5a4318; }
html[data-theme="dark"] .badge-red { color: #ffb3c0; border-color: #5c2a38; }

html[data-theme="dark"] .pages .current {
    background: #3f63e8;
    border-color: #3f63e8;
}

html[data-theme="dark"] code {
    background: #0e1626;
    color: #cfe0ff;
}

html[data-theme="dark"] .stat::after { opacity: .35; }

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 3px rgba(109, 140, 255, .22);
}

html[data-theme="dark"] .auth-body {
    background:
        radial-gradient(900px 500px at 85% 10%, #162d6e 0%, rgba(22, 45, 110, 0) 60%),
        radial-gradient(700px 500px at 5% 90%, #075752 0%, rgba(7, 87, 82, 0) 60%),
        linear-gradient(135deg, #060b18 0%, #0b1430 55%, #071026 100%);
}

html[data-theme="dark"] .auth-card { border: 1px solid var(--line); }

/* ---------------------------------------------------------
   Duyarlılık
   --------------------------------------------------------- */

@media (max-width: 1024px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-sidebar { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-item.wide { grid-column: span 2; }
}

@media (max-width: 900px) {
    .topbar-inner { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
    .nav-toggle { display: flex; margin-left: auto; }
    .nav {
        display: none;
        order: 4;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 8px 0 4px;
        border-top: 1px solid var(--line);
    }
    .nav.open { display: flex; }
    .nav a { padding: 11px 12px; }
    .userbox { order: 3; }
    .user-meta { display: none; }
    .user-chip { padding: 4px; }
    .logout-form .btn { padding: 6px 9px; }

    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid.cols-add-4,
    .form-grid.cols-add-5 {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .form-grid.cols-add-4 .btn,
    .form-grid.cols-add-5 .btn { width: 100%; }
    .auth-card { grid-template-columns: 1fr; max-width: 520px; }
    .auth-aside { padding: 32px 28px; }
    .auth-aside h1 { font-size: 25px; }
    .auth-list { margin-top: 8px; }
    .auth-form { padding: 32px 28px; }
    .setup-head, .setup-body-inner { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .container { padding: 0 16px; }
    .page { padding-top: 20px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 14px; }
    .stat-value { font-size: 23px; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-item.wide { grid-column: span 1; }
    .page-head h1 { font-size: 22px; }
    .table th, .table td { padding: 11px 12px; }
    .filter-bar .field { flex: 1 1 100%; }
    .filter-actions { width: 100%; }
    .filter-actions .btn { flex: 1; }
    .card-body { padding: 16px; }
    .detail-head, .detail-body { padding: 18px; }
    .detail-item { padding: 14px 18px; }
}

/* ---------------------------------------------------------
   Yazdırma
   --------------------------------------------------------- */

@media print {
    body { background: #fff; }
    .topbar, .footer, .no-print, .alert { display: none !important; }
    .page { padding: 0; }
    .card { border: 0; box-shadow: none; }
    .container { max-width: none; padding: 0; }
    .detail-grid { background: #fff; }
    .detail-item { border-bottom: 1px solid #ddd; }
    .note { background: #fff; }

    html[data-theme="dark"] body { background: #fff; color: #000; }
    html[data-theme="dark"] .card,
    html[data-theme="dark"] .detail-item,
    html[data-theme="dark"] .note { background: #fff; color: #000; }
    html[data-theme="dark"] .detail-label,
    html[data-theme="dark"] .muted,
    html[data-theme="dark"] .detail-head .code { color: #444; }
}
