/* ============ SonnyServer admin styles ============ */
:root {
  --primary: #f5a623;
  --primary-2: #e0202b;
  --primary-grad: linear-gradient(135deg, #fbbf24 0%, #f5a623 45%, #e0202b 100%);
  --gold: #f5a623;
  --ink: #1a1208;
  --ink-soft: #5b5140;
  --muted: #948a76;
  --bg: #fff9ef;
  --line: #f0e5d0;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 34px rgba(245, 158, 11, 0.10);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; }
a { color: var(--primary-2); text-decoration: none; }
code { background: #eef2f7; padding: 2px 6px; border-radius: 5px; font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.86em; }

.admin-body { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

/* sidebar */
.admin-sidebar { background: var(--ink); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--primary-grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.admin-brand strong { display: block; color: #fff; }
.admin-brand small { color: var(--muted); }
.admin-nav { padding: 14px 10px; flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #cbd5e1; margin-bottom: 2px; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.admin-nav a.active { background: var(--primary-grad); color: #fff; }
.nav-ico { width: 22px; text-align: center; }
.admin-sidebar-foot { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 8px; }
.admin-sidebar-foot a { color: #cbd5e1; font-size: 0.9rem; }

/* topbar + content */
.admin-main { min-width: 0; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 16px 26px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.admin-topbar h1 { font-size: 1.25rem; }
.admin-user { color: var(--muted); font-size: 0.92rem; }
.admin-content { padding: 26px; }

/* flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; font-weight: 600; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: var(--red); }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.stat-big { font-size: 1.6rem; font-weight: 800; }
.stat-box span:last-child { color: var(--muted); font-size: 0.83rem; }
.stat-ok .stat-big { color: var(--green); }
.stat-warn .stat-big { color: #b45309; }

/* panels + tables */
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 24px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.panel-head h3 { font-size: 1.1rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; padding: 9px 10px; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row-actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }
.status { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; display: inline-block; }
.status-active, .status-ok { background: #dcfce7; color: var(--green); }
.status-pending { background: #fef3c7; color: #b45309; }
.status-processing { background: #dbeafe; color: #1d4ed8; }
.status-suspended { background: #fee2e2; color: var(--red); }
.status-cancelled, .status-failed, .status-muted { background: #f1f5f9; color: var(--muted); }
.status-select { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 0.8rem; }

/* buttons */
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary-grad); color: #fff; }
.btn-ghost { background: rgba(245,158,11,.10); color: #b45309; }
.btn-outline-dark { border-color: var(--line); color: var(--ink); }
.btn-outline-dark:hover { border-color: var(--primary-2); color: var(--primary-2); }
.btn-danger { background: #fee2e2; color: var(--red); }
.btn-sm { padding: 5px 11px; font-size: 0.8rem; border-radius: 8px; }
.btn-block { display: block; width: 100%; }

/* forms */
.admin-form { display: flex; flex-direction: column; gap: 14px; }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.88rem; color: var(--ink-soft); }
.admin-form input[type="text"], .admin-form input[type="password"], .admin-form input[type="number"], .admin-form select, .admin-form textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 0.95rem; outline: none; background: #fff;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--primary-2); }
.form-checks { display: flex; gap: 18px; flex-wrap: wrap; }
.form-checks label { display: flex; flex-direction: row; align-items: center; gap: 7px; font-weight: 500; }
.test-result { margin-left: 10px; font-size: 0.85rem; font-weight: 600; }
.test-result.ok { color: var(--green); }
.test-result.err { color: var(--red); }

/* monitor */
.monitor { font-size: 0.92rem; }
.monitor-loading { color: var(--muted); padding: 20px 0; }
.monitor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.monitor-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--bg); }
.monitor-card h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.monitor-card .big { font-size: 1.6rem; font-weight: 800; }
.monitor-bar { height: 10px; border-radius: 99px; background: #e5e7eb; overflow: hidden; margin-top: 10px; }
.monitor-bar > div { height: 100%; background: var(--primary-grad); }
.monitor-services { display: flex; flex-wrap: wrap; gap: 8px; }
.monitor-service { padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; background: #dcfce7; color: var(--green); font-weight: 600; }
.monitor-error { color: var(--red); padding: 16px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; }

/* messages */
.message-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.message-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.message-head .btn { margin-left: auto; }
.message-body { margin-top: 10px; color: var(--ink-soft); background: var(--bg); border-radius: 10px; padding: 12px; }

@media (max-width: 900px) {
  .admin-body { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-form .form-row { grid-template-columns: 1fr; }
}

/* admin login */
.admin-login-body { display: grid; place-items: center; background: var(--ink); }
.admin-login { width: 100%; padding: 24px; }
.admin-login-card { max-width: 420px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 34px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.admin-login-card .brand-mark { width: 46px; height: 46px; font-size: 1.4rem; }
.admin-login-card .admin-brand { border: 0; padding: 0; display: flex; }

