:root {
  --bg: #0b0d12;
  --bg-2: #10131a;
  --panel: #141821;
  --panel-2: #1a1f2b;
  --line: #242a37;
  --line-2: #2e3545;
  --text: #e9ecf2;
  --muted: #8b93a7;
  --dim: #5d6579;
  --gold: #2f7de1;
  --gold-2: #6cc6f0;
  --accent: #2f7de1;
  --pos: #3ecf8e;
  --neg: #f0616d;
  --warn: #f5a524;
  --info: #5b9cf5;
  --violet: #a78bfa;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(47,125,225,.10), transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, rgba(91,156,245,.05), transparent 60%);
  background-attachment: fixed;
  color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--gold); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 410px; background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.login-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, #a8853f); color: #1a1408; font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 20px rgba(47,125,225,.25); }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 12px; }
.login-card h1 { font-size: 22px; margin: 28px 0 6px; letter-spacing: -.02em; }
.login-card p.lead { color: var(--muted); margin: 0 0 24px; }
.secure-note { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 12px; margin-top: 22px; justify-content: center; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--dim); }
.input, select.input, textarea.input {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; width: 100%;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 70px; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(47,125,225,.15); }
.input::placeholder { color: var(--dim); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #222838; border-color: #3a4256; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #3fb8e6, #2563d9); color: #fff; border-color: transparent; font-weight: 600; box-shadow: 0 6px 18px rgba(37,99,217,.25); }
.btn-primary:hover { background: linear-gradient(135deg, #5cc6ee, #2f6fe6); border-color: transparent; }
.btn-danger { color: var(--neg); border-color: rgba(240,97,109,.3); background: rgba(240,97,109,.06); }
.btn-danger:hover { background: rgba(240,97,109,.14); border-color: rgba(240,97,109,.5); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); border-color: transparent; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px; }
.icon-btn { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.btn svg, .nav svg, .icon { width: 16px; height: 16px; flex: none; }
.secure-note svg { width: 14px; height: 14px; flex: none; }

.alert { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.alert-error { background: rgba(240,97,109,.08); border-color: rgba(240,97,109,.3); color: #ff9aa2; }
.alert-ok { background: rgba(62,207,142,.08); border-color: rgba(62,207,142,.3); color: #7fe3b4; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: rgba(16,19,26,.85);
  backdrop-filter: blur(10px); padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; z-index: 30; }
.sidebar .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(47,125,225,.14), rgba(47,125,225,.03)); color: var(--gold-2);
  box-shadow: inset 2px 0 0 var(--gold); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2);
  border: 1px solid var(--line-2); font-weight: 600; font-size: 13px; color: var(--gold-2); flex: none; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { font-size: 11.5px; color: var(--dim); }

.main { min-width: 0; }
.topbar { display: none; }
.content { padding: 28px 32px 60px; max-width: 1440px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 6px; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .sub { color: var(--dim); font-size: 12px; }
.card-body { padding: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi .label i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; }
.kpi .foot { color: var(--dim); font-size: 12px; margin-top: 4px; }
.kpi.feature { background: linear-gradient(135deg, rgba(47,125,225,.16), rgba(47,125,225,.03) 60%), var(--panel); border-color: rgba(47,125,225,.3); }
.kpi.feature .value { color: var(--gold-2); }
.grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--muted); } .dim { color: var(--dim); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dim);
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: rgba(255,255,255,.018); }
.table tbody tr.click { cursor: pointer; }
.table tfoot td { font-weight: 700; background: var(--bg-2); border-top: 1px solid var(--line-2); border-bottom: 0; }
.table .row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: .55; }
.table tr:hover .row-actions { opacity: 1; }
.table tr.inactive td { opacity: .5; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.person { display: flex; align-items: center; gap: 11px; }
.person b { font-weight: 600; }
.person small { display: block; color: var(--dim); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-shift { color: var(--info); border-color: rgba(91,156,245,.3); background: rgba(91,156,245,.08); }
.b-earning { color: var(--pos); border-color: rgba(62,207,142,.3); background: rgba(62,207,142,.08); }
.b-addition { color: var(--violet); border-color: rgba(167,139,250,.3); background: rgba(167,139,250,.08); }
.b-advance { color: var(--warn); border-color: rgba(245,165,36,.3); background: rgba(245,165,36,.08); }
.b-deduction { color: var(--neg); border-color: rgba(240,97,109,.3); background: rgba(240,97,109,.08); }
.b-payment { color: var(--gold); border-color: rgba(47,125,225,.3); background: rgba(47,125,225,.08); }
.b-on { color: var(--pos); border-color: rgba(62,207,142,.3); background: rgba(62,207,142,.08); }
.b-off { color: var(--dim); border-color: var(--line-2); background: transparent; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .input { width: auto; min-width: 150px; padding: 8px 11px; }
.toolbar .search { flex: 1; min-width: 200px; position: relative; }
.toolbar .search .input { width: 100%; padding-left: 34px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--dim); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 7px; color: var(--muted); cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--panel-2); color: var(--gold-2); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 2px 6px rgba(0,0,0,.25); }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 260px; display: block; }
.chart text { fill: var(--dim); font-size: 10.5px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--line-2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip { position: fixed; pointer-events: none; background: #0e1118; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; box-shadow: var(--shadow); z-index: 100; min-width: 170px; }
.chart-tip b { display: block; margin-bottom: 6px; }
.chart-tip div { display: flex; justify-content: space-between; gap: 14px; }
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; gap: 10px; }
.bar-row .track { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 99px; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .meta { flex: 1; min-width: 0; }
.feed-item .meta b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .meta span { color: var(--dim); font-size: 12px; }

/* ---------- Quick actions ---------- */
.quick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 18px; }
.quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.quick button:hover { border-color: var(--line-2); background: var(--panel-2); }
.quick button .q-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.quick button b { font-size: 13px; font-weight: 600; }
.quick button span { font-size: 11.5px; color: var(--dim); }

.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 24px; }
.profile div span { display: block; font-size: 11.5px; color: var(--dim); margin-bottom: 2px; }
.profile div b { font-weight: 500; word-break: break-all; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(5,6,10,.7); backdrop-filter: blur(4px); display: grid; place-items: center;
  padding: 16px; z-index: 50; animation: fade .15s ease; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 18px; box-shadow: var(--shadow); animation: pop .18s ease; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px 22px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }
