@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

html, body {
  font-family: 'Montserrat', sans-serif;
  width: 100%;
  min-height: 100vh;
  padding: 0;
  margin: 0;

  --primary-color: #22699D;
}

h1 {
  font-size: 4rem;
  margin: unset;
}

.main {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main section {
  width: 100%;
  max-width: 1200px;
  padding: 24px;
  box-sizing: border-box;
}

/* ============================================================================
   App Bar (Top Header with Hamburger)
   ============================================================================ */

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  background: white;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-bar-user-name {
  font-size: 14px;
  color: #394045;
  font-weight: 400;
}

.app-bar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-btn:hover {
  background-color: #f0f0f0;
}

.hamburger-icon {
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.app-bar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: pre;
}

.app-bar-logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.app-bar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.app-bar-separator {
  color: var(--primary-color);
  font-weight: 800;
  margin: 0 0px;
}

.app-bar-page-title {
  font-weight: 400;
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .app-bar-right {
    display: none;
  }
}

/* Content wrapper for centering pages */
.content-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.content-wrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* ============================================================================
   Drawer Menu (Slide-out Sidebar)
   ============================================================================ */

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

.drawer-overlay.visible {
  opacity: 1;
  visibility: visible;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: left 0.3s ease-out;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer.open {
  left: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.drawer-close {
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close:hover {
  background-color: #f0f0f0;
}

.drawer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.drawer-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--primary-color);
}

/* User Section */
.drawer-user {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
}

.drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.drawer-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.drawer-user-info {
  display: flex;
  flex-direction: column;
}

.drawer-user-name {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}

.drawer-user-role {
  font-size: 14px;
  color: #5f6368;
}

/* Menu Items */
.drawer-menu {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.drawer-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.drawer-menu-item:hover {
  background: #f3f4f6;
}

.drawer-menu-item.active {
  background: #e8f0fe;
}

.drawer-menu-item.active .drawer-menu-label {
  color: var(--primary-color);
  font-weight: 600;
}

.drawer-menu-icon {
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

/* Material Design icons for menu */
.icon-dashboard {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2323699D'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

.icon-updates {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2323699D'%3E%3Cpath d='M17 1.01L7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14zm-1-6h-3V8h-2v5H8l4 4 4-4z'/%3E%3C/svg%3E");
}

.drawer-menu-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--primary-color);
}

.counter {
  display: flex;
  align-items: center;
  padding-top: 10px;
  padding-bottom: 10px;
  border-top-style: solid;
  border-bottom-style: solid;
  border-top-color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  border-top-width: 1px;
  border-bottom-width: 1px;
}

.counter button {
  font-size: 2rem;
  width: 2em;
  height: 2em;
  border: unset;
  cursor: pointer;
  border-radius: 2em;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
}

.counter button:hover {
  background-color: #0001;
}

.counter span {
  padding-left: 2rem;
  padding-right: 2rem;
  box-sizing: border-box;
  min-width: 2.5em;
  color: var(--primary-color);
  font-size: 4rem;
  text-align: center;
}

ol {
  max-width: 500px;
}

/* Updates Page Styles */
.updates-page {
  padding: 32px;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}

.bottom-spacer {
  height: 32px;
  flex-shrink: 0;
}

.page-header {
  margin-bottom: 32px;
  text-align: center;
}

.page-header h1 {
  margin-bottom: 8px;
  font-size: 2.5rem;
}

.subtitle {
  color: #5f6368;
  margin: 0;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #dadce0;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-container {
  padding: 24px;
  background-color: #fce8e6;
  border-radius: 8px;
  margin-bottom: 24px;
}

.error-message {
  color: #c5221f;
  margin: 0;
}

.products-grid {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.products-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 900px) {
  .products-grid {
    flex-direction: column;
    align-items: center;
  }
}

/* Product Card Styles */
.product-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 16px;
  width: 400px;
  max-width: calc(100vw - 64px);
  transition: box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

.product-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.product-icon {
  flex-shrink: 0;
}

.product-icon img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 12px 0;
}

.channels {
  display: flex;
  gap: 16px;
}

.channel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.channel-name {
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  text-decoration: none;
  cursor: pointer;
}

.channel-name:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.channel-version {
  font-size: 14px;
  color: #5f6368;
  font-family: "Montserrat", sans-serif;
}

@media (max-width: 768px) {
  .channel:not(:first-child) {
    display: none;
  }
}

/* ============================================================================
   Product Page Styles
   ============================================================================ */

.product-page {
  /* Override max-width to allow full horizontal stretch */
  max-width: none;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
}

.back-link {
  margin-bottom: 16px;
  width: 100%;
  max-width: 1200px;
  text-align: center;
}

.back-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.back-link a:hover {
  text-decoration: underline;
}

.product-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.product-header-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.product-header h1 {
  font-size: 2rem;
  margin: 0;
  color: var(--primary-color);
}

/* Product Toolbar (search + store icons) */
.product-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

@media (max-width: 768px) {
  .product-toolbar {
    flex-direction: column;
    gap: 12px;
  }
}

/* Store Icons Bar (Navigator) */
.store-icons-bar {
  display: flex;
  gap: 4px;
}

.store-icons-bar .store-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
  opacity: 0.85;
  position: relative;
}

.store-icons-bar .store-icon:hover {
  background-color: #f1f3f4;
  opacity: 1;
}

/* Store icon tooltips */
.store-icons-bar .store-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #333;
  color: #fff;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none;
  margin-bottom: 4px;
}

.store-icons-bar .store-icon[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.1s;
}

/* Google Play icon - multicolor play triangle */
.icon-google-play {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%234CAF50' d='M7.705 4.043C7.292 4.15 7 4.507 7 5.121v37.758c0 .614.292.971.705 1.078l20.136-20.064L7.705 4.043z'/%3E%3Cpath fill='%232196F3' d='M33.237 18.36l-5.396 5.533 5.396 5.533 6.405-3.698c.559-.322.88-.752.88-1.235s-.321-.913-.88-1.235l-6.405-3.898z'/%3E%3Cpath fill='%23FFC107' d='M27.841 23.893L7.705 44.957c.293.072.596.04.911-.11l23.621-13.638-4.396-7.316z'/%3E%3Cpath fill='%23F44336' d='M8.616 3.933c-.315-.15-.618-.182-.911-.11l20.136 20.07 4.396-5.533L8.616 3.933z'/%3E%3C/svg%3E");
}

/* App Store icon - Apple logo black */
.icon-app-store {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777777'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z'/%3E%3C/svg%3E");
}

/* GitHub icon */
.icon-github {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.17 6.839 9.49.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0 1 12 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.167 22 16.418 22 12c0-5.523-4.477-10-10-10z'/%3E%3C/svg%3E");
}

/* CI Build icon - Play/build icon */
.icon-ci {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232088FF'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}

/* Version Search */
.version-search-container {
  display: flex;
  align-items: center;
  position: relative;
  width: 280px;
}

.version-search {
  width: 100%;
  padding: 10px 16px;
  padding-right: 36px;
  font-size: 14px;
  border: 1px solid #dadce0;
  border-radius: 24px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.version-search:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(35, 105, 157, 0.2);
}

.version-search::placeholder {
  color: #9aa0a6;
  font-family: "Montserrat", sans-serif;
}

.version-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #5f6368;
  font-size: 14px;
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.15s;
}

