/* TeamPrompt Dashboard — Vault-style Dark Mode UI */

/* ═══════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════ */

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

:root {
  --bg-base: #0c0e16;
  --bg-surface: #13151f;
  --bg-elevated: #1b1e2c;
  --bg-hover: #23273a;
  --bg-active: #2c3148;
  --border: #262b3e;
  --border-light: #353b54;
  --text-primary: #e6e8f0;
  --text-secondary: #8c91a8;
  --text-muted: #5d627a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-surface: rgba(59, 130, 246, 0.10);
  --green: #22c55e;
  --green-surface: rgba(34, 197, 94, 0.10);
  --red: #ef4444;
  --red-surface: rgba(239, 68, 68, 0.10);
  --yellow: #eab308;
  --blue: #3b82f6;
  --sidebar-width: 240px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --transition: 150ms ease;
}

[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-active: #cbd5e1;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-surface: rgba(37, 99, 235, 0.08);
  --green: #16a34a;
  --green-surface: rgba(22, 163, 74, 0.08);
  --red: #dc2626;
  --red-surface: rgba(220, 38, 38, 0.08);
  --yellow: #ca8a04;
  --blue: #2563eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 13px; }

/* ═══════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════ */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.sidebar-brand-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-brand-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent-surface);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 16px 18px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 18px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--accent-surface);
  color: var(--accent);
}

.sidebar-item.active svg { stroke: var(--accent); }

.sidebar-item svg {
  flex-shrink: 0;
  stroke: var(--text-muted);
  transition: stroke var(--transition);
}

.sidebar-item:hover svg { stroke: var(--text-primary); }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover { background: var(--bg-hover); }

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; }

.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════ */

.main {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  position: relative;
}

.view {
  display: none;
  padding: 32px 40px;
  min-height: 100vh;
}

.view.active { display: block; }

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.view-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.view-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ═══════════════════════════════════════
   VAULT VIEW
   ═══════════════════════════════════════ */

.vault-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.vault-search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  transition: border-color var(--transition);
}

.vault-search:focus-within {
  border-color: var(--accent);
}

.vault-search svg { stroke: var(--text-muted); flex-shrink: 0; }

.vault-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  padding: 9px 0;
  outline: none;
}

.vault-search input::placeholder { color: var(--text-muted); }

.vault-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.vault-manage-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.vault-manage-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-surface);
}

.vault-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.vault-select:focus { border-color: var(--accent); }
.vault-select option { background: var(--bg-surface); }

/* Stats Row */
.vault-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.vault-stat {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.vault-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.vault-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Table */
.vault-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.vault-table thead {
  background: var(--bg-elevated);
}

.vault-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.vault-th-check { width: 40px; }

.vault-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.vault-row {
  cursor: pointer;
  transition: background var(--transition);
}

.vault-row:hover { background: var(--bg-hover); }

.vault-prompt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.vault-prompt-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.vault-folder-badge {
  font-size: 11px;
  background: var(--bg-active);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  font-size: 10px;
  background: var(--accent-surface);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 4px;
}

.star { font-size: 12px; }
.star-full { color: #f59e0b; }
.star-half { color: #f59e0b; opacity: 0.6; }
.star-empty { color: var(--text-muted); }

.vault-uses {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.vault-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.vault-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.vault-row:hover .vault-row-actions { opacity: 1; }

.vault-action-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.vault-action-btn svg { stroke: var(--text-muted); }
.vault-action-btn:hover { background: var(--bg-hover); border-color: var(--border-light); }
.vault-action-btn:hover svg { stroke: var(--text-primary); }

.vault-action-danger:hover { background: var(--red-surface); border-color: var(--red); }
.vault-action-danger:hover svg { stroke: var(--red); }

/* Pagination */
.vault-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.vault-page-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.vault-page-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}
.vault-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.vault-page-info {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Empty State */
.vault-empty, .collections-empty, .standards-empty, .team-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.vault-empty svg, .collections-empty svg, .standards-empty svg, .team-empty svg {
  stroke: var(--text-muted);
  margin-bottom: 16px;
}

.vault-empty h3, .collections-empty h3, .standards-empty h3, .team-empty h3 {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.vault-empty p, .collections-empty p, .standards-empty p, .team-empty p {
  font-size: 13px;
  margin-bottom: 20px;
}

/* Checkbox styling */
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ═══════════════════════════════════════
   COLLECTIONS VIEW
   ═══════════════════════════════════════ */

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.collection-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.collection-card:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.collection-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 12px;
  margin-bottom: 8px;
}

.collection-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.collection-card-vis {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-active);
  padding: 2px 6px;
  border-radius: 3px;
}

.collection-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.collection-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.collection-team-badge {
  background: var(--accent-surface);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
}

.collection-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.collection-card:hover .collection-card-actions { opacity: 1; }

/* ═══════════════════════════════════════
   STANDARDS VIEW
   ═══════════════════════════════════════ */

.standards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.standard-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all var(--transition);
}

.standard-card:hover {
  border-color: var(--border-light);
}

.standard-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.standard-indicator {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}

.standard-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.standard-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.standard-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
}

.standard-cat, .standard-scope {
  background: var(--bg-active);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: capitalize;
}

.standard-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-active);
  border-radius: 10px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: white;
}

.toggle-label-text {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 80px;
}

/* ═══════════════════════════════════════
   TEAM VIEW
   ═══════════════════════════════════════ */

