@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

/* ==========================================================================
   KENAN METAL — "Forge" theme  (Engineered Blueprint family)
   Grafit çelik + dövme turuncusu. Keskin köşeler, teknik pafta estetiği.
   Saf CSS — hiçbir framework yok.
   ========================================================================== */

:root {
    /* Çelik mavisi omurga (artech ile birebir) */
    --steel-950: #0b1c33;
    --steel-900: #0f2747;
    --steel-850: #143458;
    --steel-800: #143458;
    --steel-700: #173c69;   /* sidebar tabanı */
    --steel-600: #1d4575;   /* marka */
    --steel-500: #2d5a93;
    --steel-400: #4a6382;
    --steel-300: #6680a0;

    /* Kağıt / yüzey (artech) */
    --paper: #eaeff5;
    --surface: #ffffff;
    --surface-alt: #f4f7fb;
    --line: #d8dee7;
    --line-soft: #e7ecf2;

    /* Mürekkep (artech) */
    --ink: #14202e;
    --ink-soft: #4a5a6e;
    --ink-faint: #6b7888;

    /* Marka: birincil çelik mavisi (#1d4575) + amber sinyal aksanı (#e07b2e) */
    --forge: #1d4575;
    --forge-bright: #2d5a93;
    --forge-dark: #143458;
    --forge-glow: rgba(29, 69, 117, 0.12);

    --accent: #e07b2e;
    --accent-dark: #c25f17;

    /* Durum (artech) */
    --pos: #1f7a4d;
    --pos-soft: rgba(31, 122, 77, 0.10);
    --neg: #b42318;
    --neg-soft: rgba(180, 35, 24, 0.10);

    --sidebar-w: 200px;
    --sidebar-w-collapsed: 64px;
    --topbar-h: 56px;

    --shadow-sm: 0 1px 0 rgba(15, 39, 71, 0.04), 0 2px 8px rgba(15, 39, 71, 0.05);
    --shadow-md: 0 2px 4px rgba(15, 39, 71, 0.05), 0 8px 24px rgba(15, 39, 71, 0.08);
    --shadow-pop: 0 12px 34px rgba(15, 39, 71, 0.18);
    --shadow-card: var(--shadow-sm);

    --font-display: "Archivo", system-ui, sans-serif;
    --font-body: "IBM Plex Sans", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* Keskin köşe güvencesi — endüstriyel pafta hissi */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }

html, body { margin: 0; padding: 0; }

body {
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

.kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* ==========================================================================
   ÜST NAVİGASYON (appbar) + içerik
   ========================================================================== */

.appmain { min-height: calc(100vh - var(--topbar-h)); }

.appbar {
    position: sticky; top: 0; z-index: 40;
    background: var(--steel-900);
    border-bottom: 2px solid #000;
    /* İnce blueprint ızgara dokusu */
    background-image:
        repeating-linear-gradient(90deg, transparent 0 63px, rgba(255,255,255,0.022) 63px 64px);
}
.appbar-inner {
    max-width: 1320px; margin: 0 auto;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 8px;
    padding: 0 24px;
}

/* Marka */
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { display: block; height: 30px; width: auto; }

/* Yatay menü */
.topnav { display: flex; align-items: stretch; height: var(--topbar-h); margin-inline-start: 26px; }
.topnav a {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 0 17px; color: var(--steel-300);
    font-weight: 500; font-size: 14px;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: background .12s, color .12s, border-color .12s;
}
.topnav a .ico { width: 18px; height: 18px; color: var(--steel-400); }
.topnav a .ico svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.topnav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.topnav a:hover .ico { color: var(--steel-300); }
.topnav a.active { color: #fff; border-bottom-color: var(--forge); }
.topnav a.active .ico { color: var(--forge-bright); }

/* Mobil menü düğmesi */
.nav-toggle {
    display: none; background: none; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.15); color: #cfd8de;
    width: 38px; height: 38px; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* Sağ blok */
.appbar-right { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }

/* Kullanıcı çipi (koyu appbar üzerinde) */
.user-menu { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    background: none; border: 1px solid transparent; cursor: pointer;
    padding: 5px 8px; color: #fff;
}
.user-chip:hover { border-color: rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); }
.user-chip .avatar {
    width: 32px; height: 32px; display: grid; place-items: center;
    background: var(--forge); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.user-chip .meta { display: flex; flex-direction: column; line-height: 1.15; text-align: start; }
.user-chip .meta strong { font-size: 13px; font-weight: 600; color: #fff; }
.user-chip .meta small { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--steel-400); }
.user-chip .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--steel-300); }