.version-search-clear:hover {
  background-color: #f1f3f4;
}

/* Channels Grid - Horizontal layout */
.channels-grid {
  display: flex;
  gap: 16px;
  padding: 8px 4px 16px 4px;
  margin: 0 auto;
  align-items: stretch;
  justify-content: center;
  flex-wrap: nowrap;
  height: 100%;
  box-sizing: border-box;
}

/* Wrapper for the grid */
.channels-grid-wrapper {
  width: 120%;
  flex: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 0 24px;
  box-sizing: border-box;
}

.channel-column {
  flex: 0 0 280px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow: hidden;
}

/* Stretch class for the grid */
.channels-grid-stretch {
  justify-content: center;
}

.channels-grid-stretch .channel-column {
  flex: 0 0 280px;
  width: 280px;
}

/* Channel Header Card */
.channel-header-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  padding: 12px;
  margin: 1px 1px 8px 1px;
}

.channel-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.channel-info h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
}

.channel-select {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 4px 8px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: white;
  color: #333;
  cursor: pointer;
  margin-bottom: 4px;
  width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.channel-select:hover {
  border-color: var(--primary-color);
}

.channel-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(34, 105, 157, 0.2);
}

.channel-external-links {
  font-size: 14px;
}

.channel-external-links a {
  color: #d81b60;
  text-decoration: none;
}

.channel-external-links a:hover {
  text-decoration: underline;
}

/* Versions List */
.versions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* Important for flex overflow */
  scrollbar-width: thin; /* Firefox */
}

.versions-list::-webkit-scrollbar {
  width: 8px;
}

.versions-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.versions-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.versions-list::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

::-webkit-scrollbar-button {
  height: 0;
  width: 0;
}

/* ============================================================================
   Version Card Styles
   ============================================================================ */

.version-card {
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.version-card.inactive {
  opacity: 0.6;
}

.version-card.inactive .version-number {
  color: #9e9e9e;
}

.version-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.version-number {
  font-size: 16px;
  font-weight: 600;
  color: #202124;
  font-family: "Roboto Mono", monospace;
}

.sdk-tag {
  background: #e3f2fd;
  color: #1565c0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.version-date {
  font-size: 14px;
  color: #202124;
}

.version-time {
  font-size: 13px;
  color: #5f6368;
  font-style: italic;
}

.release-notes {
  font-size: 12px;
  color: #5f6368;
  font-style: italic;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-top: 4px;
  word-break: break-word;
}

.release-notes-content {
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.release-notes.expanded .release-notes-content {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.release-notes-toggle {
  display: block;
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 500;
  font-style: normal;
  margin-top: 4px;
}

.release-notes-toggle:hover {
  text-decoration: underline;
}

.version-actions-icons {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.action-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  opacity: 0.6;
}

.action-icon:hover {
  background-color: #f1f3f4;
  opacity: 1;
}

/* Custom tooltip with faster delay */
.action-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #333;
  color: #fff;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none;
  margin-bottom: 4px;
}

.action-icon[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.1s;
}

/* GitHub Octicons as data URIs */
.icon-changelog {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.573.677L7.177 3.073a.25.25 0 000 .354l2.396 2.396A.25.25 0 0010 5.646V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5h-1V.854a.25.25 0 00-.427-.177zM6 12v-1.646a.25.25 0 01.427-.177l2.396 2.396a.25.25 0 010 .354l-2.396 2.396A.25.25 0 016 15.146V13.5H5A2.5 2.5 0 012.5 11V5.372a2.25 2.25 0 111.5 0V11a1 1 0 001 1zM4 3.25a.75.75 0 10-1.5 0 .75.75 0 001.5 0zM12.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z'/%3E%3C/svg%3E");
}

.icon-commits {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.93 8.5a4.002 4.002 0 01-7.86 0H.75a.75.75 0 010-1.5h3.32a4.002 4.002 0 017.86 0h3.32a.75.75 0 010 1.5zm-1.43-.75a2.5 2.5 0 10-5 0 2.5 2.5 0 005 0z'/%3E%3C/svg%3E");
}

.icon-edit {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.253.253 0 00-.064.108l-.558 1.953 1.953-.558a.253.253 0 00.108-.064l6.286-6.286z'/%3E%3C/svg%3E");
}

.icon-download {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.75 14A1.75 1.75 0 011 12.25v-2.5a.75.75 0 011.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25v-2.5a.75.75 0 011.5 0v2.5A1.75 1.75 0 0113.25 14z'/%3E%3Cpath d='M7.25 7.689V2a.75.75 0 011.5 0v5.689l1.97-1.969a.749.749 0 111.06 1.06l-3.25 3.25a.749.749 0 01-1.06 0L4.22 6.78a.749.749 0 111.06-1.06l1.97 1.969z'/%3E%3C/svg%3E");
}

/* Alternative download icon (for unsigned/flashable versions) - outline style */
.icon-download-alt {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='%23666' stroke-width='1.2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.75 13.5h10.5M8 2v8m0 0l-3-3m3 3l3-3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Open in Devices (external link) - used on user device cards */
.icon-open-devices {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.22 8.72a.75.75 0 001.06 1.06l5.22-5.22v1.69a.75.75 0 001.5 0v-3.5a.75.75 0 00-.75-.75h-3.5a.75.75 0 000 1.5h1.69L6.22 8.72z'/%3E%3Cpath d='M3.5 6.75c0-.69.56-1.25 1.25-1.25H7A.75.75 0 007 4H4.75A2.75 2.75 0 002 6.75v4.5A2.75 2.75 0 004.75 14h4.5A2.75 2.75 0 0012 11.25V9a.75.75 0 00-1.5 0v2.25c0 .69-.56 1.25-1.25 1.25h-4.5A1.25 1.25 0 013 11.25v-4.5z'/%3E%3C/svg%3E");
}

/* ============================================================================
   Blocked Page (Auth Gate)
   ============================================================================ */

.blocked-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.blocked-card {
  background: white;
  border-radius: 16px;
  padding: 48px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.blocked-logo {
  margin-bottom: 24px;
}

.blocked-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 16px 0;
}

.blocked-message {
  color: #5f6368;
  font-size: 16px;
  margin: 0 0 32px 0;
  line-height: 1.5;
}

.blocked-login-btn {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
}

.blocked-login-btn:hover {
  background: #1a5580;
  text-decoration: none;
}

.blocked-login-btn:active {
  transform: scale(0.98);
}

.blocked-refresh-btn {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.blocked-refresh-btn:hover {
  background: #f0f4f8;
}

/* Dev token section */
.blocked-dev-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}

.blocked-dev-hint {
  color: #9e9e9e;
  font-size: 13px;
  margin: 0 0 12px 0;
}

.blocked-dev-input-row {
  display: flex;
  gap: 8px;
}

.blocked-dev-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-size: 14px;
  font-family: "Roboto Mono", monospace;
}

.blocked-dev-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(34, 105, 157, 0.2);
}

.blocked-dev-submit {
  background: #f0f4f8;
  border: 1px solid #dadce0;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #5f6368;
  cursor: pointer;
  transition: background-color 0.2s;
}

.blocked-dev-submit:hover {
  background: #e4e8ec;
}

/* ============================================================================
   Dashboard Page
   ============================================================================ */

.dashboard-page {
  padding: 32px;
  width: 100%;
  max-width: 800px;
  box-sizing: border-box;
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 16px;
}

.dashboard-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin: 0 0 8px 0;
}

