/* /assets/css/style.css
   Modern dark theme (constant) + base tokens
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* RESET ET BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

:root{
  color-scheme: dark;
  /* Surfaces */
  --bg0: #020714;          /* page base */
  --bg1: #061322;          /* subtle layer */
  --surface: rgba(8, 20, 36, 0.72);     /* glass surface */
  --surface-strong: rgba(8, 20, 36, 0.92);
  --surface-muted: rgba(255, 255, 255, 0.045);
  --stroke: rgba(126, 191, 219, 0.18);
  --stroke-strong: rgba(126, 191, 219, 0.34);

  /* Sidebar (distinct from page background) */
  --sidebar-bg: rgba(5, 14, 28, 0.82);
  --sidebar-stroke: rgba(126, 191, 219, 0.16);

  /* Text */
  --text: #edf6f7;
  --muted: rgba(222, 235, 238, 0.72);
  --muted2: rgba(222, 235, 238, 0.55);

  /* Accents */
  --accent: #2ee6c5;
  --accent-2: #49a7ff;
  --accent-3: #c26bff;
  --danger: #ff5c70;
  --success: #4ade80;
  --warning: #f4c95d;
  --info: #7dd3d8;

  /* Shadows / radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 18px;
  --shadow: 0 28px 90px rgba(0,0,0,0.55);
  --shadow-soft: 0 18px 54px rgba(0,0,0,0.34);

  /* Motion */
  --ease: cubic-bezier(.2,.8,.2,1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg0: #f6f9fa;
  --bg1: #edf3f5;
  --surface: rgba(255,255,255,.86);
  --surface-strong: rgba(255,255,255,.96);
  --surface-muted: rgba(9, 25, 34, 0.045);
  --stroke: rgba(20, 44, 55, 0.12);
  --stroke-strong: rgba(20, 44, 55, 0.20);
  --sidebar-bg: rgba(247, 251, 252, 0.94);
  --sidebar-stroke: rgba(20, 44, 55, 0.10);
  --text: #0f2028;
  --muted: rgba(15, 32, 40, 0.68);
  --muted2: rgba(15, 32, 40, 0.52);
}

html, body{
  height:100%;
  overflow:hidden !important;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  color: var(--text);

  /* Page background (NOT the same as sidebar) */
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(73,167,255,0.16), transparent 62%),
    radial-gradient(760px 460px at 92% 16%, rgba(46,230,197,0.13), transparent 58%),
    radial-gradient(700px 520px at 45% 105%, rgba(194,107,255,0.10), transparent 58%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* Optionnel : si ton code ajoute encore .dark-theme, ça reste ok */
body.dark-theme { color: var(--text); }

/* Ancien light-theme => forcé dark, pour éviter les pages claires */
body.light-theme { background: inherit; color: var(--text); }

body:not(.page-loaded)::before,
body:not(.page-loaded)::after {
  content: "";
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
  opacity: 1;
  visibility: visible;
}

body:not(.page-loaded)::before {
  inset: 0;
  background-color: #020714;
  background:
    radial-gradient(420px 260px at 50% 42%, rgba(46,230,197,.16), transparent 72%),
    linear-gradient(180deg, #020714, #061322);
}

body:not(.page-loaded)::after {
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 999px;
  border: 4px solid rgba(126,191,219,.18);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  box-shadow: 0 0 42px rgba(46,230,197,.22);
  animation: silengoLoader .85s linear infinite;
}

body.page-loaded::before,
body.page-loaded::after {
  display: none;
}

body.page-loader-fading::before,
body.page-loader-fading::after {
  opacity: 0;
  visibility: hidden;
}

@keyframes silengoLoader {
  to { transform: rotate(360deg); }
}

:focus-visible {
  outline: 2px solid rgba(125, 211, 216, 0.9);
  outline-offset: 3px;
  border-radius: 8px;
}

.d-flex { display: flex; width: 100%; min-width: 0; box-sizing: border-box; overflow:hidden; }
.page { --page-y-inset: 28px; gap: 28px; padding: 14px 18px 14px 0; min-height: 100vh; overflow:hidden; }

/* TYPO UTILITAIRE */
a { color: inherit; text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--stroke); opacity: 1; }

/* FORMULAIRE */
.form-label { color: var(--muted); border-color: var(--stroke); }

.form-container {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 28px 34px;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 440px;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}

.form-container:hover {
  border-color: var(--stroke-strong);
  transform: translateY(-1px);
}

.form-container h2 {
  margin-bottom: 16px;
  font-size: 1.9em;
  color: #ffffff;
  text-align: center;
  letter-spacing: -0.02em;
}

input.form-control,
form select,
form input {
  width: 100%;
  padding: 12px 12px;
  margin: 10px 0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.40);
  color: var(--text);
  font-size: 1em;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

input.form-control::placeholder,
form input::placeholder { color: rgba(229,231,235,0.45); }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: rgba(125,211,216,0.72);
  outline: none;
  box-shadow: 0 0 0 4px rgba(125,211,216,0.16);
}

form button,
.ext-button,
#play-btn {
  width: 100%;
  padding: 12px 18px;
  margin-top: 10px;
  color: #0b1220;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s var(--ease), filter .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);
}

form button:hover,
.ext-button:hover,
#play-btn:hover { transform: translateY(-1px); filter: brightness(1.04); }

form button:active,
.ext-button:active,
#play-btn:active { transform: translateY(0px); }

.btn-selected {
  background-color: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
}

