:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #0ea45f;
    --primary-dark: #087946;
    --danger: #dc2626;
    --warning: #f59e0b;
    --shadow: 0 10px 28px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.layout { min-height: 100vh; display: flex; }
.sidebar { width: 260px; background: #0f172a; color: #fff; padding: 20px; position: fixed; inset: 0 auto 0 0; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.brand-icon { width: 48px; height: 48px; background: var(--primary); border-radius: 12px; display: grid; place-items: center; font-weight: 800; }
.brand small { color: #cbd5e1; display: block; margin-top: 4px; font-size: 12px; }
.nav { display: grid; gap: 6px; }
.nav a { padding: 12px 14px; border-radius: 10px; color: #dbeafe; }
.nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.content { margin-left: 260px; width: calc(100% - 260px); padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h1 { font-size: 28px; margin: 0; }
h2 { font-size: 19px; margin: 18px 0 12px; }
h3 { margin: 0 0 8px; }
.userbox { display: flex; align-items: center; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.stat span { color: var(--muted); display: block; margin-bottom: 6px; }
.stat strong { font-size: 30px; }
.stat.warn strong { color: var(--warning); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.quick-actions, .toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { display: flex; gap: 8px; flex: 1; min-width: 280px; }
.search input { max-width: 420px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); padding: 10px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn:hover { border-color: #cbd5e1; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.secondary { background: #f8fafc; }
.btn.small { padding: 6px 9px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--danger); }
.full-btn { width: 100%; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--border); }
.alert.success { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }
.alert.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.muted { color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: left; vertical-align: top; }
th { color: #475569; font-size: 13px; background: #f8fafc; }
tr:hover td { background: #fcfcfd; }
.actions { white-space: nowrap; display: flex; gap: 6px; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 12px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; align-content: start; }
.field span { font-size: 13px; color: #475569; font-weight: 700; }
.field.full, .full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; color: var(--text); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(14, 164, 95, .18); border-color: var(--primary); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.logo-preview { max-width: 180px; max-height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.doc-form h2 { border-top: 1px solid var(--border); padding-top: 16px; }
.line-table input { min-width: 92px; }
.line-table td:nth-child(2) input { min-width: 260px; }
.totals { display: flex; gap: 12px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.totals div { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; min-width: 170px; }
.totals span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.mini-input { min-width: 80px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.photo-grid img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.signature-wrap { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 12px; background: #f8fafc; margin-bottom: 12px; }
#signature-pad { width: 100%; max-width: 520px; height: 180px; background: #fff; border: 1px solid var(--border); border-radius: 10px; touch-action: none; }
.signature-preview { max-width: 280px; max-height: 120px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #e0f2fe, #f7fee7); }
.login-card, .install-card { width: 100%; max-width: 430px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); padding: 26px; }
.install-card { max-width: 860px; }
.login-card h1, .install-card h1 { margin-bottom: 8px; }
.login-card p, .install-card p { color: var(--muted); margin-top: 0; }
.config-box { width: 100%; min-height: 180px; font-family: monospace; font-size: 12px; }
.print-body { background: #e5e7eb; }
.print-page { max-width: 960px; margin: 20px auto; background: #fff; padding: 34px; box-shadow: var(--shadow); }
.print-header { display: flex; gap: 18px; align-items: center; border-bottom: 2px solid #111827; padding-bottom: 14px; margin-bottom: 18px; }
.print-header img { width: 110px; max-height: 80px; object-fit: contain; }
.print-header h2 { margin: 0 0 6px; }
.print-header p { margin: 0; color: #374151; }
.print-title { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 18px; padding-bottom: 12px; }
.print-title h1 { font-size: 28px; }
.print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.print-grid section, .print-notes { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.print-table th, .print-table td { border: 1px solid #d1d5db; }
.print-totals { width: 320px; margin: 16px 0 16px auto; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.print-totals div { display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.print-totals div:last-child { border-bottom: 0; background: #f8fafc; }
.print-actions { text-align: center; margin-top: 20px; }
.print-actions button { padding: 12px 18px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.print-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.print-photos img { width: 100%; height: 180px; object-fit: cover; border: 1px solid var(--border); }
.signature-line { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
.signature-line > div { min-height: 100px; border-top: 1px solid #111827; padding-top: 8px; }
.signature-line img { max-width: 260px; max-height: 110px; }
@media (max-width: 960px) {
    .sidebar { position: static; width: 100%; }
    .layout { display: block; }
    .content { margin-left: 0; width: 100%; padding: 16px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .two-col, .form-grid, .print-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
}
@media print {
    body { background: #fff; }
    .print-page { margin: 0; max-width: none; box-shadow: none; padding: 0; }
    .print-actions { display: none; }
    .print-body { background: #fff; }
    a { text-decoration: none; }
}

/* v0.2 Mikro entegrasyon hazırlık stilleri */
.badge.ok { background: #dcfce7; color: #166534; }
.danger-badge { background: #fee2e2; color: #991b1b; }
.toolbar form { display: inline-flex; gap: 10px; margin: 0; }
textarea.config-box { white-space: pre; overflow: auto; }
.card h2 + .quick-actions { margin-top: 10px; }

/* v0.3 Stok içe aktarma */
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; color: #475569; }
.check input { width: auto; margin-top: 3px; }

/* v0.4 Stok fiyat/yetki ekranı */
.stock-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.wide-search { flex: 1 1 100%; align-items: center; flex-wrap: wrap; }
.wide-search input, .wide-search select { max-width: 240px; }
.warn-badge { background: #fef3c7; color: #92400e; }
.badge.warn-badge { background: #fef3c7; color: #92400e; }

/* v0.5 Sistem merkezi */
code { background: #f1f5f9; border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.card.stat code { word-break: break-all; }