.dashboard-card {
  background: white;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 24px;
}

.dashboard-card h2 {
  font-size: 1.25rem;
  color: #202124;
  margin: 0 0 16px 0;
  font-weight: 600;
}

/* User profile section */
.user-profile {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-detail-row {
  display: flex;
  gap: 12px;
}

.user-detail-label {
  font-size: 14px;
  font-weight: 500;
  color: #5f6368;
  min-width: 80px;
}

.user-detail-value {
  font-size: 14px;
  color: #202124;
}

.user-detail-value.user-id {
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  color: #5f6368;
}

/* ============================================================================
   Kebab Menu (Three-dot menu)
   ============================================================================ */

.version-header-spacer {
  flex: 1;
}

.kebab-menu-container {
  position: relative;
}

.kebab-menu-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: #5f6368;
  transition: background-color 0.15s;
}

.kebab-menu-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.kebab-menu-btn:active {
  background: rgba(0, 0, 0, 0.1);
}

.kebab-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 4px 0;
}

.menu-item {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: #202124;
  cursor: pointer;
  transition: background-color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.menu-item:hover {
  background: #f1f3f4;
}

a.menu-item {
  color: inherit;
}

a.menu-item:hover {
  color: inherit;
}

.menu-item-activate {
  color: #f59e0b;
}

.menu-item-promote {
  color: #22c55e;
}

.menu-item-delete {
  color: #ef4444;
}

.menu-item-edit {
  color: #3b82f6;
}

.menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

/* Submenu styles - click to expand */
.menu-submenu-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  transition: background-color 0.15s;
  white-space: nowrap;
}

.menu-submenu-trigger:hover {
  background: #f1f3f4;
}

.menu-submenu-arrow {
  margin-left: 8px;
  font-size: 10px;
}

.menu-submenu-content {
  background: #f9fafb;
}

.menu-submenu-content .menu-item {
  padding-left: 32px;
  color: #374151;
  font-size: 12px;
}

/* Version card loading state */
.version-card.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.version-card.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
}

/* ============================================================================
   Dialog / Modal
   ============================================================================ */

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.2s;
}

.dialog-overlay.visible {
  opacity: 1;
}

.dialog-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  animation: dialog-enter 0.2s ease-out;
}

.dialog-card-wide {
  max-width: 600px;
}

@keyframes dialog-enter {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.dialog-title {
  font-size: 18px;
  font-weight: 600;
  color: #202124;
  margin: 0 0 12px 0;
}

.dialog-message {
  font-size: 14px;
  color: #5f6368;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.dialog-textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #dadce0;
  border-radius: 8px;
  resize: vertical;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.dialog-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(34, 105, 157, 0.2);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.dialog-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
  border: none;
}

.dialog-btn-cancel {
  background: #f1f3f4;
  color: #5f6368;
}

.dialog-btn-cancel:hover {
  background: #e8eaed;
}

.dialog-btn-confirm {
  background: var(--primary-color);
  color: #ffffff;
}

.dialog-btn-confirm:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.dialog-label {
  font-size: 14px;
  font-weight: 500;
  color: #394045;
}

.dialog-input {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  box-sizing: border-box;
}

.dialog-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(34, 105, 157, 0.12);
}

.dialog-error {
  font-size: 13px;
  color: #dc2626;
  margin: 0;
}

/* ============================================================================
   Purchases Page
   ============================================================================ */

.purchases-page {
  padding: 16px 32px 32px 32px;
  width: 100%;
  max-width: 1600px;
  box-sizing: border-box;
}

/* Date Navigation */
.date-navigation {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.date-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(34, 105, 157, 0.3);
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  color: var(--primary-color);
  transition: background-color 0.15s, border-color 0.15s;
  margin-top: 10px;
}

.date-nav-btn:hover:not(.disabled) {
  background: rgba(34, 105, 157, 0.05);
  border-color: var(--primary-color);
}

.date-nav-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-icon {
  width: 6px;
  height: 10px;
  position: relative;
}

.nav-icon::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-style: solid;
  border-color: var(--primary-color);
}

.nav-icon-left::before {
  border-width: 0 0 2px 2px;
  transform: rotate(45deg);
  left: 1px;
  top: 2px;
}

.nav-icon-right::before {
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
  right: 1px;
  top: 2px;
}

.date-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  min-height: 60px;
}

.date-weekday {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 2px;
}

.date-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-color);
}

.today-badge {
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  background: rgba(34, 105, 157, 0.1);
  color: var(--primary-color);
}

/* Filters Bar */
.filters-bar {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  font-weight: 500;
  color: #5f6368;
}

.filter-chips {
  display: flex;
  gap: 6px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid #dadce0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  --chip-color: #9ca3af;
}

.filter-chip:hover {
  border-color: var(--chip-color);
  background: color-mix(in srgb, var(--chip-color) 5%, transparent);
}

.filter-chip.selected {
  border-color: var(--chip-color);
  background: color-mix(in srgb, var(--chip-color) 10%, transparent);
}

.filter-chip .chip-label {
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
}

.filter-chip.selected .chip-label {
  color: var(--chip-color);
  font-weight: 600;
}

.filter-chip .chip-icon {
  width: 14px;
  height: 14px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.5;
}

.filter-chip.selected .chip-icon {
  opacity: 1;
}

/* Chip icons */
.chip-icon-apple {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z'/%3E%3C/svg%3E");
}

.chip-icon-google {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%234CAF50' d='M7.705 4.043C7.292 4.15 7 4.507 7 5.121v37.758c0 .614.292.971.705 1.078l20.136-20.064L7.705 4.043z'/%3E%3Cpath fill='%232196F3' d='M33.237 18.36l-5.396 5.533 5.396 5.533 6.405-3.698c.559-.322.88-.752.88-1.235s-.321-.913-.88-1.235l-6.405-3.898z'/%3E%3Cpath fill='%23FFC107' d='M27.841 23.893L7.705 44.957c.293.072.596.04.911-.11l23.621-13.638-4.396-7.316z'/%3E%3Cpath fill='%23F44336' d='M8.616 3.933c-.315-.15-.618-.182-.911-.11l20.136 20.07 4.396-5.533L8.616 3.933z'/%3E%3C/svg%3E");
}

.chip-icon-naviter {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23635BFF'%3E%3Cpath d='M20 4H4v2h16V4zm1 10v-2l-1-5H4l-1 5v2h1v6h10v-6h4v6h2v-6h1zm-9 4H6v-4h6v4z'/%3E%3C/svg%3E");
}

.chip-icon-desktop {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7l-2 3v1h8v-1l-2-3h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 12H3V4h18v10z'/%3E%3C/svg%3E");
}

.chip-icon-mobile {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23059669'%3E%3Cpath d='M17 1.01L7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z'/%3E%3C/svg%3E");
}

.chip-icon-check {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2316A34A'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

.chip-icon-minus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236B7280'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11H7v-2h10v2z'/%3E%3C/svg%3E");
}

.chip-icon-manage {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236B7280'%3E%3Cpath d='M12 15.5A3.5 3.5 0 0 1 8.5 12 3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5 3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97 0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1 0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66z'/%3E%3C/svg%3E");
}

