/* ========================================
   SIDEBAR SAFE CONTROL
======================================== */

:root {
  --sidebar-width: 232px;
  --sidebar-width-tablet: 208px;
  --sidebar-line: rgba(148, 163, 184, 0.12);
  --sidebar-line-strong: rgba(96, 165, 250, 0.22);
  --sidebar-muted: #93a4bb;
  --sidebar-text: #e2e8f0;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.14), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #030814 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  box-shadow: 18px 0 42px rgba(2, 6, 23, 0.28);
  overflow-y: auto;
  z-index: 1000;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
}

/* HEADER */

.sidebar-header {
  margin-bottom: 2px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(9, 15, 28, 0.92));
  border: 1px solid var(--sidebar-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.logo-text {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

/* NAV */

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

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.nav-item span:last-child {
  min-width: 0;
}

/* ICON */

.nav-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  display: block;
}

/* HOVER */

.nav-item:hover {
  background: rgba(15, 23, 42, 0.72);
  border-color: var(--sidebar-line);
  color: #fff;
  transform: translateX(2px);
}

.nav-item:hover .nav-icon {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.16);
  color: #dbeafe;
}

/* ACTIVE */

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.04));
  border-color: var(--sidebar-line-strong);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.nav-item.active .nav-icon {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.12));
  border-color: rgba(96, 165, 250, 0.22);
  color: #fff;
}

/* FOOTER */

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-line);
  display: grid;
  gap: 12px;
}

.system-status {
  min-height: 54px;
  font-size: 12px;
  font-weight: 700;
  color: #d7e4f4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--sidebar-line);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.system-status:hover,
.system-status:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.24);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.18);
  outline: none;
}

.system-status-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.system-status-text,
.system-status-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-meta {
  color: #91a4c2;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
}

.status-dot {
  margin-top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
  flex-shrink: 0;
}

.system-status.is-online .status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.system-status.is-warning .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.system-status.is-offline .status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.system-status.is-loading .status-dot {
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
  animation: systemStatusPulse 1.4s ease-in-out infinite;
}

@keyframes systemStatusPulse {
  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* USER / LOGOUT NO FOOTER */

.sidebar-user {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}

.sidebar-user-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 44px 12px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13, 23, 40, 0.9), rgba(8, 15, 27, 0.96));
  border: 1px solid var(--sidebar-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sidebar-user-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #91a4c2;
}

.sidebar-user-info strong {
  font-size: 14px;
  color: #fff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-edit-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.sidebar-edit-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.sidebar-edit-btn:hover {
  background: rgba(37, 99, 235, 0.9);
  border-color: rgba(96, 165, 250, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

.sidebar-logout-btn {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.44), rgba(69, 10, 10, 0.66));
  color: #fee2e2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.sidebar-logout-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(252, 165, 165, 0.34);
  background: linear-gradient(180deg, rgba(153, 27, 27, 0.54), rgba(88, 28, 28, 0.74));
  box-shadow: 0 10px 22px rgba(127, 29, 29, 0.2);
}

/* CONTENT OFFSET */

.content {
  margin-left: var(--sidebar-width);
  padding: 30px;
  transition:
    margin-left 0.25s ease,
    padding 0.25s ease;
}

/* RESPONSIVO */

@media (max-width: 900px) {
  .sidebar {
    width: var(--sidebar-width-tablet);
    padding: 16px 12px 14px;
  }

  .logo {
    padding: 10px 10px 12px;
  }

  .logo-text {
    font-size: 16px;
  }

  .nav-item {
    padding: 8px;
  }

  .nav-item span:last-child {
    font-size: 12.5px;
  }

  .content {
    margin-left: var(--sidebar-width-tablet);
  }
}

@media (max-width: 700px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 14px;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-line);
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.24);
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-item {
    min-height: 52px;
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .content {
    margin-left: 0;
    padding: 18px 14px 24px;
  }
}

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

  .logo-text {
    font-size: 15px;
  }
}

.profile-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 8, 20, 0.72);
  backdrop-filter: blur(6px);
  z-index: 4000;
}

.profile-modal.show {
  display: flex;
}

