/* RS Center — arayüz stilleri */
:root {
  --bg: #0a0c11;
  --bg-2: #0e1118;
  --surface: #131722;
  --surface-2: #181d2a;
  --surface-3: #1f2535;
  --border: #232a3b;
  --border-2: #2d3549;
  --text: #e7e9f0;
  --text-2: #b4bacb;
  --muted: #7d859b;
  --accent: #7c5cff;
  --accent-2: #9b84ff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.13);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.13);
  --info: #06b6d4;
  --info-soft: rgba(6, 182, 212, 0.13);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --sidebar: 252px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f4f6fb;
  --bg-2: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f6;
  --border: #e3e7f0;
  --border-2: #d5dbe7;
  --text: #151a28;
  --text-2: #3d4558;
  --muted: #6b7489;
  --accent-soft: rgba(124, 92, 255, 0.1);
  --shadow: 0 10px 30px rgba(20, 30, 60, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* İkonlar: varsayılan boyut; bağlama özel kurallar aşağıda geçersiz kılar */
.i { width: 18px; height: 18px; flex: none; }
h1 .i, h2 .i, h3 .i { vertical-align: -3px; margin-right: 2px; }
.modal-head h3 { display: flex; align-items: center; gap: 8px; }
.tabs .i { width: 16px; height: 16px; }
.badge .i { width: 12px; height: 12px; }
.small .i, .tiny .i { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Yerleşim ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #22d3ee); color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.35);
}
.brand-name { font-weight: 750; font-size: 16px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 14px 12px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px;
  color: var(--text-2); font-weight: 500; margin: 1px 0; text-decoration: none; position: relative;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.nav .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin: 0 4.5px; }
.nav .nav-meta { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav .add-link { color: var(--accent-2); }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.btn.menu-btn { display: none; }
.search-box { position: relative; flex: 1; max-width: 520px; }
.search-box input[type='search'] { padding-left: 38px; padding-right: 36px; background: var(--surface); }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-box kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 12px; }
.content { padding: 26px 28px 60px; max-width: 1500px; width: 100%; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Kartlar ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.right { text-align: right; } .center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

.stat { padding: 16px 18px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .icon { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.stat .icon svg { width: 18px; height: 18px; }

.panel-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: border-color .15s, transform .15s; }
.panel-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.panel-card .credits { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.panel-badge { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 13px; flex: none; }

/* ---------- Form ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.input, input:not([type]), input[type='text'], input[type='password'], input[type='number'], input[type='search'], input[type='date'], input[type='datetime-local'], input[type='email'], input[type='tel'], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-2);
  background: var(--bg-2); color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.input-group { display: flex; gap: 6px; }
.input-group > input { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #6a48f5; }
.btn.success { background: var(--success); border-color: var(--success); color: #05210f; }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: #ff8a8a; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.warn { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn.icon { padding: 7px; }
.btn.sm.icon { padding: 5px; }
.btn-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }

kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }

/* ---------- Rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.err { background: var(--danger-soft); color: #ff7b7b; }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }
.badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table td.wrap { white-space: normal; word-break: break-word; }
.table-tools { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-tools .search-input { max-width: 300px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.pager .btn { margin-left: 2px; }

.kv { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 0; font-size: 13.5px; }
.kv > div { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.kv > div:nth-child(odd) { color: var(--muted); padding-right: 18px; }
.kv > div:nth-child(even) { word-break: break-word; }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 550; padding: 10px 14px;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs button .count { font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 0 7px; border-radius: 999px; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { white-space: nowrap; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 550; padding: 5px 11px; border-radius: 7px; cursor: pointer; }
.seg button.active { background: var(--surface-3); color: var(--text); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 7, 12, 0.65); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s; }
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1100px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Bildirim ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; animation: pop .2s; }
.toast.ok { border-left: 3px solid var(--success); }
.toast.err { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

/* ---------- Diğer ---------- */
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.empty h3 { color: var(--text-2); margin-bottom: 6px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
.spinner.lg { width: 30px; height: 30px; border-width: 3px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.err { background: var(--danger-soft); border-color: transparent; color: #ffb4b4; }
.alert.warn { background: var(--warning-soft); border-color: transparent; color: #fcd38a; }
.alert.ok { background: var(--success-soft); border-color: transparent; color: #8ff0b2; }
.alert.info { background: var(--info-soft); border-color: transparent; color: #8be4f3; }
:root[data-theme='light'] .alert.err { color: #b42318; }
:root[data-theme='light'] .alert.warn { color: #93590a; }
:root[data-theme='light'] .alert.ok { color: #127a3a; }
:root[data-theme='light'] .alert.info { color: #0e6f80; }

.copy { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.copy:hover { color: var(--accent-2); }
.pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
.message-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: 13.5px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .title { font-weight: 550; }
.list-item .meta { color: var(--muted); font-size: 12px; }
.icon-circle { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.icon-circle svg { width: 16px; height: 16px; }

.chart { width: 100%; height: 180px; }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart .bar:hover { opacity: 1; }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--muted); font-size: 10px; }

.type-option { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border-2); border-radius: 12px; cursor: pointer; background: var(--bg-2); }
.type-option:hover { border-color: var(--accent); }
.type-option.selected { border-color: var(--accent); background: var(--accent-soft); }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; z-index: 50; }
.dropdown-menu button { width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.dropdown-menu button:hover { background: var(--surface-3); }
.dropdown-menu button.danger { color: #ff8a8a; }
.dropdown-menu svg { width: 15px; height: 15px; }

/* ---------- Giriş ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(900px 500px at 10% -10%, rgba(124, 92, 255, .22), transparent 60%),
  radial-gradient(800px 500px at 110% 110%, rgba(34, 211, 238, .14), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 32px; }
.login-card .brand { justify-content: center; padding-bottom: 6px; }
.login-card .brand-logo { width: 46px; height: 46px; font-size: 17px; border-radius: 13px; }
.login-card .brand-name { font-size: 22px; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 50px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .search-box kbd, .user-chip .uname { display: none; }
}