.user-dropdown {
    position: absolute; inset-inline-end: 0; top: calc(100% + 10px);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
    min-width: 224px; padding: 6px; display: none; z-index: 50;
}
.user-dropdown.open { display: block; }
.user-dropdown .dd-head { padding: 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.user-dropdown .dd-head strong { display: block; font-size: 14px; }
.user-dropdown .dd-head small { color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; }
.user-dropdown button, .user-dropdown a {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; background: none; border: none; cursor: pointer;
    font: inherit; font-size: 13.5px; color: var(--ink); text-align: start;
}
.user-dropdown button:hover, .user-dropdown a:hover { background: var(--surface-alt); }
.user-dropdown .danger { color: var(--neg); }
.user-dropdown svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* Dil düğmesi — koyu appbar üzerinde */
.appbar .lang-btn { color: #cfd8de; border-color: rgba(255,255,255,0.15); background: transparent; }
.appbar .lang-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.28); }
.appbar .lang-btn .caret { border-top-color: var(--steel-300); }

/* İçerik alanı — full-width */
.view { width: 100%; padding: 28px 32px; }

/* Merkez shell (sidebar + topbar + container) artık merkez-shell.css'te.
   Eski .shell/.sidebar/.main düzeni kaldırıldı — sınıf adı çakışması collapse'i bozuyordu. */

/* ==========================================================================
   BAŞLIK / SAYFA ÜST
   ========================================================================== */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.page-head .titles { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.page-head .titles .kicker { display: none; }
.page-head .titles h1 { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; margin: 0; }
.page-head .titles p { margin: 0; color: var(--ink-faint); font-size: 13px; }
.page-head .actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ==========================================================================
   BUTONLAR
   ========================================================================== */

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
    padding: 10px 18px; border: 1px solid transparent; cursor: pointer;
    background: var(--steel-800); color: #fff; line-height: 1;
    transition: background .12s, transform .06s, box-shadow .12s;
}
.btn:hover { background: var(--steel-700); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.btn-primary { background: var(--forge); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.btn-primary:hover { background: var(--forge-dark); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-alt); border-color: var(--steel-300); }

.btn-danger { background: var(--neg); color: #fff; }
.btn-danger:hover { background: #a5281c; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

/* ==========================================================================
   KARTLAR / IZGARA
   ========================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.01em; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-2-1 { grid-template-columns: 1.3fr 1fr; }

/* İstatistik kartı — teknik ölçüm hissi */
.stat {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 20px;
    overflow: hidden;
}
.stat::before {
    content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 34px; background: var(--forge);
}
.stat .stat-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.stat .stat-value { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; margin-top: 10px; color: var(--ink); }
.stat .stat-value small { font-size: 15px; font-weight: 600; color: var(--ink-faint); font-family: var(--font-mono); }
.stat .stat-foot { margin-top: 8px; font-size: 12px; color: var(--ink-faint); }
.stat .corner { position: absolute; right: 16px; top: 16px; color: var(--line); }
.stat .corner svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; }

/* ==========================================================================
   TABLOLAR
   ========================================================================== */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead th {
    text-align: left; padding: 12px 18px;
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-faint); background: var(--surface-alt); border-bottom: 1px solid var(--line);
}
table.data tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--surface-alt); }
table.data .num { font-family: var(--font-mono); text-align: right; }
table.data .row-actions { text-align: right; white-space: nowrap; }
table.data .primary-cell { font-weight: 600; }
.empty-row td { text-align: center; padding: 40px !important; color: var(--ink-faint); }

/* Rozetler */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 4px 9px; border: 1px solid transparent;
}
.badge.ok { color: var(--pos); background: var(--pos-soft); border-color: rgba(31,138,84,0.25); }
.badge.off { color: var(--neg); background: var(--neg-soft); border-color: rgba(192,57,43,0.25); }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; }

/* ==========================================================================
   FORMLAR
   ========================================================================== */

.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-soft); margin-bottom: 7px; text-transform: uppercase; font-family: var(--font-mono); }
.field .hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-faint); font-family: var(--font-body); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
    width: 100%; padding: 11px 13px;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); font-family: var(--font-body); font-size: 14.5px;
    outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--forge); box-shadow: 0 0 0 3px var(--forge-glow); }
