/* dashboard.css - Web Application Dashboard
   Adapted from ExtensionSource/dashboard.css for the web context */

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

/* ============================================================================
   Variables
   ============================================================================ */

:root {
  --bg-dark: #121212;
  --bg-card: #1e1e1e;
  --bg-sidebar: #181818;
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1a6;
  --accent: #0a84ff;
  --accent-blue: #0a84ff;
  --accent-hover: #0077ee;
  --accent-active: #0066cc;
  --accent-focus-ring: 0 0 0 3px rgba(10, 132, 255, 0.35);
  --radius-btn: 12px;
  --radius-btn-sm: 10px;
  --btn-disabled-opacity: 0.55;
  --btn-secondary-border: 1px solid rgba(255, 255, 255, 0.16);
  --btn-secondary-hover-bg: rgba(255, 255, 255, 0.06);
  --border-color: #2b2b2b;
  --sidebar-width: 260px;
  --header-height: 64px;
  --unavailable-red: #f44336;
  --unavailable-bg: #2a1a1a;
}

/* ============================================================================
   Reset & Base
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: block;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ============================================================================
   Auth Gate
   ============================================================================ */

.auth-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  z-index: 9999;
}

.auth-gate-inner {
  text-align: center;
}

.auth-gate-brand {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.auth-gate-brand span {
  color: var(--text-secondary);
  font-weight: 400;
}

.auth-gate-inner p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 16px;
}

.auth-gate-loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Secondary: Login to Dashboard */
.btn-sign-in {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background: transparent;
  color: #e5e7eb;
  border: var(--btn-secondary-border);
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-sign-in:hover {
  background: var(--btn-secondary-hover-bg);
  color: #e5e7eb;
}
.btn-sign-in:focus-visible {
  outline: none;
  box-shadow: var(--accent-focus-ring);
}

/* ============================================================================
   App Layout
   ============================================================================ */

.app-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

/* ============================================================================
   Sidebar
   ============================================================================ */

#sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-brand {
  margin-bottom: 30px;
}

.brand-link {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.brand-link span {
  color: var(--text-secondary);
  font-weight: 400;
}

.sidebar-nav .nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-nav .nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.sidebar-nav .nav-item.active {
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent);
  font-weight: 500;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}

.nav-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.group-delete-icon {
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  color: #8e8e93;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
  padding: 0 2px;
}

.nav-item:hover .group-delete-icon,
.nav-item.active .group-delete-icon {
  opacity: 1;
}

.group-delete-icon:hover {
  color: #ff453a;
}

.nav-item-add {
  color: var(--text-secondary) !important;
  font-size: 13px;
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease;
  border: 1px dashed rgba(255,255,255,0.1);
  justify-content: flex-start;
  gap: 0;
}

.nav-item-add:hover {
  opacity: 1;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
}

.nav-item-add .icon {
  font-style: normal;
  font-size: 16px;
  margin-right: 6px;
}

.group-edit-input {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--accent-blue, #0a84ff);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 2px 6px;
  outline: none;
  width: 100%;
  max-width: 130px;
  font-family: inherit;
}

.nav-section-header, .sidebar-filters h3 {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
  padding-left: 12px;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.nav-section-header:hover, .sidebar-filters h3:hover {
  color: var(--text-secondary);
}

.group-count-badge {
  background: rgba(255,255,255,0.1);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #a1a1a6;
}

/* Filters */
.sidebar-filters {
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-filters h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

#filterFacets {
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}

/* Dynamic Filters */
.filter-group { margin-bottom: 16px; }

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 6px;
  user-select: none;
}

.filter-header:hover .filter-title { color: var(--text-primary); }

