:root {
    --red: #e0322f;
    --red-dark: #b71f1c;
    --red-soft: #fdecec;
    --ink: #16181d;
    --ink-2: #3a3f4b;
    --muted: #6b7280;
    --line: #e7e9ee;
    --bg: #f4f5f8;
    --card: #ffffff;
    --sidebar: #16181d;
    --sidebar-2: #20232b;
    --sidebar-line: #2c303a;
    --ok: #16a34a;
    --ok-soft: #e7f6ec;
    --warn: #d97706;
    --warn-soft: #fdf1e3;
    --info: #2563eb;
    --info-soft: #e8effd;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16,18,29,.06), 0 8px 24px rgba(16,18,29,.06);
    --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- Layout shell ---------- */
.pnl { min-height: 100vh; }

.pnl-side {
    background: var(--sidebar);
    color: #cfd3dc;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 248px;
    overflow-y: auto;
    z-index: 60;
}

.pnl-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--sidebar-line);
}
.pnl-brand img { height: 30px; width: auto; display: block; }
.pnl-brand b { color: #fff; font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.pnl-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(224,50,47,.2); }

.pnl-nav { padding: 12px 12px 24px; display: flex; flex-direction: column; gap: 2px; }
.pnl-nav .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #6a6f7b; padding: 16px 12px 6px; }
.pnl-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #cfd3dc;
    font-weight: 500;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.pnl-nav a svg { width: 18px; height: 18px; opacity: .85; flex: none; }
.pnl-nav a:hover { background: var(--sidebar-2); color: #fff; }
.pnl-nav a.active { background: var(--red); color: #fff; }
.pnl-nav a.active svg { opacity: 1; }
.pnl-nav a .cnt { margin-left: auto; background: rgba(255,255,255,.12); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.pnl-nav a.active .cnt { background: rgba(0,0,0,.2); }

/* ---------- Topbar ---------- */
.pnl-main { display: flex; flex-direction: column; min-width: 0; margin-left: 248px; }
.pnl-top .brand-mini { height: 26px; width: auto; display: none; }
.pnl-top {
    height: 62px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.pnl-top h1 { font-size: 18px; font-weight: 600; margin: 0; }
.pnl-top .spacer { flex: 1; }
.pnl-top .who { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.pnl-top .who .av { width: 30px; height: 30px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-weight: 700; }
.pnl-burger { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); }

.pnl-body { padding: 26px 32px; width: 100%; }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.card-h h2 { font-size: 15px; font-weight: 600; margin: 0; }
.card-h .spacer { flex: 1; }
.card-b { padding: 20px; }
.card-b.flush { padding: 0; }

/* ---------- Stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat .val { font-size: 30px; font-weight: 700; margin-top: 6px; line-height: 1; }
.stat .val small { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat.accent { border-left: 3px solid var(--red); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
    font-family: var(--font); font-weight: 600; font-size: 14px; cursor: pointer;
    transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #cfd3dc; background: #fafbfc; }
.btn-soft { background: var(--bg); color: var(--ink-2); }
.btn-soft:hover { background: #e9ebf0; }
.btn-danger { background: #fff; border-color: #f1c4c3; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line);
    background: #fafbfc; position: sticky; top: 0;
}
table.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #fafbfc; }
table.tbl .muted { color: var(--muted); font-size: 13px; }
table.tbl .strong { font-weight: 600; }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-wait { background: var(--warn-soft); color: var(--warn); }
.pill-prog { background: var(--info-soft); color: var(--info); }
.pill-done { background: var(--ok-soft); color: var(--ok); }
.pill-cancel { background: #f3f4f6; color: #6b7280; }
.pill-fail { background: var(--red-soft); color: var(--red); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field label .en { color: var(--muted); font-weight: 500; }
.inp, .sel, textarea.inp {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
    font-family: var(--font); font-size: 14px; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.inp:focus, .sel:focus, textarea.inp:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(224,50,47,.12); }
textarea.inp { resize: vertical; min-height: 90px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* bilingual dual input */
.lang-tabs { display: inline-flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 8px; margin-bottom: 10px; }
.lang-tabs button { border: 0; background: none; padding: 5px 14px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.lang-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.lang-pane { display: none; }
.lang-pane.active { display: block; }

/* ---------- Rich text editor (WYSIWYG) ---------- */
.rte { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s; }
.rte.focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(224,50,47,.12); }
.rte-tb { display: flex; flex-wrap: wrap; gap: 2px; padding: 7px 8px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.rte-tb button { border: 0; background: none; padding: 5px 9px; border-radius: 6px; font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; line-height: 1; }
.rte-tb button:hover { background: #e9ebf0; }
.rte-tb .sep { width: 1px; background: var(--line); margin: 2px 4px; }
.rte-ed { padding: 14px 16px; min-height: 180px; outline: none; font-size: 14px; line-height: 1.7; color: var(--ink); }
.rte-ed:empty::before { content: attr(data-ph); color: var(--muted); }
.rte-ed h2 { font-size: 18px; font-weight: 700; margin: 18px 0 8px; }
.rte-ed h3, .rte-ed h4 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.rte-ed p { margin: 0 0 10px; }
.rte-ed ul, .rte-ed ol { margin: 0 0 10px; padding-left: 22px; }
.rte-ed li { margin-bottom: 4px; }
.rte-ed a { color: var(--red); }
.rte-ed img { max-width: 100%; border-radius: 8px; }
.rte-ed details { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.rte-ed summary { font-weight: 600; cursor: pointer; }
.rte-ed .mat-ben-grid, .rte-ed .mat-proc-list { display: block; }
.rte-ed .mat-ben { display: flex; gap: 8px; margin-bottom: 8px; }
.rte-ed .mat-ben .ic { display: none; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: var(--bg); }

.login-visual { position: relative; overflow: hidden; background: #0d0e12; }
.login-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.login-visual .ov { position: absolute; inset: 0; background: linear-gradient(120deg, rgba(224,50,47,.28) 0%, rgba(13,14,18,.55) 45%, rgba(13,14,18,.92) 100%); }
.login-visual .vtext { position: absolute; left: 52px; right: 52px; bottom: 52px; z-index: 2; color: #fff; }
.login-visual .vtext img { height: 42px; margin-bottom: 26px; display: block; }
.login-visual .vtext h2 { font-size: 32px; line-height: 1.18; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.login-visual .vtext p { color: rgba(255,255,255,.82); margin: 12px 0 0; font-size: 15px; max-width: 420px; }
.login-visual .vtop { position: absolute; top: 40px; left: 52px; z-index: 2; }
.login-visual .vtop img { height: 34px; }

.login-form-side { display: grid; place-items: center; padding: 40px 28px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .lg-logo { height: 46px; margin-bottom: 22px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.login-card .sub { font-size: 14px; font-weight: 500; color: var(--muted); margin: 0 0 26px; }
.login-card .btn-primary { width: 100%; padding: 12px; margin-top: 8px; font-size: 15px; }
.login-err { background: var(--red-soft); color: var(--red-dark); border: 1px solid #f1c4c3; padding: 10px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; margin-bottom: 16px; }

@media (max-width: 820px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-visual { display: none; }
}

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; align-items: center; gap: 10px; min-width: 240px;
    animation: toastIn .25s ease;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--red); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Dropzone (image upload) ---------- */
.dz {
    border: 2px dashed #cfd3dc; border-radius: 12px; padding: 28px; text-align: center; color: var(--muted);
    cursor: pointer; transition: border-color .15s, background .15s; background: #fafbfc;
}
.dz.drag { border-color: var(--red); background: var(--red-soft); color: var(--red-dark); }
.dz strong { color: var(--ink-2); }
.dz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 14px; }
.dz-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.dz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-thumb .rm { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center; font-size: 13px; }
.dz-thumb .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--red); width: 0; transition: width .2s; }

/* ---------- Misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 10px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search .inp { padding-left: 34px; min-width: 230px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumb a:hover { color: var(--red); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(16,18,29,.5); z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-back.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-h .x { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.modal-b { padding: 22px; }
.modal-f { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl li { position: relative; padding: 0 0 18px 32px; }
.tl li::before { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--red); }
.tl .st { font-weight: 600; font-size: 14px; }
.tl .nt { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.tl .dt { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .pnl-main { margin-left: 0; }
    .pnl-side { z-index: 100; transform: translateX(-100%); transition: transform .22s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .pnl-side.open { transform: translateX(0); }
    .pnl-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90; display: none; }
    .pnl-scrim.show { display: block; }
    .pnl-burger { display: inline-flex; }
    .pnl-top .brand-mini { display: block; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .row2 { grid-template-columns: 1fr; }
    .pnl-body { padding: 16px; }
}
@media (max-width: 520px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* Araçlar — marka / model kataloğu */
.veh-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.veh-col { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.veh-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fafafa; border-bottom: 1px solid var(--line); }
.veh-head b { font-size: 13px; white-space: nowrap; }
.veh-head .inp-sm { flex: 1; min-width: 0; padding: 6px 10px; font-size: 13px; }
.veh-list { height: 460px; overflow-y: auto; }
.veh-row { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid #f2f2f2; cursor: pointer; font-size: 14px; }
.veh-row:hover { background: #fafafa; }
.veh-row.sel { background: var(--red-soft); font-weight: 600; }
.veh-row.off { opacity: .45; }
.veh-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-tr { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .4px; color: #0a7d3f; background: #e6f6ec; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
.veh-cnt { font-size: 12px; color: var(--muted); background: #f1f1f1; border-radius: 20px; padding: 1px 8px; }
.veh-b { border: 0; background: transparent; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); padding: 3px 5px; border-radius: 6px; }
.veh-b:hover { background: #eee; color: var(--ink); }
.veh-x:hover { background: var(--red-soft); color: var(--red); }
.veh-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) { .veh-wrap { grid-template-columns: 1fr; } .veh-list { height: 320px; } }

/* Ürüne özel parça fiyatları modalı */
.pp-box { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.pp-cat { font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.pp-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f2f2f2; }
.pp-row:last-child { border-bottom: 0; }
.pp-row span { flex: 1; font-size: 14px; }
.pp-row .inp { width: 150px; text-align: right; padding: 6px 10px; font-size: 13px; }
.pp-row b { font-size: 13px; color: var(--muted); width: 12px; }

/* form gönderilirken buton kilitli + dönen simge (çift tıklamayla mükerrer kayıt önlenir) */
.btn-busy { position: relative; pointer-events: none; opacity: .75; }
.btn-busy .spin { display: inline-block; width: 12px; height: 12px; margin-right: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: btnSpin .7s linear infinite; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* toplu seçim */
.tbl input.js-sel, .tbl input.js-sel-all { width: 17px; height: 17px; cursor: pointer; accent-color: var(--red); vertical-align: middle; }
.tbl tr.row-sel td { background: #fff5f5; }
.bulk-bar { position: sticky; bottom: 14px; z-index: 20; display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 10px 16px; border-radius: 12px; background: #16181d; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; }
.bulk-bar .spacer { flex: 1; }
.bulk-bar[hidden] { display: none !important; }
.bulk-bar .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.bulk-bar .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
