/* ============================================================
   indev.email — Design System
   Light theme only
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
code { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; font-size: 0.9em; }

/* --- CSS Variables --- */
:root {
  --bg:           #f5f6f8;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f0f1f3;
  --bg-hover:     #e8e9ec;
  --border:       #d0d2d6;
  --border-light: #e0e2e6;

  --text:         #1a1a2e;
  --text-secondary: #4C5C68;
  --text-muted:   #6b7280;
  --text-dim:     #9ca3af;

  --accent:       #306BAC;
  --accent-hover: #27599a;
  --accent-bg:    rgba(48, 107, 172, 0.08);

  --success:      #16a34a;
  --success-bg:   rgba(22, 163, 74, 0.08);
  --warning:      #ca8a04;
  --warning-bg:   rgba(202, 138, 4, 0.08);
  --danger:       #dc2626;
  --danger-bg:    rgba(220, 38, 38, 0.08);

  /* Spacing */
  --sidebar-w:    240px;
  --sidebar-collapsed-w: 56px;
  --topbar-h:     56px;
  --radius:       8px;
  --radius-sm:    6px;
  --radius-lg:    12px;

  /* Shadows */
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.12);
}

body {
  background: var(--bg);
  color: var(--text);
}

/* ============================================================
   Shell Layout (sidebar + main)
   ============================================================ */
.shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar (Veptr-style: collapsed by default, expand on hover) --- */
.sidebar {
  width: var(--sidebar-collapsed-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  overflow: hidden;
  transition: width 0.2s ease;
}

.sidebar:hover {
  width: var(--sidebar-w);
  box-shadow: var(--shadow-lg);
}

/* Hide all text labels by default; show on hover */
.sidebar-label {
  display: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar:hover .sidebar-label {
  display: inline;
}
.sidebar:hover .sidebar-brand-icon {
  display: none;
}

/* Header / brand */
.sidebar-header {
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--accent);
}

.sidebar-brand-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.sidebar-separator {
  height: 1px;
  background: var(--border);
  margin: 6px 10px;
}

/* Section labels: hidden when collapsed, shown on hover */
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  overflow: hidden;
  height: 0;
  padding: 0;
}

.sidebar:hover .sidebar-section-label {
  height: auto;
  padding: 8px 16px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s ease;
  position: relative;
  border-left: 3px solid transparent;
}

.sidebar:hover .sidebar-link {
  justify-content: flex-start;
  padding: 9px 16px;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--text);
}

.sidebar-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 8px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sidebar:hover .sidebar-footer {
  align-items: stretch;
}

/* Hide team-switcher completely when sidebar is collapsed; show on hover */
.sidebar .sidebar-team-switcher {
  display: none;
}

.sidebar:hover .sidebar-team-switcher {
  display: block;
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 5px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sidebar:hover .sidebar-footer-row {
  justify-content: flex-start;
  gap: 8px;
  padding: 5px 12px;
}

.sidebar-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--text);
}

.sidebar-footer-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.sidebar-logout-row {
  cursor: pointer;
}

.sidebar-logout-row:hover .sidebar-footer-icon {
  color: var(--text);
}

.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.sidebar-logout-row:hover .sidebar-logout-btn {
  color: var(--text);
}

/* --- Main Content --- */
.main {
  flex: 1;
  margin-left: var(--sidebar-collapsed-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
}

.sidebar:hover + .main,
.sidebar:hover ~ .main {
  margin-left: var(--sidebar-w);
}

.topbar {
  height: var(--topbar-h);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  flex: 1;
  padding: 28px 32px;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 20px 24px 0;
}

.card-body {
  padding: 20px 24px;
}

.card-header + .card-body {
  padding-top: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  border-color: var(--accent);
}

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

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--text-secondary);
}

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

.btn-outline {
  background: none;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

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

.btn-lg {
  padding: 10px 24px;
  font-size: 0.95rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-block { width: 100%; }

/* ============================================================
   Forms
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-select {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236F9CEB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

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

.form-grid .form-group {
  margin-bottom: 0;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab .icon {
  width: 16px;
  height: 16px;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--accent-bg);
  color: var(--accent);
}
.badge-default {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

/* ============================================================
   Tables
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   Stat Cards (Metrics)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   Inbox — Email List (Outlook/Skiff style)
   ============================================================ */
.inbox-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.inbox-tree {
  width: 260px;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  overflow-y: auto;
  padding: 12px 0;
  flex-shrink: 0;
}

.inbox-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Tree: Domain groups */
.tree-domain {
  margin-bottom: 2px;
}

.tree-domain-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.1s;
}

.tree-domain-header:hover {
  background: var(--bg-hover);
}

.tree-domain-header.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.tree-chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
  color: var(--text-dim);
}

.tree-chevron.open {
  transform: rotate(90deg);
}