.filter-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-toggle-icon {
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.filter-options-list {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 4px;
}

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

.filter-row label {
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background-color: #2c2c2e;
  border: 1px solid #3a3a3c;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.filter-row input[type="checkbox"]:checked {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.filter-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-row input[type="checkbox"]:hover { border-color: #555; }

.filter-range-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-left: 4px;
}

.filter-input-sm {
  width: 100%;
  background-color: #2c2c2e;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.filter-input-sm:focus { border-color: var(--accent-blue); }

.filter-input-sm::-webkit-outer-spin-button,
.filter-input-sm::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Scrollbar */
#filterFacets::-webkit-scrollbar,
.filter-options-list::-webkit-scrollbar { width: 6px; }

#filterFacets::-webkit-scrollbar-track,
.filter-options-list::-webkit-scrollbar-track { background: transparent; }

#filterFacets::-webkit-scrollbar-thumb,
.filter-options-list::-webkit-scrollbar-thumb { background-color: rgba(128, 128, 128, 0.4); border-radius: 4px; }

/* ============================================================================
   Main Content
   ============================================================================ */

#mainContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.top-bar {
  height: var(--header-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: linear-gradient(360deg, rgba(24, 24, 33, 1) 0%, rgba(49, 49, 54, 1) 100%);
  flex-shrink: 0;
}

.user-context span {
  color: var(--text-secondary);
  font-size: 14px;
}

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

/* ============================================================================
   Buttons
   ============================================================================ */

/* Secondary pills: Sync Data, Check Prices, Hide Chart, Back to Site, Account, Sign Out */
.btn-pill-primary, .btn-pill-secondary {
  background: transparent;
  color: #e5e7eb;
  border: var(--btn-secondary-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
}
.btn-pill-primary:hover, .btn-pill-secondary:hover {
  background: var(--btn-secondary-hover-bg);
  color: #e5e7eb;
}
.btn-pill-primary:focus-visible, .btn-pill-secondary:focus-visible {
  outline: none;
  box-shadow: var(--accent-focus-ring);
}

/* Ghost: Clear, low-emphasis text links */
.btn-text {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-btn-sm);
  transition: color 0.2s, background 0.15s;
  font-family: inherit;
}
.btn-text:hover { color: #fff; background: var(--btn-secondary-hover-bg); }
.btn-text:focus-visible { outline: none; box-shadow: var(--accent-focus-ring); }

/* Primary: one per section (e.g. Install Extension in empty state) */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); }
.btn-primary:focus-visible { outline: none; box-shadow: var(--accent-focus-ring); }
.btn-primary:disabled { opacity: var(--btn-disabled-opacity); cursor: not-allowed; }

/* Ghost: row open icon, remove, kebab */
.btn-icon {
  background: transparent;
  border: none;
  color: #9ca3af;
  border-radius: var(--radius-btn-sm);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
}
.btn-icon:hover { color: #fff; background: var(--btn-secondary-hover-bg); }
.btn-icon:focus-visible { outline: none; box-shadow: var(--accent-focus-ring); }

.bulk-action-select {
  background: #2c2c2e;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

/* ============================================================================
   Select Mode & Bulk Actions
   ============================================================================ */

.btn-select-mode {
  font-size: 12px;
  padding: 5px 14px;
  transition: background 0.2s, color 0.2s;
}

.btn-select-mode.active {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  border-color: rgba(255, 69, 58, 0.3);
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(10, 132, 255, 0.08);
  border: 1px solid rgba(10, 132, 255, 0.2);
  border-radius: 8px;
  margin: 0 32px 12px 32px;
  font-size: 13px;
}

.bulk-select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.bulk-action-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-action-select {
  background: var(--card-bg, #252525);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.bulk-action-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-pill-danger {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-pill-danger:hover:not(:disabled) {
  background: rgba(255, 69, 58, 0.25);
}

.btn-pill-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bulk-selection-count {
  color: var(--accent-blue, #0a84ff);
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
}

.col-checkbox {
  width: 36px;
  text-align: center;
  padding: 8px !important;
}

.col-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent-blue, #0a84ff);
}

.bulk-select-checkbox {
  display: inline-block;
  cursor: pointer;
  accent-color: var(--accent-blue, #0a84ff);
}

/* ============================================================================
   Grid / Table
   ============================================================================ */

#gridSection {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  min-height: 200px;
}

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

.grid-header h3 {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
}

.dashboard-search-input {
  background: #2c2c2e;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  width: 200px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.dashboard-search-input:focus { border-color: var(--accent); }

.badge {
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

table { width: 100%; border-collapse: collapse; }

th {
  background: #252525;
  color: #a1a1a6;
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-primary);
}

tr { background-color: #181818; cursor: pointer; }
tr:hover { background-color: rgba(255, 255, 255, 0.05); }
tr button { cursor: pointer; }

td img { width: 60px; height: 45px; object-fit: cover; border-radius: 4px; }

.col-price { font-family: 'Inter', monospace; font-weight: 600; color: var(--accent); }
.col-value { font-size: 12px; color: #4caf50; }

/* ============================================================================
   Visualization / Chart
   ============================================================================ */

.visualization-container {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  max-height: calc(100vh - var(--header-height) - 200px);
  overflow: hidden;
}

.viz-header { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; justify-content: space-between; }
.viz-header h2 { margin: 0; font-size: 18px; color: var(--text-primary); font-weight: 500; }

.chart-wrapper { flex: 1; position: relative; min-height: 200px; width: 100%; }

.resize-handle {
  height: 12px;
  background: var(--bg-dark);
  cursor: row-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
  flex-shrink: 0;
}

.resize-handle:hover { background: rgba(255,255,255,0.1); }

.handle-bar { width: 40px; height: 4px; background: #444; border-radius: 2px; }

/* Highlight */
@keyframes rowHighlight {
  0% { background-color: rgba(66, 133, 244, 0.3); }
  100% { background-color: transparent; }
}

.highlight-row { animation: rowHighlight 2s ease-out; }

/* Chart Pulse */
.chart-pulse-overlay {
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  display: none;
  transform: translate(-50%, -50%);
  background-color: rgba(66, 133, 244, 0.6);
  border: 2px solid rgba(66, 133, 244, 0.8);
}

.chart-pulse-overlay.chart-pulse-active { animation: chartPulse 2s ease-out; }

@keyframes chartPulse {
  0% { width: 20px; height: 20px; opacity: 0.8; }
  50% { width: 60px; height: 60px; opacity: 0.6; }
  100% { width: 80px; height: 80px; opacity: 0; }
}

/* Custom Tooltip */
.chart-tooltip {
  opacity: 0;
  position: absolute;
  background: rgba(28, 28, 30, 0.95);
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  padding: 10px;
  width: 200px;
  font-family: 'Inter', sans-serif;
}

.tooltip-img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; margin-bottom: 8px; background-color: #333; }
.tooltip-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.tooltip-price { font-size: 13px; font-weight: 700; color: #4caf50; margin-bottom: 8px; }
.tooltip-link { display: block; text-align: center; background: var(--accent); color: white; text-decoration: none; padding: 6px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.tooltip-link:hover { background: var(--accent-hover); color: white; }

.tooltip-tags { margin: 4px 0 6px; display: flex; flex-wrap: wrap; gap: 3px; }

/* ============================================================================
   Chart Controls
   ============================================================================ */

.viz-toolbar { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }

.viz-presets { display: inline-flex; gap: 8px; background: rgba(255, 255, 255, 0.05); padding: 4px; border-radius: 8px; }

.btn-preset {
  background: transparent; border: none; color: var(--text-secondary);
  padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; font-family: inherit;
}

.btn-preset:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.btn-preset.active { background: var(--accent); color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

/* Toggle Switch */
.toggle-switch { display: flex; align-items: center; cursor: pointer; user-select: none; gap: 8px; }
.toggle-switch input { display: none; }
.toggle-switch .slider { width: 36px; height: 20px; background-color: #3a3a3c; border-radius: 20px; position: relative; transition: background-color 0.3s; }
.toggle-switch .slider::after { content: ''; width: 16px; height: 16px; background-color: white; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform 0.3s; }
.toggle-switch input:checked + .slider { background-color: var(--accent); }
.toggle-switch input:checked + .slider::after { transform: translateX(16px); }
.toggle-switch .label-text { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.toggle-switch:hover .label-text { color: var(--text-primary); }

/* Insight Callout */
.insight-callout { background: linear-gradient(90deg, rgba(10, 132, 255, 0.1) 0%, rgba(10, 132, 255, 0.05) 100%); border: 1px solid rgba(10, 132, 255, 0.2); border-radius: 6px; padding: 6px 12px; font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 8px; }

.chart-caption { font-size: 11px; color: #666; text-align: center; margin-top: 10px; font-style: italic; min-height: 14px; }

.divider-vertical { width: 1px; height: 20px; background-color: var(--border-color); margin: 0 8px; }

/* ============================================================================
   Unavailable Listings
   ============================================================================ */

.unavailable-badge { display: inline-block; background-color: var(--unavailable-red); color: white; padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 600; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }
.unavailable-date { font-size: 11px; color: var(--text-secondary); margin-top: 4px; font-style: italic; }

/* Auction listing styles */
.auction-badge { display: inline-block; background-color: #d4a017; color: #1a1a1a; padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 600; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }
.auction-trend-warning { color: var(--text-secondary); font-size: 11px; font-style: italic; margin-top: 2px; }

.unavailable-section-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background-color: var(--unavailable-bg); border-left: 3px solid var(--unavailable-red); border-radius: 6px; margin: 16px 0 8px 0; cursor: pointer; user-select: none; }
.unavailable-section-header:hover { background-color: #331e1e; }
.unavailable-section-title { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.unavailable-section-count { background-color: var(--unavailable-red); color: white; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* ============================================================================
   Tag System
   ============================================================================ */

.tag-filter-section { padding: 0 16px 14px; border-bottom: 1px solid var(--border-color); margin-bottom: 10px; }
.tag-filter-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tag-filter-title { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.6px; }

/* Ghost: Manage Tags (gear) */
.btn-manage-tags-dashboard {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-btn-sm);
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.btn-manage-tags-dashboard:hover { color: #fff; background: var(--btn-secondary-hover-bg); }
.btn-manage-tags-dashboard:focus-visible { outline: none; box-shadow: var(--accent-focus-ring); }

.tag-filter-pills { display: flex; flex-wrap: wrap; gap: 5px; }

.tag-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.tag-pill.color-green { background: rgba(52, 168, 83, 0.15); color: #34a853; border-color: rgba(52, 168, 83, 0.3); }
.tag-pill.color-yellow { background: rgba(251, 188, 4, 0.15); color: #fbbc04; border-color: rgba(251, 188, 4, 0.3); }
.tag-pill.color-red { background: rgba(234, 67, 53, 0.15); color: #ea4335; border-color: rgba(234, 67, 53, 0.3); }

.tag-pill.filter-active { box-shadow: 0 0 0 2px var(--accent); }

.tag-pill-tiny { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 600; }
.tag-pill-tiny.color-green { background: rgba(52, 168, 83, 0.2); color: #34a853; }
.tag-pill-tiny.color-yellow { background: rgba(251, 188, 4, 0.2); color: #fbbc04; }
.tag-pill-tiny.color-red { background: rgba(234, 67, 53, 0.2); color: #ea4335; }

.tag-pill-small { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; }
.tag-pill-small.color-green { background: rgba(52, 168, 83, 0.2); color: #34a853; }
.tag-pill-small.color-yellow { background: rgba(251, 188, 4, 0.2); color: #fbbc04; }
.tag-pill-small.color-red { background: rgba(234, 67, 53, 0.2); color: #ea4335; }

.listing-tags-row { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px; }

/* Tag Modal */
.tag-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }

.tag-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.dashboard-tag-modal { width: 420px; }

.tag-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.tag-modal-header h3 { font-size: 16px; color: var(--text-primary); margin: 0; }
.tag-limit-indicator { font-size: 12px; color: var(--text-secondary); }

.tag-modal-body { padding: 16px 20px; }

.tag-management-list { margin-bottom: 16px; }

.tag-management-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }

/* Ghost: delete tag in modal */
.btn-delete-tag {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: var(--radius-btn-sm);
  transition: color 0.15s, background 0.15s;
}
.btn-delete-tag:hover { color: var(--unavailable-red); background: var(--btn-secondary-hover-bg); }
.btn-delete-tag:focus-visible { outline: none; box-shadow: var(--accent-focus-ring); }

.tag-create-form { display: flex; gap: 8px; align-items: center; }

.tag-name-input {
  flex: 1;
  background: #2c2c2e;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.tag-name-input:focus { border-color: var(--accent); }

.tag-color-select {
  background: #2c2c2e;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

/* Primary in modal: Add tag */
.btn-create-tag {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-create-tag:hover { background: var(--accent-hover); }
.btn-create-tag:focus-visible { outline: none; box-shadow: var(--accent-focus-ring); }

.tag-modal-footer { padding: 12px 20px; border-top: 1px solid var(--border-color); text-align: right; }

/* Secondary: Done in tag modal */
.btn-close-tag-modal {
  background: transparent;
  border: var(--btn-secondary-border);
  color: #e5e7eb;
  border-radius: var(--radius-btn-sm);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-close-tag-modal:hover { background: var(--btn-secondary-hover-bg); }
.btn-close-tag-modal:focus-visible { outline: none; box-shadow: var(--accent-focus-ring); }

/* ============================================================================
   Empty State
   ============================================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: var(--text-primary); font-size: 20px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 400px; line-height: 1.6; }
