/* =========================================================
   KAOKAB5GC Ops Console – Panel Overrides & Glue
   (FINAL, CLEAN)
   ========================================================= */

/* =========================================================
   LAYOUT (APP GRID)
   ========================================================= */

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
}

main.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  padding: 18px;
}
/* =========================================================
   FOOTER
   ========================================================= */

footer {
  padding: 10px;
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--panel);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   SETTINGS PANEL – TELCO-GRADE REFINEMENT
   ========================================================= */

#settingsPanel .form-row {
  margin-bottom: 22px;
}

#settingsPanel button.primary {
  margin-top: 28px;
  padding: 14px 18px;
  max-width: 260px;
}

/* Card container */
#settingsPanel .card {
  max-width: 520px;
  padding: 28px 28px 30px;
}

/* Title */
#settingsPanel h2 {
  position: relative;
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: #e5e7eb;
  margin-bottom: 14px;
  padding-bottom: 6px;
  text-transform: uppercase;
}

#settingsPanel h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ff9800 0%, #ffb74d 100%);
  border-radius: 2px;
}

/* -------------------------------
   SETTINGS DESCRIPTION / NOTICE
   (Login + License)
-------------------------------- */
#settingsPanel .settings-subtext,
#licensePanel .settings-subtext {
  margin-top: 12px;
  margin-bottom: 28px;
  font-size: 13px;
  line-height: 1.65;
  color: #9aa4b2;
}

/* Inputs */
#settingsPanel .settings-form input {
  height: 46px;
  padding: 10px 14px;
  font-size: 14px;
  color: #e5e7eb;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
}

#settingsPanel .settings-form input::placeholder {
  color: #6b7280;
}

/* Messages */
#settingsPanel .form-msg {
  margin-top: 14px;
  font-size: 13px;
}

/* Validation */
#settingsPanel .field-error {
  border: 2px solid #ff4d4f !important;
}

/* Force full-width button */
.settings-form button.primary.settings-btn {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  display: block;
  margin-top: 12px;
  padding: 14px 24px;
}

/* =========================================================
   CORE NETWORK PANEL
   ========================================================= */

#corePanel h2 {
  display: inline-block;
  position: relative;
  margin-bottom: 14px;
  padding-bottom: 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #e5e7eb;
}

#corePanel h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ff9800 0%, #ffb74d 100%);
  border-radius: 2px;
}

#corePanel .notice {
  margin-top: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
  color: #9aa4b2;
}

/* Core form rhythm */
.settings-form {
  margin-top: 6px;
}

.settings-form .form-row {
  margin-bottom: 22px;
}

.settings-form .form-row.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 26px;
}

#coreSd {
  margin-top: 2px;
}

/* Preview / apply buttons */
#corePreviewBtn,
#coreApplyBtn {
  margin-top: 30px;
  height: 50px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
}

/* Preview output */
#corePreview {
  margin-top: 22px;
  padding: 18px;
  font-size: 13px;
  line-height: 1.55;
  background: #0b1220;
  border: 1px solid #1f2a37;
  border-radius: 12px;
  color: #d1d5db;
  max-height: 360px;
  overflow: auto;
}

/* =========================================================
   SUBSCRIBER DASHBOARD FORM
   ========================================================= */

.subscriber-form .form-row select {
  width: 100%;
  background: #0b1220;
  color: #fff;
  border: 1px solid #1f2a37;
  border-radius: 8px;
  padding: 10px;
}

.subscriber-form .form-row {
  margin-bottom: 14px;
}

.subscriber-form .form-row.split {
  gap: 12px;
  margin-bottom: 14px;
}

.subscriber-form .primary {
  margin-top: 10px;
}

.subscriber-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #9aa4b2;
  line-height: 1.4;
}

/* =========================================================
   UNIFIED PANEL TITLES
   ========================================================= */

#corePanel h2,
#subscribersPanel h2,
#settingsPanel h2,
#ranPanel h2,
#panel-events h2,
#panel-alarms h2,
#licensePanel h2 {
  display: inline-block;
  position: relative;
  margin-bottom: 14px;
  padding-bottom: 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #e5e7eb;
}

#corePanel h2::after,
#subscribersPanel h2::after,
#settingsPanel h2::after,
#ranPanel h2::after,
#panel-events h2::after,
#panel-alarms h2::after,
#licensePanel h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ff9800 0%, #ffb74d 100%);
  border-radius: 2px;
}
/* =========================================================
   SIDEBAR STATUS BLOCK – BUSINESS / TELCO GRADE
   ========================================================= */

.sidebar-status {
  position: relative;
  margin-top: 28px;
  padding: 18px 18px 14px;
  font-size: 13px;
  color: #cbd5e1;
}

/* Subtle top separator (enterprise style) */
.sidebar-status::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.22),
    transparent
  );
}

/* ================= ROW ================= */

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

/* Left labels */
.status-label {
  font-size: 12px;
  letter-spacing: 0.4px;
  opacity: 0.65;
}

