/* =====================================================================
   AGD Pendik — Tasarım Sistemi
   Mobil öncelikli, modern, erişilebilir arayüz
   ===================================================================== */

:root {
    /* Marka renkleri (zümrüt yeşil + altın aksan) */
    --c-primary:        #0d7a5f;
    --c-primary-dark:   #095a45;
    --c-primary-darker: #06382b;
    --c-primary-light:  #e8f5f0;
    --c-primary-100:    #d3ece3;
    --c-accent:         #c79a3b;
    --c-accent-light:   #f7eedb;

    --c-bg:       #f4f7f6;
    --c-surface:  #ffffff;
    --c-surface-2:#fbfdfc;
    --c-text:     #16211d;
    --c-muted:    #67817a;
    --c-border:   #e4ece9;
    --c-border-2: #eef3f1;

    --c-ok:      #1f9d6a;
    --c-ok-bg:   #e4f6ee;
    --c-warn:    #c6871f;
    --c-warn-bg: #fbf0d8;
    --c-danger:  #d1495b;
    --c-danger-bg:#fbe6e9;
    --c-info:    #2f7dc4;
    --c-info-bg: #e5f0fa;

    --radius:    14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(16,40,33,.06), 0 1px 3px rgba(16,40,33,.05);
    --shadow:    0 4px 14px rgba(16,40,33,.07);
    --shadow-lg: 0 12px 34px rgba(16,40,33,.12);

    --sidebar-w: 264px;
    --topbar-h:  64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }
.icon { flex: none; vertical-align: middle; }
h1,h2,h3,h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }

