/* Tavuk Kanat Dükkanı - Yönetim Paneli
   Palet: sıcak taş zemin + biberiye/paprika kırmızısı vurgu + hardal sarısı uyarı tonu */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg: #F2F0EA;
    --surface: #FBFAF7;
    --ink: #1D1D1B;
    --ink-soft: #6B6459;
    --line: #DEDACD;
    --accent: #C86A19;
    --accent-dark: #9C2A12;
    --amber: #B4700F;
    --amber-bg: #FBF0DB;
    --green: #3F7D4E;
    --green-bg: #E9F2E9;
    --red-bg: #F7E6E0;
    --radius: 6px;
    --sidebar-w: 216px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Work Sans', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; margin: 0; letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--ink);
    color: #EFE9DE;
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar .brand {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 19px;
    font-weight: 600;
    color: #fff;
    padding: 0 10px 20px;
    line-height: 1.25;
}
.sidebar .brand span { display: block; font-family: 'Work Sans', sans-serif; font-size: 11px; font-weight: 500; color: #C9A78E; text-transform: none; margin-top: 3px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: #D8D2C4;
    font-weight: 500;
    font-size: 14.5px;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: var(--accent); color: #fff; }
.nav-link.active svg { opacity: 1; }

.sidebar-foot {
    margin-top: auto;
    padding: 10px 12px;
    font-size: 13px;
    color: #A79E8E;
}
.sidebar-foot a { color: #E3B69A; font-weight: 600; }

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 14px 26px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar h1 { font-size: 21px; }
.topbar .tarih { color: var(--ink-soft); font-size: 13.5px; }

.content { padding: 22px 26px 90px; max-width: 1080px; width: 100%; }

/* ---------- Alert banner ---------- */

.alert-bar { margin: 0 0 20px; }
.alert-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 8px;
}
.alert-row.gecikmis { background: var(--red-bg); border: 1px solid #E3B7A6; }
.alert-row.yaklasan { background: var(--amber-bg); border: 1px solid #E7C77E; }
.alert-row b { font-weight: 700; }
.alert-row .liste { margin-top: 4px; color: var(--ink-soft); font-size: 13px; }
.alert-row a.link { color: var(--accent-dark); font-weight: 600; text-decoration: underline; }

/* ---------- Stat strip ---------- */

.stat-strip { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.stat {
    flex: 1 1 190px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.stat.positive { border-left-color: var(--green); }
.stat.negative { border-left-color: var(--accent); }
.stat.neutral { border-left-color: var(--amber); }
.stat .label { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.stat .value { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat .value.green { color: var(--green); }
.stat .value.red { color: var(--accent-dark); }

/* ---------- Cards / sections ---------- */

.section { margin-bottom: 30px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.section-head h2 { font-size: 17px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-pad { padding: 18px 20px; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: none; color: var(--ink-soft); font-weight: 600; background: #F5F3EE; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-gecikmis { background: var(--red-bg); }
.row-yaklasan { background: var(--amber-bg); }
.row-odendi { opacity: .55; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag.gelir { background: var(--green-bg); color: var(--green); }
.tag.gider { background: var(--red-bg); color: var(--accent-dark); }
.tag.odendi { background: var(--green-bg); color: var(--green); }
.tag.bekliyor { background: var(--amber-bg); color: var(--amber); }
.tag.gecikti { background: var(--red-bg); color: var(--accent-dark); }

.empty-state { padding: 34px 20px; text-align: center; color: var(--ink-soft); }

/* ---------- Forms ---------- */

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink-soft); }
input, select, textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.form-actions { margin-top: 6px; display: flex; gap: 10px; align-items: center; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: #EFEBE0; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--accent-dark); padding: 6px 10px; }
.btn-link { background: none; border: none; padding: 0; color: var(--accent-dark); font-weight: 600; cursor: pointer; font-size: 13px; text-decoration: underline; }

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tabs a { padding: 7px 14px; border-radius: 20px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line); color: var(--ink-soft); background: #fff; }
.pill-tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Login ---------- */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.login-box { background: var(--surface); width: 100%; max-width: 380px; border-radius: 10px; padding: 34px 30px; }
.login-box h1 { font-size: 24px; margin-bottom: 4px; }
.login-box p.sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 22px; }
.login-error { background: var(--red-bg); color: var(--accent-dark); padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 16px; }

/* ---------- Bar chart (kâr/zarar raporu) ---------- */

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { background: #EFEBE0; border-radius: 4px; height: 20px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.bar-fill.gelir { background: var(--green); }
.bar-fill.gider { background: var(--accent); }

/* ---------- Mobile bottom nav ---------- */

.bottom-nav { display: none; }

@media (max-width: 880px) {
    .sidebar { display: none; }
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--ink);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        justify-content: space-around;
        z-index: 40;
    }
    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        color: #B9B0A0;
        font-size: 11px;
        font-weight: 600;
        padding: 4px 6px;
        border-radius: 8px;
        flex: 1;
    }
    .bottom-nav a svg { width: 20px; height: 20px; }
    .bottom-nav a.active { color: #fff; }
    .bottom-nav a.active svg { color: var(--accent); }
    .content { padding: 16px 16px 84px; }
    .topbar { padding: 12px 16px; }
    .bar-row { grid-template-columns: 70px 1fr 70px; font-size: 12px; }
}

@media (max-width: 520px) {
    .stat-strip { flex-direction: column; }
    table, thead, tbody, tr { display: block; width: 100%; }
    thead { display: none; }
    tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 4px 0; }
    tr.row-gecikmis { background: var(--red-bg); }
    tr.row-yaklasan { background: var(--amber-bg); }
    td { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(0,0,0,.05); text-align: right; }
    td::before { content: attr(data-label); font-weight: 600; color: var(--ink-soft); text-align: left; }
    td:last-child { border-bottom: none; }
    .panel-pad { padding: 14px; }
}