input::placeholder { color: var(--ink-faint); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.check-line { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check-line input { width: 18px; height: 18px; accent-color: var(--forge); cursor: pointer; }

.form-actions { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

/* ==========================================================================
   UYARILAR
   ========================================================================== */

.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 13.5px; border-left: 3px solid; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; }
.alert.success { background: var(--pos-soft); border-color: var(--pos); color: #14663d; }
.alert.error { background: var(--neg-soft); border-color: var(--neg); color: #8f2a20; }

/* ==========================================================================
   GİRİŞ EKRANI — bölünmüş blueprint
   ========================================================================== */

.auth { display: grid; grid-template-columns: 1.15fr 0.85fr; min-height: 100vh; }

.auth-brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 52px 56px; color: #fff;
    background:
        linear-gradient(rgba(16,20,24,0.90), rgba(16,20,24,0.94)),
        repeating-linear-gradient(0deg, transparent 0 63px, rgba(255,255,255,0.045) 63px 64px),
        repeating-linear-gradient(90deg, transparent 0 63px, rgba(255,255,255,0.045) 63px 64px),
        linear-gradient(135deg, #1b212a 0%, #2b3542 50%, #101418 100%);
}
.auth-brand::after {
    content: ""; position: absolute; right: -160px; bottom: -160px;
    width: 520px; height: 520px; border: 1px solid rgba(26,134,180,0.4);
    transform: rotate(18deg);
}
.auth-brand .glow {
    position: absolute; left: -120px; top: -120px; width: 380px; height: 380px;
    background: radial-gradient(circle, var(--forge-glow), transparent 68%); pointer-events: none;
}

.auth-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.auth-logo .mark { width: 46px; height: 46px; display: grid; place-items: center; background: var(--forge); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); }
.auth-logo .mark svg { width: 27px; height: 27px; }
.auth-logo .txt strong { display: block; font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: 0.06em; }
.auth-logo .txt span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--steel-400); }

.auth-copy { position: relative; z-index: 1; max-width: 460px; }
.auth-copy .kicker { color: var(--forge-bright); }
.auth-copy h2 { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.1; letter-spacing: -0.015em; margin: 16px 0 16px; }
.auth-copy p { color: var(--steel-300); font-size: 15px; line-height: 1.65; margin: 0; }

.auth-specs { position: relative; z-index: 1; display: flex; gap: 40px; }
.auth-specs div strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 26px; color: #fff; }
.auth-specs div span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--steel-400); }

.auth-form-side { display: flex; flex-direction: column; justify-content: center; padding: 52px; background: var(--surface); }
.auth-form-inner { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-form-inner .kicker { color: var(--forge-dark); }
.auth-form-inner h1 { font-family: var(--font-display); font-weight: 800; font-size: 28px; margin: 12px 0 6px; }
.auth-form-inner > p.sub { color: var(--ink-faint); margin: 0 0 30px; font-size: 14px; }

.login-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--ink-faint); }
.login-footer code { font-family: var(--font-mono); background: var(--surface-alt); border: 1px solid var(--line-soft); padding: 6px 10px; color: var(--ink-soft); }

/* ==========================================================================
   HESAPLAMA — teknik spec sheet
   ========================================================================== */

.result-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 50px 20px; text-align: center; color: var(--ink-faint); }
.result-empty svg { width: 44px; height: 44px; fill: none; stroke: var(--line); stroke-width: 1.3; }

.result-hero { padding: 24px 22px; background: var(--steel-900); color: #fff; position: relative; overflow: hidden; }
.result-hero::before {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,0.03) 31px 32px);
}
.result-hero .rh-label { position: relative; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--steel-400); }
.result-hero .rh-value { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 42px; line-height: 1; margin-top: 8px; }
.result-hero .rh-value small { font-size: 18px; color: var(--forge-bright); font-family: var(--font-mono); font-weight: 600; }