/* Bootstrap-like gradients modernisés */
.btn-primary   { background: linear-gradient(145deg, #2563eb, #60a5fa); color: #081022; border: none; }
.btn-primary:hover { filter: brightness(0.98); }

.btn-secondary { background: linear-gradient(145deg, #334155, #64748b); color: #0b1220; border: none; }
.btn-secondary:hover { filter: brightness(0.98); }

.btn-success   { background: linear-gradient(145deg, #16a34a, #22c55e); color: #081022; border: none; }
.btn-success:hover { filter: brightness(0.98); }

.btn-danger    { background: linear-gradient(145deg, #dc2626, #ef4444); color: #081022; border: none; }
.btn-danger:hover { filter: brightness(0.98); }

.btn-warning   { background: linear-gradient(145deg, #f59e0b, #fbbf24); color: #081022; border: none; }
.btn-warning:hover { filter: brightness(0.98); }

.btn-info      { background: linear-gradient(145deg, #0ea5e9, #38bdf8); color: #081022; border: none; }
.btn-info:hover { filter: brightness(0.98); }

.btn-light     { background: linear-gradient(145deg, #e5e7eb, #f8fafc); color: #0b1220; border: none; }
.btn-light:hover { filter: brightness(0.98); }

.btn-dark      { background: linear-gradient(145deg, #0b1220, #1f2937); color: #e5e7eb; border: 1px solid var(--stroke); }
.btn-dark:hover { border-color: var(--stroke-strong); }

/* MESSAGES */
.error-message,
.error,
.success {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  color: #fff;
  margin-bottom: 15px;
  font-size: 0.95em;
  position: relative;
  animation: fadeIn 0.35s var(--ease);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-soft);
}

.error-message,
.error {
  background: rgba(239, 68, 68, 0.16);
  border-left: 6px solid var(--danger);
}

.success {
  background: rgba(34, 197, 94, 0.16);
  border-left: 6px solid var(--success);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-footer {
  margin-top: 14px;
  text-align: center;
  font-size: 0.95em;
  color: var(--muted);
}

.form-footer a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity .15s var(--ease);
}
.form-footer a:hover { opacity: 0.85; }

/* SIDEBAR */
.sidebar {
  background:
    linear-gradient(180deg, rgba(73,167,255,.12), rgba(46,230,197,.04) 38%, rgba(5,14,28,.82)),
    var(--sidebar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--sidebar-stroke);
  border-radius: 0 20px 20px 0;
  min-width: 300px;
  max-width: 300px;
  height: calc(100vh - 28px);
  margin: 14px 0 14px 0;
  padding: 28px 22px 24px;
  transition: transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.05);
}

.sidebar h4,
.sidebar-title {
  color: #fff;
  font-weight: 850;
  letter-spacing: 0;
  font-size: 1.58rem;
}

.sidebar .nav-link {
  color: rgba(226,232,240,0.78);
  padding: 0.98rem 1rem;
  border-radius: 13px;
  transition: background .18s var(--ease), color .18s var(--ease), transform .12s var(--ease);
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 750;
  border: 1px solid transparent;
}

.sidebar .nav-link i {
  width: 22px;
  text-align: center;
  opacity: 0.95;
  font-size: 1.16rem;
  color: rgba(203,217,224,.72);
}

.sidebar .nav-link:hover {
  background: rgba(46,230,197,.08);
  border-color: rgba(126,191,219,.16);
  color: #fff;
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(46,230,197,.26), rgba(73,167,255,.18));
  color: #fff;
  border-color: rgba(46,230,197,.42);
  box-shadow: 0 18px 40px rgba(46,230,197,.10), inset 0 1px 0 rgba(255,255,255,.10);
}

.sidebar .nav-link.active i {
  color: #fff;
}

/* Separator (mobile / desktop) */
.sidebar-separator { border-top: 1px solid var(--sidebar-stroke); }
.sidebar-sep-mobile { display: none; }

/* Déconnexion */
.disconnect-button {
  background: linear-gradient(90deg, rgba(239,68,68,0.25), rgba(239,68,68,0.10), rgba(239,68,68,0));
  color: #fff;
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: 12px;
}
.disconnect-button:hover { filter: brightness(1.04); }

/* MAIN */
main {
  flex-grow: 1;
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: calc(100vh - var(--page-y-inset, 0px));
  max-height: calc(100vh - var(--page-y-inset, 0px));
  box-sizing: border-box;
  overflow-y: auto !important;
  overflow-x: hidden;
  min-height: 0;
}

/* Un scroll plus propre */
main::-webkit-scrollbar { width: 10px; }
main::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.20);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0);
  background-clip: padding-box;
}
main::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.28); }

/* CARDS */
.card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(73,167,255,.10), transparent 70%),
    linear-gradient(180deg, rgba(13,29,51,.78), rgba(7,18,34,.68));
  border: 1px solid rgba(126,191,219,.20);
  border-left: 1px solid rgba(126,191,219,.20);
  border-radius: 20px;
  padding: 1.65rem 1.75rem;
  min-height: 138px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.035), transparent),
    radial-gradient(240px 120px at 12% 20%, rgba(46,230,197,.08), transparent 70%);
  opacity: .9;
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--stroke-strong);
}

.card-title {
  font-size: 0.78rem;
  color: rgba(190,203,221,0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.55rem;
  position: relative;
  z-index: 1;
}

.card-text {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

/* BORDURES UTILITAIRES */
.border-secondary { border-left-color: #64748b; }
.border-success   { border-left-color: var(--success); }
.border-warning   { border-left-color: var(--warning); }
.border-info      { border-left-color: var(--info); }

.border-select-success:hover { border-left-color: var(--success) !important; }
.border-select-warning:hover { border-left-color: var(--warning) !important; }
.border-select-info:hover    { border-left-color: var(--info) !important; }
.border-select-danger:hover  { border-left-color: var(--danger) !important; }

.text-danger { color: var(--danger); }

.center-container { display: flex; justify-content: center; align-items: center; }

.radio-icon { height: 120px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  html, body { overflow: hidden; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    transform: translateX(-100%);
    z-index: 1050;
    width: 260px;
    height: var(--vh, 100vh);
    font-size: 0.95rem;
    display: inline-block;
    box-shadow: 30px 0 80px rgba(0,0,0,0.45);
  }

  .sidebar-sep-mobile { display: block; }
  .sidebar.d-flex { display: inline-block !important; }
  .sidebar.open { transform: translateX(0); }

  .menu-toggle,
  .close-sidebar {
    background: none;
    border: none;
    color: #fff;
    position: fixed;
    font-size: 1.5rem;
    cursor: pointer;
  }

  .menu-toggle {
    top: 18px;
    left: 18px;
    padding: 6px 10px;
    z-index: 1040;
    background: rgba(17, 24, 39, 0.55);
    border: 1px solid rgba(148,163,184,0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
  }

  .close-sidebar { top: 12px; left: 18px; font-size: 2rem; }

  .sidebar-title { margin-top: 36px; }
  .page { margin-top: 35px; margin-bottom: 100px; }
  .main { height: 100dvh; }
  .radio-icon { height: 90px; }
}

/* Divers */
.menu-center {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}

.menu-center-child {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-title { font-size: clamp(2.2rem, 4vw, 3.2rem); letter-spacing: 0; }
.page-subtitle { font-size: calc(0.5rem + 1vw); color: var(--muted); }

.err-list { border-bottom: 1px solid var(--stroke); }

.err-alert { animation: vumeterBlinker 1s infinite; }
@keyframes vumeterBlinker {
  0%, 50% { background-color: inherit; }
  51%, 100% { background-color: rgba(239,68,68,0.18); }
}

/* MODAL */
.modal {
  background-color: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-content {
  background: rgba(17, 24, 39, 0.74) !important;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  border-top-color: var(--stroke);
  border-bottom-color: var(--stroke);
}

.btn-close-white,
.btn-close { filter: invert(1); opacity: 0.9; }

.modal-footer .btn {
  border: none;
  font-weight: 800;
  color: #ffffff;
  transition: filter .2s var(--ease);
}
.modal-footer .btn:hover { filter: brightness(1.03); }

/* Bulk stream editor */
.bulk-stream-modal .modal-dialog {
  height: calc(100% - 2rem);
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.bulk-stream-modal .modal-content,
.bulk-stream-modal #bulkStreamForm {
  min-height: 0;
  height: 100%;
}

.bulk-stream-modal #bulkStreamForm {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bulk-stream-modal .modal-header,
.bulk-stream-modal .modal-footer {
  flex: 0 0 auto;
  padding: 1.15rem 1.35rem;
}

.bulk-stream-modal .modal-header { align-items: flex-start; }
.bulk-stream-modal .modal-footer { gap: .65rem; }

.bulk-stream-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.35rem;
}

.bulk-modal-heading .modal-title {
  margin-bottom: .3rem;
  font-size: 1.05rem;
}

.bulk-modal-heading p,
.bulk-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

.bulk-import-panel,
.bulk-editor-panel {
  padding: 1.15rem;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.018);
}

.bulk-import-panel { margin-bottom: 1rem; }

.bulk-section-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.bulk-section-heading h6 {
  margin: 0 0 .2rem;
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
}

.bulk-section-index {
  display: grid;
  flex: 0 0 1.8rem;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid var(--stroke-strong);
  border-radius: 50%;
  color: var(--text);
  font-size: .75rem;
  font-weight: 700;
}

.bulk-editor-heading .bulk-add-row { margin-left: auto; }
.bulk-import-panel textarea { resize: vertical; min-height: 8rem; }

.bulk-import-panel #bulkParserFeedback:not(:empty) {
  margin-top: .85rem;
  padding: .65rem .75rem;
  border: 1px solid rgba(34,197,94,.25);
  border-radius: var(--r-sm);
  color: #86efac;
  background: rgba(34,197,94,.07);
  font-size: .82rem;
}

.bulk-table-wrap {
  max-height: min(44vh, 520px);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
}

.bulk-table-wrap .table { margin-bottom: 0; }
.bulk-table-wrap thead { position: sticky; top: 0; z-index: 2; }
.bulk-table-wrap thead th { background: #101010; }
.bulk-table-wrap td,
.bulk-table-wrap th { padding: .7rem; }
.bulk-table-wrap input[readonly] { color: var(--muted) !important; cursor: not-allowed; }

@media (max-width: 767.98px) {
  .bulk-stream-modal .modal-dialog {
    width: auto;
    height: calc(100% - 1rem);
    margin: .5rem;
  }

  .bulk-stream-modal .modal-header,
  .bulk-stream-modal .modal-body,
  .bulk-stream-modal .modal-footer { padding: 1rem; }

  .bulk-import-panel,
  .bulk-editor-panel { padding: .85rem; }
  .bulk-editor-heading { align-items: flex-start; flex-wrap: wrap; }
  .bulk-editor-heading .bulk-add-row { width: 100%; margin-left: 0; }
  .bulk-stream-modal .modal-footer .btn { flex: 1 1 auto; }
}

/* Streams */
.stream-item { height: 40px; }

.stream-btn {
  background-color: rgba(2, 6, 23, 0.26);
  color: rgba(226,232,240,0.78);
  border: 1px solid var(--stroke);
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  padding: 8px 12px;
  min-width: 180px;
  text-align: left;
  border-radius: 12px;
}
.stream-btn:hover {
  background-color: rgba(148,163,184,0.10);
  color: #fff;
  border-color: var(--stroke-strong);
}
.stream-btn.selected {
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #fff !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

/* Player / Listen page (modern dark) */
.listen-body {
  font-family: inherit;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 50% 0%, rgba(96,165,250,0.12), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

#player-container {
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.8rem;
  width: 92%;
  max-width: 640px;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#waveform { margin: 1rem 0; }

#play-btn {
  background: linear-gradient(145deg, #2563eb, #60a5fa);
  color: #081022;
}
#play-btn:hover { filter: brightness(0.98); }

/* Install banner */
#install-banner {
  color: var(--text);
  padding-bottom: 26px;
  z-index: 9999;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.banner-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#install-btn {
  width: auto;
  min-width: 190px;
  background: linear-gradient(135deg, rgba(46,230,197,.95), rgba(73,167,255,.85));
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  padding: 14px 22px;
  margin-top: 18px;
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: filter .2s var(--ease), transform .12s var(--ease);
}
#install-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }

.dashboard-logs-shell {
  margin-top: 24px;
}

#close-banner {
  background: none;
  color: rgba(226,232,240,0.9);
  border: none;
  font-size: 18px;
  cursor: pointer;
  position: absolute;
  top: 8px;
  right: 16px;
}
#close-banner:hover { color: #fff; }

.page-title {
  display: inline-block;
  color: #fff;
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: 0;
}

.page-subtitle {
  color: var(--muted);
  font-weight: 650;
}

.page-header {
  max-width: 1480px;
  margin: 0 auto 24px;
}

.dashboard-subtitle {
  margin: 6px 0 0;
  color: rgba(190,203,221,.82);
  font-size: 1.12rem;
}

.plain-card {
  min-height: 230px;
  padding: 2.35rem 2.6rem;
  border-color: rgba(46,230,197,.26) !important;
  background:
    radial-gradient(320px 220px at 88% 50%, rgba(46,230,197,.24), transparent 70%),
    radial-gradient(520px 200px at 15% 0%, rgba(73,167,255,.15), transparent 70%),
    linear-gradient(180deg, rgba(9,28,49,.78), rgba(7,18,34,.78));
}

.plain-card::after {
  opacity: .55;
}


.plain-card .card-title {
  color: var(--accent);
}

.plain-card .card-text {
  max-width: 680px;
  font-size: 1.45rem;
}

.alert {
  color: var(--text);
  background: var(--surface) !important;
  border: 1px solid var(--stroke) !important;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
}

.alert-warning {
  color: #fff4cf;
  border-color: rgba(244,201,93,.34) !important;
  background: rgba(244,201,93,.10) !important;
}

.alert-danger {
  color: #ffd1d7;
  border-color: rgba(255,92,112,.35) !important;
  background: rgba(255,92,112,.10) !important;
}

.alert-success {
  color: #d8ffe5;
  border-color: rgba(74,222,128,.32) !important;
  background: rgba(74,222,128,.10) !important;
}

.alert-link { color: var(--accent); }


.app-hero,
.notifications-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background:
    radial-gradient(420px 160px at 95% 10%, rgba(46,230,197,.10), transparent 70%),
    rgba(8, 20, 36, 0.58);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 850;
  letter-spacing: 0;
}

p {
  margin: .2rem 0 0;
  color: var(--muted);
  max-width: 680px;
}

.app-surface,
.app-list-item,
.notification-rule {
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(73,167,255,.08), transparent 70%),
    rgba(8, 20, 36, 0.50);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-list-item {
  padding: 1rem;
}

.form-section {
  display: grid;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: rgba(4, 12, 17, 0.28);
}

.form-section-title {
  color: rgba(226,232,240,0.82);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.form-help {
  color: var(--muted2);
  font-size: .86rem;
  margin-top: -.25rem;
}

.empty-state {
  padding: 1.4rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--stroke-strong);
  border-radius: var(--r-lg);
  background: rgba(13, 25, 33, 0.38);
}

.conditional-field.is-hidden {
  display: none !important;
}

.table-container {
  overflow-x: auto;
  margin-top: 32px !important;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: rgba(8, 20, 36, 0.58);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.table-container table,
table {
  background: transparent !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.table-container thead,
.table-container thead tr,
table thead,
table thead tr {
  background: rgba(255,255,255,.055) !important;
}

.table-container th,
table th {
  color: var(--accent) !important;
  border-bottom: 1px solid var(--stroke) !important;
  font-size: .76rem !important;
  letter-spacing: .08em !important;
  font-weight: 800 !important;
}

.table-container td,
.table-container th,
table td,
table th {
  padding: .78rem .85rem !important;
  vertical-align: middle;
}

.table-container tbody tr,
table tbody tr {
  border-bottom: 1px solid rgba(190,214,225,.08);
  transition: background .16s var(--ease);
}

.table-container tbody tr:hover,
table tbody tr:hover {
  background: rgba(125,211,216,.055);
}

.form-control,
.form-select,
textarea.form-control {
  background-color: rgba(4, 12, 17, .76) !important;
  border-color: var(--stroke) !important;
  color: var(--text) !important;
  border-radius: var(--r-md);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(125,211,216,.72) !important;
  box-shadow: 0 0 0 .25rem rgba(125,211,216,.14) !important;
}

.modal-content {
  color: var(--text);
}

.btn {
  border-radius: var(--r-md);
  font-weight: 750;
  letter-spacing: 0;
}

.btn-primary   { background: linear-gradient(135deg, #247b86, #7dd3d8); color: #031014; }
.btn-secondary { background: linear-gradient(135deg, #263844, #60717a); color: #f3fbfc; }
.btn-success   { background: linear-gradient(135deg, #15955b, #4ade80); color: #031014; }
.btn-danger    { background: linear-gradient(135deg, #c9324b, #ff5c70); color: #fff; }
.btn-warning   { background: linear-gradient(135deg, #c99222, #f4c95d); color: #151004; }
.btn-info      { background: linear-gradient(135deg, #247b86, #7dd3d8); color: #031014; }
.btn-light     { background: rgba(237,246,247,.92); color: #071016; }
.btn-dark      { background: rgba(4,12,17,.84); color: var(--text); border: 1px solid var(--stroke); }

.card {
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(73,167,255,.10), transparent 70%),
    linear-gradient(180deg, rgba(13,29,51,.78), rgba(7,18,34,.68));
  border-color: rgba(126,191,219,.20);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(73,167,255,.12), rgba(46,230,197,.04) 38%, rgba(5,14,28,.82)),
    rgba(5, 14, 28, .86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sidebar .nav-link {
  border: 1px solid transparent;
}

.sidebar .nav-link:hover {
  background: rgba(125,211,216,.09);
  border-color: rgba(190,214,225,.10);
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(125,211,216,.18), rgba(182,240,156,.08));
  border-color: rgba(125,211,216,.34);
  box-shadow: 0 0 0 3px rgba(125,211,216,.10);
}

.card-title {
  color: var(--muted);
  letter-spacing: .09em;
}

.card-text {
  line-height: 1.28;
}

.border-secondary { border-left-color: #80929a !important; }
.border-success   { border-left-color: var(--success) !important; }
.border-warning   { border-left-color: var(--warning) !important; }
.border-info      { border-left-color: var(--info) !important; }
.border-danger    { border-left-color: var(--danger) !important; }

@media (max-width: 768px) {
  main {
    padding: 72px 18px 7rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .app-hero,
  .notifications-hero {
    display: grid;
  }
}

/* Silengo panel shell - mockup aligned navbar and stats page */
.page {
  --page-y-inset: 20px;
  gap: 44px;
  padding: 10px 24px 10px 10px;
}

body.dark-theme,
body.light-theme {
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(73,167,255,0.16), transparent 62%),
    radial-gradient(760px 460px at 92% 16%, rgba(46,230,197,0.13), transparent 58%),
    radial-gradient(700px 520px at 45% 105%, rgba(194,107,255,0.10), transparent 58%),
    linear-gradient(180deg, var(--bg0), var(--bg1)) !important;
  color: var(--text) !important;
}

.sidebar {
  min-width: 280px;
  max-width: 280px;
  height: calc(100vh - 20px);
  margin: 0;
  padding: 26px 22px 18px;
  border-radius: 14px;
  background:
    radial-gradient(280px 180px at 26% 0%, rgba(46,230,197,.12), transparent 68%),
    linear-gradient(180deg, rgba(8,20,36,.92), rgba(4,14,26,.92));
  border: 1px solid rgba(126,191,219,.16);
  box-shadow: 0 26px 78px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.045);
  gap: 16px;
}

.sidebar-head {
  text-align: left;
  padding: 0 4px;
}

.brand-lockup {
  justify-content: flex-start !important;
  gap: 10px !important;
}

.brand-mark {
  width: 48px !important;
  height: 48px !important;
  font-size: 2rem !important;
  color: #20e8dc !important;
  filter: drop-shadow(0 0 15px rgba(32,232,220,.42)) !important;
}

.sidebar h4,
.sidebar-title {
  margin: 0 0 0 !important;
  color: #fff;
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  letter-spacing: 0;
}

.sidebar-badge {
  width: 100%;
  min-height: 54px;
  justify-content: space-between;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 13px !important;
  color: rgba(241,247,249,.92) !important;
  font-size: .94rem !important;
  background: rgba(5,18,34,.62) !important;
  border: 1px solid rgba(126,191,219,.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.sidebar-badge .dot {
  width: 9px !important;
  height: 9px !important;
  background: #37e68a !important;
  box-shadow: 0 0 14px rgba(55,230,138,.68) !important;
}

.sidebar .nav {
  margin-top: 18px !important;
  gap: 12px !important;
}

.sidebar .nav-link {
  min-height: 62px;
  padding: 0 18px !important;
  border-radius: 13px;
  color: rgba(234,241,246,.88);
  font-size: .99rem;
  font-weight: 800;
  gap: 16px;
  background: transparent;
  border: 1px solid transparent;
}

.sidebar .nav-link i {
  width: 24px;
  font-size: 1.36rem;
  color: rgba(184,201,214,.78);
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.22));
}

.sidebar .nav-link:hover {
  background: rgba(46,230,197,.07);
  border-color: rgba(46,230,197,.16);
  color: #fff;
}

.sidebar .nav-link.active {
  background:
    radial-gradient(110px 60px at 18% 50%, rgba(46,230,197,.24), transparent 72%),
    linear-gradient(135deg, rgba(15,118,130,.58), rgba(25,83,140,.48));
  border-color: rgba(46,230,197,.58);
  color: #fff;
  box-shadow: 0 15px 34px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08);
}

.sidebar .nav-link.active i {
  color: #fff;
}

.sidebar-separator {
  margin: 18px -22px !important;
  border: 0 !important;
  height: 1px !important;
  background: rgba(126,191,219,.12) !important;
}

.sidebar .mt-auto {
  border-top: 1px solid rgba(126,191,219,.12);
  margin: 0 -22px;
  padding: 18px 12px 0 !important;
  gap: 12px !important;
}

.disconnect-button {
  min-height: 62px;
  color: #ff6f80 !important;
  background: rgba(255,92,112,.06) !important;
  border-color: rgba(255,92,112,.28) !important;
}

.disconnect-button i {
  color: #ff6f80 !important;
}

.disconnect-button:hover {
  background: rgba(255,92,112,.12) !important;
  border-color: rgba(255,92,112,.40) !important;
}

main.stats-page {
  max-width: none;
  height: calc(100vh - var(--page-y-inset, 0px));
  max-height: calc(100vh - var(--page-y-inset, 0px));
  padding: 41px 0 7rem;
  overflow-y: auto;
}

.stats-page {
  display: block;
}

.stats-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
}

.stats-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.1rem, 3.35vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 12px 42px rgba(0,0,0,.55);
}

.stats-online-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  vertical-align: .22em;
  border-radius: 999px;
  background: #23d7d1;
  box-shadow: 0 0 16px rgba(35,215,209,.86);
}

.stats-subtitle {
  margin: 12px 0 0;
  color: rgba(218,229,237,.80);
  font-size: 1.08rem;
  font-weight: 500;
}

.stats-clock {
  min-width: 148px;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
  color: #fff;
  background: rgba(8, 20, 36, .68);
  border: 1px solid rgba(126,191,219,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.stats-clock i {
  color: #24e7df;
  font-size: 1.45rem;
}

.stats-clock strong,
.stats-clock small {
  display: block;
  line-height: 1.15;
}

.stats-clock strong {
  color: #24e7df;
  font-size: .98rem;
}

.stats-clock small {
  color: rgba(234,241,246,.82);
  font-size: .9rem;
}

.stats-live-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  margin-bottom: 24px;
  border-radius: 999px;
  color: #24e7df;
  background: rgba(20, 122, 154, .34);
  border: 1px solid rgba(46,230,197,.24);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.stats-live-pill:hover {
  color: #fff;
  border-color: rgba(46,230,197,.48);
  filter: brightness(1.05);
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  margin-bottom: 34px;
}

.stats-kpi-card {
  position: relative;
  min-height: 150px;
  display: flex;
  align-items: center;
  gap: 28px;
  overflow: hidden;
  padding: 28px 30px;
  border-radius: 16px;
  background:
    radial-gradient(340px 140px at 92% 10%, rgba(73,167,255,.12), transparent 70%),
    linear-gradient(180deg, rgba(11,27,48,.70), rgba(6,18,34,.70));
  border: 1px solid rgba(126,191,219,.18);
  box-shadow: 0 24px 62px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.stats-kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .55;
}

.stats-kpi-card-bars::after {
  right: 30px;
  left: auto;
  top: 26px;
  width: 190px;
  height: 92px;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(36,231,223,.10) 12% 16%, transparent 16% 23%, rgba(36,231,223,.22) 23% 28%, transparent 28% 35%, rgba(73,167,255,.42) 35% 41%, transparent 41% 48%, rgba(73,167,255,.32) 48% 54%, transparent 54% 62%, rgba(36,231,223,.55) 62% 68%, transparent 68% 76%, rgba(73,167,255,.35) 76% 82%, transparent 82% 90%, rgba(36,231,223,.50) 90% 96%, transparent 96%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(73,167,255,.10) 5px 6px);
  mask-image: linear-gradient(180deg, transparent 0 12%, #000 18% 100%);
}

.stats-kpi-card-shield::after {
  background:
    radial-gradient(280px 120px at 93% 50%, rgba(194,107,255,.13), transparent 70%),
    radial-gradient(circle at 82% 18%, rgba(194,107,255,.28) 1px, transparent 1.4px);
  background-size: auto, 22px 22px;
}

.stats-kpi-icon {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  flex: 0 0 80px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 2rem;
}

.stats-kpi-icon-cyan {
  color: #24e7df;
  background: rgba(36,231,223,.12);
  border: 1px solid rgba(36,231,223,.14);
}

.stats-kpi-icon-purple {
  color: #bd6dff;
  background: rgba(194,107,255,.15);
  border: 1px solid rgba(194,107,255,.16);
}

.stats-kpi-label,
.stats-kpi-value {
  position: relative;
  z-index: 1;
}

.stats-kpi-label {
  margin-bottom: 6px;
  color: rgba(190,203,221,.76);
  font-size: .84rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stats-kpi-value {
  color: #fff;
  font-size: 1.92rem;
  font-weight: 900;
  line-height: 1.13;
}

.stats-kpi-value small {
  display: block;
  margin-top: 4px;
  color: rgba(218,229,237,.66);
  font-size: .92rem;
  font-weight: 700;
}

.stats-kpi-state {
  color: #c56cff;
}

.stats-kpi-card.is-success .stats-kpi-state {
  color: #55f49a;
}

.stats-kpi-card.is-warning .stats-kpi-state {
  color: #f4c95d;
}

.stats-kpi-card.is-danger .stats-kpi-state {
  color: #ff6f80;
}

.stats-table-shell {
  overflow-x: auto;
  border-radius: 16px;
  background: rgba(7,20,36,.62);
  border: 1px solid rgba(126,191,219,.17);
  box-shadow: 0 24px 68px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.stats-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  color: #fff;
}

.stats-table thead {
  background: transparent !important;
}

.stats-table thead tr {
  background: transparent !important;
}

.stats-table th {
  padding: 29px 30px 24px !important;
  color: #24e7df !important;
  font-size: .84rem !important;
  font-weight: 850 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid rgba(126,191,219,.12) !important;
}

.stats-table td {
  padding: 23px 30px !important;
  color: rgba(255,255,255,.94);
  font-size: 1.02rem;
  border-bottom: 1px solid rgba(126,191,219,.105);
}

.stats-table tbody tr:last-child td {
  border-bottom: 0;
}

.stats-table tbody tr:hover {
  background: rgba(46,230,197,.035);
}

.stats-row-date {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

.stats-row-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 999px;
}

.stats-row-dot.is-ok {
  background: #37e68a;
  box-shadow: 0 0 18px rgba(55,230,138,.58);
}

.stats-row-dot.is-warning {
  background: #ffb33c;
  box-shadow: 0 0 18px rgba(255,179,60,.58);
}

.stats-status {
  display: inline-flex;
  align-items: center;
  min-height: 41px;
  padding: 0 17px;
  border-radius: 999px;
  font-weight: 850;
}

.stats-status.is-done {
  color: #55f49a;
  background: rgba(55,230,138,.12);
  border: 1px solid rgba(55,230,138,.20);
}

.stats-status.is-alert {
  color: #ffcf6a;
  background: rgba(255,179,60,.12);
  border: 1px solid rgba(255,179,60,.24);
}

.stats-replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  min-width: 202px;
  padding: 0 18px;
  border-radius: 12px;
  color: #b9fcff;
  background: rgba(9,67,91,.56);
  border: 1px solid rgba(36,231,223,.36);
  font-weight: 850;
}

.stats-replay-btn i {
  color: #24e7df;
}

.stats-replay-btn:hover {
  color: #fff;
  background: rgba(10,92,120,.66);
  border-color: rgba(36,231,223,.58);
}

.stats-unavailable {
  color: rgba(255,255,255,.74);
  font-style: italic;
}

.stats-empty {
  color: rgba(218,229,237,.70) !important;
  text-align: center;
}

.stats-listen-modal {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  max-width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.58);
  z-index: 1000;
}

.stats-listen-content {
  width: min(80%, 860px);
  padding: 22px;
  text-align: center;
}

.stats-modal-close {
  width: auto;
  margin-top: 20px;
  padding: 10px 22px;
}

@media (max-width: 992px) {
  .page {
    --page-y-inset: 0px;
    gap: 0;
    padding: 0;
  }

  main.stats-page {
    padding: 82px 18px 7rem;
  }

  .stats-header {
    display: grid;
    margin-bottom: 26px;
  }

  .stats-kpi-grid {
    grid-template-columns: 1fr;
  }

  .stats-clock {
    width: fit-content;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 280px;
    height: 100dvh;
    border-radius: 0 14px 14px 0;
    margin: 0;
  }

  .stats-title {
    font-size: 2.05rem;
  }

  .stats-kpi-card {
    min-height: 132px;
    padding: 22px;
    gap: 18px;
  }

  .stats-kpi-icon {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    font-size: 1.55rem;
  }

  /* Mobile tables: every row becomes a self-contained card. Desktop keeps the
     regular tabular layout through the mobile-only media query. */
  .stats-table-shell,
  .table-container {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .stats-table-shell table,
  .table-container table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }

  .stats-table-shell thead,
  .table-container thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .stats-table-shell tbody,
  .table-container tbody {
    display: grid;
    gap: 14px;
  }

  .stats-table-shell tbody tr,
  .table-container tbody tr {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(126,191,219,.17) !important;
    border-radius: 15px;
    background: rgba(7,20,36,.72);
    box-shadow: 0 14px 34px rgba(0,0,0,.2);
  }

  .stats-table-shell tbody td,
  .table-container tbody td {
    display: grid;
    grid-template-columns: minmax(82px, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100% !important;
    min-width: 0;
    padding: 12px 14px !important;
    text-align: right !important;
    overflow-wrap: anywhere;
    border-bottom: 1px solid rgba(126,191,219,.10) !important;
  }

  .stats-table-shell tbody td:last-child,
  .table-container tbody td:last-child {
    border-bottom: 0 !important;
  }

  .stats-table-shell tbody td::before,
  .table-container tbody td::before {
    content: attr(data-label);
    color: #24e7df;
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .055em;
    line-height: 1.25;
    text-align: left;
    text-transform: uppercase;
  }

  .stats-table-shell .stats-row-date,
  .table-container td > * {
    min-width: 0;
    max-width: 100%;
  }

  .stats-table-shell .stats-row-date {
    justify-self: end;
    white-space: normal;
    text-align: right;
  }

  .stats-table-shell .stats-replay-btn,
  .table-container .btn {
    justify-self: end;
    max-width: 100%;
  }
}


main {
  padding-top: 41px;
}

main:not(.stats-page) > .page-title,
main:not(.stats-page) .page-title,
main:not(.stats-page) h1,
.page-header .page-title,
.app-hero h1,
.notifications-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.05rem, 3.3vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 12px 42px rgba(0,0,0,.55);
}

.page-subtitle,
.dashboard-subtitle,
.app-hero p,
.notifications-hero p {
  margin: 12px 0 0;
  color: rgba(218,229,237,.80);
  font-size: 1.08rem;
  font-weight: 500;
}

.page-header,
.app-hero,
.notifications-hero {
  max-width: none;
  margin: 0 0 34px;
}

.app-hero,
.notifications-hero {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

main > .row,
.dashboard-page > .row {
  max-width: none;
}

.card:not(.plain-card) {
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 28px 30px 28px 138px;
  border-radius: 16px;
  background:
    radial-gradient(340px 140px at 92% 10%, rgba(73,167,255,.12), transparent 70%),
    linear-gradient(180deg, rgba(11,27,48,.70), rgba(6,18,34,.70));
  border: 1px solid rgba(126,191,219,.18) !important;
  border-left: 1px solid rgba(126,191,219,.18) !important;
  box-shadow: 0 24px 62px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card:not(.plain-card)::before {
  content: "\f201";
  position: absolute;
  z-index: 1;
  left: 30px;
  top: 50%;
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transform: translateY(-50%);
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 2rem;
  color: #24e7df;
  background: rgba(36,231,223,.12);
  border: 1px solid rgba(36,231,223,.14);
}

.card:not(.plain-card)::after,
.app-surface::after,
.app-list-item::after,
.notification-rule::after,
.form-container::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .50;
  background:
    radial-gradient(280px 120px at 93% 50%, rgba(46,230,197,.10), transparent 70%),
    radial-gradient(circle at 82% 18%, rgba(46,230,197,.30) 1px, transparent 1.4px);
  background-size: auto, 22px 22px;
}

.card:not(.plain-card) .card-title,
.card:not(.plain-card) .card-text {
  position: relative;
  z-index: 2;
}

.card-title {
  margin-bottom: 6px;
  color: rgba(190,203,221,.76);
  font-size: .84rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.card-text {
  color: #fff;
  font-size: 1.72rem;
  font-weight: 900;
  line-height: 1.13;
}

.card-text p,
.card-text li,
.card-text small,
.card-text txt {
  color: rgba(234,241,246,.86);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.45;
}

.card-text p:first-child {
  color: #fff;
  font-size: 1.55rem !important;
  font-weight: 900 !important;
}

.card-hover:hover,
.card:not(.plain-card):hover {
  transform: translateY(-2px);
  border-color: rgba(46,230,197,.30) !important;
  box-shadow: 0 28px 72px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.055);
}

.card.border-success:not(.plain-card)::before,
.card.is-success:not(.plain-card)::before {
  content: "\f058";
  color: #55f49a;
  background: rgba(55,230,138,.12);
  border-color: rgba(55,230,138,.20);
}

.card.border-warning:not(.plain-card)::before,
.card.is-warning:not(.plain-card)::before {
  content: "\f0ac";
  color: #ffcf6a;
  background: rgba(255,179,60,.12);
  border-color: rgba(255,179,60,.24);
}

.card.border-info:not(.plain-card)::before {
  content: "\f57d";
  color: #49a7ff;
  background: rgba(73,167,255,.13);
  border-color: rgba(73,167,255,.22);
}

.card.border-danger:not(.plain-card)::before,
.card.is-danger:not(.plain-card)::before {
  content: "\f071";
  color: #ff6f80;
  background: rgba(255,92,112,.13);
  border-color: rgba(255,92,112,.24);
}

#cpu-stats-color::before {
  content: "\f625";
}

#storage-stats-color::before {
  content: "\f1c0";
}

#ram-stats-color::before {
  content: "\f2db";
}

#process-stats-color::before {
  content: "\f013";
}

.plain-card {
  border-radius: 16px;
}

.plain-card .card-title {
  color: #24e7df;
}

.table-container {
  margin-top: 34px !important;
  overflow-x: auto;
  border-radius: 16px;
  background: rgba(7,20,36,.62);
  border: 1px solid rgba(126,191,219,.17);
  box-shadow: 0 24px 68px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.table-container > table,
.table-container table {
  width: 100% !important;
  min-width: 760px;
  border-collapse: collapse !important;
  color: #fff !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.table-container thead,
.table-container thead tr {
  background: transparent !important;
}

.table-container th {
  padding: 29px 30px 24px !important;
  color: #24e7df !important;
  font-size: .84rem !important;
  font-weight: 850 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase !important;
  text-align: left !important;
  border-bottom: 1px solid rgba(126,191,219,.12) !important;
}

.table-container td {
  padding: 20px 30px !important;
  color: rgba(255,255,255,.92) !important;
  font-size: 1rem;
  border-bottom: 1px solid rgba(126,191,219,.105) !important;
}

.table-container tbody tr:hover {
  background: rgba(46,230,197,.035) !important;
}

.table-container img {
  border: 1px solid rgba(126,191,219,.18);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}

.table-container .btn,
.modal-footer .btn,
.card .btn {
  width: auto;
  min-height: 38px;
  margin-top: 0;
  padding: .5rem .85rem;
  border-radius: 12px;
  font-size: .9rem;
}

.table-container .btn.w-100 {
  width: 100% !important;
}

.app-surface,
.app-list-item,
.notification-rule,
.form-container {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(340px 140px at 92% 10%, rgba(73,167,255,.10), transparent 70%),
    linear-gradient(180deg, rgba(11,27,48,.68), rgba(6,18,34,.68));
  border: 1px solid rgba(126,191,219,.18);
  box-shadow: 0 24px 62px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.045);
}

.app-surface > *,
.app-list-item > *,
.form-container > * {
  position: relative;
  z-index: 2;
}

.notification-rule {
  padding: 1.15rem 1.25rem 1.15rem 5.4rem;
}

.notification-rule::before {
  content: "\f0f3";
  position: absolute;
  left: 1.25rem;
  top: 50%;
  z-index: 1;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transform: translateY(-50%);
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #24e7df;
  background: rgba(36,231,223,.12);
  border: 1px solid rgba(36,231,223,.14);
}

.rule-name,
.rule-meta,
.rule-chip-row,
.notification-rule-actions {
  position: relative;
  z-index: 2;
}

.btn-light,
.stats-live-pill,
main:not(.stats-page) > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  color: #24e7df !important;
  background: rgba(20, 122, 154, .34) !important;
  border: 1px solid rgba(46,230,197,.24) !important;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.btn-light:hover,
main:not(.stats-page) > .btn:hover {
  color: #fff !important;
  border-color: rgba(46,230,197,.48) !important;
}

.menu-center {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  justify-content: stretch;
  align-items: stretch;
}

.menu-center-child {
  width: 100%;
}

.menu-center .card {
  width: 100% !important;
  min-height: 220px;
  padding: 26px !important;
  align-items: center;
  text-align: center;
}

.menu-center .card::before {
  display: none !important;
}

.menu-center .card .card-text {
  width: 100%;
}

.station-select-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.station-select-grid .card {
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 14px !important;
}

.station-select-grid .card .card-text {
  display: grid;
  place-items: center;
  height: 100%;
}

.station-select-grid .radio-icon {
  width: auto;
  height: 70px;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 575.98px) {
  .station-select-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .station-select-grid .card {
    min-height: 115px;
    padding: 12px !important;
  }

  .station-select-grid .radio-icon {
    height: 58px;
  }
}

.station-category-separator {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 0;
  color: #24e7df;
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.station-category-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(126,191,219,.18);
}

.notification-panel.card {
  min-height: 0;
  display: block;
  padding: 1.25rem;
}

.notification-panel.card::before {
  display: none;
}

.notification-panel.card .card-title,
.notification-panel.card .card-text {
  margin-left: 0;
}

.dash-card.card,
.modal-content.card {
  min-height: 0 !important;
  display: block !important;
  padding: 0 !important;
}

.dash-card.card::before,
.modal-content.card::before {
  display: none !important;
}

.dash-card.card::after,
.modal-content.card::after {
  opacity: .28;
}

.dash-card .card-header {
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,.025) !important;
  border-bottom: 1px solid rgba(126,191,219,.12) !important;
  color: #fff !important;
  padding: 1.05rem 1.25rem !important;
}

.dash-card .card-body {
  position: relative;
  z-index: 2;
  padding: 1.25rem !important;
}

.page-head {
  margin-bottom: 34px !important;
}

.page-head .page-title {
  font-size: clamp(2.05rem, 3.3vw, 3rem) !important;
  font-weight: 900 !important;
}

.page-head .page-sub {
  margin: 12px 0 0 !important;
  color: rgba(218,229,237,.80) !important;
  font-size: 1.08rem !important;
}

.pill {
  min-height: 41px !important;
  padding: 0 17px !important;
  border-radius: 999px !important;
  font-weight: 850 !important;
  background: rgba(7,20,36,.62) !important;
  border: 1px solid rgba(126,191,219,.17) !important;
}

.meta-item {
  border-radius: 12px !important;
  background: rgba(6,18,34,.54) !important;
  border: 1px solid rgba(126,191,219,.14) !important;
}

.radio-icon {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 20px 34px rgba(0,0,0,.34));
}

@media (max-width: 768px) {
  main:not(.stats-page) {
    padding-top: 82px;
  }

  .card:not(.plain-card) {
    min-height: 132px;
    padding: 22px 22px 22px 104px;
  }

  .card:not(.plain-card)::before {
    left: 22px;
    width: 64px;
    height: 64px;
    font-size: 1.55rem;
  }

  .notification-rule {
    padding: 1rem;
  }

  .notification-rule::before {
    display: none;
  }
}

/* Auth pages */
body.auth-page {
  align-items: center;
  justify-content: center;
  overflow: auto !important;
  padding: 28px;
}

.auth-shell {
  width: min(100%, 980px);
  display: grid;
  place-items: center;
  position: relative;
}

.auth-shell::before {
  content: "";
  position: absolute;
  width: min(72vw, 640px);
  height: min(72vw, 640px);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(46,230,197,.18), transparent 62%);
  filter: blur(12px);
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  max-width: 500px;
  padding: 36px;
}

.auth-eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-align: center;
  text-transform: uppercase;
}

.auth-instance {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
  text-align: center;
}

.auth-subtitle {
  margin: -6px 0 22px;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: rgba(237,246,247,.82);
  font-size: .92rem;
  font-weight: 800;
}

.auth-form input {
  margin: 0;
  padding: 14px 15px;
  background: rgba(2, 7, 20, .58);
  border-color: rgba(126,191,219,.24);
}

.auth-form button {
  margin-top: 4px;
  min-height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
}

.auth-links {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
  font-size: .92rem;
  font-weight: 750;
}

.auth-links a,
.success a {
  color: var(--accent);
}

@media (max-width: 560px) {
  body.auth-page { padding: 16px; }
  .auth-card { padding: 26px 20px; }
}

/* Compact desktop density
   Keep text and touch targets readable while showing more useful content. */
@media (min-width: 769px) {
  .page {
    --page-y-inset: 16px;
    gap: 24px;
    padding: 8px 16px 8px 8px;
  }

  .sidebar {
    min-width: 240px;
    max-width: 240px;
    height: calc(100vh - 16px);
    padding: 18px 14px 14px;
    gap: 10px;
  }

  .sidebar-head { padding: 0 4px; }
  .brand-mark {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.55rem !important;
  }
  .sidebar h4,
  .sidebar-title { font-size: 1.28rem !important; }
  .sidebar-badge {
    min-height: 42px;
    padding: 0 11px !important;
    font-size: .82rem !important;
  }
  .sidebar .nav {
    margin-top: 8px !important;
    gap: 5px !important;
  }
  .sidebar .nav-link {
    min-height: 44px;
    padding: 0 12px !important;
    gap: 11px;
    font-size: .88rem;
  }
  .sidebar .nav-link i {
    width: 20px;
    font-size: 1.05rem;
  }
  .sidebar-separator { margin: 10px -14px !important; }
  .sidebar .mt-auto {
    margin: 0 -14px;
    padding: 10px 8px 0 !important;
    gap: 5px !important;
  }
  .disconnect-button { min-height: 44px; }

  main,
  main.stats-page { padding-top: 24px; }
  main.stats-page { padding-bottom: 4rem; }

  main:not(.stats-page) > .page-title,
  main:not(.stats-page) .page-title,
  main:not(.stats-page) h1,
  .page-header .page-title,
  .app-hero h1,
  .notifications-hero h1,
  .stats-title {
    font-size: clamp(1.65rem, 2.4vw, 2.25rem);
  }
  .page-subtitle,
  .dashboard-subtitle,
  .app-hero p,
  .notifications-hero p,
  .stats-subtitle {
    margin-top: 7px;
    font-size: .94rem;
  }
  .page-header,
  .app-hero,
  .notifications-hero { margin-bottom: 22px; }
  .stats-header { margin-bottom: 24px; }
  .stats-clock {
    min-width: 132px;
    min-height: 48px;
    padding: 7px 12px;
  }
  .stats-live-pill { margin-bottom: 16px; }

  .card:not(.plain-card) {
    min-height: 112px;
    padding: 18px 20px 18px 94px;
  }
  .card:not(.plain-card)::before {
    left: 20px;
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }
  .card-title { font-size: .76rem; }
  .card-text { font-size: 1.38rem; }
  .card-text p:first-child { font-size: 1.3rem !important; }
  .card-text p,
  .card-text li,
  .card-text small,
  .card-text txt { font-size: .9rem; }

  .stats-kpi-grid {
    gap: 16px;
    margin-bottom: 22px;
  }
  .stats-kpi-card {
    min-height: 112px;
    gap: 18px;
    padding: 18px 20px;
  }
  .stats-kpi-icon {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    font-size: 1.4rem;
  }
  .stats-kpi-value { font-size: 1.5rem; }

  .stats-table th,
  .table-container th { padding: 16px 20px 13px !important; }
  .stats-table td,
  .table-container td {
    padding: 13px 20px !important;
    font-size: .9rem;
  }
  .stats-row-date { gap: 11px; }
  .stats-status {
    min-height: 32px;
    padding: 0 12px;
  }
  .stats-replay-btn {
    min-width: 156px;
    min-height: 38px;
    gap: 8px;
    padding: 0 13px;
  }
  .table-container { margin-top: 22px !important; }

  .form-container { padding: 22px 26px; }
  .auth-card { padding: 28px; }
  .auth-form { gap: 11px; }
  .auth-form input { padding: 11px 13px; }
  .auth-form button { min-height: 44px; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 252px;
    min-width: 252px;
    max-width: 252px;
    padding: 18px 14px 14px;
    gap: 10px;
  }
  .brand-mark {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.5rem !important;
  }
  .sidebar h4,
  .sidebar-title { font-size: 1.28rem !important; }
  .sidebar-badge { min-height: 42px; }
  .sidebar .nav {
    margin-top: 8px !important;
    gap: 5px !important;
  }
  .sidebar .nav-link {
    min-height: 48px;
    padding: 0 13px !important;
    gap: 11px;
    font-size: .9rem;
  }
  .sidebar .nav-link i { font-size: 1.08rem; }
  .sidebar-separator { margin: 10px -14px !important; }
  .sidebar .mt-auto {
    margin: 0 -14px;
    padding: 10px 8px 0 !important;
    gap: 5px !important;
  }
  .disconnect-button { min-height: 48px; }

  .card:not(.plain-card) {
    min-height: 116px;
    padding: 18px 18px 18px 88px;
  }
  .card:not(.plain-card)::before {
    left: 18px;
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
  }
  .stats-kpi-card {
    min-height: 116px;
    padding: 18px;
  }
  .stats-kpi-icon {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    font-size: 1.3rem;
  }
}
.silengo-language-switcher{position:fixed;right:14px;bottom:14px;z-index:9999;display:flex;padding:3px;gap:2px;border:1px solid rgba(190,214,225,.2);border-radius:10px;background:#071016;box-shadow:0 8px 25px rgba(0,0,0,.3);font:600 12px/1 system-ui,sans-serif}
.silengo-language-switcher a{border-radius:7px;padding:8px 9px;color:rgba(241,247,249,.65);text-decoration:none}
.silengo-language-switcher a[aria-current="true"]{background:#7dd3d8;color:#071016}
.silengo-language-switcher a:focus-visible{outline:2px solid #b6f09c;outline-offset:2px}

/* ==========================================================================
   SILENGO PROFESSIONAL UI — 2026
   A restrained operations-console layer shared by every legacy PHP screen.
   ========================================================================== */
:root {
  --bg0: #050505;
  --bg1: #050505;
  --surface: #0b0b0b;
  --surface-strong: #0d0d0d;
  --surface-muted: #111111;
  --stroke: #242424;
  --stroke-strong: #383838;
  --sidebar-bg: #070707;
  --sidebar-stroke: #202020;
  --text: #f2f2f2;
  --muted: #a1a1aa;
  --muted2: #71717a;
  --accent: #f4f4f5;
  --accent-2: #d4d4d8;
  --accent-3: #a1a1aa;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #60a5fa;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --shadow: none;
  --shadow-soft: none;
}

body,
body.dark-theme,
body.light-theme {
  background: var(--bg0);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

body:not(.page-loaded)::before {
  background: var(--bg0);
}
body:not(.page-loaded)::after {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-width: 2px;
  border-color: #292929;
  border-top-color: #fafafa;
  box-shadow: none;
}

/* Keep the loading state inside the page content instead of covering navigation. */
@media (min-width: 768px) {
  body:has(.sidebar):not(.page-loaded)::before {
    left: 240px;
  }

  body:has(.sidebar):not(.page-loaded)::after {
    left: calc(240px + (100vw - 240px) / 2);
  }
}

@media (max-width: 767.98px) {
  body:has(.mobile-bottom-nav):not(.page-loaded)::before {
    bottom: calc(var(--mobile-nav-height, 76px) + env(safe-area-inset-bottom, 0px));
  }

  body:has(.mobile-bottom-nav):not(.page-loaded)::after {
    top: calc((100dvh - var(--mobile-nav-height, 76px) - env(safe-area-inset-bottom, 0px)) / 2);
  }
}

.page {
  --page-y-inset: 0px;
  gap: 0;
  padding: 0;
}

main,
main.stats-page {
  height: 100vh;
  max-height: 100vh;
  padding: 26px 30px 48px;
  scrollbar-color: #303030 transparent;
}

main::-webkit-scrollbar { width: 8px; }
main::-webkit-scrollbar-thumb { background: #303030; border: 2px solid #050505; }

.page-header,
.stats-header {
  margin: 0 0 24px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--stroke);
  background: transparent;
}

main h1,
main:not(.stats-page) h1,
main:not(.stats-page) .page-title,
.page-header .page-title,
.stats-title {
  color: #fafafa;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.035em;
  text-shadow: none;
}

.dashboard-subtitle,
.stats-subtitle,
.page-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: .86rem;
}

/* Surfaces */
.card,
.card:not(.plain-card),
.stats-kpi-card,
.stats-table-shell,
.table-container,
.notification-panel,
.form-container,
.modal-content,
.plain-card,
.channel-card,
.subscribe-plan {
  background: var(--surface);
  border: 1px solid var(--stroke) !important;
  border-radius: var(--r-lg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card,
.card:not(.plain-card) {
  min-height: 118px;
  padding: 20px;
}

.card::before,
.card::after,
.card:not(.plain-card)::before,
.card:not(.plain-card)::after,
.stats-kpi-card::after {
  display: none !important;
}

.card-hover:hover,
.card:not(.plain-card):hover,
.stats-kpi-card:hover,
.channel-card:hover {
  transform: none;
  border-color: var(--stroke-strong) !important;
  box-shadow: none;
}

.card-title,
.stats-kpi-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .085em;
  text-transform: uppercase;
}

.card-text,
.stats-kpi-value {
  color: #fafafa;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.12;
}

.border-secondary { border-color: var(--stroke) !important; }
.border-success { border-color: rgba(34,197,94,.42) !important; }
.border-warning { border-color: rgba(245,158,11,.45) !important; }
.border-danger { border-color: rgba(239,68,68,.48) !important; }
.border-info { border-color: rgba(96,165,250,.42) !important; }

/* Tables */
.stats-table-shell,
.table-container {
  margin-top: 16px;
  overflow: hidden;
}

.stats-table,
.table-container table,
table.table {
  width: 100%;
  color: var(--text);
  background: transparent;
  border-collapse: collapse;
}

.stats-table th,
.table-container th,
table.table th {
  padding: 12px 16px;
  color: #a1a1aa;
  background: #090909;
  border-bottom: 1px solid var(--stroke);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stats-table td,
.table-container td,
table.table td {
  padding: 13px 16px;
  color: #d4d4d8;
  background: transparent;
  border-bottom: 1px solid #1b1b1b;
  font-size: .82rem;
  vertical-align: middle;
}

.stats-table tbody tr:hover td,
.table-container tbody tr:hover td,
table.table tbody tr:hover td { background: #0f0f0f; }

.stats-status,
.badge {
  min-height: 0;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}
.stats-status.is-done { color: var(--success); background: rgba(34,197,94,.08); }
.stats-status.is-alert { color: var(--warning); background: rgba(245,158,11,.08); }

/* Controls */
input.form-control,
form input,
form select,
form textarea,
.form-control,
.form-select,
select,
textarea {
  min-height: 40px;
  padding: 9px 11px;
  color: #e4e4e7;
  background: #101010;
  border: 1px solid #292929;
  border-radius: var(--r-md);
  box-shadow: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.form-control:focus {
  color: #fafafa;
  background: #121212;
  border-color: #525252;
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.09);
}

.form-label,
label { color: #d4d4d8; font-size: .78rem; font-weight: 600; }
.form-help,
.form-hint { color: var(--muted2); font-size: .75rem; }

.btn,
form button,
.ext-button,
#play-btn,
.stats-replay-btn {
  width: auto;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #303030;
  border-radius: var(--r-md);
  color: #e4e4e7;
  background: #141414;
  box-shadow: none;
  font-size: .78rem;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover,
form button:hover,
.ext-button:hover,
#play-btn:hover,
.stats-replay-btn:hover {
  transform: none;
  color: #fff;
  background: #1c1c1c;
  border-color: #454545;
  filter: none;
  box-shadow: none;
}

.btn-primary,
form button.btn-primary {
  color: #090909;
  background: #fafafa;
  border-color: #fafafa;
}
.btn-primary:hover { color: #090909; background: #d4d4d8; border-color: #d4d4d8; }
.btn-success { color: #4ade80; background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.28); }
.btn-warning { color: #fbbf24; background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.28); }
.btn-danger { color: #f87171; background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.3); }
.btn-info { color: #93c5fd; background: rgba(96,165,250,.08); border-color: rgba(96,165,250,.28); }

/* Dialogs and notices */
.modal { background: rgba(0,0,0,.78); backdrop-filter: blur(3px); }
.modal-content { color: var(--text); }
.modal-header,
.modal-footer { border-color: var(--stroke); }
.alert,
.error,
.error-message,
.success {
  border-width: 1px;
  border-left-width: 2px;
  border-radius: var(--r-md);
  box-shadow: none;
}

/* Authentication */
.auth-page { background: var(--bg0); }
.auth-card,
.form-container { padding: 28px; }
.auth-eyebrow { color: var(--muted); letter-spacing: .12em; }
.auth-card::before,
.auth-card::after { display: none; }

.auth-form button[type="submit"],
.auth-form button[type="submit"]:hover,
.auth-form button[type="submit"]:focus-visible {
  color: #090909;
  background: #fafafa;
  border-color: #fafafa;
}

.auth-form button[type="submit"]:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.silengo-language-switcher {
  padding: 3px;
  border-color: var(--stroke);
  border-radius: 8px;
  background: #0b0b0b;
  box-shadow: none;
}
.silengo-language-switcher a { color: var(--muted); }
.silengo-language-switcher a[aria-current="true"] { color: #090909; background: #fafafa; }

@media (max-width: 768px) {
  main,
  main.stats-page { padding: max(12px, env(safe-area-inset-top, 0px)) 16px 32px !important; }
  .page-header,
  .stats-header { margin-bottom: 18px; padding-bottom: 15px; }
  .card:not(.plain-card) { min-height: 104px; padding: 17px; }
  .card-text,
  .stats-kpi-value { font-size: 1.4rem; }
  .stats-table-shell,
  .table-container { border: 0 !important; background: transparent; overflow: visible; }
  .stats-table tbody tr,
  .table-container tbody tr { margin-bottom: 8px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--surface); }

  /* Compact mobile records: two field summaries per row instead of one tall
     full-width line per cell. Labels remain visible above their values. */
  .stats-table-shell,
  .table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .stats-table-shell tbody,
  .table-container tbody {
    gap: 8px;
  }

  .stats-table-shell tbody tr,
  .table-container tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
  }

  .stats-table-shell tbody td,
  .table-container tbody td {
    display: flex;
    min-width: 0;
    padding: 9px 11px !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    text-align: left !important;
    border-bottom: 1px solid #1b1b1b !important;
  }

  .stats-table-shell tbody td:nth-child(odd),
  .table-container tbody td:nth-child(odd) {
    border-right: 1px solid #1b1b1b !important;
  }

  .stats-table-shell tbody td::before,
  .table-container tbody td::before {
    color: var(--muted2);
    font-size: .61rem;
    font-weight: 600;
    letter-spacing: .07em;
    line-height: 1.15;
  }

  .stats-table-shell .stats-row-date,
  .table-container td > * {
    justify-self: auto;
    max-width: 100%;
    text-align: left;
  }

  .stats-table-shell .stats-row-date {
    gap: 7px;
    white-space: normal;
  }

  .stats-table-shell .stats-row-dot {
    width: 8px;
    height: 8px;
    flex-basis: 8px;
  }

  .stats-table-shell .stats-replay-btn,
  .table-container .btn {
    justify-self: auto;
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 6px 9px;
  }
}
