/* Laboratuvar iş takip — genel stiller (mobil öncelikli) */
:root {
    --bg: #f3f5f7;
    --card: #ffffff;
    --ink: #1a2530;
    --muted: #5f6d7a;
    --line: #dfe4e9;
    --accent: #0f766e;
    --accent-dark: #0b5a54;
    --accent-soft: #e3f4f2;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --warn: #b54708;
    --warn-soft: #fff4e5;
    --ok: #067647;
    --ok-soft: #e6f6ee;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --topbar-h: 56px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0; }
h2 { font-size: 1.1rem; margin: 0; }
h3 { font-size: 1rem; margin: 0; }
code { background: #eef1f4; padding: 1px 5px; border-radius: 4px; font-size: .9em; word-break: break-all; }
.muted { color: var(--muted); }
.danger { color: var(--danger); }
.warn { color: var(--warn); }
.center-card { max-width: 520px; margin: 40px auto; text-align: center; }
small { color: var(--muted); }
ul.plain { margin: 6px 0 0; padding-left: 18px; }

/* Üst çubuk */
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 10px;
    padding: 0 12px;
    background: var(--accent);
    color: #fff;
}
.topbar a { color: #fff; }
.brand { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.brand:hover { text-decoration: none; }
.menu-btn {
    appearance: none; border: 0; background: rgba(255,255,255,.14); color: #fff;
    width: 40px; height: 40px; border-radius: 8px; font-size: 1.3rem; cursor: pointer;
}
.quick { margin-left: auto; display: flex; gap: 6px; flex: 1; max-width: 420px; }
.quick input {
    flex: 1; min-width: 0;
    border: 0; border-radius: 8px; padding: 9px 12px; font-size: 16px;
    background: rgba(255,255,255,.95); color: var(--ink);
}
.scan-btn {
    appearance: none; border: 0; background: rgba(255,255,255,.2); color: #fff;
    width: 40px; border-radius: 8px; font-size: 1.2rem; cursor: pointer;
}

/* Gövde yerleşimi */
.shell { display: block; }
.sidebar {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 40;
    width: 270px; max-width: 84vw;
    background: #fff; border-right: 1px solid var(--line);
    padding: 12px 10px 20px; overflow-y: auto;
    transform: translateX(-102%); transition: transform .2s ease;
}
body.nav-open .sidebar { transform: none; box-shadow: 4px 0 24px rgba(0,0,0,.18); }
.nav-backdrop { display: none; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 35; }
body.nav-open .nav-backdrop { display: block; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: 8px; color: var(--ink); font-weight: 500;
}
.sidebar li a:hover { background: #f1f4f6; text-decoration: none; }
.sidebar li a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.sidebar .ico { width: 22px; text-align: center; opacity: .85; }
.nav-title { margin: 16px 12px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav-user { margin-top: 18px; padding: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.nav-user > a { color: var(--ink); display: flex; flex-direction: column; }
.nav-user > a small { color: var(--muted); }
.ver { color: var(--muted); }

.main { padding: 14px 12px 60px; max-width: 1100px; margin: 0 auto; }

@media (min-width: 900px) {
    .menu-btn, .nav-backdrop { display: none !important; }
    .sidebar { transform: none; box-shadow: none; max-width: none; }
    .shell { padding-left: 270px; }
    .main { padding: 22px 28px 60px; }
    .brand { max-width: none; }
}

/* Sayfa başlığı */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-head { margin: 22px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.code-pill { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #eef1f4; border-radius: 6px; padding: 2px 8px; margin-right: 6px; font-size: .92rem; }
.count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: #e8ecef; color: var(--muted); font-size: .8rem; text-align: center; font-weight: 600; vertical-align: middle; }

/* Kartlar */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.big-ver { font-size: 1.6rem; font-weight: 700; margin: 0 0 6px; }

/* Düğmeler */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    appearance: none; cursor: pointer;
    padding: 9px 16px; min-height: 40px;
    font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
    color: var(--ink); background: #fff;
    border: 1px solid #c7cfd6; border-radius: 8px;
    text-decoration: none; transition: background .12s;
}
.btn:hover { background: #f1f4f6; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #055a37; }
.btn-danger { background: #fff; border-color: #e2a29b; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eceff2; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* Formlar */
.form-stack { display: grid; gap: 14px; }
.narrow { max-width: 620px; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .92rem; }
label small { font-weight: 400; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=url],
input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=file],
select, textarea {
    width: 100%; font: inherit; font-weight: 400; color: var(--ink);
    padding: 10px 12px; min-height: 42px;
    background: #fff; border: 1px solid #c7cfd6; border-radius: 8px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input:disabled { background: #f1f4f6; color: var(--muted); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.check.big { font-size: 1.02rem; font-weight: 600; }
.pad-top { padding-top: 24px; }
.inline-field { display: flex; align-items: center; gap: 10px; }
.inline-field input { width: 90px; }
.grid-2, .grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { flex: 0 1 190px; width: auto; }

fieldset.perms { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; }
fieldset.perms legend { font-weight: 700; padding: 0 6px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.perm-group { margin: 10px 0; display: grid; gap: 8px; }
.perm-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Uyarı mesajları */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; font-weight: 500; }
.flash-ok { background: var(--ok-soft); border-color: #a9dfc3; color: #05603a; }
.flash-err { background: var(--danger-soft); border-color: #f0b7b1; color: #8e1c12; }
.flash-warn { background: var(--warn-soft); border-color: #f4cf9c; color: #8a3a06; }
.flash form { margin-top: 8px; }

/* Tablolar (mobilde kart olur) */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #f7f9fa; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table .row-off td { opacity: .6; }
.td-actions { white-space: nowrap; text-align: right !important; }
.card .table { box-shadow: none; }
@media (max-width: 719px) {
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards { background: transparent; border: 0; box-shadow: none; }
    .table-cards thead { display: none; }
    .table-cards tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 12px; box-shadow: var(--shadow); }
    .table-cards td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right !important; }
    .table-cards td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .82rem; text-align: left; flex: none; }
    .table-cards td.td-actions { justify-content: flex-end; padding-top: 8px; }
    .table-cards td.td-actions::before { content: none; }
    .card .table-cards tr { box-shadow: none; }
}

/* Durum rozetleri */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .78rem; font-weight: 700; background: #e8ecef; color: #3c4a57; white-space: nowrap; }
.b-kabul, .b-bekliyor { background: #e7eefb; color: #1f4fa3; }
.b-islemde, .b-basladi { background: var(--warn-soft); color: var(--warn); }
.b-tamamlandi, .b-bitti { background: var(--ok-soft); color: var(--ok); }
.b-teslim { background: #ece8fb; color: #4b36a8; }
.b-iptal { background: #eceff2; color: #6b7783; }

/* Ayrıntı listesi */
.details { display: grid; gap: 12px 24px; grid-template-columns: 1fr; margin: 0; }
.details dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.details dd { margin: 2px 0 0; word-break: break-word; }
@media (min-width: 640px) { .details { grid-template-columns: 1fr 1fr; } .details .wide { grid-column: 1 / -1; } }
.status-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.status-form select { min-width: 180px; }
.danger-zone { margin-top: 20px; }

/* Ana sayfa */
.scan-card { display: grid; gap: 8px; }
.scan-card label { font-size: 1rem; }
.scan-row { display: flex; gap: 8px; }
.scan-row input { flex: 1; font-size: 1.1rem; min-height: 48px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; color: var(--ink); box-shadow: var(--shadow); }
.stat:hover { text-decoration: none; background: #fafbfc; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat-warn b { color: var(--warn); }
.stat-danger b { color: var(--danger); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: #eef1f4; color: var(--ink); border-radius: 18px; padding: 5px 12px; font-size: .88rem; }
.chip:hover { text-decoration: none; background: #e2e7ec; }
.job-list { list-style: none; margin: 0; padding: 0; }
.job-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.job-list li:last-child { border: 0; }
.job-list a { display: grid; color: var(--ink); }
.job-list li > span { text-align: right; display: grid; justify-items: end; gap: 2px; }

/* İş kartları */
.job-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .job-grid { grid-template-columns: 1fr 1fr; } }
.job { background: #fff; border: 1px solid var(--line); border-left: 4px solid #9aa8b5; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
.job-bekliyor { border-left-color: #3b6fd1; }
.job-basladi { border-left-color: #e08a1e; }
.job-bitti { border-left-color: var(--ok); }
.job-iptal { opacity: .7; }
.job header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.job-sample { display: block; font-size: .88rem; margin-top: 2px; }
.job-meta { margin: 0; display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.job-note, .job-result { padding: 8px 10px; border-radius: 8px; font-size: .92rem; }
.job-note { background: var(--warn-soft); }
.job-result { background: var(--ok-soft); }
.job-instr { border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.job-instr summary { cursor: pointer; padding: 8px 10px; font-weight: 600; font-size: .92rem; }
.instr-text { padding: 2px 12px 12px; font-size: .96rem; }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.inline-details { flex: 1 1 100%; }
.inline-details > summary { list-style: none; display: inline-flex; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.inline-details[open] > summary { margin-bottom: 10px; }

/* Süreç ekleme satırları */
.add-jobs { display: grid; gap: 10px; }
.add-job-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 10px; }
.add-job-row.on { border-color: var(--accent); background: var(--accent-soft); }
.add-job-fields { display: none; gap: 8px; grid-template-columns: 1fr; }
.add-job-row.on .add-job-fields { display: grid; }
@media (min-width: 760px) { .add-job-fields { grid-template-columns: 1.1fr .8fr 2fr; } }

/* Zaman çizelgesi */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.timeline li { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.timeline li:last-child { border: 0; }
.timeline .when { color: var(--muted); font-size: .8rem; }
.timeline .who { font-weight: 600; }
@media (min-width: 760px) { .timeline li { grid-template-columns: 140px 150px 1fr; gap: 12px; } }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0; }

/* Giriş ekranı */
body.guest { background: linear-gradient(160deg, #0f766e 0%, #134e4a 100%); min-height: 100vh; }
.guest-box { max-width: 400px; margin: 0 auto; padding: 8vh 16px 30px; }
.guest-brand { color: #fff; font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 18px; }
.guest-box .card { padding: 22px; }
.guest-box h1 { margin-bottom: 4px; }

/* Kamera ile okutma */
.scanner { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; }
.scanner[hidden] { display: none; }
.scanner video { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.scanner-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: #fff; background: rgba(0,0,0,.85); }

.no-print { }

/* Müşteri yetkilileri */
fieldset.contacts{border:1px solid var(--border,#ddd);border-radius:8px;padding:.75rem;margin:0}
fieldset.contacts legend{font-weight:600;padding:0 .4rem}
.contact-box+.contact-box{margin-top:.75rem;padding-top:.75rem;border-top:1px dashed var(--border,#ddd)}
.contact-box h3{margin:0 0 .4rem;font-size:.95rem}

/* Bilgi (i) simgesi + açılır açıklama */
.info { position: relative; display: inline-block; vertical-align: middle; margin-left: 4px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.info-btn { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--muted); background: #fff; color: var(--muted); font: italic 700 .8rem/18px Georgia, serif; cursor: pointer; text-align: center; }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--muted); color: #fff; }
.info-pop { position: absolute; z-index: 50; left: 0; top: 26px; width: min(300px, 80vw); padding: 10px 12px; background: #1f2d3a; color: #fff; border-radius: 8px; font-weight: 400; font-size: .85rem; line-height: 1.45; font-style: normal; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.info-pop code { background: rgba(255,255,255,.18); color: #fff; padding: 0 4px; border-radius: 3px; }
@media (max-width: 600px) { .info-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; } }

.center { text-align: center; margin: 0; }
.inline-pair { display: flex; gap: 8px; }
.inline-pair input { max-width: 110px; }

/* Sürüm notları */
a.ver { color: var(--muted); text-decoration: none; font-size: .8rem; }
a.ver:hover { text-decoration: underline; }
.rn-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eee; }
.rn-row:last-child { border-bottom: none; }
.rn-version { flex: 0 0 84px; font-weight: 700; color: var(--brand, #0f766e); font-size: .9rem; }
.rn-version small { display: block; font-weight: 400; font-size: .75rem; }
.rn-text { flex: 1; line-height: 1.5; }
.rn-current .rn-text { font-weight: 500; }
.flash-info { background: #e8f3f1; border-color: #b9dcd6; }
