:root {
  --color-primary: #FFB500;
  --color-primary-blue: #00A9EB;
  --color-primary-red: #FF5757;
  --color-primary-green: #7ED956;
  --color-primary-gray: #E1E0E0;
  --color-text: #0B111A;
  --color-text-muted: #6b7280;
  --color-bg: #ffffff;
  --color-card-bg: #f8f9fa;
  --color-card-hover: rgba(0, 0, 0, 0.04);
  --color-border: #e9ecef;
  --color-secondary-text: #0B111A;
}

/* Dark theme variables */
[data-theme="dark"] {
  color-scheme: dark;
  --color-primary: #FFB500;
  --color-primary-blue: #00A9EB;
  --color-primary-red: #FF5757;
  --color-primary-green: #7ED956;
  --color-primary-gray: #3a3f47;
  --color-text: #e8e8e8;
  --color-text-muted: #9ca3af;
  --color-bg: #0d1117;
  --color-card-bg: #161b22;
  --color-card-hover: rgba(255, 255, 255, 0.06);
  --color-border: #30363d;
  --color-secondary-text: #c9d1d9;
}
 
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
 
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}
 
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}
 
.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #09111b;
}
 
.header-logo {
  width: 48px;
  height: 48px;
}
 
.header-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
 
.header h1 {
  color: var(--color-text);
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
 
.title-logo {
    width: 200px;
    height: 64px;
    vertical-align: middle;
    display: inline-block;
}

 
.header .count {
  color: #09111b;
  font-size: 1.8rem;
}

.refresh-btn {
  color: var(--color-text);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-left: auto;
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(11, 133, 255, 0.3);
}

.refresh-btn:active {
  transform: translateY(0);
}

.refresh-btn.htmx-request {
  opacity: 0.7;
  pointer-events: none;
}
 
.search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: stretch;
}
 
.search-input-wrapper {
  flex: 1;
  position: relative;
}
 
.search-input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  transition: border-color 0.2s ease;
}
 
.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
 
/* Tags Dropdown Multiselect */
.tags-dropdown-wrapper {
  position: relative;
  min-width: 250px;
}
 
.tags-dropdown-button {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--color-text);
  transition: border-color 0.2s ease;
  text-align: left;
}
 
.tags-dropdown-button:hover {
  border-color: var(--color-primary);
}
 
.dropdown-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
 
.dropdown-arrow {
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}
 
.tags-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(9, 17, 27, 0.1);
  z-index: 100;
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
}

.tags-dropdown-menu:empty {
  display: none;
  border: none;
  box-shadow: none;
}
 
.dropdown-search {
  padding: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}
 
.dropdown-search input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.9rem;
}
 
.dropdown-search input:focus {
  outline: none;
  border-color: var(--color-primary);
}
 
.dropdown-options {
  overflow-y: auto;
}
 
.tag-option {
  padding: 0.4rem 0.75rem; /* less padding = tighter look */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.15s ease;
}
 
.tag-option:hover {
  background-color: #f8f9fa;
}
 
.tag-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #ddd;
  border-radius: 3px;
  background: white;
  position: relative;
  flex-shrink: 0;
}
 
.tag-option input[type="checkbox"]:checked {
  background: white;
  border-color: var(--color-primary);
}
 
.tag-option input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-primary);
  font-size: 14px;
  font-weight: bold;
}
 
.tag-option span {
  cursor: pointer;
  flex: 1;
  user-select: none;
}
 
.dropdown-actions {
  padding: 0.75rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
 
.dropdown-action-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: white;
  color: black;
  transition: all 0.2s ease;
}
 
.dropdown-action-btn:hover {
  border-color: var(--color-primary);
  background: #f8f9fa;
}
 
.no-tags-found {
  padding: 1rem;
  text-align: center;
  color: var(--color-secondary-text);
  font-size: 0.9rem;
}

/* No Results Styling */
.no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-secondary-text);
}

.no-results-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.no-results-hint {
  font-size: 0.9rem;
  color: var(--color-secondary-text);
}
 
.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
 
.prompt-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
 
.prompt-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(9, 17, 27, 0.1);
  border-color: var(--color-primary);
}
 
