/* Huddle — Overlay & feedback: dialog (modal), drawer, toast, tooltip, empty state, banner */

/* ============ Scrim ============ */
.hds-scrim {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.5);
  display: flex; z-index: var(--z-modal); animation: hds-fade .15s ease;
}
@keyframes hds-fade { from { opacity: 0; } to { opacity: 1; } }

/* ============ Dialog (modal) ============ */
.hds-dialog {
  margin: auto; width: 100%; max-width: 480px; background: var(--bg-card);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column; max-height: calc(100vh - 64px);
  animation: hds-pop .16s cubic-bezier(.16,.84,.44,1);
}
@keyframes hds-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.hds-dialog__header { display: flex; align-items: flex-start; gap: 12px; padding: var(--space-6) var(--space-6) var(--space-4); }
.hds-dialog__titles { flex: 1; min-width: 0; }
.hds-dialog__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text-primary); letter-spacing: var(--tracking-snug); }
.hds-dialog__desc { font-size: var(--text-sm); color: var(--text-muted); margin-top: 4px; line-height: var(--leading-sm); }
.hds-dialog__body { padding: 0 var(--space-6); overflow-y: auto; }
.hds-dialog__footer { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-5) var(--space-6) var(--space-6); }

/* ============ Drawer ============ */
.hds-drawer-scrim { justify-content: flex-end; }
.hds-drawer {
  width: 100%; max-width: 480px; height: 100vh; background: var(--bg-card);
  box-shadow: var(--shadow-xl); display: flex; flex-direction: column;
  animation: hds-slide .2s cubic-bezier(.16,.84,.44,1);
}
.hds-drawer--wide { max-width: 640px; }
@keyframes hds-slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.hds-drawer__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.hds-drawer__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text-primary); letter-spacing: var(--tracking-snug); }
.hds-drawer__sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.hds-drawer__body { flex: 1; overflow-y: auto; padding: var(--space-6); }
.hds-drawer__footer { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-5) var(--space-6); border-top: 1px solid var(--border-subtle); background: var(--bg-card); }

/* ============ Toast ============ */
.hds-toast-region { position: fixed; bottom: var(--space-6); right: var(--space-6); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; }
.hds-toast {
  display: flex; align-items: flex-start; gap: 12px; width: 360px; max-width: calc(100vw - 48px);
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 14px 14px 14px 16px; animation: hds-slide .2s ease;
}
.hds-toast__icon { flex: 0 0 auto; width: 20px; height: 20px; display: inline-flex; margin-top: 1px; }
.hds-toast__icon svg { width: 20px; height: 20px; }
.hds-toast--success .hds-toast__icon { color: var(--success); }
.hds-toast--danger  .hds-toast__icon { color: var(--danger); }
.hds-toast--info    .hds-toast__icon { color: var(--info); }
.hds-toast__body { flex: 1; min-width: 0; }
.hds-toast__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); }
.hds-toast__msg { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; line-height: var(--leading-sm); }
.hds-toast__close { flex: 0 0 auto; color: var(--text-muted); cursor: pointer; background: none; border: none; padding: 2px; border-radius: 4px; }
.hds-toast__close:hover { background: var(--bg-hover); color: var(--text-primary); }
.hds-toast__close svg { width: 16px; height: 16px; }

/* ============ Tooltip ============ */
.hds-tooltip {
  background: var(--bg-inverse); color: #fff; font-size: var(--text-xs); font-weight: var(--weight-medium);
  padding: 6px 10px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); white-space: nowrap;
}

/* ============ Banner (inline alert) ============ */
.hds-banner { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid; font-size: var(--text-sm); }
.hds-banner svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.hds-banner__title { font-weight: var(--weight-semibold); }
.hds-banner--info    { background: var(--info-surface);    border-color: var(--info-border);    color: var(--info); }
.hds-banner--success { background: var(--success-surface); border-color: var(--success-border); color: var(--success-600, var(--success)); }
.hds-banner--warning { background: var(--warning-surface); border-color: var(--warning-border); color: var(--warning); }
.hds-banner--danger  { background: var(--danger-surface);  border-color: var(--danger-border);  color: var(--danger); }
.hds-banner__text { color: var(--text-secondary); }

/* ============ Empty state ============ */
.hds-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-16) var(--space-6); }
.hds-empty__icon {
  width: 48px; height: 48px; border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-subtle); border: 1px solid var(--border-subtle); color: var(--text-muted); margin-bottom: var(--space-4);
}
.hds-empty__icon svg { width: 24px; height: 24px; }
.hds-empty__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text-primary); }
.hds-empty__desc { font-size: var(--text-sm); color: var(--text-muted); max-width: 360px; margin-top: 6px; line-height: var(--leading-sm); }
.hds-empty__actions { display: flex; gap: var(--space-3); margin-top: var(--space-5); }