/* Blacklist Manage button: chip-style action button (no selected state) */
.filter-chip.blacklist-manage-btn {
  cursor: pointer;
  --chip-color: #6B7280;
}
.filter-chip.blacklist-manage-btn:hover {
  border-color: var(--chip-color);
  background: color-mix(in srgb, var(--chip-color) 8%, transparent);
}
.filter-chip.blacklist-manage-btn .chip-icon {
  opacity: 0.8;
}
.filter-chip.blacklist-manage-btn .chip-label {
  color: #5f6368;
  font-weight: 500;
}

/* Blacklist dialog */
.dialog-card-blacklist .blacklist-dialog-search {
  margin-bottom: 12px;
}
.dialog-card-blacklist .blacklist-dialog-search-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-sizing: border-box;
}
.dialog-card-blacklist .blacklist-dialog-search-input:focus {
  outline: none;
  border-color: var(--primary-color, #22699d);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #22699d) 20%, transparent);
}
.dialog-card-blacklist .blacklist-dialog-search-input::placeholder {
  color: #9ca3af;
}
.dialog-card-blacklist .blacklist-dialog-list {
  max-height: 280px;
  overflow-y: auto;
  margin: 16px 0;
  padding: 8px 0;
}
.dialog-card-blacklist .blacklist-dialog-empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}
.dialog-card-blacklist .blacklist-dialog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  margin: 0 8px 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.dialog-card-blacklist .blacklist-dialog-item-text {
  flex: 1;
  font-size: 13px;
  color: #202124;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dialog-card-blacklist .blacklist-dialog-remove {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #b91c1c;
  background: transparent;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dialog-card-blacklist .blacklist-dialog-remove:hover {
  background: #fef2f2;
  border-color: #b91c1c;
}
.dialog-card-blacklist .blacklist-dialog-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.dialog-card-blacklist .blacklist-dialog-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #dadce0;
  border-radius: 8px;
}
.dialog-card-blacklist .blacklist-dialog-input:focus {
  outline: none;
  border-color: var(--primary-color, #22699d);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #22699d) 20%, transparent);
}
.dialog-card-blacklist .blacklist-dialog-add-btn {
  flex-shrink: 0;
  padding: 8px 16px;
}
.dialog-card-blacklist .blacklist-dialog-error {
  margin: 0;
  font-size: 12px;
  color: #b91c1c;
}
.dialog-card-blacklist .blacklist-dialog-error:empty {
  display: none;
}
@media (max-width: 600px) {
  .dialog-card-blacklist .blacklist-dialog-add {
    flex-direction: column;
    align-items: stretch;
  }
  .dialog-card-blacklist .blacklist-dialog-list {
    max-height: 200px;
  }
}

/* Mobile: icon-only store filters */
@media (max-width: 768px) {
  /* Hide label only when chip has an icon */
  .filter-group-store .filter-chip:has(.chip-icon) .chip-label {
    display: none;
  }
  
  .filter-group-store .filter-chip:has(.chip-icon) {
    padding: 6px 8px;
  }
}

/* Summary Stats */
.summary-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  padding: 16px 24px;
  background: #f8f9fa;
  border-radius: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #202124;
}

.stat-label {
  font-size: 13px;
  color: #5f6368;
}

.stat-item.stat-ok .stat-value {
  color: #16a34a;
}

.stat-item.stat-omit .stat-value {
  color: #f59e0b;
}

.stat-item.stat-error .stat-value {
  color: #dc2626;
}

/* Purchases Grid */
.purchases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 340px);
  gap: 16px;
  justify-content: center;
}

/* Loading/Error/Empty states */
.purchases-loading,
.purchases-error,
.purchases-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #9e9e9e;
}

.purchases-loading .loading-spinner {
  margin-bottom: 16px;
}

.purchases-error .error-icon,
.purchases-empty .empty-icon {
  opacity: 0.5;
}

.error-detail {
  font-size: 12px;
  color: #9e9e9e;
  margin: 8px 0 16px;
}

.retry-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  background: transparent;
  color: var(--primary-color);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.retry-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
}

/* ============================================================================
   Purchase Card
   ============================================================================ */

.purchase-card {
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.purchase-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Header section */
.purchase-header {
  padding: 12px 16px;
  background: #f8f9fa;
}

.purchase-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.purchase-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.purchase-time {
  font-size: 14px;
  font-weight: 600;
  color: #5f6368;
}

.purchase-header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Duration badge (prominent) */
.duration-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.duration-yearly {
  background: #e0f2fe;
  color: #0369a1;
}

.duration-monthly {
  background: #f0fdf4;
  color: #15803d;
}

.duration-trial {
  background: #ede9fe;
  color: #7c3aed;
}

.duration-lifetime {
  background: #f3e8ff;
  color: #7e22ce;
}

/* Event type badge (muted) */
.event-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  background: rgba(0, 0, 0, 0.04);
}

/* Store indicator */
.store-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.store-icon {
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.store-apple .store-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z'/%3E%3C/svg%3E");
}

.store-google .store-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%234CAF50' d='M7.705 4.043C7.292 4.15 7 4.507 7 5.121v37.758c0 .614.292.971.705 1.078l20.136-20.064L7.705 4.043z'/%3E%3Cpath fill='%232196F3' d='M33.237 18.36l-5.396 5.533 5.396 5.533 6.405-3.698c.559-.322.88-.752.88-1.235s-.321-.913-.88-1.235l-6.405-3.898z'/%3E%3Cpath fill='%23FFC107' d='M27.841 23.893L7.705 44.957c.293.072.596.04.911-.11l23.621-13.638-4.396-7.316z'/%3E%3Cpath fill='%23F44336' d='M8.616 3.933c-.315-.15-.618-.182-.911-.11l20.136 20.07 4.396-5.533L8.616 3.933z'/%3E%3C/svg%3E");
}

.store-naviter .store-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z'/%3E%3C/svg%3E");
}

.store-apple {
  color: #333;
}

.store-google {
  color: #4285f4;
}