.spec-list { width: 100%; border-collapse: collapse; }
.spec-list td { padding: 12px 22px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.spec-list tr:last-child td { border-bottom: none; }
.spec-list td:first-child { color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.spec-list td:last-child { text-align: right; font-family: var(--font-mono); font-weight: 500; }
.spec-list tr.total td { background: var(--surface-alt); font-weight: 700; }
.spec-list tr.total td:last-child { color: var(--forge-dark); font-size: 16px; }

/* Yatay bilgi şeridi (tam-genişlik kart gövdesi) */
.info-row { display: flex; flex-wrap: wrap; }
.info-row > div { flex: 1 1 200px; min-width: 0; padding: 14px 22px; border-inline-end: 1px solid var(--line-soft); }
.info-row > div + div { }
.info-row > div:last-child { border-inline-end: none; }
.info-row .k { display: block; margin-bottom: 5px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.info-row .v { display: block; font-size: 14px; color: var(--ink); word-break: break-word; }
.info-row .v.mono { font-family: var(--font-mono); }

/* Çok dilli sekmeli ad girişi */
.lang-tabs { border: 1px solid var(--line); background: var(--surface); }
.lang-tabs-head { display: flex; flex-wrap: wrap; background: var(--surface-alt); border-bottom: 1px solid var(--line); }
.lang-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border: none; background: none; cursor: pointer; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-faint); border-bottom: 2px solid transparent; transition: color 0.12s, border-color 0.12s, background 0.12s; }
.lang-tab:hover { color: var(--ink); }
.lang-tab.active { color: var(--forge); background: var(--surface); border-bottom-color: var(--forge); }
.lang-tab .req { color: var(--accent); font-weight: 700; }
.lang-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); }
.lang-panel { display: none; padding: 12px; }
.lang-panel.active { display: block; }
.lang-panel input { width: 100%; }

/* hidden özniteliği her zaman gizlesin (flex/grid kuralları ezmesin) */
[hidden] { display: none !important; }

/* Kod/JSON textarea */
.code-area {
    width: 100%; display: block; resize: vertical;
    font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55;
    padding: 12px 14px; tab-size: 2; -moz-tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto;
    color: var(--ink); background: var(--surface-alt); border: 1px solid var(--line);
}
.code-area:focus { outline: none; border-color: var(--forge); background: var(--surface); }

/* Sistem ayarları — ekleme formu + tip çipleri + tip rozetleri */
.form-stack { display: grid; gap: 16px; }
.frow { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.form-stack .frow { margin-bottom: 0; }   /* form-stack'te boşluğu gap yönetir */
.frow > .field { margin-bottom: 0; flex: 1 1 200px; }
.frow > .field.grow { flex: 1 1 460px; }   /* Hesap / Miktar — uzun ifadeler */
.frow > .field.sm { flex: 0 0 130px; }       /* Birim / Birim 2 */
.frow > .field.xs { flex: 0 0 90px; }        /* Sıra */

.type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; }
.chip-check input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 5px 12px; font-size: 12px; border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer; user-select: none; }
.chip-check span:hover { border-color: var(--steel-300); }
.chip-check input:checked + span { background: var(--forge); border-color: var(--forge); color: #fff; }
.chip-check input:focus-visible + span { outline: 2px solid var(--steel-300); outline-offset: 1px; }

.tip-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tip-badge { display: inline-block; padding: 2px 7px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--forge-dark); background: var(--forge-glow); border: 1px solid rgba(0, 86, 125, 0.2); }

/* Aramalı seçici (combo) */
.combo { position: relative; }
.combo-input { width: 100%; }
.combo-list {
    position: absolute; z-index: 40; inset-inline: 0; top: 100%; margin-top: 3px;
    max-height: 260px; overflow-y: auto; background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--shadow-pop);
}
.combo-opt {
    display: block; width: 100%; text-align: start; padding: 8px 12px;
    font-size: 13px; border: none; background: none; cursor: pointer; color: var(--ink);
}
.combo-opt:hover { background: var(--surface-alt); }
.combo-opt .c { font-family: var(--font-mono); color: var(--ink-soft); margin-inline-end: 8px; }
.combo-empty { padding: 10px 12px; font-size: 12px; color: var(--ink-faint); }

/* Görsel yükleyici (ürün) */
.img-uploader { display: flex; align-items: center; gap: 14px; }
.img-preview { width: 96px; height: 96px; flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface-alt); display: grid; place-items: center; overflow: hidden; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-preview .ph { font-size: 11px; color: var(--ink-faint); text-align: center; padding: 6px; line-height: 1.3; }
.img-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.crop-area { max-height: 58vh; background: var(--surface-alt); }
.crop-area img { display: block; max-width: 100%; }

