/* ======================================================
   Modern Dashboard UI (Light + Soft Pastel)
   Bootstrap 5 friendly
   ====================================================== */

:root{
  --bg1:#EAF7F1;
  --bg2:#EEF2FF;
  --panel:#FFFFFF;
  --panel2:#F7F8FF;
  --text:#0F172A;     /* slate-900 */
  --muted:#64748B;    /* slate-500 */
  --muted2:#94A3B8;   /* slate-400 */
  --border:rgba(15,23,42,.10);
  --shadow: 0 14px 30px rgba(15,23,42,.08);
  --shadow2: 0 10px 22px rgba(15,23,42,.06);
  --radius:18px;
  --radius-sm:14px;
  --accent:#5B6CFF;
  --accent2:#7C5CFF;
  --ring: 0 0 0 .25rem rgba(91,108,255,.18);
}

html, body{ height:100%; }

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 20% 0%, rgba(91,108,255,.14), transparent 55%),
    radial-gradient(1100px 700px at 90% 15%, rgba(34,197,94,.10), transparent 60%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ----- Links ----- */
a{ text-decoration:none; color: inherit; }
a:hover{ color: inherit; }

/* ----- Small muted helper (used all over your pages) ----- */
.small-muted{ color: var(--muted) !important; font-size:.92rem; }

/* ======================================================
   App Shell
   ====================================================== */

.app-shell{
  min-height:100vh;
  display:flex;
  gap: 18px;
  padding: 18px;
}

.app-sidebar{
  width: 270px;
  flex: 0 0 270px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.65);
  backdrop-filter: blur(10px);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  display:flex;
  flex-direction:column;
}

.brand{
  padding: 6px 8px 14px;
  display:flex;
  align-items:center;
  gap: 12px;
}


.brand-icon{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:800;
  letter-spacing:.4px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 18px rgba(91,108,255,.18);
}

.app-main{
  flex: 1 1 auto;
  min-width: 0;
}
/* If you place an image inside .brand-icon */
.brand-icon .brand-logo{
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  padding: 6px;
}


/* ======================================================
   Navigation
   ====================================================== */

.app-nav{ display:flex; flex-direction:column; gap: 6px; }

.navlink{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: rgba(15,23,42,.78);
  border: 1px solid transparent;
  transition: background .12s ease, transform .12s ease, border-color .12s ease;
}

.navlink i{ font-size: 1.05rem; color: rgba(15,23,42,.55); }

.navlink:hover{
  background: rgba(91,108,255,.08);
  border-color: rgba(91,108,255,.14);
  transform: translateY(-1px);
}

.navlink.active{
  background: linear-gradient(135deg, rgba(91,108,255,.18), rgba(124,92,255,.10));
  border-color: rgba(91,108,255,.22);
  color: rgba(15,23,42,.92);
}

.navlink.active i{ color: rgba(91,108,255,.95); }

.navlink.danger:hover{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.20);
}

.nav-sep{ height: 1px; background: rgba(15,23,42,.08); margin: 10px 0; }

.dev-tools-box{ padding: 4px 0 0; }


.sidebar-card{
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(91,108,255,.12), rgba(34,197,94,.08));
  border: 1px solid rgba(15,23,42,.08);
}

/* ======================================================
   Topbar
   ====================================================== */

.app-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.65);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow2);
}

.page-title{ font-weight: 750; letter-spacing: .2px; }

.btn-icon{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.85);
  display:grid;
  place-items:center;
}

.btn-icon:hover{ background: rgba(91,108,255,.08); border-color: rgba(91,108,255,.18); }

.topbar-search{
  position: relative;
  flex: 1 1 520px;
  max-width: 640px;
}

.topbar-search i{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(15,23,42,.45);
}

.topbar-search .form-control{
  padding-left: 40px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.10);
}

.topbar-search .form-control:focus{ box-shadow: var(--ring); border-color: rgba(91,108,255,.35); }

.user-pill{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.85);
}

