:root {
    --bg: #f4f6f8;
    --surface: #fff;
    --text: #17212b;
    --muted: #667085;
    --primary: #126e5a;
    --primary-dark: #0d5545;
    --border: #d9e0e7;
    --danger: #b42318;
    --success: #067647;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--primary); }
.topbar {
    min-height: 64px; padding: 10px max(18px, calc((100% - 1180px) / 2));
    display: flex; align-items: center; gap: 24px; background: #112a26; color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-size: 1.15rem; font-weight: 800; white-space: nowrap; }
.topbar nav { display: flex; flex: 1; gap: 18px; flex-wrap: wrap; }
.topbar nav a { opacity: .85; }
.topbar nav a:hover { opacity: 1; }
.user-menu { display: flex; gap: 12px; white-space: nowrap; font-size: .9rem; }
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto 60px; }
.auth-container { width: min(440px, calc(100% - 32px)); margin-top: 10vh; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
h1 { margin: 0; font-size: clamp(1.45rem, 4vw, 2rem); }
h2 { margin-top: 0; font-size: 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; box-shadow: 0 2px 8px rgb(16 24 40 / 5%); }
.auth-card { padding: 28px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #344054; font-size: .92rem; font-weight: 650; }
input, select, textarea {
    width: 100%; min-height: 44px; border: 1px solid #bfc9d4; border-radius: 9px;
    padding: 10px 12px; background: #fff; color: var(--text); font: inherit; font-size: 16px;
}
input:focus, select:focus { outline: 3px solid rgb(18 110 90 / 15%); border-color: var(--primary); }
.button {
    display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 9px;
    min-height: 44px; padding: 10px 17px; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none;
    background: #e8ecef; color: var(--text);
}
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.danger { background: #fee4e2; color: var(--danger); }
.button.small { min-height: 34px; padding: 6px 11px; font-size: .86rem; }
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.alert-success { background: #dcfae6; color: var(--success); }
.alert-error { background: #fee4e2; color: var(--danger); }
.alert-info { background: #e0f2fe; color: #075985; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.muted { color: var(--muted); }
.amount { font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.step-number {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--primary); color: #fff; margin-right: 8px;
}
.amount-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
.amount-input { font-size: 2rem; min-height: 70px; font-weight: 800; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.category-button { min-height: 82px; font-size: 1rem; }
.hidden { display: none !important; }
.stat { font-size: 1.7rem; font-weight: 850; margin: 8px 0; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: .78rem; background: #e8ecef; }
.badge-paid, .badge-active { color: var(--success); background: #dcfae6; }
.badge-pending, .badge-paused { color: #9a6700; background: #fef0c7; }
.badge-cancelled { color: var(--danger); background: #fee4e2; }

@media (max-width: 780px) {
    .topbar { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
    .topbar nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .user-menu { margin-left: auto; }
    .container { width: min(100% - 20px, 1180px); margin-top: 18px; }
    .grid, .grid-3 { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .card { padding: 16px; }
}

/* Yönetim paneli */
:root {
    --sidebar: #101c2c;
    --sidebar-soft: #17263a;
    --accent: #24b47e;
    --accent-soft: #e7f8f1;
    --shadow: 0 12px 35px rgba(16, 28, 44, .07);
}

body { background: #f5f7fa; min-height: 100vh; }
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: 264px; display: flex; flex-direction: column;
    padding: 26px 18px 18px; color: #d7e0eb; background:
    radial-gradient(circle at 20% 0, rgba(36, 180, 126, .14), transparent 30%), var(--sidebar);
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; color: #fff; }
.brand-mark {
    display: inline-grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px;
    border-radius: 12px; color: #fff; background: linear-gradient(135deg, #27c68b, #118563);
    font-size: .82rem; font-weight: 900; letter-spacing: -.03em; box-shadow: 0 8px 20px rgba(36,180,126,.22);
}
.sidebar .brand > span:last-child { display: grid; line-height: 1.15; }
.sidebar .brand strong { font-size: 1.08rem; }
.sidebar .brand small { margin-top: 4px; color: #8fa0b4; font-size: .7rem; font-weight: 600; letter-spacing: .04em; }
.side-nav { display: grid; gap: 5px; overflow-y: auto; }
.nav-label { margin: 20px 12px 7px; color: #66798f; font-size: .65rem; font-weight: 850; letter-spacing: .13em; }
.side-nav a {
    display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 9px 12px;
    border-radius: 10px; color: #aebdce; text-decoration: none; font-size: .9rem; font-weight: 650;
    transition: .18s ease;
}
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.055); transform: translateX(2px); }
.side-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(36,180,126,.24), rgba(36,180,126,.08)); box-shadow: inset 3px 0 var(--accent); }
.side-nav i {
    display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
    color: #7f93a9; background: rgba(255,255,255,.045); font-size: 1rem; font-style: normal;
}
.side-nav a.active i { color: #52dca9; background: rgba(36,180,126,.12); }
.sidebar-user {
    display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 16px 10px 2px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.avatar {
    display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px;
    color: #d8fff0; background: rgba(36,180,126,.18); font-weight: 850;
}
.user-copy { display: grid; min-width: 0; flex: 1; }
.user-copy strong { overflow: hidden; color: #fff; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { margin-top: 3px; color: #71869c; font-size: .7rem; }
.logout-link { color: #75889d; text-decoration: none; font-size: 1.1rem; }
.workspace { min-height: 100vh; margin-left: 264px; }
.workspace .container { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding: 38px 0 70px; }
.mobile-header { display: none; }
.workspace .page-heading { margin-bottom: 28px; }
.page-heading h1 { color: #172233; letter-spacing: -.035em; }
.eyebrow { margin: 0 0 7px; color: #8996a7; font-size: .65rem; font-weight: 850; letter-spacing: .14em; }
.today {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border: 1px solid #e3e8ef;
    border-radius: 10px; color: #66758a; background: #fff; font-size: .8rem; font-weight: 700;
}
.card {
    border-color: #e6ebf1; border-radius: 16px; box-shadow: var(--shadow);
}
.card h2 { color: #273548; letter-spacing: -.02em; }
.button { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary {
    background: linear-gradient(135deg, #1eaa78, #118563); box-shadow: 0 7px 18px rgba(18,110,90,.18);
}
.button.primary:hover { background: linear-gradient(135deg, #17936a, #0d7053); box-shadow: 0 9px 22px rgba(18,110,90,.24); }
input, select { border-color: #d9e1e9; background: #fbfcfd; transition: .15s ease; }
input:hover, select:hover { border-color: #b9c7d5; }
input:focus, select:focus { background: #fff; }
.alert { border: 1px solid transparent; box-shadow: 0 7px 18px rgba(16,24,40,.04); }
.alert-success { border-color: #a9e9ce; }
.alert-error { border-color: #fecaca; }
.alert-info { border-color: #bae6fd; }
table tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fafcfd; }
.badge { font-weight: 700; }
.auth-container { width: min(460px, calc(100% - 32px)); margin-top: 7vh; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 32px; font-size: 1.15rem; }
.auth-container .page-heading { justify-content: center; margin-bottom: 20px; }
.auth-container .page-heading h1 { font-size: 1.6rem; }
.auth-card { border: 0; box-shadow: 0 24px 70px rgba(22,34,51,.12); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
    content: ""; position: absolute; right: -32px; bottom: -42px; width: 120px; height: 120px;
    border-radius: 50%; background: var(--accent-soft);
}
.stat-label { margin: 0; color: #7d899a; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat-meta { position: relative; z-index: 1; color: #7b8899; font-size: .78rem; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-title h2 { margin: 0; }
.text-link { font-size: .8rem; font-weight: 750; text-decoration: none; }
.empty-state { padding: 30px 15px; color: var(--muted); text-align: center; }
.quick-card { background: linear-gradient(145deg, #fff, #f9fcfb); }
.step-progress { display: flex; gap: 7px; margin-bottom: 24px; }
.step-progress span { height: 5px; flex: 1; border-radius: 99px; background: #e4e9ef; }
.step-progress span.active { background: var(--accent); }
.amount-row { margin: 18px 0; }
.amount-input { border: 0; border-bottom: 2px solid #dce4eb; border-radius: 0; background: transparent; font-size: 2.4rem; }
.amount-input:focus { border-color: var(--accent); outline: 0; box-shadow: none; background: transparent; }
.category-button {
    border: 1px solid #e0e8e5; color: #29473e; background: #f6fbf9;
}
.category-button:hover { border-color: #8ed7bb; color: #0b6d4e; background: #eaf8f2; }
.sidebar-overlay { display: none; }
.category-bars { display: grid; gap: 19px; }
.bar-row > div:first-child { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; font-size: .84rem; }
.bar-row > div:first-child span { color: #657387; font-variant-numeric: tabular-nums; font-weight: 700; }
.bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: #edf1f4; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22b27d, #43d19e); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.quick-actions a {
    display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; padding: 14px; border: 1px solid #e5ebf0;
    border-radius: 12px; color: #293849; background: #fbfcfd; text-decoration: none; transition: .16s ease;
}
.quick-actions a:hover { border-color: #a9dec9; background: #f3fbf8; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(16,44,35,.07); }
.quick-actions a > span { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #16815e; background: #e8f7f1; font-size: 1.15rem; }
.quick-actions strong { align-self: end; font-size: .83rem; }
.quick-actions small { align-self: start; margin-top: 3px; color: #8490a0; font-size: .68rem; }
.mini-stat {
    display: flex; align-items: center; gap: 13px; min-height: 70px; padding: 14px 18px;
    border: 1px solid #e6ebf1; border-radius: 14px; background: #fff;
}
.mini-stat strong { color: #16815e; font-size: 1.55rem; }
.mini-stat span { color: #6f7c8d; font-size: .78rem; font-weight: 700; }
.report-filters { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 14px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.report-kpis .mini-stat { display: grid; align-content: center; gap: 3px; }
.report-kpis .mini-stat strong { overflow: hidden; font-size: 1.15rem; text-overflow: ellipsis; white-space: nowrap; }
.trend-up { color: #b54708 !important; }
.trend-down { color: #16815e !important; }
.daily-chart {
    display: flex; align-items: end; gap: 7px; min-height: 220px; padding-top: 30px; overflow-x: auto;
}
.day-column { display: grid; grid-template-rows: 18px 145px 20px; flex: 1 0 32px; min-width: 32px; text-align: center; }
.day-value { visibility: hidden; overflow: hidden; color: #69778a; font-size: .62rem; white-space: nowrap; }
.day-column:hover .day-value { visibility: visible; overflow: visible; }
.day-bar { position: relative; height: 145px; border-radius: 6px; background: #f1f4f6; }
.day-bar i {
    position: absolute; right: 0; bottom: 0; left: 0; min-height: 5px; border-radius: 6px;
    background: linear-gradient(180deg, #45d3a0, #15976b); transition: filter .15s ease;
}
.day-column:hover .day-bar i { filter: brightness(.9); }
.day-column small { padding-top: 6px; color: #8a96a6; font-size: .66rem; }
.rank-list { display: grid; }
.rank-list > div { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; min-height: 54px; border-bottom: 1px solid #edf0f3; }
.rank-list > div:last-child { border: 0; }
.rank { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: #16815e; background: #e8f7f1; font-size: .72rem; font-weight: 850; }
.rank-list strong { font-size: .84rem; }
.currency-chip {
    display: inline-grid; place-items: center; min-width: 48px; min-height: 30px; border-radius: 8px;
    color: #126d51; background: #e8f7f1; font-size: .75rem; font-weight: 850; letter-spacing: .05em;
}
.report-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -12px 0 18px;
}
.report-actions p { margin: 0; color: #718096; font-size: .82rem; }
.comparison-chart { display: grid; gap: 20px; }
.comparison-label { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; font-size: .82rem; }
.comparison-label span { color: #657387; font-weight: 700; }
.comparison-label strong { font-variant-numeric: tabular-nums; }
.comparison-track { height: 12px; overflow: hidden; border-radius: 99px; background: #edf1f4; }
.comparison-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #15976b, #45d3a0); }
.comparison-item.normalized .comparison-track i { background: linear-gradient(90deg, #3b70d4, #64a1f4); }
.comparison-item.previous .comparison-track i { background: linear-gradient(90deg, #8693a5, #b6c0cc); }
.donut-layout { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; align-items: center; gap: 28px; }
.donut-chart {
    position: relative; aspect-ratio: 1; width: min(100%, 240px); margin: auto; border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.03);
}
.donut-chart::after {
    content: ""; position: absolute; inset: 25%; border-radius: 50%; background: #fff;
    box-shadow: 0 0 0 1px rgba(16,28,44,.03), 0 7px 20px rgba(16,28,44,.06);
}
.donut-chart > div { position: absolute; inset: 25%; z-index: 1; display: grid; place-content: center; text-align: center; }
.donut-chart strong { font-size: clamp(.8rem, 1.4vw, 1.1rem); white-space: nowrap; }
.donut-chart span { margin-top: 3px; color: #8793a3; font-size: .66rem; }
.chart-legend { display: grid; gap: 3px; }
.chart-legend > div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; min-height: 40px; padding: 5px 0; border-bottom: 1px solid #eef1f4; }
.chart-legend > div:last-child { border-bottom: 0; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.chart-legend span { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.chart-legend strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend small { color: #8a96a6; font-size: .67rem; }
.chart-legend b { font-size: .76rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 1020px) {
    .sidebar { width: 232px; }
    .workspace { margin-left: 232px; }
    .workspace .container { width: min(100% - 36px, 1240px); }
    .report-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
    .sidebar {
        width: min(290px, 86vw); transform: translateX(-105%); box-shadow: 20px 0 55px rgba(0,0,0,.22);
        transition: transform .22s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .workspace { margin-left: 0; }
    .mobile-header {
        position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
        height: 60px; padding: 0 14px; color: #fff; background: rgba(16,28,44,.96); backdrop-filter: blur(12px);
        font-size: .9rem; font-weight: 800;
    }
    .menu-toggle { width: 38px; height: 38px; border: 0; color: #fff; background: transparent; font-size: 1.25rem; }
    .small-avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; font-size: .75rem; }
    .workspace .container { width: min(100% - 20px, 1240px); padding-top: 22px; }
    .workspace .page-heading { margin-bottom: 20px; }
    .today { display: none; }
    .sidebar-overlay {
        position: fixed; inset: 0; z-index: 40; display: block; visibility: hidden;
        opacity: 0; background: rgba(5,13,24,.55); transition: .2s ease;
    }
    .sidebar-overlay.show { visibility: visible; opacity: 1; }
    .category-grid { grid-template-columns: 1fr 1fr; }
    .amount-input { font-size: 2rem; }
    .quick-actions { grid-template-columns: 1fr; }
    .report-filters { grid-template-columns: 1fr 1fr; }
    .report-filters .button { grid-column: 1 / -1; }
    .report-kpis { grid-template-columns: 1fr 1fr; }
    .report-actions { align-items: flex-start; flex-direction: column; }
    .donut-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .report-filters, .report-kpis { grid-template-columns: 1fr; }
    .report-actions .actions, .report-actions .button { width: 100%; }
    .report-actions .actions { display: grid; grid-template-columns: 1fr; }
    .donut-chart { width: 200px; }
    .chart-legend span { display: grid; gap: 1px; }
}

@media (max-width: 680px) {
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
    .responsive-table thead { display: none; }
    .responsive-table tr { margin-bottom: 12px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
    .responsive-table td {
        display: grid; grid-template-columns: minmax(105px, 38%) 1fr; align-items: center; min-height: 34px;
        padding: 7px 0; border-bottom: 1px dashed #e3e8ed; text-align: right;
    }
    .responsive-table td:last-child { border-bottom: 0; }
    .responsive-table td::before {
        content: attr(data-label); color: #7a8797; font-size: .68rem; font-weight: 800;
        letter-spacing: .03em; text-align: left; text-transform: uppercase;
    }
    .responsive-table td > * { justify-self: end; }
}

@media print {
    @page { size: A4 landscape; margin: 10mm; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body { color: #17212b; background: #fff; font-size: 9pt; }
    .sidebar, .mobile-header, .sidebar-overlay, .no-print { display: none !important; }
    .workspace { margin: 0; }
    .workspace .container { width: 100%; margin: 0; padding: 0; }
    .workspace .page-heading { margin-bottom: 12px; }
    .workspace .page-heading .today { display: inline-flex; }
    .card { padding: 12px; border: 1px solid #dfe5eb; box-shadow: none; break-inside: avoid; }
    .grid, .grid-3, .report-kpis { gap: 9px; }
    .stat { font-size: 1.25rem; }
    .daily-chart { min-height: 150px; }
    .day-column { grid-template-rows: 14px 95px 16px; }
    .day-bar { height: 95px; }
    .day-value { display: none; }
    table { font-size: 8pt; }
    th, td { padding: 6px; }
    .responsive-table { display: table; }
    .responsive-table thead { display: table-header-group; }
    .responsive-table tbody { display: table-row-group; }
    .responsive-table tr { display: table-row; }
    .responsive-table td { display: table-cell; width: auto; }
    .responsive-table td::before { display: none; }
    a { color: inherit; text-decoration: none; }
}
