:root {
  --bg: #f5f7fb;
  --p: #fff;
  --ink: #162033;
  --muted: #718096;
  --line: #e5eaf2;
  --brand: #173f7a;
  --ok: #15803d;
  --bad: #b91c1c;
  --warn: #b45309;
}
* { box-sizing: border-box; }
.hidden { display: none !important; }
body { margin: 0; font-family: Segoe UI, Arial, sans-serif; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app { display: flex; min-height: 100vh; }
.side { width: 240px; background: #0f1f38; color: #fff; padding: 18px 12px; position: fixed; inset: 0 auto 0 0; }
.brand { padding: 5px 10px 18px; display: flex; gap: 10px; align-items: center; }
.brand img { width: 34px; height: 34px; border-radius: 8px; background: #fff; }
.brand b { font-size: 15px; display: block; }
.brand small { display: block; color: #9fb0c9; margin-top: 3px; }
.nav button {
  width: 100%; border: 0; background: transparent; color: #dbe6f5;
  text-align: left; padding: 11px 12px; border-radius: 9px; margin: 2px 0; font-weight: 700;
}
.nav button.active, .nav button:hover { background: #214878; }
.main { margin-left: 240px; width: calc(100% - 240px); padding: 22px; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.title h1 { margin: 0; font-size: 25px; }
.title p { margin: 4px 0 0; color: var(--muted); }
.user { background: #fff; border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.status-bar { background: #173f7a; color: #fff; font-weight: 800; font-size: 13px; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.status-bar.err { background: #991b1b; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { background: var(--p); border: 1px solid var(--line); border-radius: 13px; padding: 17px; box-shadow: 0 8px 25px #0f172a0b; }
.k { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.n { font-size: 27px; font-weight: 900; margin-top: 6px; }
.section { margin-top: 14px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.head h2 { margin: 0; font-size: 16px; }
.btn { border: 1px solid var(--line); background: #fff; padding: 8px 11px; border-radius: 8px; font-weight: 800; }
.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.danger { background: #fff; border-color: #fecaca; color: #991b1b; }
.search { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.page { display: none; }
.page.active { display: block; }
.tablewrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; white-space: nowrap; }
.table th { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.thumbcell { width: 56px; height: 36px; object-fit: cover; border-radius: 6px; background: #edf1f5; }
.badge { padding: 4px 7px; border-radius: 99px; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.deployed, .active { background: #dcfce7; color: #166534; }
.offline, .suspended { background: #fee2e2; color: #991b1b; }
.international, .pending { background: #fef3c7; color: #92400e; }
.local, .neutral { background: #e0e7ff; color: #3730a3; }
.empty { text-align: center; padding: 35px; color: var(--muted); }
.modal { position: fixed; inset: 0; background: #0f172a99; display: none; align-items: center; justify-content: center; padding: 18px; z-index: 10; }
.modal.open { display: flex; }
.box { background: #fff; width: min(820px, 100%); max-height: 92vh; overflow: auto; border-radius: 15px; padding: 20px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field label { display: block; font-size: 10px; color: var(--muted); font-weight: 900; margin-bottom: 4px; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.full { grid-column: 1 / -1; }
.foot { text-align: right; margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }
.close { float: right; border: 0; background: #edf1f5; border-radius: 7px; padding: 6px 10px; }
.drop {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 28px 18px; text-align: center;
  background: #f8fafc; color: var(--muted); font-size: 13px; font-weight: 700;
}
.drop.over { border-color: var(--brand); background: #eef5ff; color: var(--brand); }
.preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.preview .shot { position: relative; width: 148px; }
.preview img { width: 148px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.preview .shot.cover img { outline: 2px solid var(--brand); }
.preview .x {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border: 0;
  border-radius: 50%; background: #991b1b; color: #fff; font-size: 12px; line-height: 20px;
}
.preview .shot-tools { display: flex; gap: 4px; margin-top: 4px; }
.preview .shot-tools button { flex: 1; padding: 4px 6px; font-size: 10px; }
.pull-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pull-row .search, .pull-row input { flex: 1; min-width: 220px; }
.pull-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 14px; }
.pull-box label { display: block; font-size: 10px; color: var(--muted); font-weight: 900; margin-bottom: 6px; text-transform: uppercase; }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.link-row { display: grid; grid-template-columns: 140px 1fr 1.4fr 52px 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.faq-row { display: grid; grid-template-columns: 1fr 36px; gap: 8px; margin-bottom: 10px; }
.faq-row textarea { grid-column: 1; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.faq-row input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-weight: 700; }
.faq-row .danger { grid-column: 2; grid-row: 1 / span 2; }
.link-row input, .link-row select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
@media (max-width: 800px) {
  .link-row { grid-template-columns: 1fr; }
}
.guess { font-size: 12px; color: var(--muted); margin-top: 6px; }
.guess b { color: var(--brand); }
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #0f1f38; padding: 20px;
}
.login-box {
  width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 28px 24px;
}
.login-box h1 { margin: 8px 0 4px; font-size: 22px; }
.login-box p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.err { color: #991b1b; font-size: 13px; font-weight: 700; min-height: 18px; margin: 8px 0; }
@media (max-width: 800px) {
  .side { position: static; width: 100%; height: auto; }
  .app { display: block; }
  .main { margin: 0; width: 100%; padding: 14px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .form { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
}