.calc { background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc span { display: block; font-size: 11px; color: var(--dim); }
.calc b { font-size: 15px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #0e1118; border: 1px solid var(--line-2); border-left: 3px solid var(--pos); border-radius: 10px; padding: 11px 14px;
  box-shadow: var(--shadow); animation: pop .2s ease; max-width: 340px; }
.toast.err { border-left-color: var(--neg); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button { border: 0; background: none; padding: 13px 12px; color: var(--muted); cursor: pointer; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--gold-2); border-color: var(--gold); }
.qr { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-2); border: 1px solid var(--line-2); padding: 8px 10px; border-radius: 8px; letter-spacing: .08em; word-break: break-all; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
.loading { display: grid; place-items: center; padding: 60px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .app.nav-open .sidebar { transform: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; background: rgba(11,13,18,.9); backdrop-filter: blur(10px); z-index: 20; }
  .content { padding: 20px 16px 50px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .page-head h2 { font-size: 20px; }
  .kpi .value { font-size: 20px; }
  .toolbar .input { min-width: 0; flex: 1 1 140px; }
}
.nowrap { white-space: nowrap; }

/* ---------- SEI marka ---------- */
.brand-logo { display: block; height: 50px; width: auto; }
.login-card .brand-logo { height: 64px; margin: 0 auto; }
.login-card .brand { flex-direction: column; text-align: center; gap: 6px; }
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: 4px; }
.topbar .brand-logo { height: 30px; }
.b-payment { color: #6cc6f0; border-color: rgba(108,198,240,.3); background: rgba(108,198,240,.08); }

/* ---------- Excel içe aktarma ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; border: 1.5px dashed var(--line-2); border-radius: 14px;
  background: var(--bg-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; margin-top: 4px; }
.drop:hover, .drop.over { border-color: var(--gold); background: rgba(47,125,225,.06); }
.drop.busy { opacity: .7; pointer-events: none; }
.drop-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(47,125,225,.12); color: var(--gold-2); margin-bottom: 4px; }
.drop-ico svg { width: 22px; height: 22px; transform: rotate(180deg); }
.drop span { color: var(--dim); font-size: 12.5px; }
.imp-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.imp-h { margin: 18px 0 10px; font-size: 13.5px; font-weight: 600; }
.imp-h .dim { font-weight: 400; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.map-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.map-item.set { border-color: rgba(47,125,225,.45); }
.map-item > span { font-size: 12px; color: var(--muted); }
.map-item .input { padding: 6px 30px 6px 9px; font-size: 13px; }
.imp-opts { display: flex; flex-direction: column; gap: 9px; }
.imp-prev { border: 1px solid var(--line); border-radius: 10px; max-height: 240px; }
.imp-prev .table td, .imp-prev .table th { padding: 8px 10px; font-size: 12.5px; white-space: nowrap; }
.imp-sum { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid; }
.imp-sum.good { border-color: rgba(62,207,142,.35); background: rgba(62,207,142,.06); }
.imp-sum.warn { border-color: rgba(245,165,36,.35); background: rgba(245,165,36,.06); }
.imp-sum span { display: block; font-size: 11.5px; color: var(--dim); }
.imp-sum b { font-size: 16px; }
.imp-errs { max-height: 220px; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.imp-errs td, .imp-errs th { padding: 7px 10px; font-size: 12.5px; }

/* ---------- KDV ---------- */
.vat-box { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.vat-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; }
.vat-rate { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-weight: 500; }
.chip.on, .chip:hover { border-color: var(--gold); color: var(--gold-2); }
.calc small { display: block; font-size: 11px; margin-top: 2px; }

/* ---------- Bonus ---------- */
.b-bonus { color: #2dd4bf; border-color: rgba(45,212,191,.35); background: rgba(45,212,191,.08); }
.b-bonus-neg { color: #f472b6; border-color: rgba(244,114,182,.35); background: rgba(244,114,182,.08); }
.modal.xwide { max-width: 1040px; }
