/* ==========================================================================
   DORAEMON HOSTING — Reusable UI Components (Icons, Buttons, Forms, Modals)
   ========================================================================== */
.ic {
  width: 16px; height: 16px; display: inline-block; vertical-align: -3px; flex-shrink: 0;
  filter: invert(72%) sepia(6%) saturate(240%) hue-rotate(200deg) brightness(96%) contrast(94%);
}
.ic-sm { width: 14px; height: 14px; vertical-align: -2px; }
.ic-lg { width: 20px; height: 20px; vertical-align: -4px; }
html[data-theme="light"] .ic { filter: invert(25%) sepia(10%) saturate(300%) hue-rotate(200deg) brightness(92%) contrast(92%); }
.btn-danger .ic { filter: invert(100%) brightness(200%) !important; }
.btn-primary .ic { filter: invert(6%) sepia(12%) saturate(750%) hue-rotate(185deg) brightness(95%) contrast(98%) !important; }
html[data-theme="light"] .btn-primary .ic { filter: invert(100%) brightness(200%) !important; }
.nav-link.active .ic, .tab-pill.active .ic { filter: invert(53%) sepia(85%) saturate(2100%) hue-rotate(214deg) brightness(102%) contrast(98%) !important; }
html[data-theme="light"] .nav-link.active .ic, html[data-theme="light"] .tab-pill.active .ic { filter: invert(27%) sepia(92%) saturate(3800%) hue-rotate(228deg) brightness(96%) contrast(98%) !important; }

.rt-logo { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; display: inline-block; }
.rt-logo-sm { width: 18px; height: 18px; }
.rt-logo-lg { width: 32px; height: 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-family: var(--font); font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 13.5px; font-weight: 600; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-full { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

.btn-primary { background: var(--accent); color: var(--accent-on, #090d14); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red); color: #ffffff; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }
.btn-danger-soft { background: var(--red-soft); border-color: rgba(239, 68, 68, 0.25); color: var(--red); }
.btn-danger-soft:hover:not(:disabled) { background: var(--red); color: #ffffff; }

.field { margin-bottom: 14px; }
.label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.input-wrap { position: relative; }
.input-wrap .ic-left { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 13.5px; outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.input.with-ic { padding-left: 34px; }
.input.with-right { padding-right: 68px; }
.textarea { height: auto; min-height: 100px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pw-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--accent-fg); font-family: var(--font);
  font-size: 12px; font-weight: 600; padding: 4px 8px; cursor: pointer;
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
}
.badge-online { background: var(--green-soft); border-color: rgba(34, 197, 94, 0.28); color: var(--green); }
.badge-offline { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.badge-accent { background: var(--accent-soft); border-color: rgba(99, 102, 241, 0.28); color: var(--accent-fg); }
.badge-amber { background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.28); color: var(--amber); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.panel {
  border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border);
  padding: 18px; margin-bottom: 16px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

.row-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bg-subtle); border: 1px solid var(--border); margin-bottom: 7px;
}
.row-item:hover { border-color: var(--border-strong); }

.empty-box { text-align: center; padding: 36px 16px; }
.empty-box img { width: 130px; height: auto; margin-bottom: 12px; opacity: 0.9; }
.empty-box h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 4px; }
.empty-box p { font-size: 13px; color: var(--text-2); max-width: 380px; margin: 0 auto 16px; }

.modal-bg {
  position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border-strong);
  padding: 20px; box-shadow: var(--shadow-modal);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.cmdk-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 9px 11px;
  border-radius: var(--radius-xs); border: none; background: transparent; color: var(--text-2);
  font-family: var(--font); font-size: 13px; cursor: pointer; text-align: left;
}
.cmdk-item:hover { background: var(--surface-2); color: var(--text); }

.toast-root { position: fixed; bottom: 70px; right: 16px; z-index: 999; display: flex; flex-direction: column; gap: 8px; max-width: 340px; pointer-events: none; }
@media (min-width: 1024px) { .toast-root { bottom: 20px; } }
.toast { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); font-size: 13px; font-weight: 500; }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

.boot-screen {
  position: fixed; inset: 0; z-index: 9999; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.boot-screen.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-spinner { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.7s linear infinite; }

/* Enhanced Button Variants & Controlled Hover Lighting */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #2589f5 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 10px rgba(57, 168, 255, 0.22);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: var(--glow-2);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-fg); background: var(--accent-soft); }
.btn-success { background: var(--green); color: #051b11; font-weight: 600; }
.btn-success:hover:not(:disabled) { filter: brightness(1.06); }
