/* DerinTech Arıza Takip */
:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --text: #15202b;
  --muted: #667085;
  --border: #e3e7ed;
  --border-strong: #cfd6df;
  --navy: #0b2e4f;
  --navy-2: #123d66;
  --primary: #0f4c81;
  --primary-hover: #0c3f6c;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --red: #c0352b;
  --red-bg: #fdecea;
  --green: #18794e;
  --green-bg: #e7f6ee;
  --amber: #a15c07;
  --amber-bg: #fdf3e1;
  --blue: #1d5fbf;
  --blue-bg: #e8f0fc;
  --violet: #6b3fc4;
  --violet-bg: #f0eafc;
  --teal: #0b7a71;
  --teal-bg: #e2f6f3;
  --slate: #475467;
  --slate-bg: #eef1f5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.h2 { font-size: 20px; font-weight: 650; margin-bottom: 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sub { color: var(--muted); font-size: 12.5px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: .94em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.text-red { color: var(--red) !important; }
.pre { white-space: pre-wrap; word-break: break-word; }
.inline { display: inline; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 8px rgba(0,0,0,.12); }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #0e7490); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.brand-mark.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 16px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: rgba(255,255,255,.75); padding: 7px 12px; border-radius: 7px; font-weight: 500; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255,255,255,.14); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.9); padding: 4px 8px 4px 4px; border-radius: 20px; }
.user-chip:hover, .user-chip.active { background: rgba(255,255,255,.1); text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--navy-2); border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }

