/* LazerKesim — tek dosya stil. Harici bağımlılık yok (CSP: style-src 'self'). */

:root {
    /* Yüzeyler */
    --bg: #f6f7f9;
    --panel: #ffffff;
    --panel-2: #fbfcfd;
    --ink: #14202b;
    --ink-soft: #33414f;
    --muted: #63707d;
    --line: #e5e9ee;
    --line-soft: #eef1f4;

    /* Koyu yüzey (kenar çubuğu / giriş paneli) */
    --dark: #0e1822;
    --dark-2: #142230;
    --dark-line: #22323f;
    --dark-ink: #c5cfd8;
    --dark-ink-dim: #7d8b98;

    /* Marka — lazer kızılı */
    --brand: #b5341c;
    --brand-strong: #9c2c17;
    --brand-tint: #fbecea;
    --brand-ink: #ffffff;

    --ok: #1b7a48;
    --ok-tint: #e7f4ec;
    --warn: #9a6a14;
    --warn-tint: #fdf2da;
    --err: #b0271f;
    --err-tint: #fbeae9;

    --radius: 10px;
    --radius-sm: 7px;
    --shadow-sm: 0 1px 2px rgba(15, 25, 35, .06);
    --shadow: 0 1px 3px rgba(15, 25, 35, .07), 0 6px 16px -8px rgba(15, 25, 35, .12);
    --shadow-lg: 0 24px 60px -18px rgba(15, 25, 35, .35);

    font-size: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.01em; }

/* --- Uygulama düzeni --- */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

.sidebar {
    background: var(--dark);
    color: var(--dark-ink);
    padding: 16px 14px 20px;
    display: flex; flex-direction: column; gap: 2px;
    border-right: 1px solid var(--dark-line);
}
.sidebar .logo {
    color: #fff; font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em;
    padding: 8px 10px 16px; display: flex; align-items: center; gap: 9px;
}
.sidebar .logo .mark {
    width: 26px; height: 26px; border-radius: 7px; flex: none;
    background: linear-gradient(150deg, var(--brand), #d9603f);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: .9rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.sidebar a {
    color: var(--dark-ink); padding: 8px 10px; border-radius: 7px;
    display: flex; gap: 9px; font-size: .92rem; line-height: 1.3;
    transition: background .12s ease, color .12s ease;
}
.sidebar a:hover { background: var(--dark-2); text-decoration: none; color: #fff; }
.sidebar a.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.sidebar .spacer { flex: 1; }
.sidebar .sub {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--dark-ink-dim); padding: 16px 10px 5px; font-weight: 600;
}
.sidebar form { padding: 2px 10px; }
.sidebar .btn-link { color: var(--dark-ink-dim); font-size: .88rem; }
.sidebar .btn-link:hover { color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: rgba(255,255,255,.85); backdrop-filter: saturate(1.4) blur(6px);
    border-bottom: 1px solid var(--line);
    padding: 13px 26px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.12rem; margin: 0; font-weight: 650; }
.topbar .user { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 12px; }
.content { padding: 26px; max-width: 1140px; width: 100%; }

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 4px 6px; }
    .sidebar .logo { padding: 4px 8px; width: 100%; }
    .sidebar .sub, .sidebar .spacer { display: none; }
    .sidebar a { font-size: .85rem; padding: 6px 9px; }
    .content { padding: 18px; }
}

/* --- Kartlar --- */
.card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 14px; font-size: 1.02rem; font-weight: 650; }

.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid.cols-4 { grid-template-columns: 1fr; } }

.stat {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 17px 18px; box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .84rem; margin-top: 3px; }

/* --- Tablolar --- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--line-soft); }
th {
    color: var(--muted); font-weight: 600; font-size: .72rem;
    text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 1px solid var(--line);
}
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: var(--panel-2); }
tfoot td { border-top: 1px solid var(--line); font-weight: 600; }
.text-right { text-align: right; }

/* --- Formlar --- */
.form-row { margin-bottom: 15px; }
label { display: block; font-size: .82rem; color: var(--ink-soft); font-weight: 550; margin-bottom: 6px; }
input, select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--ink);
    transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: #9aa5b1; }