/* ---------------- App shell ---------------- */
.app { min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(185deg, var(--c-primary-darker), var(--c-primary-dark));
    color: #d9efe7;
    display: flex; flex-direction: column;
    z-index: 60;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo {
    width: 42px; height: 42px; flex: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--c-accent), #e3bd6b);
    color: var(--c-primary-darker);
    display: grid; place-items: center;
    font-weight: 800; font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.brand-text strong { display: block; color: #fff; font-size: 15px; line-height: 1.1; }
.brand-text span { font-size: 11.5px; color: #9fc9bb; letter-spacing: .02em; }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.nav-section { margin-top: 16px; padding: 0 12px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #79a596; font-weight: 700; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin: 2px 0;
    border-radius: 11px;
    color: #c4e3d8; font-weight: 500; font-size: 14.5px;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--c-accent); }
.nav-link .icon { opacity: .9; }
.nav-link .nav-badge { margin-left: auto; background: var(--c-accent); color: var(--c-primary-darker); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { background: rgba(255,255,255,.16); color: #fff; }
.sidebar-user .su-meta { min-width: 0; }
.sidebar-user .su-meta strong { display:block; color:#fff; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user .su-meta span { font-size:11.5px; color:#9fc9bb; }

/* main */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 40;
    height: var(--topbar-h);
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center; gap: 14px;
    padding: 0 22px;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .tb-sub { font-size: 12.5px; color: var(--c-muted); font-weight: 500; }
.topbar-spacer { flex: 1; }
.icon-btn {
    position: relative;
    width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text);
    display: grid; place-items: center; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--c-primary-light); border-color: var(--c-primary-100); color: var(--c-primary-dark); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; min-width: 17px; height: 17px; padding: 0 4px; background: var(--c-danger); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 20px; display: grid; place-items: center; border: 2px solid var(--c-surface); }

.menu-btn { display: none; }

.content { padding: 22px; flex: 1; max-width: 1240px; width: 100%; }

/* ---------------- Avatar ---------------- */
.avatar {
    width: 40px; height: 40px; flex: none;
    border-radius: 50%;
    background: var(--c-primary-light); color: var(--c-primary-dark);
    display: grid; place-items: center;
    font-weight: 700; font-size: 14px;
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------------- Page header ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; margin: 0 0 2px; }
.page-head p { margin: 0; color: var(--c-muted); font-size: 13.5px; }

/* ---------------- Cards ---------------- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--c-border-2); }
.card-head h3 { margin: 0; font-size: 15.5px; }
.card-head .icon { color: var(--c-primary); }
.card-head .ch-action { margin-left: auto; }

/* grids */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ---------------- Stat cards ---------------- */
.stat {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex; align-items: flex-start; gap: 14px;
    position: relative; overflow: hidden;
}
.stat .stat-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--c-primary-light); color: var(--c-primary); }
.stat.amber .stat-ic { background: var(--c-accent-light); color: var(--c-accent); }
.stat.blue  .stat-ic { background: var(--c-info-bg); color: var(--c-info); }
.stat.red   .stat-ic { background: var(--c-danger-bg); color: var(--c-danger); }
.stat .stat-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat .stat-lbl { color: var(--c-muted); font-size: 13px; margin-top: 4px; }

/* hero / welcome card */
.hero {
    border-radius: var(--radius-lg);
    background: linear-gradient(125deg, var(--c-primary-dark), var(--c-primary) 60%, #11906f);
    color: #fff; padding: 26px 28px;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow);
}
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.07); }
.hero::before { content: ''; position: absolute; right: 60px; bottom: -70px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.05); }
.hero h2 { color: #fff; font-size: 23px; margin-bottom: 6px; position: relative; }
.hero p { margin: 0; color: #d4ede4; position: relative; max-width: 60ch; }
.hero .hero-role { display: inline-flex; align-items:center; gap:7px; margin-top:14px; background: rgba(255,255,255,.16); padding: 6px 13px; border-radius: 30px; font-size: 13px; font-weight: 600; position: relative; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: 11px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 2px 8px rgba(13,122,95,.28); }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-ghost { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-primary-light); border-color: var(--c-primary-100); color: var(--c-primary-dark); }
.btn-accent { background: var(--c-accent); color: #3a2c08; }
.btn-accent:hover { background: #b88a2e; color:#3a2c08; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #b53b4c; color:#fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 30px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.badge.ok { background: var(--c-ok-bg); color: var(--c-ok); }
.badge.warn { background: var(--c-warn-bg); color: var(--c-warn); }
.badge.danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge.info { background: var(--c-info-bg); color: var(--c-info); }
.badge.muted { background: #eef2f0; color: var(--c-muted); }
.badge.accent { background: var(--c-accent-light); color: var(--c-accent); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--c-border-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--c-surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .cu-name { font-weight: 600; }
.cell-user .cu-sub { font-size: 12px; color: var(--c-muted); }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label.lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--c-text); }
label.lbl .req { color: var(--c-danger); }
.input, .select, textarea.input {
    width: 100%; padding: 11px 13px;
    border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14.5px; color: var(--c-text);
    background: var(--c-surface);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-100); }
.input::placeholder { color: #9fb3ac; }
textarea.input { resize: vertical; min-height: 92px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }
.input-icon .input { padding-left: 40px; }
.help { font-size: 12px; color: var(--c-muted); margin-top: 5px; }

/* segmented radios (yoklama vb.) */
.seg { display: inline-flex; border: 1px solid var(--c-border); border-radius: 10px; overflow: hidden; background: var(--c-surface); }
.seg label { padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--c-muted); border-right: 1px solid var(--c-border); }
.seg label:last-child { border-right: 0; }
.seg input { display: none; }
.seg input:checked + span { color: #fff; }
.seg label:has(input[value="geldi"]:checked), .seg label.on-ok { background: var(--c-ok); color:#fff; }
.seg label:has(input[value="gelmedi"]:checked), .seg label.on-danger { background: var(--c-danger); color:#fff; }
.seg label:has(input[value="izinli"]:checked), .seg label.on-warn { background: var(--c-warn); color:#fff; }

/* ---------------- Progress ---------------- */
.progress { height: 8px; border-radius: 20px; background: var(--c-border); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--c-primary), #15a37f); }
.progress.amber > span { background: linear-gradient(90deg, var(--c-accent), #e3bd6b); }

/* ---------------- Alerts / flash ---------------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert.success { background: var(--c-ok-bg); border-color: #bfe6d3; color: #14724e; }
.alert.error   { background: var(--c-danger-bg); border-color: #f1c4cb; color: #a4313f; }
.alert.warning { background: var(--c-warn-bg); border-color: #ecd29a; color: #8a5f12; }
.alert.info    { background: var(--c-info-bg); border-color: #c2ddf2; color: #235d92; }

/* toast container */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--c-surface); border: 1px solid var(--c-border); border-left: 4px solid var(--c-primary); box-shadow: var(--shadow-lg); padding: 12px 16px; border-radius: 10px; font-size: 14px; animation: slideIn .25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------------- Empty state ---------------- */
.empty-state { text-align: center; padding: 44px 24px; color: var(--c-muted); }
.empty-state .empty-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--c-primary-light); color: var(--c-primary); display: grid; place-items: center; margin: 0 auto 16px; }
.empty-state h2, .empty-state h3 { color: var(--c-text); margin-bottom: 6px; }
.empty-state p { max-width: 44ch; margin: 0 auto 18px; }

/* lists */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--c-border-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 14px; }
.list-item .li-sub { font-size: 12.5px; color: var(--c-muted); }
.list-item.unread { background: var(--c-primary-light); }

/* misc utils */
.muted { color: var(--c-muted); }
.text-sm { font-size: 13px; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex { display: flex; } .items-center { align-items: center; } .gap { gap: 10px; } .gap-lg { gap: 16px; }
.between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.right { text-align: right; } .center { text-align: center; }
.divider { height: 1px; background: var(--c-border-2); margin: 16px 0; }
.tag-source { font-size: 11.5px; color: var(--c-muted); background: #eef3f1; padding: 2px 8px; border-radius: 6px; }

/* drawer backdrop (mobile) */
.backdrop { display: none; position: fixed; inset: 0; background: rgba(10,30,24,.45); z-index: 55; }
.backdrop.show { display: block; }

/* bottom nav (mobile) */
.bottom-nav { display: none; }

/* ============== Login / auth pages ============== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-aside {
    background: linear-gradient(160deg, var(--c-primary-darker), var(--c-primary-dark) 55%, var(--c-primary));
    color: #fff; padding: 56px 52px; position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.auth-aside::after { content: ''; position: absolute; right: -80px; bottom: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.06); }
.auth-aside::before { content: ''; position: absolute; left: -60px; top: 40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.05); }
.auth-aside .a-brand { display: flex; align-items: center; gap: 12px; position: relative; }
.auth-aside .a-hero { margin-top: auto; position: relative; }
.auth-aside .a-hero h1 { color: #fff; font-size: 34px; line-height: 1.15; }
.auth-aside .a-hero p { color: #cfe8df; font-size: 16px; max-width: 42ch; }
.auth-aside .a-features { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.auth-aside .a-feat { display: flex; align-items: center; gap: 12px; color: #dcf0e8; font-size: 14.5px; }
.auth-aside .a-feat .icon-wrap { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.13); display: grid; place-items: center; flex: none; }

.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--c-bg); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .ac-head { margin-bottom: 24px; }
.auth-card .ac-head h2 { font-size: 25px; margin-bottom: 4px; }
.auth-card .ac-head p { color: var(--c-muted); margin: 0; }
.auth-logo-sm { display: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .main { margin-left: 0; }
    .menu-btn { display: grid; }
    .content { padding: 16px 14px 88px; }   /* alt nav için boşluk */
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-logo-sm { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px; }

    /* alt navigasyon çubuğu */
    .bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
        background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
        border-top: 1px solid var(--c-border);
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        justify-content: space-around;
    }
    .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; padding: 6px 2px; color: var(--c-muted); font-size: 10.5px; font-weight: 600; border-radius: 10px; }
    .bottom-nav a.active { color: var(--c-primary); background: var(--c-primary-light); }
}
@media (max-width: 620px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-head { align-items: flex-start; }
    .topbar { padding: 0 14px; }
    .topbar h1 { font-size: 16px; }
    .hero { padding: 22px; }
    .hero h2 { font-size: 20px; }

    /* tabloları kart görünümüne çevir */
    .tbl.responsive thead { display: none; }
    .tbl.responsive, .tbl.responsive tbody, .tbl.responsive tr, .tbl.responsive td { display: block; width: 100%; }
    .tbl.responsive tr { border: 1px solid var(--c-border); border-radius: 12px; margin-bottom: 12px; padding: 6px 4px; background: var(--c-surface); }
    .tbl.responsive td { border: 0; padding: 8px 14px; display: flex; justify-content: space-between; gap: 14px; align-items: center; text-align: right; }
    .tbl.responsive td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .03em; text-align: left; }
    .tbl.responsive td:empty { display: none; }
    .tbl.responsive .cell-user { justify-content: flex-end; }
}
