/* shadcn/ui Zinc Theme Design Tokens */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
}

.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
}

/* Base Form Controls conforming to shadcn/ui */
.shadcn-input {
  display: flex;
  height: 2.25rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: transparent;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: hsl(var(--foreground));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shadcn-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 1px hsl(var(--ring));
}

.shadcn-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

select.shadcn-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2rem;
}

.dark select.shadcn-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

.shadcn-textarea {
  display: flex;
  min-height: 4rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: hsl(var(--foreground));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}

.shadcn-textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 1px hsl(var(--ring));
}

/* Tabs & Toggles state styling */
.nav-tab.active-tab {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.type-btn.active-type {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Tab panes switching */
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* Status Pill */
.db-status-pill.connected .status-dot {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.db-status-pill.error .status-dot {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* shadcn Toast Notifications (Sonner-style) */
.shadcn-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  transition: all 0.2s ease;
}

.shadcn-toast.success {
  border-left: 3px solid #10b981;
}

.shadcn-toast.error {
  border-left: 3px solid #ef4444;
}

.shadcn-toast.info {
  border-left: 3px solid #3b82f6;
}

/* Interactive Status Badge Pill Dropdown */
.status-badge-select {
  display: inline-flex;
  align-items: center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0.25rem 1.6rem 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 9999px;
  border-width: 1px;
  cursor: pointer;
  background-position: right 0.45rem center;
  background-repeat: no-repeat;
  background-size: 10px 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  transition: all 0.15s ease-in-out;
  outline: none;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.status-badge-select:hover {
  filter: brightness(0.95);
}

.dark .status-badge-select:hover {
  filter: brightness(1.2);
}

.status-badge-paid {
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}
.dark .status-badge-paid {
  color: #34d399;
  background-color: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.35);
}

.status-badge-sent {
  background-color: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.3);
}
.dark .status-badge-sent {
  color: #60a5fa;
  background-color: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
}

.status-badge-overdue {
  background-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}
.dark .status-badge-overdue {
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}

.status-badge-draft {
  background-color: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.28);
}
.dark .status-badge-draft {
  color: #94a3b8;
  background-color: rgba(100, 116, 139, 0.18);
  border-color: rgba(100, 116, 139, 0.35);
}

.status-badge-converted {
  background-color: rgba(147, 51, 234, 0.12);
  color: #7c3aed;
  border-color: rgba(147, 51, 234, 0.3);
}
.dark .status-badge-converted {
  color: #c084fc;
  background-color: rgba(147, 51, 234, 0.18);
  border-color: rgba(147, 51, 234, 0.35);
}

.status-badge-expired {
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}
.dark .status-badge-expired {
  color: #fbbf24;
  background-color: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
}

/* Input Icon Positioning Utilities */
.input-with-icon {
  padding-left: 2.65rem !important;
}
.input-with-icon-right {
  padding-right: 2.65rem !important;
}
