/* ============================================================
   WebSiteCreater — Yönetim Paneli stilleri
   Sade, modern, yüksek okunabilirlik. Renkler tek yerde (değişken).
   ============================================================ */
:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-soft: #475569;
    --text-faint: #94a3b8;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --info: #0891b2;
    --info-soft: #ecfeff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .15);
    --sidebar-w: 256px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
}

[hidden] { display: none !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, opacity .15s;
    white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 16px; height: 16px; fill: currentColor; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }

/* ---------- Giriş ekranı ---------- */
.login-view {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background: radial-gradient(1200px 600px at 50% -10%, #e0e7ff 0%, var(--bg) 55%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand-mark {
    width: 40px; height: 40px;
    flex: 0 0 40px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { color: var(--text-faint); font-size: 12px; }
.login-title { margin: 0 0 4px; font-size: 22px; }
.login-hint { margin: 0 0 24px; color: var(--text-soft); }
.login-error {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 13px;
}
.login-footnote { color: var(--text-faint); font-size: 12px; }

/* ---------- Form alanları ---------- */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
input, select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}

/* ---------- Uygulama düzeni ---------- */
.app-view { display: flex; min-height: 100%; }
.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--border); }
.nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-weight: 600;
    cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); }
.nav-icon { width: 20px; height: 20px; fill: currentColor; flex: 0 0 20px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 8px; }
.me-avatar {
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    text-transform: uppercase;
}
.me-info { overflow: hidden; }
.me-email { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { color: var(--text-faint); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
}
.page-title { margin: 0; font-size: 20px; }
.content { padding: 28px; flex: 1; }

/* ---------- Kartlar / paneller ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel-pad { padding: 20px; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.panel-title { font-weight: 700; font-size: 15px; }

/* ---------- İstatistik kartları ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
}
.stat-label { color: var(--text-soft); font-size: 13px; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.stat-sub { color: var(--text-faint); font-size: 12px; margin-top: 4px; }
.section-title { font-size: 15px; font-weight: 700; margin: 28px 0 14px; }

/* ---------- Filtre çubuğu ---------- */
.filters {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.filters .field { margin-bottom: 0; min-width: 180px; }
.filters .grow { flex: 1; min-width: 220px; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.data th, table.data td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data th {
    color: var(--text-soft);
    font-weight: 600;
    background: var(--surface-2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
table.data tbody tr { transition: background .1s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-2); }
table.data td.wrap { white-space: normal; }
.muted { color: var(--text-faint); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.strong { font-weight: 600; }

/* ---------- Rozetler ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--success); background: var(--success-soft); border-color: #bbf7d0; }
.badge-red { color: var(--danger); background: var(--danger-soft); border-color: #fecaca; }
.badge-amber { color: var(--warning); background: var(--warning-soft); border-color: #fde68a; }
.badge-blue { color: var(--info); background: var(--info-soft); border-color: #a5f3fc; }
.badge-gray { color: var(--text-soft); background: var(--surface-2); border-color: var(--border); }
.badge-indigo { color: var(--primary-dark); background: var(--primary-soft); border-color: #c7d2fe; }

/* ---------- Sayfalama ---------- */
.pager {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pager-info { color: var(--text-soft); font-size: 13px; }
.pager-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Durumlar (boş / yükleniyor) ---------- */
.state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-soft);
}
.state-title { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 6px; }
.spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Detay (anahtar/değer) ---------- */
.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px 24px;
}
.kv-label { color: var(--text-faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kv-value { font-size: 14px; margin-top: 2px; word-break: break-word; }

/* sekmeler */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 0; flex-wrap: wrap; }
.tab {
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.stack-gap > * + * { margin-top: 20px; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    z-index: 50;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 460px;
    padding: 24px;
}
.modal-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.modal-body { color: var(--text-soft); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toast ---------- */
.toast-container {
    position: fixed; right: 20px; bottom: 20px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 80;
}
.toast {
    background: var(--text);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    max-width: 360px;
    animation: toast-in .2s ease;
}
.toast-success { background: #15803d; }
.toast-error { background: #b91c1c; }
.toast-info { background: #1e293b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.crumb { color: var(--text-faint); font-size: 13px; margin-bottom: 14px; }
.crumb a { color: var(--text-soft); }

@media (max-width: 820px) {
    .sidebar { display: none; }
    .content { padding: 16px; }
    .topbar { padding: 14px 16px; }
}