/* Tablo görsel thumbnail */
.thumb { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface-alt); overflow: hidden; color: var(--ink-faint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { width: 18px; height: 18px; }
.thumb[data-preview] { cursor: zoom-in; }

/* Görsel önizleme popover (thumbnail üstüne gelince) */
.img-popover { position: fixed; z-index: 200; padding: 5px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-pop); pointer-events: none; }
.img-popover img { display: block; width: 280px; height: 280px; object-fit: contain; background: #fff; }

.note { font-size: 12px; color: var(--ink-faint); line-height: 1.5; padding: 14px 18px; background: var(--surface-alt); border-left: 3px solid var(--line); margin-top: 18px; }

/* ==========================================================================
   DATATABLES — tasarım sistemine uyarlanmış temiz stil
   (native DataTables 2.x, Bootstrap'sız)
   ========================================================================== */

.dt-container { width: 100%; }

/* Üst araç çubuğu: uzunluk seçimi + arama */
.dt-container .dt-layout-row:first-child {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.dt-container .dt-length label,
.dt-container .dt-search label {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-faint); display: inline-flex; align-items: center; gap: 8px;
}
.dt-container .dt-length select {
    width: auto; padding: 6px 26px 6px 10px; font-size: 13px; background-color: var(--surface);
}
.dt-container .dt-search input {
    width: 220px; padding: 8px 12px; font-size: 13.5px; margin-inline-start: 4px;
}
.dt-container .dt-search input::placeholder { color: var(--ink-faint); }

/* Gövde tablosu — kendi .data stiliyle aynı görünüm */
.dt-container table.data { border: none; }
.dt-container table.data thead th {
    cursor: default;
}
table.data thead th.dt-orderable-asc,
table.data thead th.dt-orderable-desc { cursor: pointer; }
table.data thead th.dt-orderable-asc:hover,
table.data thead th.dt-orderable-desc:hover { color: var(--forge); }

/* Sıralama ikonu — ince ve nötr */
table.data thead th .dt-column-order { inset-inline-end: 8px; }
table.data thead th .dt-column-order::before,
table.data thead th .dt-column-order::after { opacity: .4; font-size: .7em; }
table.data thead th.dt-ordering-asc .dt-column-order::before,
table.data thead th.dt-ordering-desc .dt-column-order::after { opacity: 1; color: var(--forge); }

/* Alt araç çubuğu (bilgi + sayfalama) artık datatables.css'te —
   Bootstrap5 renderer .row/.pagination/.page-link markup'ı kullanıyor. */

/* Boş durum */
.dt-container table.data td.dt-empty { text-align: center; padding: 40px !important; color: var(--ink-faint); }

/* ==========================================================================
   DİL DEĞİŞTİRİCİ
   ========================================================================== */

.lang-menu { position: relative; }
.lang-btn {
    display: flex; align-items: center; gap: 7px;
    background: none; border: 1px solid var(--line); cursor: pointer;
    padding: 7px 10px; color: var(--ink-soft); font: inherit; font-size: 13px;
}
.lang-btn:hover { background: var(--surface-alt); border-color: var(--steel-300); }
.lang-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.lang-btn .code { font-family: var(--font-mono); font-weight: 600; letter-spacing: .06em; }
.lang-btn .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--ink-faint); }

.lang-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
    min-width: 168px; padding: 6px; display: none; z-index: 40;
}
.lang-dropdown.open { display: block; }
.lang-dropdown a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    font-size: 13.5px; color: var(--ink);
}
.lang-dropdown a:hover { background: var(--surface-alt); }
.lang-dropdown a.active { color: var(--forge); font-weight: 600; }
.lang-dropdown a .code { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; width: 22px; color: var(--ink-faint); }
.lang-dropdown a.active .code { color: var(--forge); }

/* Giriş ekranı dil değiştirici (sağ üst köşe) */
.auth-lang { position: absolute; top: 22px; right: 26px; z-index: 5; }
[dir=rtl] .auth-lang { right: auto; left: 26px; }

/* ==========================================================================
   RTL (Arapça) DESTEĞİ
   ========================================================================== */