.store-naviter {
  color: var(--primary-color);
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-ok {
  background: #dcfce7;
  color: #16a34a;
}

.status-omit {
  background: #fef3c7;
  color: #d97706;
}

.status-error {
  background: #fee2e2;
  color: #dc2626;
}

/* User section */
.purchase-user-section {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f4;
}

.no-user-info {
  font-size: 13px;
  color: #9e9e9e;
  font-style: italic;
  margin: 0;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.user-row:last-child {
  margin-bottom: 0;
}

.user-icon {
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.6;
}

.icon-person {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

.icon-email {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.icon-link {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z'/%3E%3C/svg%3E");
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: #202124;
}

.user-email {
  font-size: 13px;
  color: #5f6368;
}

.user-link {
  cursor: pointer;
  transition: background-color 0.15s;
  margin: 4px -8px 0;
  padding: 4px 8px;
  border-radius: 4px;
}

.user-link:hover {
  background: #f1f3f4;
}

.link-text {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 500;
}

/* License section */
.purchase-license-section {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f3f4;
}

.license-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #5f6368;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.license-icon {
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.license-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 4px;
}

.license-row:last-child {
  margin-bottom: 0;
}

.license-label {
  color: #5f6368;
}

.license-value {
  color: #202124;
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
}

.license-value.highlight {
  color: #16a34a;
  font-weight: 600;
}

/* Details section */
.purchase-details-section {
  padding: 8px 16px 12px;
}

.details-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0px 0;
  font-weight: 500;
}

.details-toggle:hover {
  text-decoration: underline;
}

.toggle-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 6px;
  border-color: transparent transparent transparent var(--primary-color);
  transition: transform 0.15s;
}

.toggle-icon.expanded {
  transform: rotate(90deg);
}

.details-content {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.detail-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-label {
  font-weight: 500;
  color: #5f6368;
  min-width: 100px;
  flex-shrink: 0;
}

.detail-value {
  color: #202124;
  font-family: "Roboto Mono", monospace;
  word-break: break-all;
}

.detail-json-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.detail-json-toggle {
  font-size: 12px;
  font-weight: 500;
  color: #5f6368;
  cursor: pointer;
  margin-bottom: 8px;
}

.detail-json-content {
  background: #1e293b;
  border-radius: 6px;
  overflow: auto;
  max-height: 300px;
  overflow-x: hidden;
}

.detail-json-content pre {
  margin: 0;
  padding: 12px;
  font-size: 11px;
  color: #e2e8f0;
  font-family: "Roboto Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}


/* Background colors for different duration types */
.duration-yearly-bg {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
}

.duration-monthly-bg {
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
}

.duration-trial-bg {
  background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%);
}

.duration-lifetime-bg {
  background: linear-gradient(135deg, #f3e8ff 0%, #faf5ff 100%);
}

/* Purchases menu icon - Dollar symbol */
.icon-purchases {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E");
}

/* Users menu icon */
.icon-users {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M16 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 3-1.34 3-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.67 0-8 1.34-8 4v2h10v-2c0-1.07.23-2.07.64-3.01C9.83 13.36 8.9 13 8 13zm8 0c-1.93 0-3.68.32-5 .86 1.32.84 2.2 2.06 2.2 3.64v2H24v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

/* Sealer menu icon - lock/unlock */
.icon-sealer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E");
}

.icon-logs {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z'/%3E%3C/svg%3E");
}

/* ============================================================================
   Symbolize Page Styles
   ============================================================================ */

.symbolize-page {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 32px;
  box-sizing: border-box;
}

.symbolize-input-section {
  margin-bottom: 24px;
}

.symbolize-instruction {
  margin: 0 0 12px;
  font-size: 14px;
  color: #5f6368;
}

.symbolize-log-window {
  height: 400px;
  margin-bottom: 12px;
}

.symbolize-log-window .symbolize-textarea {
  height: 100%;
}

.symbolize-log-window-loading {
  opacity: 0.6;
  pointer-events: none;
}

.symbolize-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  font-size: 13px;
  font-family: ui-monospace, monospace;
  border: 1px solid #dadce0;
  border-radius: 8px;
  resize: none;
  margin: 0;
}

.symbolize-textarea:focus {
  outline: none;
  border-color: var(--primary-color, #22699d);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #22699d) 20%, transparent);
}

.symbolize-textarea:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.symbolize-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.symbolize-file-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.symbolize-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  color: #202124;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.symbolize-btn-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.symbolize-btn:hover:not(.disabled) {
  border-color: #9ca3af;
  background: #f8fafc;
}

.symbolize-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.symbolize-btn-primary {
  background: var(--primary-color, #22699d);
  border-color: var(--primary-color, #22699d);
  color: #fff;
}

.symbolize-btn-primary:hover:not(.disabled) {
  background: color-mix(in srgb, var(--primary-color, #22699d) 85%, black);
  border-color: color-mix(in srgb, var(--primary-color, #22699d) 85%, black);
}

.symbolize-error {
  margin: 12px 0 0;
  font-size: 13px;
  color: #b91c1c;
}

.symbolize-result-section {
  height: 400px;
  margin-bottom: 12px;
}

.symbolize-result-content {
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  padding: 12px;
  padding-bottom: 24px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.symbolize-result-empty {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

.symbolize-result-line {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 2px 0;
}

.symbolize-result-actions {
  display: flex;
  gap: 12px;
}

@media (max-width: 600px) {
  .symbolize-page {
    padding: 16px;
    padding-bottom: 24px;
  }
  .symbolize-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .symbolize-btn {
    width: 100%;
  }
  .symbolize-log-window {
    height: 280px;
  }
  .symbolize-result-section {
    height: 280px;
  }
}

/* ============================================================================
   Stats Page Styles - Two Column Layout
   ============================================================================ */

.stats-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 24px;
  box-sizing: border-box;
}

/* Loading and Error states */
.stats-loading,
.stats-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px;
  text-align: center;
  flex: 1;
}

.stats-error .error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.stats-error .error-detail {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
}

/* Two-column layout */
.stats-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 20px;
}

/* ============================================================================
   Users Page Styles
   ============================================================================ */

.users-page {
  width: 100%;
  height: calc(100vh - 56px);
  padding: 16px 24px;
  box-sizing: border-box;
}

.users-layout {
  display: flex;
  gap: 20px;
  height: 100%;
  overflow: hidden;
}

.users-sidebar {
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
}

.users-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-search-field {
  position: relative;
}

.users-search-input {
  width: 100%;
  height: 40px;
  padding: 10px 12px 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  line-height: 20px;
  box-sizing: border-box;
  margin: 0;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.users-search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(34, 105, 157, 0.12);
}

.users-search-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.users-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.users-search-clear:hover {
  background: #e2e8f0;
}

.users-search-clear-icon {
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M18.3 5.71L12 12l6.3 6.29-1.41 1.42L10.59 13.4 4.29 19.71 2.88 18.3 9.17 12 2.88 5.71 4.29 4.29 10.59 10.6l6.3-6.3 1.41 1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.users-search-status {
  font-size: 12px;
  color: #64748b;
  padding: 6px 4px 0;
}

.users-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.users-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-recent-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.users-recent-item:hover {
  border-color: #cbd5f5;
  box-shadow: 0 0 0 2px rgba(203, 213, 245, 0.3);
}

.users-recent-name {
  font-weight: 600;
  font-size: 13px;
  color: #1f2937;
}

.users-recent-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
}

.users-recent-time {
  color: #94a3b8;
}

/* ============================================================================
   JSON Tools + Dialog
   ============================================================================ */

.json-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.json-toolbar-title {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.json-toolbar-actions {
  display: flex;
  gap: 6px;
}

.json-tool-btn {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.json-expand-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(248, 250, 252, 0.6);
  background: rgba(30, 41, 59, 0.7);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.json-expand-btn:hover {
  border-color: rgba(248, 250, 252, 0.9);
  background: rgba(51, 65, 85, 0.8);
}

.json-expand-btn .json-tool-full {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f8fafc'%3E%3Cpath d='M7 14H5v5h5v-2H7v-3zm0-4h2V7h3V5H5v5zm10 9h-3v2h5v-5h-2v3zm0-14V3h-5v2h3v3h2z'/%3E%3C/svg%3E");
}

.json-tool-btn:hover {
  border-color: #cbd5f5;
}

.json-tool-icon {
  width: 14px;
  height: 14px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.json-tool-full {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 14H5v5h5v-2H7v-3zm0-4h2V7h3V5H5v5zm10 9h-3v2h5v-5h-2v3zm0-14V3h-5v2h3v3h2z'/%3E%3C/svg%3E");
}

.json-tool-copy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
}

.json-tool-download {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M5 20h14v-2H5v2zM12 2v12l4-4 1.41 1.41L12 17.83l-5.41-5.42L8 10l4 4V2h0z'/%3E%3C/svg%3E");
}

.json-tool-close {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M18.3 5.71L12 12l6.3 6.29-1.41 1.42L10.59 13.4 4.29 19.71 2.88 18.3 9.17 12 2.88 5.71 4.29 4.29 10.59 10.6l6.3-6.3 1.41 1.41z'/%3E%3C/svg%3E");
}

.json-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.json-dialog {
  width: min(960px, 90vw);
  height: min(80vh, 720px);
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  padding: 16px;
  gap: 12px;
}

.json-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.json-dialog-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.json-dialog-actions {
  display: flex;
  gap: 6px;
}

.json-dialog-search {
  display: flex;
  align-items: center;
  gap: 12px;
}

.json-dialog-search input {
  flex: 1;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-family: "Montserrat", sans-serif;
}

.json-dialog-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(34, 105, 157, 0.12);
}

.json-dialog-search span {
  font-size: 12px;
  color: #64748b;
}

.json-dialog-search-actions {
  display: flex;
  gap: 6px;
}

.json-dialog-search-btn {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #475569;
}

.json-dialog-search-btn:hover {
  border-color: #cbd5f5;
  color: #1f2937;
}

.json-dialog-content {
  flex: 1;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

.json-dialog-content mark {
  background: #fde68a;
  color: #0f172a;
  padding: 0 2px;
  border-radius: 2px;
}

.json-dialog-content mark.active {
  background: #f59e0b;
  color: #0f172a;
}

.json-box {
  position: relative;
}

.users-result {
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.users-result.selected {
  border-color: #22699D;
  box-shadow: 0 0 0 2px rgba(34, 105, 157, 0.12);
}

.users-result-name {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

.users-result-email {
  font-size: 12px;
  color: #64748b;
}

.users-serial-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.users-serial-result-main {
  flex: 1;
  min-width: 0;
}

.users-serial-result .users-result-name {
  margin-bottom: 2px;
}

.users-serial-result-device {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.users-serial-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.users-serial-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.users-serial-tag-owner {
  background: #e0f2fe;
  color: #0369a1;
}

.users-serial-tag-warranty {
  background: #dcfce7;
  color: #166534;
}

.users-serial-tag-using {
  background: #fef3c7;
  color: #92400e;
}

.users-detail {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.users-detail-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Heartbeats menu icon */
.icon-heartbeats {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

/* ============================================================================
   Heartbeats List Page Styles
   ============================================================================ */

.heartbeats-page {
  width: 100%;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.heartbeats-layout {
  display: flex;
  height: 100%;
  gap: 20px;
  padding: 16px 20px;
  box-sizing: border-box;
}

.heartbeats-sidebar {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.heartbeats-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.heartbeats-office-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #22699D;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.heartbeats-office-link:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.heartbeats-office-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.heartbeats-toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.heartbeats-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
}

.heartbeats-toggle-label {
  flex: 1;
}

.heartbeats-toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s;
}

.heartbeats-toggle-switch.on {
  background: #22699D;
}

.heartbeats-toggle-switch::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.heartbeats-toggle-switch.on::after {
  transform: translateX(16px);
}

.heartbeats-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.heartbeats-result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.heartbeats-result-time {
  color: #64748b;
  margin-right: 4px;
}

.heartbeats-result-emoji {
  font-size: 14px;
}

.heartbeats-result-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
}

.heartbeats-result-power {
  background: #f3e8ff;
  color: #7c3aed;
}

.heartbeats-result-email {
  background: #dcfce7;
  color: #166534;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heartbeats-result-version {
  background: #dbeafe;
  color: #1d4ed8;
}

.heartbeats-result-duration {
  background: #ffedd5;
  color: #c2410c;
}

/* ============================================================================
   Heartbeat Detail Page Styles
   ============================================================================ */

.heartbeat-detail-page {
  width: 100%;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.heartbeat-detail-layout {
  display: flex;
  height: 100%;
  gap: 20px;
  padding: 16px 20px;
  box-sizing: border-box;
  align-items: flex-start;
}

.heartbeat-detail-left {
  width: 420px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.heartbeat-detail-center {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.heartbeat-detail-center > *:first-child {
  margin-top: 0;
}

.heartbeat-detail-right {
  width: 420px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  box-sizing: border-box;
}

.heartbeat-detail-right > *:first-child {
  margin-top: 0;
}

.heartbeat-briefing-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.heartbeat-briefing-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.heartbeat-briefing-status {
  font-size: 18px;
  font-weight: 700;
}

.heartbeat-briefing-status.healthy {
  color: #15803d;
}

.heartbeat-briefing-status.warning {
  color: #b45309;
}

.heartbeat-briefing-warnings {
  font-size: 13px;
  color: #b45309;
  font-style: italic;
}

.heartbeat-briefing-section {
  margin-bottom: 16px;
}

.heartbeat-briefing-section:last-child {
  margin-bottom: 0;
}

.heartbeat-briefing-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #22699D;
  margin: 0 0px 8px 0;
}

.heartbeat-briefing-counter-more {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  margin-top: 4px;
}

.heartbeat-briefing-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.heartbeat-briefing-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.heartbeat-briefing-label {
  flex-shrink: 0;
  width: 170px;
  font-weight: 500;
  color: #64748b;
}

.heartbeat-briefing-value {
  font-family: ui-monospace, monospace;
  color: #0f172a;
}

.heartbeat-briefing-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.heartbeat-briefing-metric-row {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.heartbeat-briefing-metric-row .heartbeat-briefing-value {
  font-size: 18px;
  font-weight: 700;
  color: #22699D;
}

.heartbeat-detail-briefing-json,
.heartbeat-detail-series-json {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.heartbeat-detail-json-toggle {
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: #334155;
}

.heartbeat-detail-json-toggle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.heartbeat-detail-pre {
  margin: 0;
  padding: 12px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.heartbeat-detail-graph-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: "Montserrat", sans-serif;
}

.icon-metric-line1 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z'/%3E%3C/svg%3E");
}

.icon-metric-line2 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 14H3V5h18v12z'/%3E%3C/svg%3E");
}

.icon-source {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M12 2l-5.5 9h11L12 2zm0 3.84L13.93 9h-3.86L12 5.84zM17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5zm0 7a2.5 2.5 0 010-5 2.5 2.5 0 010 5zM3 21.5h8v-8H3v8zm2-6h4v4H5v-4z'/%3E%3C/svg%3E");
}

.heartbeat-detail-control-spacer {
  flex: 1;
}

.heartbeat-detail-json-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.heartbeat-detail-json-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.heartbeat-detail-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.icon-raw-json {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M14.6 16.6l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4m-5.2 0L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4z'/%3E%3C/svg%3E");
}

.heartbeat-detail-select {
  padding: 6px 24px 6px 10px;
  font-size: 13px;
  font-family: "Montserrat", sans-serif;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 16px 16px;
}

.heartbeat-detail-chart-wrap {
  flex: 1;
  min-height: 300px;
  height: 300px;
  position: relative;
  font-family: "Montserrat", sans-serif;
}

.heartbeat-detail-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.heartbeat-detail-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  gap: 16px;
}

.heartbeat-detail-content.with-json > .heartbeat-detail-chart-wrap {
  flex: 0 0 auto;
  height: 250px;
  min-height: 200px;
}

.heartbeat-detail-content.with-json > .heartbeat-detail-json-panels {
  flex: 1;
  min-height: 0;
}

.heartbeat-detail-json-panels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: auto;
}

.heartbeat-detail-json-panels.split {
  flex-direction: row;
  gap: 16px;
}

.heartbeat-detail-json-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.heartbeat-detail-json-panels.split .heartbeat-detail-json-panel {
  flex: 1;
}

@media (max-width: 900px) {
  .heartbeat-detail-layout {
    flex-direction: column;
    overflow-y: auto;
  }
  .heartbeat-detail-left,
  .heartbeat-detail-center,
  .heartbeat-detail-right {
    width: 100%;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }
}

/* ============================================================================
   Sealer Page Styles
   ============================================================================ */

.sealer-page {
  width: 100%;
  height: calc(100vh - 56px);
  padding: 16px 24px;
  box-sizing: border-box;
}

.sealer-layout {
  display: flex;
  gap: 20px;
  height: 100%;
  overflow: hidden;
}

.sealer-sidebar {
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
}

.sealer-sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sealer-sidebar-title {
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  margin: 0px;
}

.sealer-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sealer-tokens-section {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.sealer-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.sealer-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sealer-btn-primary {
  background: var(--primary-color);
  color: #ffffff;
}

.sealer-btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.sealer-btn-reset {
  background: #ffffff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.sealer-btn-reset:hover:not(:disabled) {
  background: #f0f9ff;
  box-shadow: 0 2px 4px rgba(34, 105, 157, 0.2);
}

.sealer-token-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.sealer-token-item {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.sealer-token-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.sealer-token-item.selected {
  background: #e0f2fe;
  border-color: var(--primary-color);
}

.sealer-token-serial {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.sealer-token-meta {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

.sealer-token-valid {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.sealer-loading,
.sealer-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.sealer-empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sealer-error {
  padding: 8px 12px;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 8px;
  font-size: 13px;
}

.sealer-detail {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sealer-qr-section {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 20px 20px 60px 20px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.sealer-qr-caption {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
}

.sealer-qr-valid {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
  margin-top: 4px;
}

.sealer-qr-container {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.sealer-qr-image {
  border-radius: 8px;
}

.sealer-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.sealer-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.sealer-card-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
}

.sealer-card-last-modified {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.sealer-card-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #1a5a8a 100%);
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
}

.sealer-card-icon-svg {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background-color: #f0f9ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 28px;
}

.sealer-card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sealer-card-title {
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.sealer-card-version {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.sealer-card-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.sealer-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sealer-card-instructions {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  margin: 0;
}

.sealer-instructions-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
}

.sealer-card-download {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.sealer-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #1a5a8a 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  text-decoration: none;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(34, 105, 157, 0.3);
}

.sealer-download-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(34, 105, 157, 0.35);
}

.sealer-download-icon {
  font-size: 18px;
  line-height: 1;
}

.sealer-workflow-link {
  font-size: 13px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.sealer-workflow-link:hover {
  color: #1a5a8a;
  text-decoration: underline;
}

@media (max-width: 960px) {
  .sealer-page {
    padding: 16px;
  }

  .sealer-layout {
    flex-direction: column;
    gap: 16px;
  }

  .sealer-sidebar {
    width: 100%;
  }
}

.users-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  min-width: 0;
  overflow: hidden;
}

.users-profile-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.users-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #334155;
  overflow: hidden;
}

.users-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.users-profile-name {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.users-profile-email {
  font-size: 13px;
  color: #64748b;
}

.users-profile-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.users-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 16px;
  margin-top: 16px;
}

.users-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.users-info-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.users-info-value {
  font-size: 13px;
  color: #1f2937;
}

.users-profile-actions {
  margin-top: 12px;
}

.users-action-btn {
  background: #22699D;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.users-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.users-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.users-section-count {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
}

.users-recent-toggle {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  padding: 4px;
  border-radius: 8px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.users-recent-toggle:hover {
  border-color: #cbd5f5;
  color: #1f2937;
}

.users-recent-toggle-icon {
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.users-recent-toggle-icon.expand {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
}

.users-recent-toggle-icon.collapse {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 14l5-5 5 5H7z'/%3E%3C/svg%3E");
}

.users-section-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin: 10px 0 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.users-section-subtitle-note {
  font-size: 11px;
  color: #64748b;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.users-device-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.users-device-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.users-device-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.users-device-heartbeats {
  font-size: 12px;
  color: var(--primary-color);
  cursor: pointer;
  width: fit-content;
}

.users-device-setting {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.users-device-setting-title {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.users-device-setting-name {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
}

.users-device-setting-heartbeats {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.users-device-heartbeats-link {
  color: var(--primary-color);
  text-decoration: none;
}

.users-device-heartbeats-link:hover {
  text-decoration: underline;
}

.users-device-row,
.users-heartbeat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.users-device-actions {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-shrink: 0;
}

.users-device-action-icon {
  flex-shrink: 0;
  /* Align the 16px icon graphic (centered in 28px box) with the top line of text: shift up by 6px */
  margin-top: -6px;
  margin-right: -6px;
}

/* Tooltip on the left so it is not clipped by the card */
.users-device-action-icon[data-tooltip]::after {
  bottom: auto;
  left: auto;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-bottom: 0;
  margin-right: 8px;
}

.users-device-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.users-device-name {
  font-weight: 600;
  font-size: 13px;
}

.users-device-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.users-device-serial {
  font-size: 12px;
  color: #64748b;
}

.users-device-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.users-device-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: #64748b;
  min-height: 16px;
}

.users-device-detail-toggle {
  min-height: 18px;
}

.users-device-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
}

.users-device-meta-value {
  color: #475569;
}

@media (max-width: 1200px) {
  .users-device-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .users-device-grid {
    grid-template-columns: 1fr;
  }
}

.users-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.badge-phone {
  background: #fce7f3;
  color: #be185d;
}

.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.users-device-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 4px;
}

.users-device-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.users-device-tag-remove:hover {
  background: rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.users-device-tag-remove:focus {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.users-settings-group {
  margin-bottom: 10px;
}

.users-settings-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.users-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.users-app-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.users-app-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.users-app-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.users-app-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}

.users-app-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: #64748b;
}

.users-app-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
}

.users-app-meta-value {
  color: #475569;
}

.users-setting-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-setting-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.users-setting-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.users-setting-sub {
  font-size: 11px;
  color: #64748b;
}

.users-json {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  border-radius: 8px;
  padding: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
}

.users-json pre {
  margin: 0;
}

.json-box {
  position: relative;
}

.users-heartbeats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.users-heartbeat-row {
  cursor: pointer;
  flex-direction: column;
  align-items: flex-start;
}

.users-heartbeat-id {
  font-weight: 600;
  font-size: 12px;
}

.users-heartbeat-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: #64748b;
}

.users-heartbeat-detail {
  margin-top: 12px;
}

.users-purchases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.users-purchases-list {
  padding: 0;
  max-width: none;
}

.users-purchase-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-purchase-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

.users-purchase-main {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
}

.users-purchase-meta {
  font-size: 11px;
  color: #64748b;
}

.users-error {
  color: #b91c1c;
  background: #fee2e2;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.users-empty {
  color: #94a3b8;
  font-size: 12px;
  padding: 8px 4px;
}

.users-loading {
  font-size: 13px;
  color: #64748b;
  padding: 8px 4px;
}

.users-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.users-dialog {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.users-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.users-dialog-btn {
  border: 1px solid #cbd5f5;
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.users-dialog-btn.primary {
  background: #22699D;
  color: white;
  border-color: #22699D;
}

@media (max-width: 960px) {
  .users-page {
    padding: 16px;
  }

  .users-layout {
    flex-direction: column;
    gap: 16px;
  }

  .users-sidebar {
    width: 100%;
  }
}

/* Left Panel - Metrics List */
.stats-left-panel {
  width: 450px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
}

/* Search Bar */
.stats-search-container {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0;
  border-bottom: 1px solid #e2e8f0;
}

.stats-search {
  width: 100%;
  height: 40px;
  padding: 10px 36px 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  line-height: 20px;
  box-sizing: border-box;
  margin: 0;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stats-search:focus {
  border-color: var(--primary-color);
}

.stats-search::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.stats-search-clear {
  position: absolute;
  right: 20px;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  padding: 4px;
}

.stats-search-clear:hover {
  color: #374151;
}

/* Metrics List */
.stats-metrics-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Category Section */
.stats-category {
  border-bottom: 1px solid #f3f4f6;
}

.stats-category-header {
  display: flex;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
}

.stats-category-header:hover {
  background: #f3f4f6;
}

.stats-category-arrow {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #6b7280;
  margin-right: 8px;
  transition: transform 0.15s;
}

.stats-category-arrow.expanded {
  transform: rotate(90deg);
}

.stats-category-name {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.stats-category-metrics {
  padding: 4px 0;
}

/* Metric Row */
.stats-metric-row {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color 0.15s;
  overflow: hidden;
}

.stats-metric-row:hover {
  background-color: #f3f4f6;
}

/* Checkbox */
.stats-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-radius: 3px;
  margin-right: 10px;
  flex-shrink: 0;
  transition: background-color 0.15s, border-color 0.15s;
}

.stats-checkbox.checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.stats-metric-name {
  font-size: 13px;
  color: #2563eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.stats-metric-separator {
  font-size: 13px;
  color: #6b7280;
}

.stats-metric-value {
  font-size: 13px;
  font-weight: 500;
  color: #0d9488;
}

.stats-metric-diff {
  font-size: 10px;
  margin-left: 4px;
}

.stats-metric-diff.diff-positive {
  color: #16a34a;
}

.stats-metric-diff.diff-negative {
  color: #dc2626;
}

/* Right Panel - Chart Area */
.stats-right-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stats-chart-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.stats-chart-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 14px;
}

.stats-charts {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Chart Container */
.stats-chart-container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.stats-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.stats-chart-title {
  font-size: 12px;
  color: #374151;
  font-family: "Montserrat", sans-serif;
}

.stats-chart-close {
  width: 24px;
  height: 24px;
  background: #dc2626;
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.stats-chart-close:hover {
  background-color: #b91c1c;
}

.stats-chart {
  padding: 10px;
  position: relative;
}

.stats-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .stats-page {
    padding: 16px;
  }

  .stats-layout {
    flex-direction: column;
    gap: 16px;
  }

  .stats-left-panel {
    width: 100%;
    max-height: 50vh;
    border: 1px solid #e2e8f0;
  }

  .stats-right-panel {
    flex: 1;
    min-height: 300px;
  }
}

/* Stats menu icon - Line chart/trending */
.icon-stats {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z'/%3E%3C/svg%3E");
}

/* X-Alps menu icon - Mountain/hiking */
.icon-xalps {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322699D'%3E%3Cpath d='M14 6l-3.75 5 2.85 3.8-1.6 1.2C9.81 13.75 7 10 7 10l-6 8h22L14 6z'/%3E%3C/svg%3E");
}

/* ============================================================================
   X-Alps Page Styles
   ============================================================================ */

.xalps-page {
  width: 100%;
  display: flex;
  overflow: hidden;
  padding: 16px 24px;
  gap: 20px;
  box-sizing: border-box;
  font-family: "Montserrat", sans-serif;
}

/* Left Panel - Account List */
.xalps-left-panel {
  width: 450px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.xalps-add-btn {
  margin: 0;
  padding: 12px 16px;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  transition: background-color 0.15s;
}

.xalps-add-btn:hover {
  background: #1b5a87;
}

.xalps-search-container {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0;
}

.xalps-search-icon {
  position: absolute;
  left: 24px;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239ca3af'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.xalps-search {
  width: 100%;
  padding: 10px 12px 10px 36px;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.xalps-search:focus {
  border-color: var(--primary-color);
}

.xalps-account-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  border-top: 1px solid #e2e8f0;
}

.xalps-loading,
.xalps-error,
.xalps-empty {
  padding: 32px;
  text-align: center;
  color: #6b7280;
}

.xalps-account-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.15s;
}

.xalps-account-item:hover {
  background-color: #f9fafb;
}

.xalps-account-item.selected {
  background-color: #e0f2fe;
}

.xalps-account-info {
  flex: 1;
  min-width: 0;
}

.xalps-account-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xalps-account-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xalps-delete-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
  flex-shrink: 0;
}

.xalps-delete-btn:hover {
  background-color: #fee2e2;
}

.xalps-delete-icon {
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Right Panel - Account Details */
.xalps-right-panel {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow-y: auto;
}

.xalps-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 16px;
}

.xalps-details {
  padding: 24px;
}

.xalps-details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.xalps-details-name {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.xalps-details-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xalps-btn {
  padding: 8px 16px;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s;
}

.xalps-btn:hover {
  background: #1b5a87;
}

.xalps-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.xalps-btn-secondary:hover {
  background: #e5e7eb;
}

.xalps-btn-danger {
  background: #dc2626;
}

.xalps-btn-danger:hover {
  background: #b91c1c;
}

.xalps-download-icon {
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.xalps-portrait {
  max-width: 150px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.xalps-ogn-address {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 16px;
}

.xalps-ogn-address.override {
  color: #dc2626;
}

.xalps-settings-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.xalps-settings-json {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  font-size: 12px;
  font-family: "Courier New", monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Dialog Styles */
.xalps-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.xalps-dialog-container {
  max-width: 90%;
  max-height: 90%;
}

.xalps-dialog {
  background: #ffffff;
  border-radius: 12px;
  min-width: 400px;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.xalps-dialog-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.xalps-dialog-content {
  padding: 20px 24px;
}

.xalps-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

.xalps-field {
  margin-bottom: 16px;
}

.xalps-field > span:first-child {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.xalps-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.xalps-input:focus {
  border-color: var(--primary-color);
}

/* IGC Dialog */
.xalps-igc-dialog {
  max-width: 500px;
}

.xalps-igc-list {
  max-height: 400px;
  overflow-y: auto;
}

.xalps-igc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.15s;
}

.xalps-igc-item:hover {
  color: var(--primary-color);
}

/* Mobile responsive */
@media (max-width: 900px) {
  .xalps-page {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }

  .xalps-left-panel {
    width: 100%;
    max-height: 50vh;
  }

  .xalps-right-panel {
    flex: 1;
    min-height: 300px;
  }

  .xalps-dialog {
    min-width: unset;
    width: 90%;
  }
}
