:root {
  --bg: #0f1720; --panel: #182230; --panel2: #1f2c3d; --line: #2b3a4f;
  --text: #e6edf5; --muted: #8aa0b8; --accent: #2f81f7; --accent2: #1f6feb;
  --ok: #2ea043; --warn: #d29922; --err: #f85149; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, "Segoe UI", Roboto, sans-serif;
       background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2);
         color: var(--text); padding: 8px 14px; border-radius: 8px; font-size: 14px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
button.primary:hover { background: var(--accent); }
input, select { background: var(--bg); border: 1px solid var(--line); color: var(--text);
                padding: 9px 11px; border-radius: 8px; font-size: 14px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.error { color: var(--err); margin-top: 8px; min-height: 18px; font-size: 13px; }

/* Login */
.login-screen { min-height: 100vh; display: grid; place-items: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
              padding: 32px; width: 320px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card .sub { margin: 0 0 8px; color: var(--muted); }

/* App layout */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line);
           display: flex; flex-direction: column; padding: 16px; }
.brand { font-weight: 700; font-size: 18px; margin-bottom: 20px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a { padding: 10px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.sidebar nav a:hover { background: var(--panel2); color: var(--text); }
.sidebar nav a.active { background: var(--accent2); color: #fff; }
.who { display: flex; align-items: center; justify-content: space-between; gap: 8px;
       border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 13px; }
.who button { padding: 6px 10px; font-size: 13px; }

.content { padding: 24px 28px; overflow: auto; }
.head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.head h2 { margin: 0; }
.reload { padding: 6px 12px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
td .act { color: var(--accent); cursor: pointer; margin-right: 12px; }
td .act.del { color: var(--err); }
.badge { padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.badge.on { background: rgba(46,160,67,.15); color: var(--ok); }
.badge.off { background: rgba(248,81,73,.15); color: var(--err); }
.badge.bot { background: rgba(210,153,34,.15); color: var(--warn); }

/* Settings */
.settings { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.settings .row { display: grid; grid-template-columns: 1fr 140px; gap: 12px; align-items: center;
                 background: var(--panel); padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); }
.settings .row label { color: var(--muted); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
              padding: 24px; width: 460px; max-width: 92vw; }
.modal-card h3 { margin: 0 0 16px; }
.modal-body-row { margin-bottom: 12px; }
.modal-body-row label { display: block; color: var(--muted); margin-bottom: 5px; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.phone-row { display: flex; gap: 8px; }
.phone-country { flex: 0 0 auto; width: auto; max-width: 170px; }
.phone-number { flex: 1; }
.ord-input { width: 64px; padding: 6px 8px; text-align: center; }