/* ---------- Layout ---------- */
.container { max-width: 1400px; margin: 0 auto; padding: 24px 20px 40px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 30px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.narrow { max-width: 560px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 650; text-transform: none; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.count { background: var(--slate-bg); color: var(--slate); border-radius: 10px; font-size: 11.5px; padding: 1px 8px; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s, color .12s; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #062c29; }
.btn-accent:hover { background: #2dd4bf; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: #f7f8fa; }
.btn-ghost { background: transparent; color: var(--slate); }
.btn-ghost:hover { background: var(--slate-bg); color: var(--text); }
.btn-ghost-light { background: transparent; color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a12a22; }
.chip { border: 1px solid var(--border-strong); background: #fff; border-radius: 14px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--slate); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.copy-btn { border: 1px solid var(--border); background: #fff; border-radius: 5px; font-family: var(--font); font-size: 11px; padding: 0 6px; color: var(--muted); cursor: pointer; margin-left: 4px; vertical-align: 1px; }
.copy-btn:hover { color: var(--primary); border-color: var(--primary); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
label { font-size: 12.5px; font-weight: 600; color: #344054; }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; font: inherit; color: var(--text);
}
textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 76px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 76, 129, .15); }
input[type=file] { font: inherit; font-size: 13px; padding: 7px; border: 1px dashed var(--border-strong); border-radius: 8px; background: #fafbfc; width: 100%; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.form-section { border: 1px solid var(--border); padding: 4px 20px 20px; }
.form-section legend { font-weight: 650; font-size: 14px; padding: 0 6px; margin-left: -6px; color: var(--navy); background: var(--surface); }
.form-section legend::before { content: ""; display: inline-block; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); margin-right: 8px; vertical-align: -2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; margin-top: 8px; }
.quick-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(242,244,247,.92); backdrop-filter: blur(6px); padding: 12px 0; border-top: 1px solid var(--border); margin-top: 4px; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; font-size: 13.5px; }
.alert-success { background: var(--green-bg); border-color: #b5e2c9; color: #0f5132; }
.alert-error { background: var(--red-bg); border-color: #f5c2bd; color: #8a1f17; }
.alert-warning { background: var(--amber-bg); border-color: #f3d9a4; color: #7a4504; }
.alert-info { background: var(--blue-bg); border-color: #c3d6f5; color: #173f80; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; color: var(--text); border-top: 3px solid var(--primary); }
.stat:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.stat-num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat.blue { border-top-color: var(--blue); }
.stat.teal { border-top-color: var(--accent); }
.stat.red { border-top-color: var(--red); }
.stat.red .stat-num { color: var(--red); }
.stat.muted { border-top-color: var(--border-strong); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
.filters .filter-q { flex: 1 1 280px; }
.filters select { width: auto; min-width: 160px; max-width: 240px; }

/* ---------- Table ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-meta { padding: 10px 16px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--border); }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #f8f9fb; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: #f8fafc; }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.row-muted td { opacity: .55; }
.row-warn td { background: #fff8f7; }
.actions-cell { white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge-xs { height: 18px; font-size: 10.5px; padding: 0 6px; margin-left: 4px; }
.badge-slate { background: var(--slate-bg); color: var(--slate); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-teal { background: var(--teal-bg); color: var(--teal); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-muted { background: #f0f1f3; color: #8a919c; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-green { background: #22a06b; }
.dot-red { background: var(--red); }
.dot-muted { background: #b8bfc9; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }
.page { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 7px; color: var(--slate); font-weight: 500; }
.page:hover { background: var(--slate-bg); text-decoration: none; }
.page.active { background: var(--primary); color: #fff; }
.page.disabled, .page.gap { color: #c0c6cf; }

/* ---------- Detail ---------- */
.record-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; margin: 0; }
.dl-row { min-width: 0; }
.dl dt { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.dl-stack { grid-template-columns: 1fr; gap: 10px; }
.text-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.text-block-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.process { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.process-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--teal-bg); }
.process .dl { grid-template-columns: 1fr; gap: 9px; }
.warranty { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.warranty-green { background: var(--green-bg); color: var(--green); }
.warranty-red { background: var(--red-bg); color: var(--red); }
.warranty-muted { background: var(--slate-bg); color: var(--slate); }
.files { list-style: none; margin: 0 0 14px; padding: 0; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.files li:last-child { border-bottom: 0; }
.file-info { flex: 1; min-width: 0; }
.file-info a { font-weight: 600; word-break: break-all; }
.file-icon { flex: none; width: 38px; height: 44px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; }
.file-pdf { background: #d1453b; }
.file-img { background: #3b7dd8; }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.upload-row select { width: auto; }
.upload-row input[type=file] { flex: 1 1 220px; width: auto; }
.timeline { list-style: none; margin: 0 0 12px; padding: 0 0 0 14px; border-left: 2px solid var(--border); max-height: 420px; overflow-y: auto; }
.timeline li { position: relative; padding: 0 0 12px 6px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.tl-head { font-size: 13px; }
.danger-zone { border-color: #f1c9c4; }
.danger-zone .card-title { color: var(--red); }

/* ---------- Auth ---------- */
.auth-body { background: radial-gradient(1200px 600px at 10% -10%, #1a4f80 0%, transparent 60%), linear-gradient(160deg, #0b2e4f 0%, #071d33 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 410px; background: #fff; border-radius: 14px; padding: 30px 30px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-app { font-weight: 700; font-size: 16px; color: var(--navy); }
.auth-sub { color: var(--muted); font-size: 12.5px; }
.auth-link { text-align: center; margin: 16px 0 0; font-size: 13px; }
.auth-foot { color: rgba(255,255,255,.45); font-size: 12px; margin-top: 18px; }
.setup-section { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); font-weight: 650; color: var(--navy); }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; font-size: 13px; }
.checklist li { padding: 3px 0; }
.checklist .ok { color: var(--green); }
.checklist .bad { color: var(--red); font-weight: 600; }
.checklist .warn { color: var(--amber); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .detail-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .brand-text, .user-name { display: none; }
  .topbar-actions { margin-left: auto; }
  .container { padding: 16px 12px 30px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process { grid-template-columns: 1fr; }
  .filters select { flex: 1 1 140px; max-width: none; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .topbar, .footer, .no-print, .page-actions, .back, .sticky-actions { display: none !important; }
  .container { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .detail-layout { grid-template-columns: 1fr 1fr; }
  .timeline { max-height: none; overflow: visible; }
  a { color: inherit; }
}