/* ================= ENVIRONMENT ================= */

.status-env {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  top: -1px;
}

.status-dot.green {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.7);
}

.status-text {
  font-weight: 500;
  color: #e5e7eb;
}

/* ================= DIVIDER ================= */

.status-divider {
  height: 1px;
  margin: 12px 0;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.18),
    transparent
  );
}

/* ================= LICENSE BADGE ================= */

/* Base license badge (always present – prevents white flicker) */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 3px 10px;
  min-height: 20px;

  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;

  color: #9aa4b2;                       /* neutral muted */
  background: rgba(255,255,255,0.04);
  border-radius: 999px;

  opacity: 0.85;
}

/* ACTIVE – green pill (final authority) */
.status-badge.active {
  font-weight: 700;
  color: #052e16;
  background: linear-gradient(
    180deg,
    #22c55e 0%,
    #16a34a 100%
  );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 0 0 1px rgba(34,197,94,0.45),
    0 2px 6px rgba(34,197,94,0.25);

  opacity: 1;
}

/* UNLICENSED – amber / warning */
.status-badge.warn {
  font-weight: 700;
  color: #78350f;
  background: linear-gradient(
    180deg,
    #fbbf24 0%,
    #f59e0b 100%
  );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 0 0 1px rgba(245,158,11,0.45),
    0 2px 6px rgba(245,158,11,0.25);

  opacity: 1;
}

/* EXPIRED / INVALID – red / error */
.status-badge.error {
  font-weight: 700;
  color: #7f1d1d;
  background: linear-gradient(
    180deg,
    #f87171 0%,
    #ef4444 100%
  );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 0 0 1px rgba(239,68,68,0.45),
    0 2px 6px rgba(239,68,68,0.25);

  opacity: 1;
}


/* ================= MONO VALUES ================= */

.status-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: #e5e7eb;
}

/* ===== LICENSE SETTINGS – Upload & Activate ===== */

.license-actions {

  margin-top: 18px;
}

.license-actions input[type="file"] {
  display: none; /* hidden, triggered by button */
}

.btn-primary {
  background: linear-gradient(180deg, #ffa726, #fb8c00);
  border: none;
  padding: 10px 18px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  color: #111;
}

.btn-secondary {
  background: #1e2a3a;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 9px 16px;
  border-radius: 6px;
  margin-right: 8px;
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.license-msg {
  margin-top: 12px;
  font-size: 13px;
}

.license-msg.success {
  color: #3ddc84; /* green */
}

.license-msg.error {
  color: #ff5252; /* red */
}
/* ======================================================
   FINAL UI POLISH — LICENSE SETTINGS (10%)
   ====================================================== */

/* 1) Strengthen LICENSE SETTINGS title underline perception */
#licensePanel .settings-title::after {
  height: 3px;                 /* slightly stronger */
  width: 56px;                 /* same visual anchor as Login */
}

/* 2) Make "Choose License File" look like a real secondary button */
#licensePanel .secondary.settings-btn {
  background: linear-gradient(180deg, #1f2937, #111827);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e5e7eb;
  height: 44px;                /* match primary button height */
  display: flex;
  align-items: center;
  justify-content: center;
}

#licensePanel .secondary.settings-btn:hover {
  background: linear-gradient(180deg, #243041, #141c2a);
}

/* 3) Tighten vertical rhythm between file chooser and primary action */
#licensePanel .form-row {
  margin-bottom: 10px;
}

#licensePanel .primary.settings-btn {
  margin-top: 6px;             /* closer to Login card rhythm */
}

/* 4) Slightly calm the warning text (more enterprise tone) */
#licensePanel .settings-subtext strong {
  font-weight: 600;
}

#licensePanel .settings-subtext {
  line-height: 1.45;
}
/* CSS warning icon (replaces emoji) */
.settings-subtext.warn .warn-icon {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  position: relative;
  top: 1px;

  /* triangle */
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid #f59e0b;
}

.settings-subtext.warn .warn-icon::after {
  content: "!";
  position: absolute;
  left: -3px;
  top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #0b1220;
}
/* ===============================
   PRODUCT ID – READONLY IDENTIFIER
   =============================== */

#productId {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;                 /* 🔥 slightly smaller digits */
  letter-spacing: 0.8px;

  color: #22c55e;                  /* green digits */
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.35);

  cursor: default;
}
/* ======================================================
 * RAN DELETE BUTTON (TELCO-GRADE)
 * ====================================================== */

.btn-delete {
.btn-delete {
  min-width: 74px;            /* prevents column resize */
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #b30000;
  background: #d9534f;        /* red */
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}
  min-width: 74px;            /* prevents column resize */
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #b30000;
  background: #d9534f;        /* red */
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.btn-delete:hover:not(.disabled) {
  background: #c9302c;
}

.btn-delete.disabled,
.btn-delete:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #aaa;
  background: #ccc;
  color: #555;
}
