:root { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", sans-serif; background: #eef2f6; color: #0f172a; }
body.app { display: flex; min-height: 100vh; }
.side { width: 230px; flex: 0 0 230px; background: #f8fafc; border-right: 1px solid #dbe3ee; padding: 14px 10px 28px; }
.side-brand { font-weight: 700; color: #1d4ed8; padding: 8px 10px 16px; letter-spacing: .04em; }
.side-label { margin: 16px 10px 6px; font-size: 11px; text-transform: uppercase; color: #64748b; letter-spacing: .06em; }
.side a { display: block; padding: 9px 12px; border-radius: 8px; color: #334155; text-decoration: none; font-size: 14px; }
.side a.on { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.side a.passive { color: #94a3b8; }
.shell { flex: 1; min-width: 0; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 22px; background: #1d4ed8; color: #fff; }
header a { color: #e2e8f0; text-decoration: none; }
header strong { letter-spacing: .04em; }
header .head-side { display: flex; align-items: center; gap: 12px; margin-left: auto; }
header .head-side form.inline { margin: 0; }
header .head-side button { background: #fff; color: #1d4ed8; }
main { padding: 22px 18px 40px; }
.crumb { color: #64748b; margin-top: -8px; }
.identity { background: #fff; border-radius: 12px; padding: 16px 18px 22px; }
.identity h2 { margin: 0 0 10px; font-size: 18px; }
.warn { background: #fef3c7; color: #92400e; padding: 10px 12px; border-radius: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 14px 0; }
.grid2 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #334155; }
.grid2 input, .grid2 select { width: 100%; }
.grid2 input:disabled { background: #f1f5f9; color: #64748b; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.aktif, .st-aktif { background: #dcfce7; color: #166534; }
.badge.pasif, .st-pasif { background: #fef9c3; color: #854d0e; }
.badge.suresi, .st-suresi { background: #fee2e2; color: #991b1b; }
@media (max-width: 800px) {
  body.app { display: block; }
  .side { width: auto; }
  .grid2 { grid-template-columns: 1fr; }
}
.usage-bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; margin: 8px 0 4px; }
.usage-bars a { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; text-decoration: none; }
.usage-bars i { display: block; width: 100%; background: #2563eb; border-radius: 3px 3px 0 0; min-height: 2px; }
.usage-bars a.on i { background: #d97706; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 8px 0; }
.live-box { background: #fff; border-radius: 12px; padding: 12px 16px 16px; margin: 0 0 14px; }
.fault-box { background: #fff; border: 1px solid #fecaca; border-radius: 12px; padding: 12px 16px 8px; margin: 0 0 16px; }
.fault-box h2 { margin: 0 0 8px; color: #991b1b; font-size: 18px; }
.fault-box h2.jobs { margin-top: 18px; color: #1e3a8a; }
.otp-code input { width: 220px; margin: 8px 0 12px; }
.home-opt { background: #fff; border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; }
.home-opt label { display: flex; gap: 10px; align-items: center; font-weight: 650; }
.home-opt input { width: 18px; height: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.card { background: #fff; border-radius: 12px; padding: 16px; }
.card b { display: block; font-size: 28px; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 14px; vertical-align: top; }
th { background: #e2e8f0; }
form.inline, .row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
input, select, button { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; }
button, .btn { background: #0284c7; color: #fff; border: 0; text-decoration: none; display: inline-block; }
.msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.ok { background: #dcfce7; }
.err { background: #fee2e2; }
.login { max-width: 380px; margin: 10vh auto; background: #fff; padding: 22px; border-radius: 14px; }
.login input { width: 100%; margin: 6px 0 12px; }
.login button { width: 100%; }
.muted { color: #64748b; font-size: 13px; }
.sheet { background: #fff; border-radius: 12px; padding: 8px 22px 20px; max-width: 860px; }
.sheet h2 { font-size: 15px; margin: 22px 0 10px; }
.frow { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: center; margin: 10px 0; }
.frow > span:first-child { color: #1e293b; font-size: 14px; }
.frow input, .frow select, .frow textarea { width: 100%; }
.phonebox { display: flex; align-items: stretch; }
.phonebox b { display: flex; align-items: center; padding: 0 10px; border: 1px solid #cbd5e1; border-right: 0; border-radius: 8px 0 0 8px; background: #fff; font-weight: 500; }
.phonebox input { border-radius: 0 8px 8px 0; }
.hours { display: flex; gap: 10px; }
.hours input { width: 140px; }
td.actions { white-space: nowrap; }
td.actions form { display: inline; margin: 0 0 0 6px; }
a.line { background: #fff; color: #1d4ed8; border: 1px solid #93c5fd; padding: 6px 10px; border-radius: 8px; text-decoration: none; font-size: 13px; }
button.danger { background: #b91c1c; }
.router-fold { margin-top: 10px; }
.router-fold summary { list-style: none; cursor: pointer; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 16px; font-weight: 700; }
.router-fold summary::-webkit-details-marker { display: none; }
.router-fold[open] summary { border-radius: 12px 12px 0 0; }
.fold-body { background: #f8fafc; border: 1px solid #e2e8f0; border-top: 0; border-radius: 0 0 12px 12px; padding: 8px 14px 16px; }
.people-table td:first-child, .people-table th:first-child { padding-left: 14px; }
tr.row-online td:first-child { box-shadow: inset 8px 0 0 #22c55e; }
button.good { background: #15803d; }
button.warn { background: #ca8a04; }
.device-menu { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 14px; border-top: 1px solid #dbe3ee; }
.device-menu a { display: inline-block; padding: 8px 12px; border-radius: 8px; background: #fff; color: #334155; text-decoration: none; border: 1px solid #dbe3ee; }
.device-menu a.on { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.online-num a { color: inherit; text-decoration: none; }
.device-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.device-head h1 { margin: 0 0 4px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #16a34a; margin-right: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; }
.stat em { display: block; color: #64748b; font-style: normal; font-size: 13px; margin-bottom: 6px; }
.stat strong { font-size: 18px; }
.online-num { font-size: 32px; }
.load-ok { color: #15803d; }
.load-mid { color: #b45309; }
.load-hot { color: #b91c1c; }
.stat.wide { grid-column: span 2; }
.meter { height: 16px; background: #e5e7eb; border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
.meter span { display: block; height: 100%; background: #22c55e; }
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat.wide { grid-column: span 2; }
}
@media (max-width: 800px) {
  .frow { grid-template-columns: 1fr; }
}
.addr-block { margin: 14px 0; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; overflow: hidden; }
.addr-block summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; background: #f3f4f6; padding: 10px 14px; font-weight: 650; }
.addr-block summary::-webkit-details-marker { display: none; }
.addr-block summary::after { content: ""; margin-left: auto; flex: 0 0 auto; border: solid #64748b; border-width: 0 2px 2px 0; padding: 4px; transform: rotate(45deg); }
.addr-block[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.addr-preview { font-weight: 500; color: #64748b; font-size: 13px; }
.addr-preview b { color: #0f172a; font-weight: 600; }
.addr-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 18px 16px 8px; }
.addr-row { display: grid; grid-template-columns: 180px minmax(240px, 1fr); gap: 12px; align-items: center; font-size: 14px; color: #334155; }
.addr-row > span:first-child { text-align: right; }
.addr-row input, .addr-row select, .addr-note textarea { width: 100%; background: #fff; }
.addr-row input[name="cadde"], .addr-row input[name="bina"], .addr-row input[name="daire"] {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding-right: 28px;
}
.addr-span { grid-column: 1 / -1; }
.addr-code { display: flex; gap: 8px; align-items: center; }
.addr-code input { flex: 1; max-width: none; }
.addr-query { background: #2563eb; color: #fff; border: 0; border-radius: 4px; padding: 8px 14px; white-space: nowrap; cursor: pointer; text-decoration: none; }
.req-mark { display: inline-flex; gap: 2px; height: 12px; vertical-align: middle; }
.req-mark::before, .req-mark::after { content: ""; width: 2px; height: 12px; background: #ef4444; }
.adv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; padding: 16px; }
.adv-pair label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #334155; }
.adv-pair input, .adv-pair select { width: 100%; }
.addr-note { padding: 14px 16px 16px; }
.addr-note textarea { width: 100%; min-height: 0; background: #fff3a0; line-height: 1.45; }
.tags-cell { min-width: 220px; }
.tags-cell .tag, .tags-cell .tag-add { display: inline-flex; align-items: center; gap: 4px; margin: 2px 4px 2px 0; }
.tags-cell .tag { background: #fff3a0; color: #713f12; border-radius: 999px; padding: 2px 4px 2px 10px; }
.tags-cell .tag span { font-size: 12px; }
.tags-cell .tag button { background: transparent; color: #92400e; border: 0; padding: 0 6px; font-size: 16px; line-height: 1; cursor: pointer; }
.tags-cell .tag-add input { width: 120px; padding: 4px 8px; background: #fff3a0; border-radius: 999px; }
.tags-cell .tag-add button { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: #d97706; color: #fff; font-weight: 700; line-height: 1; }
.people-table th, .people-table td { padding: 3px 6px; font-size: 12px; line-height: 1.25; }
.people-table .badge { font-size: 10px; padding: 1px 6px; }
.people-table input, .people-table button { padding: 2px 6px; font-size: 11px; }
.people-table .tags-cell { min-width: 160px; }
.people-table .tags-cell .tag span { font-size: 11px; }
.people-table .tags-cell .tag-add input { width: 88px; padding: 2px 6px; }
.people-table .tags-cell .tag-add button { width: 20px; height: 20px; font-size: 12px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.pager form { margin: 0; }
.pager a { color: #1d4ed8; text-decoration: none; }
.pager select { padding: 4px 8px; font-size: 13px; }
.edit-menu { position: relative; display: inline-block; }
.edit-menu summary { cursor: pointer; color: #1d4ed8; list-style: none; }
.edit-menu summary::-webkit-details-marker { display: none; }
.edit-menu .menu { position: absolute; z-index: 6; left: 0; top: 100%; margin-top: 4px; min-width: 220px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }
.edit-menu .menu a, .edit-menu .menu button { display: block; width: 100%; margin: 4px 0; text-align: left; }
.edit-menu .menu form { margin: 0; }
@media (max-width: 800px) {
  .addr-grid { grid-template-columns: 1fr; }
  .addr-row { grid-template-columns: 1fr; }
  .addr-row > span:first-child { text-align: left; }
  .addr-preview { display: none; }
  .adv-pair { grid-template-columns: 1fr; }
}
