:root {
    --bg: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --ink: #16202e;
    --ink-soft: #5a6b80;
    --line: #e2e8f0;
    --brand: #0f766e;      /* deep teal */
    --brand-600: #0d675f;
    --brand-050: #e6f4f2;
    --accent: #f97316;     /* orange accent */
    --danger: #dc2626;
    --ok: #16a34a;
    --warn: #d97706;
    --sidebar: #0f1b2a;    /* dark slate */
    --sidebar-ink: #9fb0c3;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(16, 32, 46, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Manrope', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .page-title, .brand-text strong { font-family: 'Sora', 'Manrope', sans-serif; }
a { text-decoration: none; color: inherit; }

/* ---------- Uygulama iskeleti ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 264px;
    background: var(--sidebar);
    color: var(--sidebar-ink);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), #14b8a6);
    color: #fff; display: grid; place-items: center; font-size: 20px;
}
.brand-text strong { color: #fff; display: block; font-size: 16px; letter-spacing: .3px; }
.brand-text small { color: var(--sidebar-ink); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; }

.sidebar-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: var(--sidebar-ink); font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
.sidebar-nav .nav-link i { font-size: 18px; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--brand); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; }

.main-area { flex: 1; margin-left: 264px; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 26px; background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 30;
}
.page-title { font-size: 20px; margin: 0; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--brand-050); color: var(--brand-600);
    display: grid; place-items: center; font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 14px; }
.role-badge {
    font-size: 11px; color: var(--brand-600); background: var(--brand-050);
    padding: 1px 8px; border-radius: 20px; width: fit-content; font-weight: 600;
}
.btn-icon {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-soft); display: grid; place-items: center;
    font-size: 18px; cursor: pointer; transition: all .15s ease;
}
.btn-icon:hover { background: var(--surface-2); color: var(--brand); border-color: var(--brand); }

.content { padding: 26px; flex: 1; }

/* ---------- Kartlar / grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
}
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; color: #fff; }
.stat-icon.teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.stat-icon.orange { background: linear-gradient(135deg, #ea580c, #f97316); }
.stat-icon.blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.stat-icon.violet { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.stat-meta .stat-value { font-family: 'Sora'; font-size: 28px; font-weight: 700; line-height: 1; }
.stat-meta .stat-label { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }

.panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 22px;
}
.panel-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 20px; }
.panel-body.flush { padding: 0; }

/* ---------- Tablolar ---------- */
.table { margin: 0; }
.table thead th {
    background: var(--surface-2); color: var(--ink-soft);
    font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 1px solid var(--line); padding: 12px 16px; font-weight: 600;
}
.table tbody td { padding: 13px 16px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table tbody tr:hover { background: var(--surface-2); }

.badge-soft { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-off { background: #fee2e2; color: #b91c1c; }
.badge-role { background: var(--brand-050); color: var(--brand-600); }

/* ---------- Butonlar ---------- */
.btn-primary { background: var(--brand); border-color: var(--brand); font-weight: 600; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }

/* ---------- Formlar ---------- */
.form-label { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 5px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--line); padding: 10px 12px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }

/* ---------- Boş durum ---------- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { width: 80px; height: 80px; border-radius: 22px; background: var(--brand-050); color: var(--brand); display: grid; place-items: center; font-size: 38px; margin: 0 auto 18px; }
.empty-icon.danger { background: #fee2e2; color: var(--danger); }

/* ---------- Giriş ekranı ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-hero {
    background: linear-gradient(150deg, #0f1b2a 0%, #0f766e 100%);
    color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.login-hero::after {
    content: ''; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(20,184,166,.35), transparent 70%); border-radius: 50%;
}
.login-hero .hero-mark { width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 30px; margin-bottom: 28px; }
.login-hero h1 { font-size: 38px; line-height: 1.1; margin-bottom: 16px; }
.login-hero p { color: rgba(255,255,255,.75); font-size: 16px; max-width: 420px; }
.login-hero ul { list-style: none; padding: 0; margin: 32px 0 0; }
.login-hero li { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: rgba(255,255,255,.85); }
.login-hero li i { color: #5eead4; }

.login-panel { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--ink-soft); margin-bottom: 26px; }
.demo-hint { margin-top: 22px; padding: 14px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; font-size: 13px; color: var(--ink-soft); }
.demo-hint code { color: var(--brand-600); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}
