/* telegram/admin_portal/static/style.css -- 2026-08-11
   Shared stylesheet for every admin_portal page. --navy/--gold/etc. are
   defined per-page in base.html's inline <style> block (read from
   brand_kit.colors() at render time) -- this file only uses them via
   var(), never hardcodes a brand color directly, so a brand-kit color
   change never needs a second edit here. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
}

/* ---------------------------------------------------------------------
   Login page (no sidebar)
--------------------------------------------------------------------- */
body.no-sidebar {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #0d1f36 100%);
}

.login-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 40px 36px;
  width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand .brand-mark {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.login-brand .brand-sub {
  font-size: 11px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.login-card label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin: 14px 0 6px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8dae0;
  border-radius: 8px;
  font-size: 14px;
}

.login-card input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-tint);
}

.login-card button {
  width: 100%;
  margin-top: 22px;
  padding: 11px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.login-card button:hover { background: #0d1f36; }

/* ---------------------------------------------------------------------
   App shell -- sidebar + main column
--------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--navy);
  color: #cfd8e6;
  padding: 20px 0 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 16px;
}

.sidebar-brand .brand-mark {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
}

.sidebar-brand .brand-sub {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-top: 2px;
}

.nav-section { margin-bottom: 18px; }

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f7f9a;
  padding: 0 22px;
  margin-bottom: 6px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px;
  font-size: 13.5px;
  color: #d3dbe8;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s;
}

a.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(212,175,55,0.14);
  border-left-color: var(--gold);
  color: #ffffff;
  font-weight: 600;
}

.nav-item.disabled {
  color: #5c6c86;
  cursor: default;
}

.nav-icon { width: 18px; text-align: center; flex-shrink: 0; }

.soon-badge {
  margin-left: auto;
  font-size: 9px;
  background: rgba(255,255,255,0.10);
  color: #9fb0cc;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #ffffff;
  border-bottom: 1px solid #e6e8ec;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.user-chip {
  background: var(--navy-tint);
  color: var(--navy);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.logout-link {
  color: #888;
  text-decoration: none;
}

.logout-link:hover { color: var(--navy); text-decoration: underline; }

.content {
  padding: 26px 28px 60px;
  max-width: 1200px;
}

/* ---------------------------------------------------------------------
   Flash messages
--------------------------------------------------------------------- */
.flash-stack { margin-bottom: 20px; }

.flash {
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 8px;
}

.flash-success { background: #e6f7ec; color: #1a7a3e; border: 1px solid #b8e6c8; }
.flash-error { background: #fbeaea; color: #a3312f; border: 1px solid #f0c2c1; }

/* ---------------------------------------------------------------------
   Cards, stat tiles, tables -- shared across every content page
--------------------------------------------------------------------- */
.stat-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-tile {
  background: #ffffff;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 18px 22px;
  min-width: 170px;
  flex: 1;
}

.stat-tile .label {
  font-size: 11.5px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-tile .value {
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.card {
  background: #ffffff;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 22px;
}

.card h2 {
  font-size: 15px;
  margin: 0 0 14px;
  color: var(--navy);
}

.card p.card-note {
  font-size: 12.5px;
  color: #888;
  margin: -8px 0 16px;
}

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
  text-align: left;
  color: #666;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 2px solid #eceef1;
  white-space: nowrap;
}

td { padding: 9px 10px; border-bottom: 1px solid #f0f1f3; white-space: nowrap; }

tr:hover td { background: #fafbfc; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.pill-online { background: #e6f7ec; color: #1a7a3e; }
.pill-offline { background: #fbeaea; color: #a3312f; }
.pill-warn { background: #fdf2e0; color: #9a6412; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 7px;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.12s;
}

.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--navy); color: white; }
.btn-secondary { background: #eef0f3; color: #333; }
.btn-sm { padding: 4px 10px; font-size: 11.5px; }

pre.log-view {
  background: #0d1117;
  color: #c9d1d9;
  padding: 18px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  max-height: 70vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------------------------------------------------------------
   Filter + export toolbar, pagination -- shared across every analytics
   view (2026-08-11).
--------------------------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eceef1;
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-form input[type="text"] {
  padding: 6px 12px;
  border: 1px solid #d8dae0;
  border-radius: 7px;
  font-size: 13px;
  width: 220px;
}

.filter-form input[type="text"]:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-tint);
}

.export-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.export-label {
  font-size: 11.5px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.pagination-info {
  font-size: 12.5px;
  color: #777;
  text-align: center;
}

.btn-disabled {
  opacity: 0.35;
  pointer-events: none;
}

code {
  background: #f2f3f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ---------------------------------------------------------------------
   Confirm-dialog modal -- used by every destructive action (bot restart
   today; more in later phases). Built once here, reused everywhere.
--------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,15,25,0.55);
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open { display: flex; }

.modal-box {
  background: white;
  border-radius: 12px;
  padding: 26px 28px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-box h3 { margin: 0 0 10px; color: var(--navy); font-size: 16px; }
.modal-box p { font-size: 13.5px; color: #555; margin: 0 0 20px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
