:root {
    /* Teal & Slate paleti */
    --color-primary: #0d9488;
    --color-primary-dark: #0f766e;
    --color-primary-light: #14b8a6;
    --color-primary-soft: #ccfbf1;

    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-sidebar: #1e293b;
    --color-sidebar-hover: #334155;
    --color-sidebar-active: #0d9488;

    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;

    --color-success: #16a34a;
    --color-error: #dc2626;
    --color-warning: #d97706;
    --color-info: #0284c7;

    --sidebar-width: 256px;
    --topbar-height: 60px;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }

html { font-size: 14px; position: relative; min-height: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { color: var(--color-primary); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    color: #cbd5e1;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform .25s ease;
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 1.25rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .3px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .brand-mark {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
    display: grid; place-items: center;
    color: #fff; font-weight: 800;
}

.sidebar-nav { padding: .75rem; overflow-y: auto; flex: 1; }
.sidebar-footer { padding: .85rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); text-align: center; }
.sidebar-footer a { color: #94a3b8; font-size: .78rem; text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }
.sidebar-footer strong { color: var(--color-primary-light); }
.auth-copyright { text-align: center; margin-top: 1.5rem; }
.auth-copyright a { color: var(--color-text-muted); font-size: .78rem; text-decoration: none; }
.auth-copyright a:hover { color: var(--color-primary-dark); }
.sidebar-nav .nav-section {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
    color: #64748b; padding: 1rem .75rem .4rem;
}

.sidebar-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    color: #cbd5e1;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .15s, color .15s;
}
.sidebar-link:hover { background: var(--color-sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--color-sidebar-active); color: #fff; }
.sidebar-link .icon { width: 20px; flex: none; font-size: 1.05rem; text-align: center; line-height: 1; }

.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-left { display: flex; align-items: center; gap: .75rem; }
.topbar-title { font-weight: 600; font-size: 1.05rem; }

.topbar-user { display: flex; align-items: center; gap: .75rem; }
.user-chip {
    display: flex; align-items: center; gap: .6rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: .35rem .65rem;
    border-radius: 999px;
    cursor: pointer;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
}
.user-chip .user-name { font-weight: 600; font-size: .85rem; line-height: 1.1; }
.user-chip .user-role { font-size: .72rem; color: var(--color-text-muted); }

.content { padding: 1.5rem; flex: 1; }

.menu-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    padding: .4rem; color: var(--color-text);
}

.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 1025;
}

/* ---------- Cards ---------- */
.card-x {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-x-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
}
.card-x-header h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.card-x-body { padding: 1.25rem; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-header .subtitle { color: var(--color-text-muted); margin: .15rem 0 0; font-size: .85rem; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat-card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 1rem;
}
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 12px; flex: none;
    display: grid; place-items: center; background: var(--color-primary-soft); color: var(--color-primary-dark);
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: var(--color-text-muted); font-size: .82rem; margin-top: .25rem; }

