/* ================================================================
   OfisTeknik Bayi Portalı — Tema
   ================================================================ */
:root {
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --accent: #0ea5e9;
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f1f5f9;
    --card: #ffffff;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .1);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .1), 0 8px 10px -6px rgba(15, 23, 42, .08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }

.page { padding: 32px 0 64px; }

/* ---------- Topbar ---------- */
.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.topbar .container { max-width: 1360px; }
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 68px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--ink);
    letter-spacing: -.02em;
}
.brand .logo-mark {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 1.05rem;
    box-shadow: var(--shadow);
}
.brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-tag { font-size: .68rem; font-weight: 700; color: var(--primary); background: var(--primary-50); border: 1px solid var(--primary-100); padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; }
.auth-logo { width: 210px; max-width: 74%; height: auto; display: block; margin: 0 auto 20px; }

.nav { display: flex; gap: 2px; margin-left: 4px; }
.nav a {
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav a:hover { background: var(--primary-50); color: var(--primary); }
.nav a.active { background: var(--primary); color: #fff; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Orta genişlikte üst menü sıkışırsa: kılavuz yazısı ikona insin, bayi chip küçülsün */
@media (max-width: 1250px) {
    .btn-guide span { display: none; }
    .btn-guide { padding: 8px 11px; }
    .dealer-chip .who span { display: none; }
    .brand-tag { display: none; }
    .nav a { padding: 8px 9px; font-size: .88rem; }
}

/* Bayi mini kartı (topbar) */
.dealer-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 6px 6px 12px;
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: 999px;
}
.dealer-chip .who { text-align: right; line-height: 1.15; }
.dealer-chip .who b { font-size: .85rem; color: var(--ink); }
.dealer-chip .who span { display: block; font-size: .7rem; color: var(--muted); }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #fff; font-weight: 700; font-size: .9rem;
    overflow: hidden; flex: none;
    border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.btn-logout {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 600; font-size: .85rem;
    border: 1px solid var(--line); background: #fff;
    transition: all .15s;
}
.btn-logout:hover { color: var(--danger); border-color: #fecaca; background: #fef2f2; }

.btn-guide {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 13px; border-radius: var(--radius-sm);
    color: var(--primary); font-weight: 600; font-size: .85rem;
    border: 1px solid var(--primary-100); background: var(--primary-50);
    transition: all .15s; white-space: nowrap;
}
.btn-guide:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Hero / Dealer card ---------- */
.dealer-card {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    border-radius: var(--radius);
    padding: 20px 26px;
    display: flex; align-items: center; gap: 20px;
    box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden;
}
.dealer-card::after {
    content: ''; position: absolute; right: -60px; top: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.dealer-card .avatar-lg {
    width: 66px; height: 66px; border-radius: 16px;
    background: #fff; color: var(--primary-dark);
    display: grid; place-items: center;
    font-weight: 800; font-size: 1.8rem; flex: none;
    overflow: hidden; box-shadow: var(--shadow);
}
.dealer-card .avatar-lg img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: #fff; }
.dealer-card h1 { font-size: 1.6rem; letter-spacing: -.02em; margin-bottom: 2px; }
.dealer-card .sub { opacity: .85; font-size: .95rem; }
.dealer-card .meta { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.dealer-card .meta span { font-size: .85rem; opacity: .9; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Section ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 12px; }
.section-head h2 { font-size: 1.25rem; letter-spacing: -.02em; color: var(--ink); }
.section-head a { font-size: .88rem; font-weight: 600; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Card ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-100); }

/* Stat card */
.stat { display: flex; align-items: center; gap: 14px; }
.stat .ico {
    width: 46px; height: 46px; border-radius: 12px; flex: none;
    display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 1.3rem;
}
.stat .num { font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--ink); }
.stat .lbl { font-size: .82rem; color: var(--muted); }

/* ---------- File / download item ---------- */
.file-item { display: flex; align-items: center; gap: 14px; }
.file-item .ext {
    width: 48px; height: 48px; border-radius: 12px; flex: none;
    display: grid; place-items: center; font-weight: 800; font-size: .72rem; color: #fff;
    text-transform: uppercase;
}
.ext.driver { background: #7c3aed; }
.ext.yazilim { background: #2563eb; }
.ext.dokuman { background: #0891b2; }
.ext.firmware { background: #ea580c; }
.file-item .info { min-width: 0; flex: 1; }
.file-item .info h3 { font-size: .98rem; color: var(--ink); margin-bottom: 2px; }
.file-item .info .metae { font-size: .78rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: .7rem; font-weight: 700; background: var(--primary-50); color: var(--primary);
}
.badge.gray { background: #f1f5f9; color: var(--muted); }
.badge.on { background: #dcfce7; color: #16a34a; }
.badge.off { background: #fee2e2; color: #dc2626; }
.badge.primary { background: var(--primary-50); color: var(--primary); }

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .88rem; cursor: pointer;
    background: var(--primary); color: #fff; border: none;
    transition: background .15s, transform .1s;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary-100); }
.btn.ghost:hover { background: var(--primary-50); }
.btn.sm { padding: 7px 12px; font-size: .82rem; }
.btn.block { width: 100%; justify-content: center; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
    padding: 7px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600;
    background: #fff; color: var(--ink-soft); border: 1px solid var(--line); cursor: pointer;
    transition: all .15s;
}
.chip:hover { border-color: var(--primary-light); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Çoklu dosya listesi (indirme) ---------- */
.file-entry { display: block; }
.file-entry .file-item { margin-bottom: 0; }
.asset-downloads { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.adl-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s, background .15s; }
.adl-row:hover { border-color: var(--primary-100); background: var(--primary-50); }
.adl-ext { flex: none; min-width: 46px; text-align: center; font-size: .64rem; font-weight: 800; letter-spacing: .03em; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 5px 7px; border-radius: 7px; text-transform: uppercase; }
.adl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 500; color: var(--ink); }
.adl-size { flex: none; color: var(--muted); font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.adl-btn { flex: none; }
.adl-btn span { font-size: .95em; }
@media (max-width: 560px) {
    .adl-size { display: none; }
    .adl-ext { min-width: 40px; }
}

/* ---------- Model filtresi (dropdown) ---------- */
.model-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow-sm); }
.model-filter label { font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.model-filter select { padding: 9px 32px 9px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: .9rem; background: #fff; min-width: 260px; cursor: pointer; color: var(--ink); appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }
.model-filter select:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-100); }

/* ---------- Announcement ---------- */
.announce { display: flex; flex-direction: column; gap: 6px; }
.announce .top { display: flex; align-items: center; gap: 8px; }
.announce time { font-size: .78rem; color: var(--muted); }
.announce h3 { font-size: 1.02rem; color: var(--ink); }
.announce p { font-size: .9rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin { font-size: .68rem; font-weight: 700; color: var(--warning); background: #fffbeb; padding: 2px 8px; border-radius: 999px; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: radial-gradient(circle at 20% 20%, #1e3a8a 0%, #0f172a 60%); }
.auth-card {
    width: 100%; max-width: 410px; background: #fff; border-radius: 18px;
    padding: 38px 34px; box-shadow: var(--shadow-lg);
}
.auth-card .logo-mark { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 1.4rem; box-shadow: var(--shadow); }
.auth-card h1 { text-align: center; font-size: 1.35rem; letter-spacing: -.02em; }
.auth-card .lead { text-align: center; color: var(--muted); font-size: .9rem; margin: 4px 0 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
    width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: .95rem; font-family: inherit; transition: border-color .15s, box-shadow .15s; background: #fff;
}
.field input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-100); }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 18px; }
.alert.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert.info  { background: var(--primary-50); color: var(--primary-dark); border: 1px solid var(--primary-100); }
.alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.demo-hint { margin-top: 20px; text-align: center; font-size: .78rem; color: var(--muted); }
.demo-hint code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; color: var(--ink-soft); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ico { font-size: 2.4rem; margin-bottom: 8px; opacity: .5; }

/* ---------- Teknik Destek ---------- */
.ticket-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.tk-top { display:flex; align-items:center; gap:10px; margin-bottom:5px; }
.tk-top h3 { font-size:1rem; color:var(--ink); }
.tk-meta { display:flex; flex-wrap:wrap; gap:12px; font-size:.8rem; color:var(--muted); }

/* Panodaki kompakt liste */
.dash-list { gap:8px; }
.dash-list .card { padding:13px 15px; }
.dash-list .file-item .ext { width:40px; height:40px; font-size:.64rem; border-radius:10px; }
.dash-list .file-item .info h3 { font-size:.92rem; }
.dash-list .file-item .metae { font-size:.74rem; gap:8px; }
.dash-list .announce h3 { font-size:.95rem; }
.dash-list .announce p { font-size:.82rem; }
.dash-list .announce time { font-size:.72rem; }
.ticket-row.mini { padding:12px 15px; }
.ticket-row.mini .tk-top { gap:8px; margin-bottom:3px; }
.ticket-row.mini .tk-top h3 { font-size:.9rem; }
.ticket-row.mini .tk-meta { gap:10px; font-size:.74rem; }
.ticket-row.mini .badge { font-size:.66rem; padding:2px 7px; }
.ticket-row.mini .btn.sm { padding:5px 10px; font-size:.78rem; }
.badge.answered { background:#fef3c7; color:#b45309; }

.auto-info { display:flex; gap:12px; flex-wrap:wrap; }
.auto-info > div { flex:1; min-width:180px; background:var(--primary-50); border:1px solid var(--primary-100); border-radius:10px; padding:10px 14px; }
.auto-info .lbl { display:block; font-size:.72rem; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:2px; }
.auto-info b { font-size:.95rem; color:var(--ink); }

.ff { margin-bottom:16px; }
.ff label { display:block; font-size:.84rem; font-weight:600; color:var(--ink-soft); margin-bottom:6px; }
.ff input, .ff select, .ff textarea { width:100%; padding:10px 13px; border:1px solid var(--line); border-radius:var(--radius-sm); font-size:.93rem; font-family:inherit; background:#fff; }
.ff input:focus, .ff select:focus, .ff textarea:focus { outline:none; border-color:var(--primary-light); box-shadow:0 0 0 3px var(--primary-100); }
.ff textarea { resize:vertical; }
.ff-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }

/* Talep başlığı */
.ticket-head { margin-bottom:18px; }
.th-top { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.th-top h2 { font-size:1.2rem; flex:1; }
.th-id { color:var(--muted); font-weight:700; }
.th-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; border-top:1px solid var(--line); padding-top:14px; }
.th-grid .lbl { display:block; font-size:.72rem; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:2px; }
.th-grid > div { font-size:.9rem; color:var(--ink); }

/* Chat */
.chat { display:flex; flex-direction:column; gap:12px; padding:6px 2px; }
.msg { display:flex; }
.msg.mine { justify-content:flex-end; }
.msg.other { justify-content:flex-start; }
.msg-bubble { max-width:72%; padding:11px 14px; border-radius:14px; font-size:.92rem; line-height:1.5; box-shadow:var(--shadow-sm); }
.msg.mine .msg-bubble { background:var(--primary); color:#fff; border-bottom-right-radius:4px; }
.msg.other .msg-bubble { background:#fff; color:var(--ink); border:1px solid var(--line); border-bottom-left-radius:4px; }
.msg-who { font-size:.74rem; font-weight:700; color:var(--primary); margin-bottom:4px; }
.msg-text { white-space:pre-wrap; word-break:break-word; }
.msg-img { max-width:240px; max-height:220px; border-radius:9px; margin-top:8px; display:block; }
.msg-file { display:inline-block; margin-top:8px; padding:6px 11px; border-radius:8px; font-size:.85rem; font-weight:600; background:rgba(255,255,255,.18); }
.msg.other .msg-file { background:var(--primary-50); color:var(--primary); }
.msg-time { font-size:.68rem; opacity:.7; margin-top:6px; text-align:right; }
.msg.other .msg-time { color:var(--muted); }

/* Yanıt kutusu */
.chat-reply { margin-top:16px; }
.chat-reply textarea { width:100%; padding:10px 13px; border:1px solid var(--line); border-radius:var(--radius-sm); font-family:inherit; font-size:.93rem; resize:vertical; }
.chat-reply textarea:focus { outline:none; border-color:var(--primary-light); box-shadow:0 0 0 3px var(--primary-100); }
.cr-actions { display:flex; align-items:center; justify-content:space-between; margin-top:10px; }
.cr-file { font-size:.85rem; font-weight:600; color:var(--muted); cursor:pointer; white-space:nowrap; }
.cr-file input { display:none; }
.cr-file:hover { color:var(--primary); }
.cr-left { display:flex; align-items:center; gap:10px; min-width:0; }
.cr-fname { font-size:.82rem; font-weight:600; color:var(--primary); max-width:320px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attach-list { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 2px; }
.attach-list:empty { display:none; }
.attach-chip { display:inline-flex; align-items:center; gap:8px; max-width:280px; background:var(--primary-50); border:1px solid var(--primary-100); color:var(--primary-dark); padding:6px 10px; border-radius:8px; font-size:.82rem; font-weight:600; }
.attach-chip .ac-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attach-x { color:var(--danger); font-weight:800; text-decoration:none; cursor:pointer; flex:none; font-size:.9rem; }
.attach-x:hover { color:#b91c1c; }

@media (max-width:640px){ .ff-row { grid-template-columns:1fr; } .msg-bubble { max-width:88%; } }

/* ---------- Dosya Detay Sayfası ---------- */
.detail-wrap { max-width: 860px; }
.detail-head { padding: 14px 16px; }
.detail-tbl { width: 100%; border-collapse: collapse; }
.detail-tbl th, .detail-tbl td { padding: 7px 12px; border: 1px solid var(--line); font-size: .85rem; text-align: left; vertical-align: middle; }
.detail-tbl th { background: var(--primary-50); color: var(--primary-dark); font-weight: 700; width: 108px; white-space: nowrap; }
.detail-files { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.df-title { font-size: .95rem; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.detail-content p { font-size: 1rem; color: var(--ink-soft); line-height: 1.8; margin-bottom: 14px; }
.detail-content figure { margin: 0 0 18px; }
.detail-content figure img { width: 100%; border-radius: 12px; display: block; box-shadow: var(--shadow); }
.detail-content figcaption { font-size: .85rem; color: var(--muted); font-style: italic; text-align: center; margin-top: 8px; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 28px 0; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); background: #fff; }

/* ---------- Animasyon (Motion ile birlikte) ---------- */
[data-anim] { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .nav { display: none; }
}
@media (max-width: 640px) {
    .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
    .dealer-card { flex-direction: column; text-align: center; padding: 24px; }
    .dealer-card .meta { justify-content: center; }
    .dealer-chip .who { display: none; }
    .topbar-inner { gap: 12px; }
    .brand small { display: none; }
    .brand-tag { display: none; }
    .brand-logo { height: 28px; }
    .btn-guide span { display: none; }
    .btn-guide { padding: 8px 11px; }
}
