/* =====================================================================
   Sathubs NOC: dark navy theme
   (works on top of Bootstrap 5.3 with data-bs-theme="dark")
   ===================================================================== */
:root, :root[data-bs-theme="dark"] {
  --noc-bg: #060a13;
  --noc-bg2: #0a1120;
  --noc-panel: #0e1729;
  --noc-panel2: #131f36;
  --noc-line: rgba(130, 160, 210, .15);
  --noc-text: #e7eefb;
  --noc-muted: #8a9bb8;
  --noc-accent: #3b82f6;
  --noc-accent2: #22d3ee;
  --noc-green: #22c55e;
  --noc-red: #f4585b;
  --noc-amber: #f5a524;
  --sidebar-w: 252px;

  --bs-body-bg: var(--noc-bg);
  --bs-body-color: var(--noc-text);
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-secondary-color: rgba(138, 155, 184, .95);
  --bs-secondary-bg: var(--noc-panel2);
  --bs-tertiary-bg: var(--noc-panel2);
  --bs-border-color: var(--noc-line);
  --bs-link-color: #7db0ff;
  --bs-link-hover-color: #a9ccff;
  --bs-emphasis-color: #fff;
}

html { color-scheme: dark; }
body {
  font-family: var(--bs-body-font-family);
  font-size: .925rem;
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(59, 130, 246, .11), transparent 62%),
    radial-gradient(900px 480px at -8% 108%, rgba(34, 211, 238, .06), transparent 58%),
    var(--noc-bg);
  background-attachment: fixed;
  color: var(--noc-text);
}
h1, h2, h3, h4, h5, h6 { letter-spacing: -.01em; font-weight: 650; color: #f3f7ff; }
a { text-decoration: none; }
::selection { background: rgba(59, 130, 246, .45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(130, 160, 210, .22); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------ sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0a1223 0%, #070c18 100%);
  border-right: 1px solid var(--noc-line);
  overflow-y: auto;
}
.sb-brand { display: block; padding: 1.35rem 1.4rem 1.1rem; }
.sb-brand img { width: 150px; height: auto; display: block; opacity: .95; }
.sb-label {
  font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  color: #5d7092; padding: 1.15rem 1.5rem .4rem;
}
.sb-link {
  position: relative; display: flex; align-items: center; gap: .8rem;
  margin: 2px .75rem; padding: .58rem .85rem; border-radius: 10px;
  color: #aebbd3; font-weight: 500; transition: background .15s, color .15s;
}
.sb-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }
.sb-link:hover { background: rgba(59, 130, 246, .10); color: #fff; }
.sb-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 130, 246, .26), rgba(59, 130, 246, .05));
  box-shadow: inset 2px 0 0 var(--noc-accent);
}
.sb-link.active i { color: #7db0ff; }
.sb-foot { margin-top: auto; padding: 1rem 1.4rem 1.3rem; color: #5d7092; font-size: .72rem; border-top: 1px solid var(--noc-line); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: 1rem; padding: .7rem 1.8rem;
  background: rgba(6, 10, 19, .72); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--noc-line);
}
.menu-btn { display: none; background: none; border: 0; color: var(--noc-text); font-size: 1.5rem; padding: 0; }
.live-pill {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .75rem; color: var(--noc-muted);
  padding: .28rem .7rem; border: 1px solid var(--noc-line); border-radius: 999px; background: rgba(255, 255, 255, .02);
}
.live-pill i { font-size: .5rem; }
.live-pill i.text-success { animation: livepulse 2s infinite; }
@keyframes livepulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  color: #fff; background: linear-gradient(135deg, #3b82f6, #22d3ee);
}
.page { padding: 1.6rem 1.8rem 3rem; }

/* ------------------------------------------------------------ cards, tables, forms */
.card {
  --bs-card-bg: var(--noc-panel); --bs-card-border-color: var(--noc-line); --bs-card-cap-bg: transparent;
  --bs-card-color: var(--noc-text); --bs-card-border-radius: 14px; --bs-card-inner-border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), rgba(255, 255, 255, 0)), var(--noc-panel);
  border: 1px solid var(--noc-line); box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}
