/* ───────── 디자인 토큰 ───────── */
:root {
  --primary: #3366ff;
  --primary-d: #2550d9;
  --primary-l: #eef3ff;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e6e9f0;
  --line2: #f0f2f6;
  --text: #191f28;
  --text2: #4e5968;
  --text3: #8b95a1;
  --ok: #12b76a;
  --ok-l: #e8f8f0;
  --warn: #f79009;
  --warn-l: #fff4e5;
  --ng: #f04438;
  --ng-l: #fdeceb;
  --tg: #229ed9;
  --side: #0f1729;
  --side2: #1b2540;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Malgun Gothic', sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.hidden { display: none !important; }

/* ───────── 레이아웃 ───────── */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 236px; flex-shrink: 0; background: var(--side); color: #c7cede;
  position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 30;
  display: flex; flex-direction: column; transition: transform .2s;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.side .brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; }
.side .brand .bt { min-width: 0; flex: 1; overflow: hidden; }
.side .brand .bt > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .brand.editable { cursor: pointer; margin: 6px 8px 0; padding: 16px 12px 12px; border-radius: 10px; }
.side .brand.editable:hover { background: var(--side2); }
.side .brand .brand-edit { opacity: 0; color: #7f8aa3; transition: opacity .12s; }
.side .brand.editable:hover .brand-edit { opacity: 1; }
.side .brand small { display: block; font-size: 11px; color: #7f8aa3; font-weight: 500; letter-spacing: 0; }
.side .cta { margin: 4px 16px 14px; }
.side .cta .btn { width: 100%; justify-content: center; height: 42px; font-size: 14.5px; }
.nav-sec { padding: 10px 12px 4px; }
.nav-sec .t { font-size: 11.5px; color: #66718a; padding: 6px 10px; font-weight: 600; letter-spacing: .3px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #b8c0d2; font-weight: 500; margin: 1px 0; font-size: 14px;
}
.nav a svg { width: 18px; height: 18px; opacity: .85; flex-shrink: 0; }
.nav a:hover { background: var(--side2); color: #fff; }
.nav a.on { background: rgba(51, 102, 255, .18); color: #fff; }
.nav a.on svg { color: #7aa0ff; opacity: 1; }
.nav a .badge { margin-left: auto; background: var(--ng); color: #fff; font-size: 11px; padding: 0 7px; border-radius: 10px; font-weight: 700; line-height: 18px; }
.nav a .badge.blue { background: var(--primary); }
.side .foot { margin-top: auto; padding: 14px 20px; font-size: 12px; color: #66718a; border-top: 1px solid #1d2742; }

.main { flex: 1; margin-left: 236px; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 60px; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.top .menu-btn { display: none; }
.top .crumb { font-weight: 700; font-size: 16px; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.balance-chip { display: flex; align-items: center; gap: 8px; background: var(--primary-l); color: var(--primary-d); padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; cursor: pointer; }
.mode-chip { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--warn-l); color: #b54708; font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 8px; position: relative; }
.user-chip:hover { background: var(--bg); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #dfe6ff; color: var(--primary-d); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.dropdown { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1); min-width: 170px; padding: 6px; z-index: 50; }
.dropdown a { display: block; padding: 8px 12px; color: var(--text); border-radius: 6px; }
.dropdown a:hover { background: var(--bg); }

.content { padding: 28px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1, .login-art h2 { word-break: keep-all; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.page-head p { margin: 4px 0 0; color: var(--text3); font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────── 카드 ───────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line2); gap: 10px; }
.card-h h3 { font-size: 15px; font-weight: 700; }
.card-h .sub { color: var(--text3); font-size: 12.5px; font-weight: 400; margin-left: 6px; }
.card-b { padding: 20px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }

.stat { padding: 18px 20px; }
.stat .k { color: var(--text3); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--text2); margin-left: 2px; }
.stat .d { font-size: 12.5px; color: var(--text3); margin-top: 4px; }
.stat .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; float: right; }
.ico.blue { background: var(--primary-l); color: var(--primary); }
.ico.green { background: var(--ok-l); color: var(--ok); }
.ico.orange { background: var(--warn-l); color: var(--warn); }
.ico.tg { background: #e6f5fc; color: var(--tg); }

/* ───────── 버튼 / 폼 ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f7f8fa; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.danger { color: var(--ng); }
.btn.danger.fill { background: var(--ng); border-color: var(--ng); color: #fff; }
.btn.tg { background: var(--tg); border-color: var(--tg); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { margin-bottom: 16px; }
.field > label, .lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text2); }
.field .help { font-size: 12px; color: var(--text3); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51, 102, 255, .12); }
.input.mono, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.switch { position: relative; width: 40px; height: 22px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d0d5dd; border-radius: 22px; cursor: pointer; transition: .15s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }

.seg { display: inline-flex; background: var(--bg); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--text3); font-size: 13px; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--text3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }

/* ───────── 표 ───────── */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text3); font-size: 12.5px; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafbff; }
.tbl tr.click { cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .w-chk { width: 36px; }
.tbl .ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--text3); padding: 48px 20px; }
.empty > svg { width: 40px; height: 40px; opacity: .35; display: block; margin: 0 auto 10px; }

.pager { display: flex; gap: 4px; justify-content: center; padding: 14px; align-items: center; }
.pager button { min-width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .info { color: var(--text3); font-size: 12.5px; margin: 0 10px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line2); }
.toolbar .input { width: auto; height: 34px; }
.toolbar .sp { flex: 1; }

/* ───────── 배지 ───────── */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--text2); white-space: nowrap; }
.tag.ok { background: var(--ok-l); color: #067647; }
.tag.ng { background: var(--ng-l); color: #b42318; }
.tag.warn { background: var(--warn-l); color: #b54708; }
.tag.blue { background: var(--primary-l); color: var(--primary-d); }
.tag.tg { background: #e6f5fc; color: #0b77a8; }
.tag.gray { background: #f2f4f7; color: #667085; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #d0d5dd; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 183, 106, .18); }
.dot.warn { background: var(--warn); }

/* ───────── 발송 화면 ───────── */
.send-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.step { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; display: grid; place-items: center; }
.editor { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51, 102, 255, .12); }
.editor input.subject { border: 0; border-bottom: 1px solid var(--line2); width: 100%; padding: 12px 14px; outline: none; font-weight: 600; }
.editor textarea { border: 0; width: 100%; min-height: 220px; padding: 14px; outline: none; resize: vertical; line-height: 1.65; display: block; }
.editor .bar { display: flex; align-items: center; gap: 4px; padding: 8px 10px; background: #fafbfc; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.editor .bar .sp { flex: 1; }
.bytes { font-size: 12.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.bytes b { color: var(--text); }
.type-badge { font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--primary); color: #fff; }
.type-badge.LMS { background: #7a5af8; }
.type-badge.MMS { background: #ee46bc; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.special { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; padding: 8px; }
.special button { border: 1px solid var(--line2); background: #fff; height: 30px; cursor: pointer; border-radius: 5px; }
.special button:hover { background: var(--primary-l); }

.rcpt-box { border: 1px solid var(--line); border-radius: 10px; }
.rcpt-list { max-height: 280px; overflow-y: auto; }
.rcpt-list .it { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.rcpt-list .it:hover { background: #fafbfc; }
.rcpt-list .it .ph { font-variant-numeric: tabular-nums; font-weight: 600; width: 120px; }
.rcpt-list .it .nm { color: var(--text2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcpt-list .it .x { border: 0; background: none; cursor: pointer; color: var(--text3); padding: 2px 6px; border-radius: 4px; }
.rcpt-list .it .x:hover { background: var(--ng-l); color: var(--ng); }
.rcpt-sum { display: flex; gap: 14px; padding: 10px 14px; background: #fafbfc; border-top: 1px solid var(--line2); font-size: 12.5px; color: var(--text3); align-items: center; border-radius: 0 0 10px 10px; }
.rcpt-sum b { color: var(--text); }

/* 휴대폰 미리보기 */
.phone {
  width: 300px; margin: 0 auto; background: #111; border-radius: 40px; padding: 12px; box-shadow: 0 20px 40px rgba(16, 24, 40, .18);
}
.phone .scr { background: #fff; border-radius: 30px; height: 560px; display: flex; flex-direction: column; overflow: hidden; }
.phone .notch { height: 28px; display: flex; justify-content: center; align-items: center; }
.phone .notch::before { content: ''; width: 90px; height: 22px; background: #111; border-radius: 0 0 14px 14px; margin-top: -10px; }
.phone .hd { text-align: center; padding: 6px 10px 12px; border-bottom: 1px solid #f0f0f0; }
.phone .hd .av { width: 42px; height: 42px; border-radius: 50%; background: #c9ced6; margin: 0 auto 4px; display: grid; place-items: center; color: #fff; }
.phone .hd .nm { font-size: 12.5px; font-weight: 600; }
.phone .body { flex: 1; overflow-y: auto; padding: 14px 12px; background: #fff; }
.phone .time { text-align: center; font-size: 10.5px; color: #8e8e93; margin-bottom: 8px; }
.phone .bubble { background: #e9e9eb; border-radius: 18px; padding: 9px 13px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-width: 88%; }
.phone .bubble .sj { font-weight: 700; margin-bottom: 4px; display: block; }
.phone .bubble img { max-width: 100%; border-radius: 10px; display: block; margin-bottom: 6px; }
.phone .bubble.empty { color: #aaa; }

/* ───────── 모달 / 토스트 ───────── */
.modal-bg { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 60px 16px; overflow-y: auto; animation: fade .12s; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; box-shadow: 0 24px 48px rgba(16, 24, 40, .2); animation: pop .15s; }
.modal.wide { max-width: 760px; }
.modal.xwide { max-width: 980px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line2); }
.modal-h h3 { font-size: 17px; font-weight: 700; }
.modal-b { padding: 22px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line2); background: #fafbfc; border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1d2939; color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: pop .15s; max-width: 90vw; white-space: pre-line; }
.toast.err { background: #b42318; }
.toast.ok { background: #067647; }

/* ───────── 기타 ───────── */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--text3); }
.kv dd { margin: 0; font-weight: 500; word-break: break-all; }
.note { background: #f8faff; border: 1px solid #dbe5ff; color: var(--text2); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.65; }
.note.warn { background: #fffaf0; border-color: #fedf89; }
.note b { color: var(--text); }
.code-box { background: #0f1729; color: #d6e0ff; border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; position: relative; }
.code-box .copy { position: absolute; top: 8px; right: 8px; }
.copy-line { display: flex; gap: 6px; }
.copy-line .input { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: #fafbfc; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding: 0 0 18px 38px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-l); color: var(--primary); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.steps li > b { display: block; margin-bottom: 4px; }
.steps li p { margin: 0; color: var(--text2); font-size: 13px; }
.muted { color: var(--text3); }
.small { font-size: 12.5px; }
.bold { font-weight: 700; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .wrap { flex-wrap: wrap; }
.prog { height: 8px; background: var(--line2); border-radius: 8px; overflow: hidden; display: flex; }
.prog i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text3); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.list-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line2); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 600; }
.list-item .s { color: var(--text3); font-size: 12.5px; }
.msg-text { white-space: pre-wrap; word-break: break-all; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); display: inline-block; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .bar-ok { fill: var(--primary); }
.chart .bar-ng { fill: #ffb4ae; }
.chart text { font-size: 10px; fill: var(--text3); }

/* 로그인 */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(140deg, #1d3fbf 0%, #3366ff 55%, #6b8cff 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h2 { font-size: 34px; line-height: 1.3; font-weight: 800; letter-spacing: -.8px; }
.login-art p { opacity: .85; font-size: 15px; }
.login-art .feat { display: grid; gap: 12px; max-width: 360px; }
.login-art .feat div { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 12px 16px; font-weight: 500; backdrop-filter: blur(4px); }
.login-box { display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: #fff; }
.login-box form { width: 100%; max-width: 360px; }
.login-box h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.login-box .input { height: 46px; }
.login-box .btn { width: 100%; height: 48px; justify-content: center; font-size: 15px; margin-top: 8px; }

/* ───────── 반응형 ───────── */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .send-grid, .g-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .main { margin-left: 0; }
  .top { padding: 0 16px; }
  .top .menu-btn { display: inline-flex; }
  .content { padding: 18px 16px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .page-head .actions { width: 100%; }
  .toolbar .input { max-width: 100%; }
  .tbl td { white-space: nowrap; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .mode-chip, .user-chip .nm { display: none; }
  .kv { grid-template-columns: 96px 1fr; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 20px; }
  .phone { transform: scale(.9); transform-origin: top center; }
}