input:hover, select:hover, textarea:hover { border-color: #cfd6de; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}
input:disabled, select:disabled { background: var(--panel-2); color: var(--muted); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
    background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600;
    cursor: pointer; transition: background .12s ease, box-shadow .12s ease, transform .05s ease;
    box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--brand-strong); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--panel-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: #94211a; }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 7px 13px; font-size: .85rem; }
.btn.xs { padding: 4px 10px; font-size: .78rem; box-shadow: none; }
.btn-link { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* --- Uyarılar --- */
.alert {
    padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px;
    font-size: .9rem; border: 1px solid; display: flex; gap: 9px;
}
.alert::before { font-weight: 700; }
.alert.err  { background: var(--err-tint);  border-color: #f0c9c6; color: var(--err); }
.alert.err::before  { content: "!"; }
.alert.info { background: #eaf1fb; border-color: #c5daf7; color: #1a4f9c; }
.alert.info::before { content: "i"; }
.alert.ok   { background: var(--ok-tint);   border-color: #b8ddc7; color: var(--ok); }
.alert.ok::before   { content: "✓"; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert div { flex: 1; }

.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: .74rem; background: var(--line-soft); color: var(--muted); font-weight: 500;
}
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* ============================================================
   Giriş ekranı — iki panelli, prestijli
   ============================================================ */
.auth {
    min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
    background: var(--bg);
}
.auth__aside {
    position: relative; overflow: hidden;
    background: radial-gradient(1200px 520px at 12% -10%, #1c2f3f 0%, var(--dark) 55%);
    color: #fff; padding: 54px 56px; display: flex; flex-direction: column;
}
.auth__aside::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        repeating-linear-gradient(115deg, rgba(217,96,63,.12) 0 1px, transparent 1px 78px),
        radial-gradient(420px 420px at 90% 110%, rgba(181,52,28,.30), transparent 70%);
    mask: linear-gradient(180deg, #000, rgba(0,0,0,.35));
}
.auth__aside > * { position: relative; z-index: 1; }
.auth__brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.18rem; letter-spacing: -.01em; }
.auth__brand .mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(150deg, var(--brand), #e0693f);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 24px -6px rgba(181,52,28,.6);
}
.auth__aside .headline {
    margin-top: auto; font-size: 1.9rem; font-weight: 700; line-height: 1.25;
    letter-spacing: -.02em; max-width: 15ch;
}
.auth__aside .sub { margin-top: 14px; color: #b9c6d1; font-size: 1rem; max-width: 40ch; }
.auth__points { margin-top: 30px; display: flex; flex-direction: column; gap: 13px; }
.auth__points li { list-style: none; display: flex; gap: 11px; align-items: flex-start; color: #cdd8e1; font-size: .93rem; }
.auth__points .tick {
    flex: none; width: 20px; height: 20px; border-radius: 6px; margin-top: 1px;
    background: rgba(217,96,63,.16); color: #f0a488; display: inline-flex;
    align-items: center; justify-content: center; font-size: .72rem; font-weight: 700;
}
.auth__aside .foot { margin-top: 40px; color: var(--dark-ink-dim); font-size: .8rem; }

.auth__main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 384px; }
.auth__card .title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.auth__card .lead { color: var(--muted); margin-top: 6px; margin-bottom: 26px; font-size: .95rem; }
.auth__card .form-row { margin-bottom: 16px; }
.auth__card input { padding: 11px 13px; }
.auth__card .btn.block { padding: 11px 16px; margin-top: 4px; font-size: .96rem; }
.auth__note {
    margin-top: 20px; text-align: center; font-size: .78rem; color: var(--muted);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.auth__note .lock { opacity: .6; }
.auth__card .brand { text-align: center; font-weight: 800; font-size: 1.3rem; color: var(--brand); margin-bottom: 4px; }
.auth__card .sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth__aside { display: none; }
    .auth__main { padding: 32px 20px; min-height: 100vh; }
}

/* --- Araç çubuğu / filtreler / sayfalama --- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; font-size: 1.3rem; font-weight: 680; letter-spacing: -.02em; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: end; }
.filters .form-row { margin: 0; }
.filters label { margin-bottom: 4px; font-size: .74rem; }
.filters input, .filters select { min-width: 150px; padding: 8px 10px; }
.filters .btn { align-self: end; }

.pagination { display: flex; gap: 6px; align-items: center; margin-top: 16px; font-size: .86rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); }
.pagination a:hover { background: var(--panel-2); text-decoration: none; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { color: var(--muted); opacity: .5; border-color: var(--line-soft); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline; }

/* --- Form grid --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }
.field-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.inline-group { display: flex; gap: 8px; }
.inline-group > * { flex: 1; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.summary-row { display: flex; gap: 12px; flex-wrap: wrap; }
.summary-row .stat { flex: 1; min-width: 150px; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--err); }
.neg { color: var(--ok); }

/* --- Durum rozetleri --- */
.durum { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.durum-taslak       { background: var(--line-soft); color: var(--muted); }
.durum-onayli       { background: #eaf1fb; color: #1a4f9c; }
.durum-kismi_odendi { background: var(--warn-tint); color: var(--warn); }
.durum-odendi       { background: var(--ok-tint); color: var(--ok); }
.durum-iptal        { background: var(--err-tint); color: var(--err); text-decoration: line-through; }

/* --- Kalem tablosu --- */
.kalem-tablo table { font-size: .88rem; }
.kalem-tablo th, .kalem-tablo td { padding: 5px 6px; }
.kalem-tablo input, .kalem-tablo select { padding: 6px 7px; min-width: 0; }
.kalem-tablo .k-aciklama { min-width: 160px; }
.kalem-tablo .k-miktar, .kalem-tablo .k-fiyat, .kalem-tablo .k-iskonto { width: 80px; text-align: right; }
.kalem-tablo .k-kdv { width: 74px; }
.kalem-tablo .k-birim { width: 74px; }
.kalem-tablo .k-urun { min-width: 132px; }

.totbox { margin-left: auto; margin-top: 16px; max-width: 340px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.totbox .satir { display: flex; justify-content: space-between; padding: 4px 0; font-size: .92rem; }
.totbox .satir.genel { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 9px; font-weight: 700; font-size: 1.06rem; }

/* --- Çıktı butonları --- */
.ciktilar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ciktilar .grp { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.ciktilar .grp a { padding: 7px 12px; font-size: .84rem; color: var(--ink); border-right: 1px solid var(--line); background: #fff; }
.ciktilar .grp a:last-child { border-right: 0; }
.ciktilar .grp a:hover { background: var(--brand); color: #fff; text-decoration: none; }
.ciktilar .grp .lbl { padding: 7px 10px; font-size: .76rem; color: var(--muted); background: var(--panel-2); border-right: 1px solid var(--line); }

.rapor-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 700px) { .rapor-menu { grid-template-columns: 1fr; } }
.rapor-menu a { display: block; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease, transform .06s ease; }
.rapor-menu a:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.rapor-menu a .t { font-weight: 680; margin-bottom: 5px; }
.rapor-menu a .d { color: var(--muted); font-size: .88rem; }

.ekstre-blok + .ekstre-blok { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