.profile-box {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: 24px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(6, 18, 40, 0.98), rgba(4, 12, 28, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-header h2 {
  margin: 0;
  font-size: 22px;
  color: #fff;
}

.profile-subtitle {
  margin: 8px 0 0;
  color: #90a4c4;
  font-size: 14px;
  line-height: 1.55;
}

.profile-close-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-close-btn:hover {
  color: #fca5a5;
  transform: translateY(-1px);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(12, 23, 42, 0.88), rgba(8, 16, 31, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.profile-avatar-preview {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.22);
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-identity-copy {
  display: grid;
  gap: 6px;
}

.profile-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a8b9d3;
}

.profile-section-subtitle {
  margin: 0;
  color: #d7e2f0;
  font-size: 14px;
  line-height: 1.55;
}

.profile-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-form .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-form .field label {
  font-size: 12px;
  font-weight: 700;
  color: #9db6d8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-form .field input {
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(102, 153, 255, 0.18);
  background: rgba(13, 27, 52, 0.92);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: 0.2s ease;
}

.profile-form .field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.profile-upload-row {
  display: grid;
  gap: 10px;
}

.profile-upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-upload-input {
  display: none;
}

.profile-upload-btn,
.profile-upload-clear {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.profile-upload-btn {
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.3), rgba(30, 64, 175, 0.42));
  color: #eff6ff;
}

.profile-upload-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, 0.36);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.16);
}

.profile-upload-clear {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.82);
  color: #d9e3ef;
}

.profile-upload-clear:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.92);
}

.profile-upload-clear[hidden] {
  display: none !important;
}

.profile-upload-meta {
  color: #9fb0c8;
  font-size: 13px;
  line-height: 1.5;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.avatar-option {
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.avatar-option img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  border-radius: 18px;
  border: 2px solid transparent;
  background: #0f172a;
}

.avatar-option:hover {
  transform: translateY(-2px);
}

.avatar-option.active img {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

.profile-actions .btn-primary,
.profile-actions #saveProfileBtn {
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.2);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease,
    opacity 0.2s ease;
}

.profile-actions .btn-primary:hover,
.profile-actions #saveProfileBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.28);
  filter: brightness(1.04);
}

.profile-actions .btn-primary:disabled,
.profile-actions #saveProfileBtn:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.14);
}

.profile-feedback {
  min-height: 20px;
  font-size: 13px;
  font-weight: 600;
}

.profile-feedback.success {
  color: #86efac;
}

.profile-feedback.error {
  color: #fca5a5;
}

@media (max-width: 760px) {
  .profile-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-field-grid {
    grid-template-columns: 1fr;
  }

  .avatar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-box {
    padding: 20px;
  }
}

/* ========================================
   SIDEBAR COMPACTA + BUSCA DE CLIENTE
======================================== */

body.safecontrol-compact-shell {
  --sidebar-width: 104px;
}

body.safecontrol-compact-shell .sidebar {
  inset: 20px auto 20px 20px;
  width: 64px;
  height: auto;
  padding: 10px 7px;
  gap: 14px;
  overflow: visible;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 26px;
  box-shadow: 0 22px 54px rgba(2, 6, 23, 0.24);
}

body.safecontrol-compact-shell .sidebar-header {
  width: 100%;
  margin: 0;
}

body.safecontrol-compact-shell .logo {
  width: 48px;
  height: 48px;
  padding: 0;
  justify-content: center;
  border: none;
  border-radius: 20px;
  background: #0f172a;
  box-shadow: none;
}

body.safecontrol-compact-shell .logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: none;
}

body.safecontrol-compact-shell .logo-text,
body.safecontrol-compact-shell .nav-item > span:last-child,
body.safecontrol-compact-shell .sidebar-user-info,
body.safecontrol-compact-shell .system-status-copy {
  display: none;
}

body.safecontrol-compact-shell .nav {
  width: 100%;
  align-items: center;
  gap: 9px;
}

body.safecontrol-compact-shell .nav-item {
  width: 46px;
  min-height: 46px;
  padding: 0;
  justify-content: center;
  gap: 0;
  border-radius: 18px;
  color: #64748b;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.safecontrol-compact-shell button.nav-item {
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
}

body.safecontrol-compact-shell .nav-item:hover,
body.safecontrol-compact-shell .nav-item:focus-visible {
  color: #0284c7;
  background: #e0f2fe;
  transform: none;
  outline: none;
}

body.safecontrol-compact-shell .nav-item.active {
  color: #0284c7;
  background: #e0f2fe;
  border-color: rgba(14, 165, 233, 0.18);
}

body.safecontrol-compact-shell .nav-item.active::before {
  display: none;
}

body.safecontrol-compact-shell .nav-icon {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: inherit;
}

body.safecontrol-compact-shell .nav-item:hover .nav-icon,
body.safecontrol-compact-shell .nav-item:focus-visible .nav-icon,
body.safecontrol-compact-shell .nav-item.active .nav-icon {
  background: transparent;
  border-color: transparent;
  color: inherit;
}

body.safecontrol-compact-shell .nav-icon svg {
  width: 19px;
  height: 19px;
}

body.safecontrol-compact-shell .sidebar-footer {
  width: 100%;
  margin-top: auto;
  padding: 0;
  border: none;
  justify-items: center;
}

