:root {
    --black: #111111;
    --ink: #232323;
    --muted: #737373;
    --line: #e7e1d3;
    --gold: #c9a227;
    --gold-2: #f0d46a;
    --bg: #f8f7f3;
    --white: #ffffff;
    --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
.table-link { color: var(--black); font-weight: 800; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--black); color: var(--white); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.brand span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--gold); color: var(--gold-2); font-weight: 800; }
.brand.center { justify-content: center; color: var(--black); }
.sidebar nav { display: grid; gap: 4px; }
.sidebar a, .sidebar p { padding: 10px 12px; border-radius: 8px; }
.sidebar a:hover { background: rgba(201, 162, 39, .16); color: var(--gold-2); }
.sidebar p { color: var(--gold-2); font-size: 12px; font-weight: 700; text-transform: uppercase; margin: 14px 0 2px; }
.main { min-width: 0; padding: 22px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.topbar strong { display: block; }
.topbar small, .muted { color: var(--muted); }
.icon-btn { display: none; background: var(--black); color: var(--white); border: 0; width: 40px; height: 40px; border-radius: 8px; }
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 18px; }
.card, .panel, .auth-card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(17, 17, 17, .04); }
.card { padding: 18px; }
.card small { color: var(--muted); display: block; margin-bottom: 10px; }
.card strong { font-size: 24px; overflow-wrap: anywhere; }
.panel { padding: 18px; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 16px; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
.actions, .row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn, button { border: 1px solid var(--line); background: var(--white); color: var(--ink); min-height: 38px; border-radius: 8px; padding: 9px 13px; cursor: pointer; font-weight: 700; }
.btn.primary, button.primary { background: var(--black); color: var(--gold-2); border-color: var(--black); }
.form { display: grid; gap: 14px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; min-height: 42px; padding: 10px 12px; font: inherit; background: #fffdf8; }
textarea { min-height: 110px; resize: vertical; }
.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; min-height: auto; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; }
td form { display: inline; }
td button { min-height: 0; padding: 0; border: 0; color: var(--danger); background: transparent; }
.danger-row td { color: var(--danger); font-weight: 700; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; }
.alert.success { border-color: #8cc59b; }
.alert.error { border-color: #e0a29d; color: var(--danger); }
.guest { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.auth-card { width: min(440px, 100%); padding: 26px; }
.auth-card h1 { text-align: center; margin: 12px 0 20px; }
.report-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.bank-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: 8px; color: #fff; font-weight: 800; font-size: 12px; }
.bank-yapikredi { background: #5b2585; }
.bank-enpara { background: #6b2c91; }
.bank-garanti { background: #1f9d55; }
.bank-is-bankasi { background: #123b7a; }
.bank-akbank { background: #d71920; }
.bank-ziraat { background: #d71920; }
.bank-halkbank { background: #0072bc; }
.bank-default { background: var(--ink); }
.plan-list { display: grid; gap: 10px; }
.plan-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; }
.plan-item strong, .plan-item small { display: block; }
.plan-item small { color: var(--muted); margin-top: 4px; }
.plan-item.overdue { border-color: #e0a29d; background: #fff6f5; }
.plan-amount { font-weight: 900; white-space: nowrap; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 16px; }
.detail-list { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 14px; margin: 14px 0 0; }
.detail-list dt { color: var(--muted); font-weight: 700; }
.detail-list dd { margin: 0; font-weight: 700; }

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; width: 280px; transform: translateX(-105%); transition: .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .icon-btn { display: inline-grid; place-items: center; }
    .main { padding: 16px; }
    .split, .grid-form { grid-template-columns: 1fr; }
    .profile-grid, .detail-list { grid-template-columns: 1fr; }
    .section-head { align-items: flex-start; flex-direction: column; }
}
