/* Enterprise Console - Premium Components */

/* --- Inputs --- */
.search-input,
.main-input {
    background-color: var(--bg-input);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--fg-primary);
    padding: 8px 12px;
    font-size: var(--text-sm);
    width: 100%;
    outline: none;
    transition: background-color 0.1s;
}

.search-input:focus,
.main-input:focus {
    background-color: var(--bg-surface-active);
    /* Simulated focus ring or bottom border if desired, but kept minimal */
    box-shadow: inset 0 -1px 0 0 var(--accent);
}

.search-input {
    font-size: var(--text-xs);
    height: 28px;
}

.main-input {
    height: 48px;
    font-size: var(--text-md);
    padding: 0 20px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.main-input:focus {
    border-color: var(--accent);
}

/* --- Buttons --- */
.action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-secondary);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.action-btn:hover {
    color: var(--fg-primary);
    background: var(--bg-surface-active);
}


/* --- Lists --- */
.list-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: background 0.1s;
}

.list-item:hover {
    background-color: var(--bg-surface-hover);
}

.list-item.active {
    background-color: var(--bg-surface-active);
}

.list-content {
    display: flex;
    flex-direction: column;
    margin-left: 10px;
}

.list-content .primary {
    font-size: var(--text-sm);
    color: var(--fg-primary);
    font-weight: 500;
}

.list-content .secondary {
    font-size: 10px;
    color: var(--fg-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-muted);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 4px var(--success-dim);
}

/* --- Chat Elements --- */
/* --- Chat Elements (Minimal Bubbles) --- */
.message-row {
    display: flex;
    margin-bottom: 16px;
    width: 100%;
}

.message-bubble {
    padding: 12px 18px;
    font-size: var(--text-sm);
    max-width: 85%;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.6;
}

.message-content {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Markdown Polish */
.message-content p {
    margin: 0 0 0.75em 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul,
.message-content ol {
    margin: 0.75em 0;
    padding-left: 1.5em;
}

.message-content pre {
    background-color: var(--bg-surface-2);
    /* Dark background for code blocks explicitly */
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 12px 0;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.message-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    color: var(--fg-primary);
    /* Default light text for inner code */
}

.message-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #e6edf3;
}

.message-content p code,
.message-content li code {
    background-color: var(--bg-surface-active);
    color: var(--accent);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 12px;
}

/* Agent Message - Document Feel */
.message-row.agent {
    justify-content: flex-start;
}

.message-row.agent .message-bubble {
    color: var(--fg-primary);
    background-color: var(--bg-app);
    border-radius: 0;
    padding: 12px 0;
}

/* User Message - Bubble */
.message-row.user {
    justify-content: flex-end;
}

.message-row.user .message-bubble {
    color: var(--fg-primary);
    background-color: var(--bg-surface-2);
    border-radius: 12px 12px 0 12px;
    text-align: left;
    font-weight: 400;
}

/* --- Modernized Input Area --- */
.chat-input-area {
    padding: 0 24px 24px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background-color: transparent;
    border-top: none;
}

.chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 16px 8px 24px;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--border-highlight);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--fg-primary);
    padding: 12px 0;
    font-size: var(--text-md);
    outline: none;
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.5;
}

/* --- Welcome State (Minimalist) --- */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    animation: fadeIn 0.8s var(--ease-out);
    padding: 20px;
}

.welcome-card {
    background: transparent;
    border: none;
    padding: 0;
    text-align: center;
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: none;
}

.welcome-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.welcome-icon-wrapper i {
    font-size: 24px;
    color: var(--fg-secondary);
}