body.safecontrol-compact-shell .sidebar-user {
  width: 100%;
  justify-items: center;
  gap: 10px;
}

body.safecontrol-compact-shell .sidebar-user-card {
  width: 46px;
  height: 46px;
  padding: 0;
  justify-content: center;
  border: none;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

body.safecontrol-compact-shell .sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

body.safecontrol-compact-shell .sidebar-edit-btn {
  right: -3px;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  padding: 0;
}

body.safecontrol-compact-shell .sidebar-edit-btn svg {
  width: 10px;
  height: 10px;
}

body.safecontrol-compact-shell .sidebar-logout-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 16px;
  font-size: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.safecontrol-compact-shell .sidebar-logout-btn::before {
  content: "S";
  color: #ef4444;
  font-size: 16px;
  font-weight: 900;
}

body.safecontrol-compact-shell .system-status {
  width: 42px;
  min-height: 42px;
  padding: 0;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  box-shadow: none;
  color: transparent;
  font-size: 0;
}

body.safecontrol-compact-shell .system-status .status-dot {
  margin: 0;
}

body.safecontrol-compact-shell .content {
  margin-left: var(--sidebar-width);
}

body.safecontrol-compact-shell .site-shell {
  margin-left: 92px;
}

.client-lookup-panel {
  position: fixed;
  z-index: 999;
  top: 20px;
  bottom: 20px;
  left: 96px;
  width: min(360px, calc(100vw - 124px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 26px 62px rgba(2, 6, 23, 0.24);
  color: #0f172a;
  transform: translateX(-16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.client-lookup-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.client-lookup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.client-lookup-kicker {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.client-lookup-head h2 {
  margin: 6px 0 4px;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.12;
}

.client-lookup-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.client-lookup-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 50%;
  background: #f8fafc;
  color: #334155;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.client-lookup-search {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.client-lookup-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0 14px;
  outline: none;
}

.client-lookup-search input:focus {
  border-color: rgba(14, 165, 233, 0.38);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.client-lookup-body {
  overflow: auto;
  padding: 14px 18px 18px;
}

.client-lookup-empty,
.client-lookup-loading,
.client-lookup-error {
  border-radius: 16px;
  padding: 14px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.client-lookup-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.18);
}

.client-lookup-results {
  display: grid;
  gap: 8px;
}

.client-lookup-result {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.client-lookup-result:hover,
.client-lookup-result:focus-visible {
  border-color: rgba(14, 165, 233, 0.26);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.1);
  outline: none;
}

.client-lookup-result strong,
.client-lookup-detail-title {
  color: #0f172a;
  font-size: 15px;
  line-height: 1.2;
}

.client-lookup-result span,
.client-lookup-muted {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.client-lookup-status-row,
.client-lookup-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-lookup-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.client-lookup-chip.online {
  background: #dcfce7;
  color: #166534;
}

.client-lookup-chip.offline {
  background: #fee2e2;
  color: #991b1b;
}

.client-lookup-chip.warning {
  background: #fef3c7;
  color: #92400e;
}

.client-lookup-chip.neutral {
  background: #e2e8f0;
  color: #475569;
}

.client-lookup-detail {
  display: grid;
  gap: 12px;
}

.client-lookup-detail-card {
  border-radius: 18px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  display: grid;
  gap: 10px;
}

.client-lookup-detail-top {
  display: grid;
  gap: 6px;
}

.client-lookup-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.client-lookup-data {
  min-height: 72px;
  padding: 11px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 6px;
}

.client-lookup-data span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-lookup-data strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.25;
  word-break: break-word;
}

.client-lookup-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
}

.client-lookup-line strong {
  color: #0f172a;
  text-align: right;
  word-break: break-word;
}

.client-lookup-actions {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.client-lookup-action {
  min-height: 44px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(14, 165, 233, 0.2);
  background: #ffffff;
  color: #0369a1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.client-lookup-action.primary {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 12px 24px rgba(2, 132, 199, 0.2);
}

@media (max-width: 700px) {
  body.safecontrol-compact-shell .sidebar {
    position: fixed;
    inset: auto 12px 12px 12px;
    width: auto;
    height: 66px;
    flex-direction: row;
    border-radius: 24px;
  }

  body.safecontrol-compact-shell .sidebar-header,
  body.safecontrol-compact-shell .sidebar-footer {
    width: auto;
  }

  body.safecontrol-compact-shell .nav {
    grid-template-columns: none;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    justify-content: flex-start;
  }

  body.safecontrol-compact-shell .content {
    margin-left: 0;
    padding-bottom: 92px;
  }

  body.safecontrol-compact-shell .site-shell {
    margin-left: auto;
    padding-bottom: 82px;
  }

  .client-lookup-panel {
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 88px;
    width: auto;
  }
}