.avatar{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-weight: 800;
  color:#fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.user-name{ font-weight: 700; line-height: 1.05; }

/* ======================================================
   LIVE / Status helpers
   ====================================================== */

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70%  { box-shadow: 0 0 0 12px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.pulse-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display:inline-block;
  vertical-align: middle;
  background: rgba(34,197,94,1);
}

.pulse-dot.is-live{
  animation: livePulse 1.6s infinite;
}

.row-live{
  position: relative;
}

.row-live td:first-child{
  position: relative;
}

.status-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
}

.badge-soft{
  background: rgba(91,108,255,.12);
  border: 1px solid rgba(91,108,255,.18);
  color: rgba(15,23,42,.92);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 650;
  font-size: .82rem;
}

.ip-masked{
  color: rgba(15,23,42,.65);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.ip-masked:hover{
  color: rgba(91,108,255,.95);
}


/* ======================================================
   Content + Cards
   ====================================================== */

.app-content{ margin-top: 14px; }

.card{
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow2);
}

.card .card-body{ padding: 1rem; }

.badge{ border-radius: 999px; padding: .35rem .6rem; font-weight: 700; }

.badge-soft{
  background: rgba(91,108,255,.10);
  border: 1px solid rgba(91,108,255,.16);
  color: rgba(15,23,42,.78);
}

.btn{
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.10);
}

.btn-outline-light{
  border-color: rgba(15,23,42,.12) !important;
  color: rgba(15,23,42,.80) !important;
  background: rgba(255,255,255,.70);
}
.btn-outline-light:hover{
  background: rgba(91,108,255,.10) !important;
  border-color: rgba(91,108,255,.20) !important;
}

.btn-light{
  background: linear-gradient(135deg, rgba(91,108,255,.18), rgba(124,92,255,.10)) !important;
  border-color: rgba(91,108,255,.22) !important;
}

.form-control, .form-select{
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.92);
  color: rgba(15,23,42,.92);
}
.form-control::placeholder{ color: rgba(15,23,42,.40); }
.form-control:focus, .form-select:focus{
  box-shadow: var(--ring);
  border-color: rgba(91,108,255,.35);
}

/* Tables */
.table{ color: rgba(15,23,42,.92); }
.table > :not(caption) > * > *{ border-bottom-color: rgba(15,23,42,.08); }
.table thead th{ color: rgba(15,23,42,.70); border-bottom-color: rgba(15,23,42,.12); }
.table-hover tbody tr:hover{ background: rgba(91,108,255,.06); }

/* List groups (recent lists) */
.list-group{ gap: .55rem; }
.list-group-flush{ gap: .55rem; }
.list-group-item{
  border: 1px solid rgba(15,23,42,.10) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.92) !important;
  color: rgba(15,23,42,.92) !important;
  transition: transform .10s ease, background .10s ease, border-color .10s ease;
}
.list-group-item:hover{
  transform: translateY(-1px);
  background: rgba(91,108,255,.06) !important;
  border-color: rgba(91,108,255,.18) !important;
}

/* Offcanvas (mobile nav) */
.app-offcanvas{
  background: rgba(255,255,255,.92);
  border-right: 1px solid rgba(15,23,42,.10);
}
.app-offcanvas .offcanvas-header{ border-bottom: 1px solid rgba(15,23,42,.08); }

/* Make Bootstrap "bg-black" not ruin the light theme on legacy cards */
.bg-black{ background: transparent !important; }

/* Responsive tweaks */
@media (max-width: 991.98px){
  .app-shell{ padding: 14px; }
  .app-topbar{ border-radius: 18px; }
}

/* Pre blocks */
pre{
  margin:0;
  border-radius: 16px;
  padding: .9rem 1rem;
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.08);
  overflow:auto;
}

.tacho-preview{
  background: rgba(15,23,42,.04) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  color: rgba(15,23,42,.92) !important;

  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
               Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.4;

  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================
   DEV TOOLS LOCK NOTICE
   ========================= */

.dev-lock-hint{
  margin: 6px 6px 10px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: .9rem;
  color: rgba(15,23,42,.78);
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.12);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dev-lock-hint i{
  margin-top: 6px;
  color: rgba(15,23,42,.65);
}

.dev-lock-hint a{
  color: rgba(91,108,255,.95);
  font-weight: 700;
  text-decoration: none;
}

.dev-lock-hint a:hover{
  text-decoration: underline;
}