.welcome-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--fg-primary);
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.welcome-subtitle {
    font-size: var(--text-sm);
    color: var(--fg-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* Quick Actions / Chips (Refined) */
.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.action-chip {
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-chip:hover {
    background: var(--bg-surface-hover);
    color: var(--fg-primary);
    border-color: var(--border-highlight);
}

.action-chip i {
    font-size: 13px;
    opacity: 0.7;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.send-btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.1s;
}

.send-btn-icon:hover {
    background-color: var(--accent);
    color: var(--fg-on-accent);
}

/* --- Modals (Added) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-box h3 {
    margin: 0 0 16px 0;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--fg-primary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* --- Typing / Thinking Animation --- */
.thinking-dots::after {
    content: '.';
    animation: dots 1s steps(5, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

/* --- Agent Cards (New) --- */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.agent-card {
    display: flex;
    align-items: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.agent-card:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.agent-card.active {
    background-color: var(--bg-surface-active);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.agent-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--fg-secondary);
    font-size: 16px;
    flex-shrink: 0;
}

.agent-card.active .agent-icon-wrapper {
    background-color: var(--accent);
    color: var(--fg-on-accent);
}

.agent-info {
    flex: 1;
    min-width: 0;
    /* Text truncation fix */
}

.agent-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--fg-primary);
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-url {
    font-size: 11px;
    color: var(--fg-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--fg-muted);
    margin-left: 8px;
    box-shadow: none;
    /* Reset shadow */
}

.agent-status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 4px var(--success);
}

/* --- Animations --- */
.thinking-dots {
    color: var(--fg-primary);
}

.thinking-dots::after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

/* ── Skill feedback bar ─────────────────────────────────────────────── */
.msg-feedback-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.feedback-label {
    font-size: var(--text-xs);
    color: var(--fg-muted);
    margin-right: 2px;
}

.feedback-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--fg-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.feedback-btn:hover {
    color: var(--fg-primary);
    border-color: var(--border-highlight);
    background: var(--bg-surface-hover);
}

.feedback-btn[data-type="thumbs_up"]:hover {
    color: var(--success);
    border-color: var(--success);
}

.feedback-btn[data-type="thumbs_down"]:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.feedback-done {
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: 5px;
}

.feedback-done.positive {
    color: var(--success);
}

.feedback-done.negative {
    color: var(--fg-muted);
}


/* ── @mention dropdown — Phase 7 skill extensions ────────────────────── */
.mention-item-icon.skill-icon {
    background: var(--accent-dim);
    border: 1px solid var(--border-highlight);
    color: var(--fg-secondary);
}

.mention-item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mention-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mention-item-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-primary);
    line-height: 1.3;
}

.mention-item-desc {
    font-size: 10px;
    color: var(--fg-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.mention-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.mention-badge.user-skill {
    background: var(--accent-dim);
    color: var(--fg-secondary);
    border: 1px solid var(--border-color);
}

.mention-badge.system-skill {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Code block header bar — language badge + copy button */
.message-row.agent .message-content pre::before {
    content: attr(data-lang);
    display: block;
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--fg-muted);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-sans);
}

.message-row.agent .message-content pre code {
    display: block;
    padding: 14px 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.65;
    color: #e6edf3;
    background: none;
    white-space: pre;
}

/* Local Prism Dark Theme Syntax Highlighting Fallbacks */
.message-content pre code[class*="language-"],
.message-content pre[class*="language-"] {
    color: #e6edf3;
}

.message-content pre .token.comment,
.message-content pre .token.prolog,
.message-content pre .token.doctype,
.message-content pre .token.cdata {
    color: #8b949e;
    font-style: italic;
}

.message-content pre .token.punctuation {
    color: #8b949e;
}

.message-content pre .token.property,
.message-content pre .token.tag,
.message-content pre .token.boolean,
.message-content pre .token.number,
.message-content pre .token.constant,
.message-content pre .token.symbol,
.message-content pre .token.deleted {
    color: #ff79c6;
}

.message-content pre .token.selector,
.message-content pre .token.attr-name,
.message-content pre .token.string,
.message-content pre .token.char,
.message-content pre .token.builtin,
.message-content pre .token.inserted {
    color: #50fa7b;
}

.message-content pre .token.operator,
.message-content pre .token.entity,
.message-content pre .token.url,
.language-css .token.string,
.style .token.string {
    color: #8be9fd;
}

.message-content pre .token.atrule,
.message-content pre .token.attr-value,
.message-content pre .token.keyword {
    color: #ff79c6;
}

.message-content pre .token.function,
.message-content pre .token.class-name {
    color: #f1fa8c;
}

.message-content pre .token.regex,
.message-content pre .token.important,
.message-content pre .token.variable {
    color: #f1fa8c;
}

/* Markdown-specific Prism tokens */
.message-content pre .token.title {
    color: #ff79c6;
    font-weight: bold;
}
.message-content pre .token.list {
    color: #8be9fd;
}
.message-content pre .token.hr {
    color: #8b949e;
}
.message-content pre .token.url {
    color: #8be9fd;
    text-decoration: underline;
}
.message-content pre .token.bold {
    font-weight: bold;
}
.message-content pre .token.italic {
    font-style: italic;
}

/* Copy button — injected by JS, fades in on hover */
.code-copy-btn {
    position: absolute;
    top: 4px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-surface-active);
    border: 1px solid var(--border-color);
    color: var(--fg-muted);
    font-size: 10px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    letter-spacing: .01em;
    opacity: 0;
    transition: opacity .15s, color .15s;
}

.message-row.agent .message-content pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    color: var(--fg-primary);
}

