:root {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #cbd5e1;
    --danger: #b91c1c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}

.auth-title { margin: 0 0 .25rem; font-size: 1.5rem; }
.auth-subtitle { margin: 0 0 1.5rem; color: var(--muted); }

.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .25rem; font-weight: 600; font-size: .9rem; }
.field input {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}
.field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.field-error { margin: .35rem 0 0; color: var(--danger); font-size: .875rem; }

.check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; font-size: .9rem; }

.btn {
    display: inline-block;
    padding: .7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem 1.25rem; }
}

/* ===== Yönetim paneli (Aşama 3) ===== */
:root { --sidebar-w: 250px; --sidebar-bg: #0f172a; --demo: #b45309; --demo-bg: #fef3c7; --real: #047857; --real-bg: #d1fae5; }

.app { min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    background: var(--sidebar-bg); color: #e2e8f0; padding: 1rem .75rem;
    overflow-y: auto; z-index: 40; transition: transform .2s ease;
}
.brand { font-weight: 700; font-size: 1.15rem; padding: .5rem .75rem 1.25rem; color: #fff; }
.nav { display: flex; flex-direction: column; gap: .15rem; }
.nav-heading { margin: 1rem .75rem .35rem; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.nav-link { display: block; padding: .6rem .75rem; border-radius: 8px; color: #cbd5e1; text-decoration: none; }
.nav-link:hover { background: #1e293b; color: #fff; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link.disabled { color: #64748b; cursor: not-allowed; }
.nav-link.disabled:hover { background: transparent; color: #64748b; }
.nav-link small { margin-left: .35rem; font-size: .68rem; background: #1e293b; padding: .1rem .4rem; border-radius: 999px; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 30; }

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

.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; margin: 0; font-size: 1.15rem; }
.icon-btn { display: none; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: .35rem .65rem; font-size: 1.1rem; cursor: pointer; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem .5rem; border-radius: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--bg); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; }
.user-menu-panel {
    position: absolute; right: 0; top: calc(100% + .5rem); min-width: 230px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: .5rem;
}
.user-menu-info { display: flex; flex-direction: column; padding: .5rem .6rem .75rem; border-bottom: 1px solid var(--border); margin-bottom: .35rem; font-size: .85rem; }
.user-menu-info span { color: var(--muted); overflow-wrap: anywhere; }
.menu-item { width: 100%; text-align: left; padding: .55rem .6rem; border: 0; background: transparent; border-radius: 6px; font-size: .95rem; cursor: pointer; }
.menu-item:hover { background: var(--bg); }

.content { padding: 1.25rem; }

.notice { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.notice-demo { background: var(--demo-bg); color: #78350f; border: 1px solid #fcd34d; }

.grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.card-label { color: var(--muted); font-size: .88rem; }
.card-title { margin: 0; font-size: 1rem; }
.card-value { font-size: 1.6rem; font-weight: 700; overflow-wrap: anywhere; }
.card-note { margin-top: .25rem; color: var(--muted); font-size: .82rem; }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; }
.badge-demo { background: var(--demo-bg); color: var(--demo); border: 1px solid #fcd34d; }
.badge-real { background: var(--real-bg); color: var(--real); }

.bars { display: flex; align-items: flex-end; gap: .6rem; height: 180px; padding-top: .5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; max-width: 44px; background: repeating-linear-gradient(45deg, #93c5fd, #93c5fd 6px, #bfdbfe 6px, #bfdbfe 12px); border-radius: 6px 6px 0 0; }
.bar-label { margin-top: .35rem; font-size: .75rem; color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .55rem .5rem; text-align: left; border-bottom: 1px solid var(--bg); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.table .num { text-align: right; }

.log-row { padding: .55rem 0; border-bottom: 1px solid var(--bg); }
.log-row:last-child { border-bottom: 0; }
.log-row small, .muted { color: var(--muted); }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    .icon-btn { display: inline-block; }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar-backdrop { display: block; }
    .user-name { display: none; }
    .content { padding: .9rem; }
    .grid-2 { grid-template-columns: 1fr; }
}