/* ---------- Buttons ---------- */
.btn-x {
    display: inline-flex; align-items: center; gap: .45rem;
    border: 1px solid transparent; border-radius: 8px;
    padding: .5rem .9rem; font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: background .15s, box-shadow .15s, opacity .15s;
    text-decoration: none; line-height: 1.2;
}
.btn-x:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary-x { background: var(--color-primary); color: #fff; }
.btn-primary-x:hover { background: var(--color-primary-dark); color: #fff; }
.btn-secondary-x { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary-x:hover { background: var(--color-bg); }
.btn-danger-x { background: var(--color-error); color: #fff; }
.btn-danger-x:hover { background: #b91c1c; color: #fff; }
.btn-ghost-x { background: transparent; color: var(--color-text-muted); }
.btn-ghost-x:hover { background: var(--color-bg); color: var(--color-text); }
.btn-sm-x { padding: .35rem .6rem; font-size: .8rem; }
.btn-block-x { width: 100%; justify-content: center; }

/* ---------- Forms (standart responsive grid) ---------- */
.form-grid { display: grid; gap: 1rem 1.25rem; grid-template-columns: 1fr; }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
/* Bir alanın satırın tamamını kaplaması için */
.form-grid .col-span-2 { grid-column: span 2; }
.form-grid .col-span-full { grid-column: 1 / -1; }

@media (max-width: 992px) {
    .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .form-grid .col-span-2 { grid-column: span 1; }
}

/* Form bölümü (gruplama) */
.form-section { padding: 1.25rem 0; border-top: 1px solid var(--color-border); }
.form-section:first-of-type { border-top: none; padding-top: .25rem; }
.form-section-title {
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--color-text-muted); margin: 0 0 .9rem;
}

/* Input + buton grubu (örn. barkod + kamera) */
.input-group-x { display: flex; gap: .5rem; }
.input-group-x .form-control-x { flex: 1; min-width: 0; }
.input-group-x .btn-icon {
    flex: none; width: 42px; border: 1px solid var(--color-border);
    border-radius: 8px; background: var(--color-surface); cursor: pointer;
    display: grid; place-items: center; font-size: 1.1rem; color: var(--color-primary-dark);
    transition: background .15s, border-color .15s;
}
.input-group-x .btn-icon:hover { background: var(--color-primary-soft); border-color: var(--color-primary); }

.form-group-x { display: flex; flex-direction: column; gap: .35rem; }
.form-label-x { font-weight: 600; font-size: .83rem; color: var(--color-text); }
.form-label-x .req { color: var(--color-error); }
.form-control-x {
    width: 100%; padding: .6rem .75rem;
    border: 1px solid var(--color-border); border-radius: 8px;
    font-size: .9rem; background: #fff; color: var(--color-text);
    transition: border-color .15s, box-shadow .15s;
}
.form-control-x:focus {
    outline: none; border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}
.form-control-x.input-error { border-color: var(--color-error); }

/* Büyük harf GÖSTERİMİ (değeri değiştirmez; sunucu kayıtta büyütür).
   text-transform Türkçe karakterlerin işaretlerini korur; lang="tr" ile i→İ doğru olur. */
.text-uc { text-transform: uppercase; }
.text-uc::placeholder { text-transform: none; }
.field-error { color: var(--color-error); font-size: .78rem; min-height: 1em; }

.form-check-x { display: flex; align-items: center; gap: .5rem; }
.form-check-x input { width: 18px; height: 18px; accent-color: var(--color-primary); }
.form-check-x label { font-size: .88rem; cursor: pointer; }

/* Switch (toggle) */
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .switch-slider {
    position: relative; width: 42px; height: 24px; flex: none;
    background: #cbd5e1; border-radius: 999px; transition: background .2s;
}
.switch .switch-slider::before {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; background: #fff; border-radius: 50%;
    transition: transform .2s; box-shadow: var(--shadow-sm);
}
.switch input[type=checkbox]:checked ~ .switch-slider { background: var(--color-primary); }
.switch input[type=checkbox]:checked ~ .switch-slider::before { transform: translateX(18px); }
.switch input[type=checkbox]:focus-visible ~ .switch-slider { box-shadow: 0 0 0 3px rgba(13,148,136,.25); }
.switch .switch-label { font-size: .88rem; font-weight: 500; }

/* Segmented filtre */
.segmented { display: inline-flex; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 8px; padding: 2px; }
.segmented button {
    border: none; background: none; cursor: pointer; padding: .4rem .8rem;
    border-radius: 6px; font-size: .82rem; font-weight: 600; color: var(--color-text-muted);
}
.segmented button.active { background: var(--color-surface); color: var(--color-primary-dark); box-shadow: var(--shadow-sm); }

.form-actions { display: flex; gap: .6rem; margin-top: .5rem; }

/* Audit değişiklikleri */
.audit-changes { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; }
.audit-change { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.audit-field { font-weight: 600; color: var(--color-text-muted); }
.audit-old { color: var(--color-error); text-decoration: line-through; }
.audit-new { color: var(--color-success); font-weight: 600; }

/* Yetki/menü seçici */
.perm-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; gap: 1rem; flex-wrap: wrap; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.perm-group { border: 1px solid var(--color-border); border-radius: var(--radius); padding: .85rem 1rem; background: #f8fafc; }
.perm-group-head { padding-bottom: .5rem; margin-bottom: .5rem; border-bottom: 1px solid var(--color-border); }
.perm-item { padding: .2rem 0; }

/* ---------- Tables ---------- */
.table-x { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table-x thead th {
    text-align: left; padding: .7rem .9rem;
    color: var(--color-text-muted); font-weight: 600; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--color-border);
    background: #f8fafc;
}
.table-x tbody td { padding: .75rem .9rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table-x tbody tr:hover { background: #f8fafc; }
.table-responsive-x { overflow-x: auto; }

/* ---------- Badges ---------- */
.badge-x {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .6rem; border-radius: 999px;
    font-size: .74rem; font-weight: 600;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-neutral { background: #e2e8f0; color: #475569; }
.badge-primary { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.badge-warning { background: #ffedd5; color: #c2410c; }

.text-muted-x { color: var(--color-text-muted); }

/* ---------- İkon aksiyon butonları ---------- */
.btn-action {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid var(--color-border); background: var(--color-surface);
    color: var(--color-text-muted); cursor: pointer; font-size: 1rem;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-action:hover { background: var(--color-bg); color: var(--color-text); }
.btn-action.btn-action-primary:hover { color: var(--color-primary-dark); border-color: var(--color-primary); background: var(--color-primary-soft); }
.btn-action.btn-action-danger:hover { color: #fff; background: var(--color-error); border-color: var(--color-error); }

/* ---------- Tooltip (hover) ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
    background: #1e293b; color: #fff; padding: .3rem .55rem; border-radius: 6px;
    font-size: .72rem; font-weight: 500; white-space: nowrap; z-index: 60; pointer-events: none;
    box-shadow: var(--shadow);
}
[data-tooltip]:hover::before {
    content: ""; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: #1e293b; z-index: 60; pointer-events: none;
}

/* ---------- Stok progress bar ---------- */
.stock-cell { display: flex; align-items: center; gap: .6rem; min-width: 180px; }
.stock-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; min-width: 90px; }
.stock-bar .fill { height: 100%; border-radius: 999px; transition: width .3s; }
.stock-bar.s-red .fill { background: var(--color-error); }
.stock-bar.s-amber .fill { background: var(--color-warning); }
.stock-bar.s-green .fill { background: var(--color-success); }
.stock-bar.s-muted .fill { background: #cbd5e1; }
.stock-num { font-weight: 700; font-size: .85rem; white-space: nowrap; }
.stock-num small { font-weight: 400; color: var(--color-text-muted); }

/* Görsel galerisi (lightbox) */
.lightbox { position: fixed; inset: 0; background: rgba(15, 23, 42, .92); z-index: 3000; display: none; }
.lightbox.show { display: grid; place-items: center; }
.lb-stage { max-width: 92vw; max-height: 84vh; display: grid; place-items: center; }
.lb-stage img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 8px; cursor: pointer; box-shadow: 0 12px 48px rgba(0,0,0,.5); }
.lb-btn {
    position: fixed; display: grid; place-items: center; cursor: pointer;
    background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 999px;
    width: 46px; height: 46px; font-size: 1.2rem; transition: background .15s;
}
.lb-btn:hover { background: rgba(255,255,255,.28); color: #fff; }
.lb-close { top: 1.1rem; right: 1.1rem; }
.lb-open { top: 1.1rem; right: 4.4rem; text-decoration: none; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.lb-prev { left: 1.2rem; }
.lb-next { right: 1.2rem; }
.lb-counter {
    position: fixed; bottom: 1.3rem; left: 50%; transform: translateX(-50%);
    color: #e2e8f0; font-size: .9rem; font-weight: 600;
    background: rgba(15,23,42,.6); padding: .35rem .8rem; border-radius: 999px;
}
@media (max-width: 640px) {
    .lb-nav { width: 42px; height: 42px; }
    .lb-prev { left: .5rem; } .lb-next { right: .5rem; }
}

/* Tıklanabilir görsel rozeti */
.img-badge { background: none; border: none; cursor: pointer; color: var(--color-primary-dark); font-size: .8rem; padding: 0; margin-left: .35rem; }
.img-badge:hover { text-decoration: underline; }
.thumb-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.thumb-row img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--color-border); cursor: pointer; }

/* Görsel önizleme */
.img-preview-grid { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.img-preview {
    width: 96px; height: 96px; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--color-border); background: #f8fafc;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Dashboard aylık bölüm */
.month-nav { display: flex; align-items: center; gap: .6rem; }
.month-label { font-weight: 700; min-width: 120px; text-align: center; }
.dash-month-grid { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .dash-month-grid { grid-template-columns: 1fr; } }
.chart-box { height: 220px; display: grid; place-items: center; position: relative; }
.chart-legend { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; }
.dash-subtitle { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); margin: 0 0 1rem; }

.top-moved { display: flex; flex-direction: column; gap: .85rem; }
.top-moved-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; font-size: .88rem; }
.top-moved-name { font-weight: 600; }
.top-moved-count { color: var(--color-text-muted); font-size: .8rem; white-space: nowrap; }
.stock-bar.s-primary .fill { background: var(--color-primary); }

/* Rapor özet kartları */
.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.summary-card { background: var(--color-surface); border: 1px solid var(--color-border); border-left-width: 4px; border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); }
.summary-card.s-green { border-left-color: var(--color-success); }
.summary-card.s-red { border-left-color: var(--color-error); }
.summary-card.s-orange { border-left-color: var(--color-warning); }
.summary-title { font-size: .85rem; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.summary-card.s-green .summary-title { color: var(--color-success); }
.summary-card.s-red .summary-title { color: var(--color-error); }
.summary-card.s-orange .summary-title { color: #c2410c; }
.summary-qty { font-size: 1.7rem; font-weight: 800; margin: .25rem 0 .15rem; }
.summary-meta { font-size: .8rem; color: var(--color-text-muted); }

/* Yazdırma */
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .sidebar-backdrop, .no-print, .app-loader, .toast-container { display: none !important; }
    .main-area { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .card-x, .summary-card { box-shadow: none !important; border-color: #ccc !important; }
    .table-scroll { max-height: none !important; overflow: visible !important; }
    .print-only { display: block !important; }
    .print-header { margin-bottom: 1rem; }
    .print-header h2 { margin: 0 0 .25rem; }
    body { background: #fff !important; }
}

/* Sayfalama (pager) */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .85rem 1.25rem; border-top: 1px solid var(--color-border); flex-wrap: wrap;
}
.pager-controls { display: flex; gap: .4rem; }

/* Legend */
.legend { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--color-text-muted); }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .dot.s-red { background: var(--color-error); }
.legend .dot.s-amber { background: var(--color-warning); }
.legend .dot.s-green { background: var(--color-success); }

/* ---------- Kaydırmalı tablo (sticky başlık) ---------- */
.table-scroll { max-height: 560px; overflow-y: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; }

/* Kritik stok vurgusu */
.row-critical { background: #fef2f2 !important; }
.row-critical:hover { background: #fee2e2 !important; }
.row-critical .badge-danger { margin-left: .4rem; }
.stat-card-alert { border-color: #fca5a5; background: #fef2f2; }
.stat-icon-alert { background: #fee2e2 !important; color: var(--color-error) !important; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-text-muted); }

/* ---------- Auth (login) ---------- */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center;
    background: linear-gradient(135deg, #0f766e 0%, #1e293b 100%);
    padding: 1.5rem;
}
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--color-surface); border-radius: 16px;
    box-shadow: var(--shadow-lg); padding: 2.25rem;
}
.auth-head { text-align: center; margin-bottom: 1.75rem; }
.auth-head .brand-mark {
    width: 52px; height: 52px; border-radius: 14px; margin: 0 auto .9rem;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
    display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.3rem;
}
.auth-head h1 { font-size: 1.3rem; margin: 0 0 .25rem; }
.auth-head p { color: var(--color-text-muted); margin: 0; font-size: .85rem; }

/* ---------- Loader ---------- */
.app-loader {
    position: fixed; inset: 0;
    background: rgba(241,245,249,.65);
    backdrop-filter: blur(2px);
    display: none; place-items: center;
    z-index: 2000;
}
.app-loader.show { display: grid; }
.app-loader .spinner {
    width: 46px; height: 46px;
    border: 4px solid rgba(13,148,136,.25);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-x.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-x.is-loading::after {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.5); border-top-color: #fff;
    animation: spin .6s linear infinite;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed; top: 1rem; right: 1rem;
    display: flex; flex-direction: column; gap: .6rem;
    z-index: 2100; max-width: 360px;
}
.toast-x {
    display: flex; align-items: flex-start; gap: .65rem;
    background: var(--color-surface); border-radius: 10px;
    box-shadow: var(--shadow-lg); padding: .85rem 1rem;
    border-left: 4px solid var(--color-info);
    animation: toast-in .25s ease;
}
.toast-x.hide { animation: toast-out .2s ease forwards; }
.toast-x .toast-icon { flex: none; width: 20px; height: 20px; margin-top: 1px; font-weight: 700; }
.toast-x .toast-body { flex: 1; font-size: .86rem; line-height: 1.35; }
.toast-x .toast-close { background: none; border: none; cursor: pointer; color: var(--color-text-muted); font-size: 1.1rem; line-height: 1; }
.toast-success { border-left-color: var(--color-success); }
.toast-success .toast-icon { color: var(--color-success); }
.toast-error { border-left-color: var(--color-error); }
.toast-error .toast-icon { color: var(--color-error); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info { border-left-color: var(--color-info); }
.toast-info .toast-icon { color: var(--color-info); }

@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ---------- Dropdown ---------- */
.dropdown-x { position: relative; }
.dropdown-menu-x {
    position: absolute; right: 0; top: calc(100% + .4rem);
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 10px; box-shadow: var(--shadow); min-width: 180px;
    padding: .35rem; display: none; z-index: 1100;
}
.dropdown-menu-x.show { display: block; }
.dropdown-item-x {
    display: flex; align-items: center; gap: .55rem;
    width: 100%; text-align: left; background: none; border: none; cursor: pointer;
    padding: .55rem .65rem; border-radius: 7px; font-size: .85rem; color: var(--color-text);
    text-decoration: none;
}
.dropdown-item-x:hover { background: var(--color-bg); color: var(--color-text); }
.dropdown-divider-x { height: 1px; background: var(--color-border); margin: .35rem 0; }

/* ---------- Modal ---------- */
.modal-x {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    display: none; place-items: center; z-index: 2050; padding: 1rem;
}
.modal-x.show { display: grid; }
.modal-card {
    background: var(--color-surface); border-radius: 14px;
    box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; padding: 1.5rem;
}
.modal-card.modal-lg { max-width: 560px; }
.modal-card h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.modal-card p { color: var(--color-text-muted); margin: 0 0 1.25rem; font-size: .9rem; }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; }

/* Barkod tarayıcı */
.scanner-box {
    width: 100%; border-radius: 12px; overflow: hidden;
    background: #0f172a; aspect-ratio: 4 / 3; margin-bottom: 1rem;
    display: grid; place-items: center;
}
.scanner-box video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scanner-status { font-size: .85rem; color: var(--color-text-muted); margin-bottom: 1rem; text-align: center; }

/* Disabled görünüm */
.form-control-x:disabled, .form-control-x[readonly] {
    background: #f8fafc; color: var(--color-text-muted); cursor: not-allowed;
}

/* ---------- Autocomplete ---------- */
.ac-wrap { position: relative; }
/* Autocomplete bir input-group içindeyse kalan alanı kaplasın (kamera butonu yanında) */
.input-group-x .ac-wrap { flex: 1; min-width: 0; }
.ac-list {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 10px; box-shadow: var(--shadow); z-index: 1200;
    max-height: 280px; overflow-y: auto; padding: .3rem; display: none;
}
.ac-list.show { display: block; }
.ac-item {
    padding: .55rem .65rem; border-radius: 7px; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    font-size: .88rem;
}
.ac-item:hover, .ac-item.active { background: var(--color-primary-soft); }
.ac-item .ac-sub { font-size: .76rem; color: var(--color-text-muted); }

.hint-new {
    font-size: .8rem; color: var(--color-primary-dark);
    background: var(--color-primary-soft); border-radius: 8px;
    padding: .4rem .6rem; margin-top: .35rem; display: none;
}
.hint-new.show { display: block; }

.computed-box {
    background: linear-gradient(135deg, var(--color-primary-soft), #fff);
    border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 1rem 1.25rem; display: flex; align-items: baseline; gap: .5rem;
}
.computed-box .computed-value { font-size: 1.8rem; font-weight: 800; color: var(--color-primary-dark); }
.computed-box .computed-unit { font-size: 1rem; color: var(--color-text-muted); font-weight: 600; }
.computed-box .computed-formula { margin-left: auto; font-size: .82rem; color: var(--color-text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .sidebar-backdrop.show { display: block; }
    .user-chip .user-meta { display: none; }
}