.code-copy-btn.copied {
    color: var(--success);
    border-color: rgba(63, 185, 80, 0.3);
}

/* ── Skeleton / Shimmer ── */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface-hover) 25%,
    var(--bg-surface-active) 50%,
    var(--bg-surface-hover) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.skeleton-text  { height: 13px; }
.skeleton-title { height: 18px; }
.skeleton-circle { border-radius: var(--radius-full); }
.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

/* ── Buttons ── */
/* Base button — inherits variables, apply variants below */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  height: 32px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: var(--tracking-tight);
}

/* Primary — filled with accent (white in dark, black in light) */
.btn-primary {
  background: var(--accent);
  color: var(--fg-on-accent);
  border: 1px solid transparent;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }

/* Secondary — ghost with border */
.btn-secondary {
  background: transparent;
  color: var(--fg-secondary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--fg-primary);
  border-color: var(--border-highlight);
}

/* Ghost — no border, no bg */
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg-surface-hover); color: var(--fg-primary); }

/* Danger */
.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.2);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* Sizes */
.btn-sm { height: 26px; padding: 0 10px; font-size: var(--text-xs); }
.btn-lg { height: 40px; padding: 0 20px; font-size: var(--text-md); }

/* Icon-only */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: var(--bg-surface-hover); color: var(--fg-primary); border-color: var(--border-color); }

/* Loading state */
.btn.loading, .tb-btn.loading { opacity: 0.6; pointer-events: none; }
.btn.loading::after, .tb-btn.loading::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  margin-left: 4px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-neutral  { background: var(--bg-surface-active); color: var(--fg-secondary); border: 1px solid var(--border-color); }
.badge-success  { background: var(--success-dim);  color: var(--success);  border: 1px solid rgba(63,185,80,0.2); }
.badge-warning  { background: var(--warning-dim);  color: var(--warning);  border: 1px solid rgba(210,153,34,0.2); }
.badge-danger   { background: var(--danger-dim);   color: var(--danger);   border: 1px solid rgba(248,81,73,0.2); }
.badge-info     { background: var(--info-dim);     color: var(--info);     border: 1px solid rgba(56,139,253,0.2); }

/* Status dot badge */
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-no-dot::before { display: none; }

/* ── Toasts ── */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  animation: toast-in 0.25s var(--ease-spring);
}
.toast.leaving { animation: toast-out 0.2s var(--ease-in-out) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(4px); }
}

.toast-icon  { font-size: 14px; flex-shrink: 0; }
.toast-message { flex: 1; font-size: var(--text-sm); color: var(--fg-primary); }
.toast-close { color: var(--fg-muted); cursor: pointer; font-size: 12px; flex-shrink: 0; }
.toast-close:hover { color: var(--fg-primary); }

.toast.success { border-left: 3px solid var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.info    .toast-icon { color: var(--info); }

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-surface-active);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.empty-state-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--fg-primary);
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  max-width: 280px;
  line-height: 1.5;
}

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg-primary);
  letter-spacing: var(--tracking-tight);
}

.card-body { padding: 16px 20px; }

/* Hoverable card variant */
.card-hover {
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  cursor: pointer;
}
.card-hover:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-sm);
}

/* ── Form Inputs ── */
.input,
.select,
.textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.5;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
}

.input::placeholder, .textarea::placeholder { color: var(--fg-muted); }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input:disabled, .select:disabled, .textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-primary);
}

.form-hint {
  margin-top: 5px;
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.form-error {
  margin-top: 5px;
  font-size: var(--text-xs);
  color: var(--danger);
}

.input.error { border-color: var(--danger); }
.input.error:focus { box-shadow: 0 0 0 3px var(--danger-dim); }

/* ── Data Table ── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  white-space: nowrap;
}

.table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fg-secondary);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr { transition: background var(--dur-fast); }
.table tbody tr:hover td { background: var(--bg-surface-hover); color: var(--fg-primary); }

.table .cell-primary { color: var(--fg-primary); font-weight: var(--weight-medium); }
.table .cell-mono { font-family: var(--font-mono); font-size: var(--text-xs); }

/* ── Toggle Switch ── */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--bg-surface-active);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  transition: all var(--dur-base) var(--ease-out);
  position: relative;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--fg-muted);
  border-radius: 50%;
  transition: all var(--dur-base) var(--ease-spring);
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: var(--fg-on-accent);
}

.toggle-label { font-size: var(--text-sm); color: var(--fg-secondary); user-select: none; }