[dir=rtl] body,
body[dir=rtl] { direction: rtl; }
[dir=rtl] .sidebar { border-right: none; border-left: 1px solid #000; }
[dir=rtl] .nav a { border-left: none; border-right: 2px solid transparent; }
[dir=rtl] .nav a.active { border-right-color: var(--forge); background: linear-gradient(270deg, var(--forge-glow), transparent 70%); }
[dir=rtl] .stat::before { left: auto; right: 0; }
[dir=rtl] .stat .corner { right: auto; left: 16px; }
[dir=rtl] .alert { border-left: none; border-right: 3px solid; }
[dir=rtl] .note { border-left: none; border-right: 3px solid var(--line); }
[dir=rtl] .result-hero .rh-label,
[dir=rtl] .spec-list td:last-child,
[dir=rtl] table.data .num,
[dir=rtl] table.data .row-actions { text-align: left; }
[dir=rtl] .spec-list td:first-child { text-align: right; }
[dir=rtl] .topbar-right { margin-left: 0; margin-right: auto; }
[dir=rtl] .user-dropdown, [dir=rtl] .lang-dropdown { right: auto; left: 0; }
[dir=rtl] .page-head .titles h1,
[dir=rtl] .auth-copy h2 { letter-spacing: 0; }

/* Yardımcılar */
.muted { color: var(--ink-faint); }
.mt-0 { margin-top: 0; }
.stack > * + * { margin-top: 18px; }

/* ==========================================================================
   DUYARLI
   ========================================================================== */

@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .grid-2-1, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    .topnav {
        position: absolute; top: var(--topbar-h); inset-inline: 0;
        flex-direction: column; height: auto;
        background: var(--steel-900); border-bottom: 2px solid #000;
        margin-inline-start: 0; display: none; z-index: 45;
        box-shadow: var(--shadow-pop);
    }
    .appbar.nav-open .topnav { display: flex; }
    .topnav a {
        height: auto; padding: 14px 24px; margin-bottom: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .topnav a.active { border-bottom-color: rgba(255,255,255,0.05); border-inline-start: 3px solid var(--forge); }
}

@media (max-width: 720px) {
    .grid-3 { grid-template-columns: 1fr; }
    .view { padding: 20px 16px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .user-chip .meta { display: none; }
    .field-row { grid-template-columns: 1fr; }
    .appbar-inner { padding: 0 16px; }
}

.ta-right { text-align: right; }
[dir=rtl] .ta-right { text-align: left; }

/* ==========================================================================
   MODAL (merkez)
   ========================================================================== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(11,31,40,0.55);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
    width: 100%; max-width: 560px; max-height: 90vh;
    display: flex; flex-direction: column; box-shadow: var(--shadow-pop);
}
/* Koyu başlık (merkez standart) */
.modal-card > .card-head {
    flex: 0 0 auto; min-height: 56px; padding: 12px 22px;
    background: var(--steel-800); border-bottom: 1px solid var(--steel-900);
}
.modal-card > .card-head h3 { color: #fff; font-size: 16px; }
.modal-card > .card-pad { flex: 1 1 auto; overflow-y: auto; }
.modal-card .card-head .x {
    background: none; border: none; cursor: pointer; color: rgba(255, 255, 255, 0.65);
    width: 32px; height: 32px; display: grid; place-items: center; font-size: 22px; line-height: 1;
    transition: color 0.12s ease;
}
.modal-card .card-head .x:hover { color: #fff; }

/* ==========================================================================
   TABLO SATIR ÖĞELERİ (artech stili)
   ========================================================================== */
.cell-lead { display: flex; align-items: flex-start; gap: 10px; }
.cell-lead .sq { width: 8px; height: 8px; margin-top: 5px; background: var(--steel-600); flex-shrink: 0; }
.cell-lead .nm strong { display: block; font-weight: 600; color: var(--ink); line-height: 1.3; }
.cell-lead .nm small { color: var(--ink-faint); font-size: 12px; }

/* İkonlu tablo aksiyon butonları */
.btn.btn-ghost.btn-sm svg { width: 14px; height: 14px; }
.row-actions .btn { margin-inline-start: 4px; }

/* Tip rozeti — renkli kare nokta (artech) */
.tag-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; padding: 4px 10px; letter-spacing: .01em; }
.tag-dot::before { content: ""; width: 7px; height: 7px; flex-shrink: 0; }
.tag-dot.supplier { color: var(--accent-dark); background: rgba(224,123,46,.10); }
.tag-dot.supplier::before { background: var(--accent); }
.tag-dot.customer { color: var(--steel-600); background: rgba(29,69,117,.09); }
.tag-dot.customer::before { background: var(--steel-600); }