.table {
  --bs-table-bg: transparent; --bs-table-color: var(--noc-text); --bs-table-border-color: var(--noc-line);
  --bs-table-hover-bg: rgba(59, 130, 246, .07); --bs-table-hover-color: #fff;
  --bs-table-striped-bg: rgba(255, 255, 255, .02); --bs-table-active-bg: rgba(59, 130, 246, .1);
}
.table thead th {
  font-size: .68rem !important; letter-spacing: .09em; text-transform: uppercase; color: #6f82a5 !important;
  font-weight: 600; border-bottom: 1px solid var(--noc-line) !important; background: rgba(255, 255, 255, .015);
  white-space: nowrap;
}
.table > :not(caption) > * > * { padding-top: .62rem; padding-bottom: .62rem; }
.table-light { --bs-table-bg: rgba(255, 255, 255, .03) !important; --bs-table-color: var(--noc-muted) !important; }
.bg-light, .bg-white { background-color: rgba(255, 255, 255, .04) !important; color: var(--noc-text) !important; }
.text-bg-light { background-color: rgba(255, 255, 255, .06) !important; color: var(--noc-muted) !important; }
.text-bg-dark { background-color: #02050b !important; color: #aebbd3 !important; border: 1px solid var(--noc-line); }
.text-bg-secondary { background-color: #3a4a68 !important; }
.badge { font-weight: 600; letter-spacing: .01em; }
.border, .border-top, .border-bottom { border-color: var(--noc-line) !important; }
.text-muted { color: var(--noc-muted) !important; }
.display-6 { font-weight: 700; letter-spacing: -.02em; }

.form-control, .form-select {
  background-color: #0a1322; border: 1px solid rgba(130, 160, 210, .22); color: var(--noc-text); border-radius: 10px;
}
.form-control::placeholder { color: #5d7092; }
.form-control:focus, .form-select:focus {
  background-color: #0c1628; color: #fff; border-color: var(--noc-accent);
  box-shadow: 0 0 0 .22rem rgba(59, 130, 246, .22);
}
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-label { color: #b7c4dc; font-weight: 500; }
.form-check-input { background-color: #0a1322; border-color: rgba(130, 160, 210, .35); }
.form-check-input:checked { background-color: var(--noc-accent); border-color: var(--noc-accent); }

.btn { border-radius: 10px; font-weight: 550; }
.btn-primary {
  --bs-btn-bg: #2f6df0; --bs-btn-border-color: #2f6df0; --bs-btn-hover-bg: #4a82ff; --bs-btn-hover-border-color: #4a82ff;
  --bs-btn-active-bg: #2559cc; --bs-btn-active-border-color: #2559cc; --bs-btn-disabled-bg: #2f6df0;
  box-shadow: 0 6px 18px rgba(47, 109, 240, .28);
}
.btn-outline-primary { --bs-btn-color: #7db0ff; --bs-btn-border-color: rgba(125, 176, 255, .45); --bs-btn-hover-bg: #2f6df0; --bs-btn-hover-border-color: #2f6df0; }
.btn-outline-secondary { --bs-btn-color: #aebbd3; --bs-btn-border-color: rgba(130, 160, 210, .3); --bs-btn-hover-bg: rgba(130, 160, 210, .16); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: rgba(130, 160, 210, .45); --bs-btn-active-bg: rgba(130, 160, 210, .22); }
.btn-outline-danger { --bs-btn-color: #ff7b7e; --bs-btn-border-color: rgba(244, 88, 91, .5); }
.btn-success { --bs-btn-bg: #17a35a; --bs-btn-border-color: #17a35a; --bs-btn-hover-bg: #1fbe6a; --bs-btn-hover-border-color: #1fbe6a; }
.btn-group .btn-outline-secondary.active { background: rgba(59, 130, 246, .25); border-color: var(--noc-accent); color: #fff; }
.pagination { --bs-pagination-bg: var(--noc-panel); --bs-pagination-border-color: var(--noc-line); --bs-pagination-color: #aebbd3;
  --bs-pagination-hover-bg: var(--noc-panel2); --bs-pagination-disabled-bg: var(--noc-panel); }
.alert { border-radius: 12px; }
details > summary { cursor: pointer; }

/* toast and banner used by live updates */
#live-toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 2000; max-width: 360px; display: none;
  background: rgba(15, 25, 45, .96); border: 1px solid rgba(125, 176, 255, .35); color: #e7eefb; border-radius: 12px; }
#live-banner { display: none; background: rgba(59, 130, 246, .14); border: 0; border-bottom: 1px solid rgba(59, 130, 246, .35); color: #cfe0ff; }
#live-banner a { color: #fff; }

/* ------------------------------------------------------------ dashboard hero and KPIs */
.hero {
  position: relative; height: 360px; border-radius: 20px; overflow: hidden; border: 1px solid var(--noc-line);
  background: radial-gradient(900px 420px at 50% 0%, #0f2347 0%, #08101f 55%, #050a14 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* soft shade behind the greeting so the text stays readable over the animation */
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 10, 20, .6) 0%, rgba(5, 10, 20, .3) 28%, rgba(5, 10, 20, 0) 50%); }
.hero-text { position: absolute; left: 2rem; top: 1.7rem; z-index: 2; max-width: 42%; pointer-events: none; }
.hero-text .eyebrow { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: #7db0ff; font-weight: 600; }
.hero-text h2 { font-size: 1.9rem; margin: .35rem 0 .3rem; font-weight: 700; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.hero-text p { color: #9db0cf; margin: 0; max-width: 34rem; }
.hero-legend { position: absolute; left: 1.6rem; bottom: 1.1rem; z-index: 2; display: flex; gap: 1rem; font-size: .72rem; color: #8ea3c6;
  background: rgba(6, 12, 24, .55); border: 1px solid var(--noc-line); border-radius: 999px; padding: .35rem .85rem; backdrop-filter: blur(6px); }
.hero-legend i { font-size: .55rem; margin-right: .35rem; }

.kpi { display: flex; align-items: center; gap: 1rem; padding: 1.05rem 1.2rem; height: 100%; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--kpi-glow, rgba(59, 130, 246, .22)), transparent 70%); }
.kpi-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; flex: none;
  background: var(--kpi-bg, rgba(59, 130, 246, .16)); color: var(--kpi-fg, #7db0ff); }
.kpi .num { font-size: 1.85rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: #fff; }
.kpi .lbl { color: var(--noc-muted); font-size: .78rem; margin-top: .3rem; }
.kpi.green { --kpi-bg: rgba(34, 197, 94, .15); --kpi-fg: #4ade80; --kpi-glow: rgba(34, 197, 94, .2); }
.kpi.slate { --kpi-bg: rgba(148, 163, 184, .14); --kpi-fg: #a8b6cc; --kpi-glow: rgba(148, 163, 184, .14); }
.kpi.cyan { --kpi-bg: rgba(34, 211, 238, .14); --kpi-fg: #67e8f9; --kpi-glow: rgba(34, 211, 238, .18); }
.kpi.violet { --kpi-bg: rgba(139, 92, 246, .16); --kpi-fg: #b497ff; --kpi-glow: rgba(139, 92, 246, .2); }
a.kpi-link { color: inherit; display: block; height: 100%; }
a.kpi-link .card { transition: transform .15s, border-color .15s; }
a.kpi-link:hover .card { transform: translateY(-2px); border-color: rgba(125, 176, 255, .4); }

.today-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.6rem; }
.today-item { display: inline-flex; align-items: center; gap: .55rem; color: var(--noc-muted); }
.today-item .n { min-width: 1.9rem; text-align: center; padding: .15rem .55rem; border-radius: 8px; font-weight: 700; color: #fff;
  background: rgba(255, 255, 255, .06); }
.today-item .n.on-success { background: rgba(34, 197, 94, .22); color: #6ee7a0; }
.today-item .n.on-danger { background: rgba(244, 88, 91, .22); color: #ff8f92; }
.today-item .n.on-primary { background: rgba(59, 130, 246, .26); color: #9cc2ff; }
.chart-box { position: relative; }
.card-title-sm { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #6f82a5; font-weight: 600; margin-bottom: .9rem; }
.feed-item { display: flex; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--noc-line); }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--noc-accent); margin-top: .45rem; flex: none; box-shadow: 0 0 10px var(--noc-accent); }

/* ------------------------------------------------------------ login page */
body.auth { background: var(--noc-bg); overflow-x: hidden; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, .9fr); }
.auth-visual {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 2.6rem 3rem; background: radial-gradient(1000px 600px at 40% 0%, #10264d 0%, #08101f 55%, #050a14 100%);
}
.auth-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.auth-visual::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 10, 19, 0) 72%, rgba(6, 10, 19, .85) 100%),
    linear-gradient(180deg, rgba(6, 10, 19, .35), rgba(6, 10, 19, 0) 26%),
    linear-gradient(0deg, rgba(5, 9, 18, .88) 0%, rgba(5, 9, 18, .55) 26%, rgba(5, 9, 18, 0) 46%); }
.auth-visual > * { position: relative; z-index: 2; }
.auth-logo { width: 190px; max-width: 60%; display: block; }
.auth-hero h1 { font-size: 2.35rem; line-height: 1.12; font-weight: 750; margin: 0 0 .8rem; text-shadow: 0 3px 24px rgba(0, 0, 0, .6); }
.auth-hero h1 span { background: linear-gradient(90deg, #7db0ff, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #9db0cf; max-width: 30rem; font-size: 1.02rem; margin: 0 0 1.4rem; }
.auth-points { display: flex; flex-wrap: wrap; gap: .6rem; }
.auth-points span { font-size: .78rem; color: #b9c9e6; padding: .38rem .8rem; border-radius: 999px;
  background: rgba(10, 20, 40, .6); border: 1px solid rgba(130, 160, 210, .22); backdrop-filter: blur(6px); }
.auth-points i { color: #7db0ff; margin-right: .4rem; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem;
  background: radial-gradient(700px 420px at 100% 0%, rgba(59, 130, 246, .10), transparent 60%), var(--noc-bg); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h2 { font-size: 1.65rem; font-weight: 700; margin-bottom: .35rem; }
.auth-card .sub { color: var(--noc-muted); margin-bottom: 1.8rem; }
.auth-field { margin-bottom: 1.1rem; }
.auth-field label { display: block; font-size: .8rem; color: #b7c4dc; margin-bottom: .4rem; font-weight: 500; }
.input-icon { position: relative; }
.input-icon > i.lead-i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #5d7092; pointer-events: none; }
.input-icon input { width: 100%; padding: .8rem .95rem .8rem 2.6rem; border-radius: 12px; font-size: .95rem; color: #fff;
  background: #0a1322; border: 1px solid rgba(130, 160, 210, .24); outline: none; transition: border-color .15s, box-shadow .15s; }
.input-icon input:focus { border-color: var(--noc-accent); box-shadow: 0 0 0 4px rgba(59, 130, 246, .2); }
.input-icon .toggle-pw { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #6f82a5; padding: .4rem .55rem; cursor: pointer; }
.input-icon .toggle-pw:hover { color: #fff; }
.auth-btn { width: 100%; padding: .85rem 1rem; margin-top: .4rem; border: 0; border-radius: 12px; color: #fff; font-weight: 650; font-size: .98rem;
  background: linear-gradient(135deg, #2f6df0, #1f9bd6); box-shadow: 0 10px 28px rgba(47, 109, 240, .35); cursor: pointer; transition: transform .15s, box-shadow .15s, filter .15s; }
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(47, 109, 240, .45); filter: brightness(1.07); }
.auth-error { background: rgba(244, 88, 91, .12); border: 1px solid rgba(244, 88, 91, .4); color: #ffb0b2; padding: .7rem .9rem; border-radius: 12px; margin-bottom: 1.1rem; font-size: .88rem; }
.auth-notice { background: rgba(245, 165, 36, .12); border: 1px solid rgba(245, 165, 36, .4); color: #ffd59a; padding: .7rem .9rem; border-radius: 12px; margin-bottom: 1.1rem; font-size: .88rem; }
.auth-foot { margin-top: 2rem; color: #5d7092; font-size: .76rem; text-align: center; }
.auth-mobile-logo { display: none; width: 150px; margin: 0 auto 1.6rem; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-block; }
  .page, .topbar { padding-left: 1rem; padding-right: 1rem; }
  .hero { height: 300px; }
  .hero-text { max-width: 90%; left: 1.2rem; }
  .hero-text h2 { font-size: 1.4rem; }
  .hero-legend { display: none; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-mobile-logo { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .live-pill i.text-success { animation: none; }
  * { transition: none !important; }
}

/* ------------------------------------------------------------ Shared / Dedicated link-type buttons */
#id_link_type { display: flex; flex-wrap: wrap; gap: .6rem; }
#id_link_type > div label {
  display: flex; align-items: center; gap: .55rem; cursor: pointer; margin: 0;
  padding: .55rem 1.1rem; border-radius: 10px; font-weight: 550; color: #b7c4dc;
  background: #0a1322; border: 1px solid rgba(130, 160, 210, .28); transition: border-color .15s, background .15s;
}
#id_link_type > div label:hover { border-color: rgba(125, 176, 255, .6); }
#id_link_type > div label:has(input:checked) { color: #fff; border-color: var(--noc-accent); background: rgba(59, 130, 246, .20); }
#id_link_type .form-check-input { margin: 0; }