.team-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.team-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all var(--transition);
}

.team-card:hover { border-color: var(--border-light); }

.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.team-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.team-card-actions { display: flex; gap: 4px; }

.team-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.team-card-footer {
  font-size: 11px;
  color: var(--text-muted);
}

/* Members Panel */
.team-members-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

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

.members-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.member-row:hover { background: var(--bg-hover); }

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

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

.member-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.member-you {
  font-size: 10px;
  font-weight: 400;
  color: var(--accent);
}

.member-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
}

.member-role { text-transform: capitalize; font-weight: 500; }

.member-teams { color: var(--text-muted); }

.member-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.member-row:hover .member-actions { opacity: 1; }

/* ═══════════════════════════════════════
   ORG VIEW
   ═══════════════════════════════════════ */

.org-form-wrap {
  max-width: 560px;
}

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

/* ═══════════════════════════════════════
   FORMS (shared)
   ═══════════════════════════════════════ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.form-input option { background: var(--bg-surface); }

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-color {
  height: 38px;
  padding: 4px;
  cursor: pointer;
}

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

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.form-toggle-row {
  padding: 4px 0;
}

.form-toggle-row .toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Collection prompt checklist */
.coll-prompt-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--bg-base);
}

.coll-prompt-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: background var(--transition);
}

.coll-prompt-check:hover { background: var(--bg-hover); }

/* ═══════════════════════════════════════
   ANALYTICS VIEW
   ═══════════════════════════════════════ */

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.analytics-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.analytics-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.analytics-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.metric {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.analytics-item:last-child { border-bottom: none; }

.analytics-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
}

.analytics-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-item-val {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Department bars */
.dept-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dept-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 90px;
}

.dept-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-active);
  border-radius: 4px;
  overflow: hidden;
}

.dept-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 300ms ease;
}

.dept-bar-val {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Timeline */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════
   IMPORT / EXPORT VIEW
   ═══════════════════════════════════════ */

.ie-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 700px;
}

.ie-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
}

.ie-card-icon {
  margin-bottom: 16px;
}

.ie-card-icon svg { stroke: var(--accent); }

.ie-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.ie-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════
   TOAST
   ═══════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  animation: toast-in 200ms ease;
}

.toast-success {
  background: var(--green);
  color: white;
}

.toast-error {
  background: var(--red);
  color: white;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════ */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 14, 22, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  gap: 16px;
}

.loading-overlay.hidden { display: none; }

[data-theme="light"] .loading-overlay {
  background: rgba(248, 250, 252, 0.92);
}

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

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

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ═══════════════════════════════════════
   VALIDATION BOX
   ═══════════════════════════════════════ */

.validation-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
}

.validation-box.hidden { display: none; }

.validation-pass {
  background: var(--green-surface);
  border: 1px solid var(--green);
  color: var(--green);
}

.validation-fail {
  background: var(--red-surface);
  border: 1px solid var(--red);
  color: var(--text-primary);
}

.validation-fail strong {
  color: var(--red);
  display: block;
  margin-bottom: 6px;
}

.validation-item {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
  padding-left: 12px;
  position: relative;
}

.validation-item::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--red);
}

/* ═══════════════════════════════════════
   VERSION HISTORY
   ═══════════════════════════════════════ */

.version-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.version-entry {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color var(--transition);
}

.version-entry:hover {
  border-color: var(--border-light);
}

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

.version-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-surface);
  padding: 1px 6px;
  border-radius: 3px;
}

.version-date {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
}

.version-restore {
  font-size: 11px;
  padding: 2px 8px;
}

.version-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ═══════════════════════════════════════
   FAVORITE BUTTON
   ═══════════════════════════════════════ */

.vault-fav {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all var(--transition);
  line-height: 1;
}

.vault-fav:hover {
  background: var(--bg-hover);
  border-color: var(--yellow);
  color: var(--yellow);
}

.vault-fav.active {
  color: var(--yellow);
  border-color: var(--yellow);
  background: rgba(245, 158, 11, 0.1);
}

/* ═══════════════════════════════════════
   VERSION BADGE
   ═══════════════════════════════════════ */

.vault-version {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-surface);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ═══════════════════════════════════════
   CHAR COUNT
   ═══════════════════════════════════════ */

.char-count {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  float: right;
}

/* ═══════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.08); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.14); }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 900px) {
  .team-content { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .ie-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════
   MANAGE FOLDERS / DEPARTMENTS MODAL
   ═══════════════════════════════════════ */

.manage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
}

.manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.manage-row-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.manage-row-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.manage-row-count {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.manage-row-delete {
  flex-shrink: 0;
}

.manage-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.manage-add-form .form-input {
  flex: 1;
}

.form-input-sm {
  width: 80px !important;
  flex: none !important;
}

.btn-sm {
  padding: 6px 14px !important;
  font-size: 12px !important;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .sidebar { width: 56px; min-width: 56px; }
  .sidebar-brand-text, .sidebar-brand-badge, .sidebar-section-label,
  .sidebar-item span, .sidebar-user-info { display: none; }
  .sidebar-item { justify-content: center; padding: 12px; }
  .sidebar-user { justify-content: center; }
  .view { padding: 20px; }
  .vault-toolbar { flex-direction: column; }
  .vault-stats { flex-wrap: wrap; }
  .vault-stat { min-width: 120px; }
}