.prompt-card h3 {
  color: var(--color-text);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}
 
.prompt-card p {
  color: var(--color-secondary-text);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  flex: 1;
}
 
.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
 
.tag {
  background: var(--color-card-bg);
  border: 1.5px solid var(--color-primary);
  border-radius: 16px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--color-text);
  font-weight: 500;
}

/* Special tag backgrounds for workspace and project */
.workspace-tag {
  background: #e8f5e9 !important;
  color: #2e7d32 !important;
  border-color: #2e7d32 !important;
}

.project-tag {
  background: #fff3e0 !important;
  color: #f57c00 !important;
  border-color: #f57c00 !important;
}

[data-theme="dark"] .workspace-tag {
  background: rgba(46, 125, 50, 0.2) !important;
  color: #81c784 !important;
  border-color: #66bb6a !important;
}

[data-theme="dark"] .project-tag {
  background: rgba(245, 124, 0, 0.2) !important;
  color: #ffb74d !important;
  border-color: #ffa726 !important;
}
 
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 17, 27, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}
 
.modal-overlay:target {
  display: flex;
}
 
.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  margin: auto;
}
 
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-primary);
}
 
.modal-title-wrapper {
  flex: 1;
}
 
.modal-header h2 {
  color: var(--color-text);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
}
 
.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--color-secondary-text);
  padding: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  line-height: 1;
  text-decoration: none;
}
 
.close-btn:hover {
  color: var(--color-text);
}
 
.version-badge {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-text);
  padding: 0.4rem 0.9rem;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
 
.author-info {
  color: var(--color-secondary-text);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
 
.author-info strong {
  color: var(--color-text);
}
 
.author-link {
  color: #4a9eff;
  text-decoration: none;
}
 
.author-link:hover {
  text-decoration: underline;
}
 
.section {
  margin-bottom: 2rem;
}
 
.section h3 {
  color: var(--color-text);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}
 
.section-description {
  color: var(--color-secondary-text);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
 
.code-block {
  background: #f8f9fa;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-top: 0.75rem;
  position: relative;
}
 
.code-block pre {
  margin: 0;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #09111b;
  background: transparent;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.code-inline {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Courier New", monospace;
  font-size: 0.85rem;
  background: rgba(255, 179, 11, 0.1);
  color: var(--color-text);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 179, 11, 0.2);
}
 
.copy-btn {
  background: var(--color-primary);
  color: var(--color-text);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  transition: all 0.2s ease;
}
 
.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 179, 11, 0.3);
}
 
.copy-btn:active {
  transform: translateY(0);
}
 
.copy-btn.copied {
  background: #28a745;
}
 
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-secondary-text);
  font-size: 1.1rem;
  grid-column: 1 / -1;
}
 
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
 
::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
 
::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}
 
::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* ── Model tier tabs in Create Key modal ──────────────────────────────────── */

.tier-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.tier-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  background: var(--color-card-bg);
  color: var(--color-text-muted);
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}

.tier-tab:hover {
  background: var(--color-card-hover);
}

.tier-tab.active {
  background: var(--color-primary);
  color: #0B111A;
  font-weight: 600;
}

/* ── Model config admin page ──────────────────────────────────────────────── */

.model-config-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.model-config-stats {
  display: flex;
  gap: 0.5rem;
}

.stat-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.stat-pill.stat-metered {
  background: rgba(255, 87, 87, 0.1);
  border-color: rgba(255, 87, 87, 0.3);
  color: var(--color-primary-red);
}

.stat-pill.stat-unmetered {
  background: rgba(126, 217, 86, 0.1);
  border-color: rgba(126, 217, 86, 0.3);
  color: var(--color-primary-green);
}

.model-config-actions {
  display: flex;
  gap: 0.5rem;
}

.tier-toggle-group {
  display: flex;
  gap: 0.25rem;
}

.tier-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tier-badge.tier-metered {
  background: rgba(255, 87, 87, 0.15);
  color: var(--color-primary-red);
}

.tier-badge.tier-unmetered {
  background: rgba(126, 217, 86, 0.15);
  color: var(--color-primary-green);
}