.tree-domain-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tree-domain-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-recipients {
  display: none;
  padding-left: 20px;
}

.tree-recipients.open {
  display: block;
}

.tree-recipient {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 28px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: background 0.1s;
}

.tree-recipient:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.tree-recipient.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.tree-recipient-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tree-recipient-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pill / count */
.pill {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Email list rows */
.email-list {
  flex: 1;
  overflow-y: auto;
}

.email-row-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.email-row-wrap.active {
  background: var(--accent-bg);
}
.email-row-wrap:hover {
  background: var(--bg-hover);
}
.email-delete-form {
  display: flex;
  align-items: center;
  padding-right: 12px;
  opacity: 0;
  transition: opacity 0.15s;
}
.email-row-wrap:hover .email-delete-form {
  opacity: 1;
}
.email-delete-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}
.email-delete-btn:hover {
  color: #fff;
  background: var(--danger);
}

.email-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.email-row:hover {
  background: transparent;
}

.email-sender-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.email-content {
  flex: 1;
  min-width: 0;
}

.email-top-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.email-sender {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-subject {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-preview {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   Message Detail Drawer
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 900;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 70%;
  max-width: 900px;
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  z-index: 901;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.drawer-header .topbar-title {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 12px;
}

.drawer-header .drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
}

/* ============================================================
   Message Detail (drawer / full view)
   ============================================================ */
.message-view {
  padding: 28px 32px;
}

.message-header {
  margin-bottom: 24px;
}

.message-subject {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.message-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  font-size: 0.85rem;
}

.message-meta dt {
  color: var(--text-dim);
  font-weight: 600;
}

.message-meta dd {
  color: var(--text-secondary);
}

.message-body {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.message-body pre {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  margin: 0;
}

/* ============================================================
   Centered Page (Login, Magic Link, Confirmation)
   ============================================================ */
.centered-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.centered-box {
  width: 100%;
  max-width: 400px;
}

.centered-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.centered-logo img {
  height: 36px;
}

/* ============================================================
   Landing Page
   ============================================================ */
.landing {
  min-height: 100vh;
  background: var(--bg);
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.landing-logo img {
  height: 32px;
}

.hero {
  text-align: center;
  max-width: 720px;
  margin: 80px auto 60px;
  padding: 0 24px;
}

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--accent-bg);
  color: var(--accent);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}

.hero .gradient {
  background: linear-gradient(135deg, #306BAC, #1a4b8c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.landing-footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ============================================================
   Domain Cards — Grid Layout
   ============================================================ */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.domain-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.domain-card-new {
  border-color: var(--success);
  animation: new-card-glow 3s ease-out forwards;
}

@keyframes new-card-glow {
  0%   { box-shadow: 0 0 0 3px var(--success-bg); border-color: var(--success); }
  100% { box-shadow: none; border-color: var(--border); }
}

.domain-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.domain-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.domain-card-meta {
  flex: 1;
  min-width: 0;
}

.domain-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.domain-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.domain-card-body {
  padding: 10px 16px 14px;
}

.domain-credential {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.8rem;
}

.domain-credential:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.domain-credential .label {
  font-weight: 600;
  color: var(--accent);
  min-width: 90px;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.domain-credential .value {
  flex: 1;
  color: var(--text);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.domain-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.btn-danger-ghost {
  background: none;
  border: 1px solid transparent;
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.btn-danger-ghost:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* ============================================================
   Modules Grid (Veptr-style settings)
   ============================================================ */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

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

.module-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.module-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   Utilities
   ============================================================ */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none; }
.w-full { width: 100%; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* Copy to clipboard tooltip */
.copy-feedback {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--success);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.copy-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9000;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9001;
  width: 420px;
  max-width: 90vw;
}
.modal-header {
  padding: 20px 24px 0;
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.modal-body {
  padding: 12px 24px 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.modal-footer {
  padding: 0 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* View toggle buttons */
.view-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.view-toggle-btn:hover { color: var(--text); border-color: var(--text-muted); }
.view-toggle-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }

/* Copy button inline */
.copy-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--accent); }

.copy-btn-inline {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
}
.copy-btn-inline:hover { color: var(--accent); }

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: opacity 0.4s ease;
}
.toast-success {
  background: var(--success);
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar:hover { width: var(--sidebar-collapsed-w); box-shadow: none; }
  .sidebar:hover .sidebar-label { display: none; }
  .sidebar:hover .sidebar-link { justify-content: center; padding: 9px 0; }
  .sidebar:hover .sidebar-footer-item { justify-content: center; padding: 6px 0; }
  .sidebar:hover + .main,
  .sidebar:hover ~ .main { margin-left: var(--sidebar-collapsed-w); }
  .content { padding: 16px; }
  .hero h1 { font-size: 2rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .inbox-tree { width: 200px; }
}
