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

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #e5e5e5;
  min-height: 100vh;
  padding: 20px;
  line-height: 1.5;
}

.container { 
  max-width: 1400px; 
  margin: 0 auto; 
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #252525;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header h1 { 
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #888888;
}

.badge.live {
  border-color: #10b981;
  color: #10b981;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Actions */
.actions {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 6px;
  color: #e5e5e5;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  background: #252525;
  border-color: #333333;
}

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

.btn-primary {
  background: #ffffff;
  color: #0a0a0a;
  border-color: #ffffff;
}

.btn-primary:hover {
  background: #e5e5e5;
  border-color: #e5e5e5;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #252525;
  padding-bottom: 0;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #666666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  color: #e5e5e5;
  background: #1a1a1a;
}

.tab.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Data Browser */
.data-browser {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  padding: 24px;
}

.data-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.data-tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #252525;
  border-radius: 6px;
  color: #888888;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.data-tab:hover {
  border-color: #333333;
  color: #e5e5e5;
}

.data-tab.active {
  background: #252525;
  border-color: #ffffff;
  color: #ffffff;
}

.data-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-input, .filter-select {
  padding: 10px 14px;
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 6px;
  color: #e5e5e5;
  font-size: 14px;
  font-family: inherit;
}

.filter-input {
  flex: 1;
  min-width: 250px;
}

.filter-select {
  width: auto;
  min-width: 150px;
  cursor: pointer;
}

.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: #ffffff;
}

/* Data Table */
.data-table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  background: #0a0a0a;
  border-bottom: 2px solid #252525;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.data-table tbody tr {
  border-bottom: 1px solid #1a1a1a;
  cursor: pointer;
  transition: background 0.2s;
}

.data-table tbody tr:hover {
  background: #1a1a1a;
}

.data-table td {
  padding: 14px 16px;
}

.table-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.table-cell.mono {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 13px;
}

.badge-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.badge-status.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.badge-status.converted {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid #10b981;
}

.badge-status.expired {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid #6b7280;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.pagination-btn {
  padding: 8px 16px;
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 6px;
  color: #e5e5e5;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: #252525;
  border-color: #ffffff;
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: #888888;
}

/* JSON Modal */
.json-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.json-modal-content {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.json-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #252525;
}

.json-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.close-btn {
  background: transparent;
  border: none;
  color: #888888;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #ffffff;
}

.close-btn svg {
  width: 20px;
  height: 20px;
}

.json-view {
  flex: 1;
  overflow: auto;
  padding: 24px;
  background: #0a0a0a;
  margin: 0;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e5e5e5;
}

.copy-btn {
  margin: 0 24px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Schema Viewer */
.schema-table {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.schema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #252525;
}

.schema-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  font-family: 'SF Mono', Monaco, monospace;
}

.schema-section {
  margin-bottom: 24px;
}

.schema-section:last-child {
  margin-bottom: 0;
}

.schema-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.schema-columns {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.schema-columns th {
  text-align: left;
  padding: 10px 12px;
  background: #0a0a0a;
  color: #666666;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.schema-columns td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a1a;
}

.schema-columns code {
  background: #0a0a0a;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: #10b981;
}

.type-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 11px;
  font-weight: 600;
}

.default-value {
  color: #888888;
}

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

.index-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #0a0a0a;
  border-radius: 6px;
}

.index-item svg {
  width: 16px;
  height: 16px;
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 2px;
}

.index-name {
  font-size: 13px;
  font-weight: 600;
  color: #e5e5e5;
  font-family: 'SF Mono', Monaco, monospace;
  margin-bottom: 4px;
}

.index-def {
  font-size: 12px;
  color: #666666;
  font-family: 'SF Mono', Monaco, monospace;
  word-break: break-all;
}

/* Alert */
.alert {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-content h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert-content p {
  font-size: 14px;
  color: #888888;
}

.alert.success {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.alert.success svg { color: #10b981; }
.alert.success h3 { color: #10b981; }

.alert.warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.alert.warning svg { color: #f59e0b; }
.alert.warning h3 { color: #f59e0b; }

.alert.danger {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.alert.danger svg { color: #ef4444; }
.alert.danger h3 { color: #ef4444; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: #333333;
}

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

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 20px;
  height: 20px;
  color: #666666;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.stat-subtitle {
  font-size: 13px;
  color: #666666;
}

/* Progress Bar */
.progress-container {
  margin-top: 12px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-percentage {
  font-size: 13px;
  font-weight: 600;
  font-family: 'SF Mono', Monaco, monospace;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #252525;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #10b981;
  border-radius: 3px;
  transition: width 0.5s ease, background-color 0.3s;
}

.progress-fill.warning {
  background: #f59e0b;
}

.progress-fill.danger {
  background: #ef4444;
}

/* States */
.loading, .empty-state, .error-state {
  text-align: center;
  color: #666666;
  padding: 60px 40px;
  font-size: 14px;
}

.error-state {
  color: #ef4444;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #252525;
  font-size: 13px;
  color: #666666;
  margin-top: 40px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: #888888;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #e5e5e5;
}

/* Users Management */
.users-management {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  padding: 24px;
}

.users-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #252525;
}

.users-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.users-header .subtitle {
  font-size: 14px;
  color: #888888;
}

.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: 6px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-delete svg {
  width: 14px;
  height: 14px;
}

/* SQL Runner */
.sql-runner {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.sql-runner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #252525;
}

.sql-runner-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
}

.sql-textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 8px;
  color: #e5e5e5;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  margin-bottom: 16px;
}

.sql-textarea:focus {
  outline: none;
  border-color: #ffffff;
}

.sql-textarea::placeholder {
  color: #666666;
}

.sql-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.sql-results {
  margin-top: 24px;
  padding: 20px;
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 8px;
}

.sql-success, .sql-error {
  margin-bottom: 20px;
}

.sql-success-header, .sql-error-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sql-success-header svg, .sql-error-header svg {
  width: 24px;
  height: 24px;
}

.sql-success-header {
  color: #10b981;
}

.sql-error-header {
  color: #ef4444;
}

.sql-success-header h3, .sql-error-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.sql-success p, .sql-error p {
  color: #e5e5e5;
  margin-bottom: 8px;
}

.sql-row-count {
  font-size: 13px;
  color: #888888;
  font-family: 'SF Mono', Monaco, monospace;
}

.sql-error-message {
  color: #ef4444;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 14px;
  background: rgba(239, 68, 68, 0.1);
  padding: 12px;
  border-radius: 6px;
  margin-top: 12px;
}

.sql-error-hint {
  color: #f59e0b;
  font-size: 13px;
  font-style: italic;
  margin-top: 8px;
}

.sql-results-table {
  margin-top: 20px;
}

.sql-results-table h4 {
  font-size: 14px;
  font-weight: 600;
  color: #888888;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sql-note {
  margin-top: 12px;
  font-size: 13px;
  color: #f59e0b;
  font-style: italic;
}

.schema-viewer {
  margin-top: 24px;
}

.schema-viewer h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 20px;
}

/* SMTP Tester */
.smtp-tester {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  margin: 0 auto;
}

.smtp-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #252525;
}

.smtp-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.smtp-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #888888;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group label i {
  font-size: 16px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-option:hover {
  border-color: #333333;
  background: #1a1a1a;
}

.radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #ffffff;
}

.radio-option input[type="radio"]:checked + .radio-label {
  color: #ffffff;
  font-weight: 600;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #888888;
  flex: 1;
  transition: color 0.2s;
}

.radio-label i {
  font-size: 16px;
}

.btn-large {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
}

.smtp-results {
  margin-top: 24px;
  padding: 20px;
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 8px;
}

.smtp-success {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.smtp-success-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #10b981;
}

.smtp-success-header i {
  font-size: 24px;
}

.smtp-success-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.smtp-success-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.smtp-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #e5e5e5;
}

.smtp-info-row i {
  width: 20px;
  color: #888888;
}

.smtp-note {
  margin-top: 12px;
  padding: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  border-radius: 6px;
  font-size: 13px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 8px;
}

.smtp-note i {
  font-size: 16px;
}

.smtp-error {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.smtp-error-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ef4444;
}

.smtp-error-header i {
  font-size: 24px;
}

.smtp-error-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.smtp-error-message {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: 6px;
  font-size: 14px;
  color: #ef4444;
  font-family: 'SF Mono', Monaco, monospace;
}

.smtp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: #888888;
}

.smtp-loading i {
  font-size: 20px;
  animation: spin 1s linear infinite;
}

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

/* Test APIs Tab */
.test-apis-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.api-health-section {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  padding: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #252525;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.api-overall-status {
  background: #0a0a0a;
  border: 2px solid #252525;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.api-overall-status h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.timestamp {
  font-size: 13px;
  color: #666666;
}

.api-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.api-service-card {
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.api-service-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.api-service-header i {
  font-size: 24px;
  color: #666666;
}

.api-service-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: #e5e5e5;
}

.api-service-status {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.api-service-latency {
  font-size: 13px;
  font-weight: 500;
}

.api-service-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 8px;
  padding: 8px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 4px;
}

.test-section {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  padding: 24px;
}

.test-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.test-section .subtitle {
  font-size: 14px;
  color: #888888;
  margin-bottom: 20px;
}

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

.file-upload {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-name {
  font-size: 13px;
  color: #666666;
  font-style: italic;
}

.test-textarea {
  width: 100%;
  min-height: 150px;
  padding: 14px;
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 8px;
  color: #e5e5e5;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.test-textarea:focus {
  outline: none;
  border-color: #ffffff;
}

.test-textarea::placeholder {
  color: #666666;
}

.test-results {
  margin-top: 20px;
  padding: 20px;
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 8px;
}

.test-success {
  color: #10b981;
}

.test-success h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-error {
  color: #ef4444;
}

.test-error h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-error p {
  color: #e5e5e5;
  background: rgba(239, 68, 68, 0.1);
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
}

.test-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: #1a1a1a;
  border-radius: 6px;
}

.test-metrics span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888888;
  font-family: 'SF Mono', Monaco, monospace;
}

.test-metrics i {
  color: #666666;
}

.test-result-box {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.test-result-box h5 {
  font-size: 13px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.test-result-box pre {
  color: #e5e5e5;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
}

.exam-markers-container {
  margin-top: 16px;
}

.exam-markers-container h5 {
  font-size: 13px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.exam-marker {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

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

.marker-header strong {
  color: #ffffff;
  font-size: 14px;
}

.marker-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.marker-status.normal {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid #10b981;
}

.marker-status.high {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.marker-status.low {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.marker-details {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #888888;
  margin-bottom: 6px;
}

.marker-details strong {
  color: #e5e5e5;
}

.marker-normalized {
  font-size: 12px;
  color: #666666;
  font-family: 'SF Mono', Monaco, monospace;
}

.marker-normalized code {
  background: #0a0a0a;
  padding: 2px 6px;
  border-radius: 3px;
  color: #888888;
}

.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  background: #1a1a1a;
  border-radius: 6px;
  padding: 16px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #888888;
  padding: 8px;
  background: #0a0a0a;
  border-radius: 4px;
}

.flow-step i {
  color: #10b981;
  font-size: 16px;
}

.flow-step.total {
  border-top: 1px solid #252525;
  padding-top: 12px;
  margin-top: 4px;
  color: #ffffff;
  font-weight: 600;
}

.flow-step.total i {
  color: #f59e0b;
}

.btn-delete-prospect {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: 6px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-prospect:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-delete-prospect svg {
  width: 14px;
  height: 14px;
}

.clickable-cell {
  cursor: pointer;
}

/* ============================================= */
/* RLS POLICIES SECTION */
/* ============================================= */

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #f59e0b;
}

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

.policy-item {
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 8px;
  padding: 14px;
  transition: border-color 0.2s;
}

.policy-item:hover {
  border-color: #333333;
}

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

.policy-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #e5e5e5;
}

.policy-name svg {
  color: #10b981;
}

.policy-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.policy-select {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid #3b82f6;
}

.policy-insert {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid #10b981;
}

.policy-update {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.policy-delete {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.policy-all {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border: 1px solid #a855f7;
}

.policy-detail {
  margin-top: 8px;
  padding: 8px;
  background: #1a1a1a;
  border-radius: 4px;
}

.policy-detail strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.policy-detail code {
  display: block;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 12px;
  color: #e5e5e5;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.info-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: #888888;
}

.info-message svg {
  width: 18px;
  height: 18px;
  color: #3b82f6;
  flex-shrink: 0;
}

/* ============================================= */

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .actions {
    width: 100%;
  }
  
  .btn {
    flex: 1;
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .data-filters {
    flex-direction: column;
  }
  
  .filter-input {
    width: 100%;
  }
  
  .footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .sql-runner-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .sql-actions {
    flex-direction: column;
  }
  
  .sql-actions .btn {
    width: 100%;
  }
  
  .api-services-grid {
    grid-template-columns: 1fr;
  }
  
  .test-metrics {
    flex-direction: column;
    gap: 8px;
  }
  
  .file-upload {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════════
   SUPPORT TICKETS DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

/* Tab badge */
.support-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #E74C3C;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

/* Header bar */
.support-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.support-header-bar h2 { font-size: 1.3rem; color: #fff; }
.support-header-bar .subtitle { color: #888; font-size: 0.85rem; margin-top: 2px; }

/* Filters */
.support-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.support-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #aaa;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.support-filter-btn:hover { border-color: #555; color: #fff; }
.support-filter-btn.active { background: #2563EB; border-color: #2563EB; color: #fff; }

/* Split panel */
.support-split {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  min-height: 600px;
}

/* List panel */
.support-list-panel {
  background: #141414;
  border: 1px solid #222;
  border-radius: 10px;
  overflow-y: auto;
  max-height: 80vh;
}

/* Detail panel */
.support-detail-panel {
  background: #141414;
  border: 1px solid #222;
  border-radius: 10px;
  overflow-y: auto;
  max-height: 80vh;
  padding: 20px;
}

/* Loading / Error / Empty */
.support-loading, .support-error, .support-empty, .support-empty-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #666;
  gap: 12px;
  text-align: center;
}
.support-loading i, .support-empty i, .support-empty-detail i { font-size: 2rem; }
.support-error { color: #E74C3C; }

/* Ticket list items */
.support-ticket-item {
  padding: 14px 16px;
  border-bottom: 1px solid #1e1e1e;
  cursor: pointer;
  transition: background 0.15s;
}
.support-ticket-item:hover { background: #1a1a2e; }
.support-ticket-item.selected { background: #1a1a3a; border-left: 3px solid #2563EB; }
.support-ticket-item.is-open { border-left: 3px solid #E74C3C; }
.support-ticket-item.is-open.selected { border-left: 3px solid #2563EB; }

.sti-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sti-number { font-size: 12px; font-weight: 700; color: #2563EB; font-family: monospace; }
.sti-time { font-size: 11px; color: #666; }
.sti-subject { font-size: 14px; color: #e5e5e5; font-weight: 500; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sti-footer { display: flex; justify-content: space-between; align-items: center; }
.sti-status { font-size: 11px; font-weight: 600; }
.sti-status i { margin-right: 3px; }
.sti-user { font-size: 11px; color: #888; }

/* ── Detail Header ── */
.sd-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sd-header-left { display: flex; align-items: center; gap: 12px; }
.sd-header-left h3 { font-size: 1.2rem; font-family: monospace; color: #2563EB; }
.sd-status-badge { padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.sd-status-badge i { margin-right: 4px; }
.sd-date { font-size: 12px; color: #666; }
.sd-subject { font-size: 15px; color: #ccc; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #222; }

/* ── Collapsible cards ── */
.sd-card {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.sd-card-title {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #bbb;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: background 0.15s;
}
.sd-card-title:hover { background: #222; }
.sd-chevron { margin-left: auto; transition: transform 0.2s; font-size: 11px; }
.sd-card.collapsed .sd-card-body { display: none; }
.sd-card.collapsed .sd-chevron { transform: rotate(-90deg); }
.sd-card-body { padding: 12px 14px; border-top: 1px solid #252525; }

/* Info grid */
.sd-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sd-info-item { display: flex; flex-direction: column; gap: 2px; }
.sd-info-label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.sd-info-value { font-size: 13px; color: #ddd; }
.sd-info-empty { color: #555; font-size: 12px; font-style: italic; padding: 8px; }

/* ── Rich Log Styles ─────────────────────────────── */
.sd-log-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}
.sd-log-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #1a1a1a;
  flex-wrap: wrap;
}
.sd-log-entry.sd-log-error { background: #E74C3C15; border-left: 3px solid #E74C3C; }
.sd-log-entry.sd-log-warn { background: #F39C1215; border-left: 3px solid #F39C12; }
.sd-log-method { font-weight: 700; min-width: 42px; text-align: center; }
.sd-log-url { color: #A0A0A0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-log-status { font-weight: 700; min-width: 32px; text-align: center; }
.sd-log-duration { color: #888; min-width: 50px; text-align: right; }
.sd-log-err-msg { color: #E74C3C; font-size: 11px; width: 100%; padding-left: 50px; }
.sd-log-time { color: #666; margin-left: auto; white-space: nowrap; font-size: 11px; }
.sd-log-level { font-weight: 700; min-width: 80px; }
.sd-log-message { color: #CCC; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-log-context { color: #888; font-size: 11px; width: 100%; padding-left: 80px; }
.sd-log-screen { color: #7FDBFF; }
.sd-log-screens .sd-log-entry { background: transparent; border-bottom: 1px solid #222; border-radius: 0; }

/* ── Messages ── */
.sd-messages-title {
  font-size: 14px;
  font-weight: 600;
  color: #aaa;
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sd-messages {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  background: #111;
  border-radius: 8px;
  border: 1px solid #222;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sd-msg {
  padding: 10px 14px;
  border-radius: 10px;
  max-width: 85%;
}
.sd-msg-user {
  background: #1a2a4a;
  border: 1px solid #253a5e;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.sd-msg-admin {
  background: #1a3a1a;
  border: 1px solid #254e25;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.sd-msg-sender { font-size: 11px; font-weight: 600; color: #888; margin-bottom: 4px; }
.sd-msg-text { font-size: 13px; color: #e5e5e5; white-space: pre-wrap; line-height: 1.5; }
.sd-msg-time { font-size: 10px; color: #555; margin-top: 4px; text-align: right; }

/* ── Reply area ── */
.sd-reply-area {
  margin-top: 16px;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 8px;
  padding: 14px;
}
.sd-reply-header {
  font-size: 13px;
  font-weight: 600;
  color: #aaa;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sd-reply-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.sd-reply-row label { font-size: 12px; color: #888; white-space: nowrap; }
.sd-input {
  flex: 1;
  padding: 6px 10px;
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e5e5e5;
  font-size: 13px;
}
.sd-textarea {
  width: 100%;
  padding: 10px;
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e5e5e5;
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 10px;
}
.sd-textarea:focus, .sd-input:focus { outline: none; border-color: #2563EB; }

.sd-reply-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sd-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.sd-btn i { font-size: 12px; }
.sd-btn-reply { background: #2563EB; color: #fff; }
.sd-btn-reply:hover { background: #1d4ed8; }
.sd-btn-info { background: #F39C12; color: #000; }
.sd-btn-info:hover { background: #e67e22; }
.sd-btn-resolve { background: #27AE60; color: #fff; }
.sd-btn-resolve:hover { background: #1e8449; }
.sd-btn-close { background: #555; color: #fff; }
.sd-btn-close:hover { background: #777; }

.sd-closed-banner {
  margin-top: 16px;
  padding: 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #888;
  text-align: center;
  font-size: 13px;
}
.sd-closed-banner i { margin-right: 6px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .support-split { grid-template-columns: 1fr; }
  .support-list-panel { max-height: 300px; }
  .sd-info-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   FINANCES DASHBOARD
   ═══════════════════════════════════════════════════════════ */

/* Period Bar */
.fin-period-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.fin-period-label {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  margin-right: 4px;
}
.fin-period-btn {
  padding: 6px 14px;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 8px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.fin-period-btn:hover { background: #252525; color: #e5e5e5; }
.fin-period-btn.active {
  background: #003F52;
  border-color: #003F52;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,63,82,0.3);
}

/* KPI Grid */
.fin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.fin-kpi-card {
  background: #111;
  border: 1px solid #252525;
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.fin-kpi-card:hover { border-color: #333; }
.fin-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #003F52, #00D9FF);
  border-radius: 14px 14px 0 0;
}
.fin-kpi-card.accent-red::before { background: linear-gradient(90deg, #FF5252, #FFB74D); }
.fin-kpi-card.accent-blue::before { background: linear-gradient(90deg, #5794E0, #003F52); }
.fin-kpi-card.accent-cyan::before { background: linear-gradient(90deg, #00D9FF, #26A69A); }
.fin-kpi-card.accent-green::before { background: linear-gradient(90deg, #00E676, #26A69A); }

.fin-kpi-icon {
  font-size: 20px;
  margin-bottom: 6px;
}
.fin-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.fin-kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #f0f0f0;
  font-variant-numeric: tabular-nums;
}
.fin-kpi-sub {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

/* Charts Grid */
.fin-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.fin-chart-card {
  background: #111;
  border: 1px solid #252525;
  border-radius: 14px;
  padding: 20px;
}
.fin-chart-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #e5e5e5;
  margin-bottom: 16px;
}
.fin-chart-card.fin-chart-wide {
  grid-column: span 2;
}
.fin-chart-container {
  position: relative;
  height: 280px;
}
.fin-chart-container-wide {
  position: relative;
  height: 320px;
}

/* Tables */
.fin-table-card {
  background: #111;
  border: 1px solid #252525;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.fin-table-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #e5e5e5;
  margin-bottom: 16px;
}
.fin-table-scroll {
  overflow-x: auto;
}
.fin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.fin-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #252525;
  white-space: nowrap;
}
.fin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #ccc;
  font-variant-numeric: tabular-nums;
}
.fin-table tr:hover td {
  background: rgba(0,63,82,0.08);
}
.fin-table code {
  background: rgba(0,217,255,0.08);
  border: 1px solid rgba(0,217,255,0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  color: #00D9FF;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Provider Badges */
.fin-provider-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.fin-provider-groq {
  background: rgba(0,230,118,0.15);
  color: #00E676;
  border: 1px solid rgba(0,230,118,0.3);
}
.fin-provider-anthropic {
  background: rgba(171,71,188,0.15);
  color: #CE93D8;
  border: 1px solid rgba(171,71,188,0.3);
}
.fin-provider-openai {
  background: rgba(0,217,255,0.15);
  color: #00D9FF;
  border: 1px solid rgba(0,217,255,0.3);
}

/* Gateway Status Card */
.fin-gateway-card {
  background: #111;
  border: 1px solid #252525;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.fin-gateway-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #e5e5e5;
  margin-bottom: 16px;
}
.fin-gateway-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  font-size: 13px;
  color: #888;
}
.fin-gateway-grid strong {
  color: #e5e5e5;
}

/* Chart Empty State */
.fin-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #555;
  gap: 12px;
  text-align: center;
  padding: 20px;
}
.fin-chart-empty i {
  font-size: 32px;
  color: #333;
}
.fin-chart-empty span {
  font-size: 13px;
  color: #555;
  max-width: 200px;
  line-height: 1.5;
}

/* Loading state */
.fin-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 40px;
  color: #888;
}
.fin-loading-overlay i {
  font-size: 28px;
  animation: spin 1s linear infinite;
}
.fin-loading-overlay span {
  font-size: 14px;
}

/* Period button disabled during load */
.fin-period-btn.loading {
  opacity: 0.5;
}

/* ── Custom Date Range ── */
.fin-custom-range {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #0e0e0e;
  border: 1px solid #252525;
  border-radius: 8px;
  margin-bottom: 20px;
}
.fin-custom-range.visible {
  display: flex;
}
.fin-custom-range label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #aaa;
}
.fin-custom-range input[type="date"] {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e5e5e5;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.fin-custom-range input[type="date"]:focus {
  border-color: #00D9FF;
}
.fin-custom-range input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

/* ── Percentage Bar (Top 10) ── */
.fin-pct-bar {
  position: relative;
  background: #1a1a1a;
  border-radius: 4px;
  height: 22px;
  min-width: 100px;
  overflow: hidden;
}
.fin-pct-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(0,217,255,0.25), rgba(0,217,255,0.08));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.fin-pct-bar span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 11px;
  font-weight: 600;
  color: #00D9FF;
}

/* ── Top row hover ── */
.fin-top-row:hover td {
  background: rgba(0,217,255,0.06) !important;
}

/* ── User Detail Breakdown tables ── */
.fin-ud-breakdown {
  margin-top: 16px;
}
.fin-ud-breakdown h5 {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 8px;
  font-weight: 500;
  pointer-events: none;
  cursor: wait;
}

/* ── User Detail Panel (Layer 2→3) ── */
.fin-ud-panel {
  background: #0a0a0a;
  border: 1px solid #252525;
  border-radius: 10px;
  margin: 8px 12px 12px;
  padding: 20px;
}
.fin-ud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #252525;
}
.fin-ud-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.fin-ud-cost {
  font-size: 28px;
  font-weight: 800;
  color: #00D9FF;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Monaco, monospace;
}

/* Mini charts row */
.fin-ud-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.fin-ud-minichart {
  background: #111;
  border: 1px solid #252525;
  border-radius: 10px;
  padding: 14px;
}
.fin-ud-minichart h5 {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin-bottom: 10px;
}
.fin-ud-chart-box {
  position: relative;
  height: 180px;
}

/* Calls section */
.fin-ud-calls {
  margin-top: 16px;
}
.fin-ud-calls h5 {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  margin-bottom: 12px;
}

/* Call detail box (Layer 3) */
.fin-call-detail-box {
  background: #0e0e0e;
  border: 1px solid #1a1a1a;
  border-left: 3px solid #00D9FF;
  border-radius: 0 0 8px 8px;
  padding: 16px 20px;
  margin: 0 8px 8px;
}
.fin-cd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.fin-cd-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.fin-cd-grid code {
  font-size: 12px;
  color: #00D9FF;
  background: rgba(0,217,255,0.08);
  padding: 2px 6px;
  border-radius: 3px;
}
.fin-cd-grid strong {
  color: #e5e5e5;
  font-size: 13px;
}

/* User row hover highlight */
.fin-user-row:hover td {
  background: rgba(0,217,255,0.06) !important;
}
.fin-call-row:hover td {
  background: rgba(0,217,255,0.04) !important;
}

/* Responsive drill-down */
@media (max-width: 768px) {
  .fin-ud-charts-row { grid-template-columns: 1fr; }
  .fin-cd-grid { grid-template-columns: 1fr 1fr; }
  .fin-ud-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .fin-ud-cost { font-size: 22px; }
}

/* Finances Responsive */
@media (max-width: 1200px) {
  .fin-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .fin-charts-grid { grid-template-columns: 1fr; }
  .fin-chart-card.fin-chart-wide { grid-column: span 1; }
  .fin-gateway-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .fin-kpi-grid { grid-template-columns: 1fr 1fr; }
  .fin-gateway-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   Premium Badges & User Actions
   Professional, responsive, Font Awesome icons only
   ═══════════════════════════════════════════════════════════ */

/* Premium Status Badges */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: default;
}

.premium-badge i {
  font-size: 10px;
}

/* Free — subtle, muted */
.premium-free {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #6b7280;
}

/* Manual Premium — gold/amber, prominent, impossible to miss */
.premium-manual {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  text-transform: uppercase;
  animation: manualGlow 3s ease-in-out infinite alternate;
}

@keyframes manualGlow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 8px 0 rgba(245, 158, 11, 0.15); }
}

/* Manual Trial — orange, with hourglass animation */
.premium-trial {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.15), rgba(234, 88, 12, 0.2));
  border: 1px solid rgba(251, 146, 60, 0.4);
  color: #fb923c;
  text-transform: uppercase;
  animation: trialPulse 2s ease-in-out infinite alternate;
}

.premium-trial i {
  animation: trialSpin 4s linear infinite;
}

@keyframes trialPulse {
  0% { box-shadow: 0 0 0 0 rgba(251, 146, 60, 0); }
  100% { box-shadow: 0 0 6px 0 rgba(251, 146, 60, 0.2); }
}

@keyframes trialSpin {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(180deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(360deg); }
  100% { transform: rotate(360deg); }
}

/* Manual Trial Expired — red/dimmed */
.premium-trial-expired {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(185, 28, 28, 0.18));
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  animation: none;
}

.premium-trial-expired i {
  animation: none;
}

/* Apple Premium — purple */
.premium-apple {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.12), rgba(126, 34, 206, 0.18));
  border: 1px solid rgba(147, 51, 234, 0.35);
  color: #a78bfa;
}

/* Android Premium — green */
.premium-android {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(16, 185, 129, 0.18));
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

/* Other Premium — generic */
.premium-other {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ─── User Action Buttons ─────────────────────────────────── */

.user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #d1d5db;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

.btn-action i {
  font-size: 11px;
  pointer-events: none;
}

.btn-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Grant Premium — warm gold */
.btn-grant-premium {
  border-color: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

.btn-grant-premium:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

/* Revoke Premium — orange/warning */
.btn-action-danger {
  border-color: rgba(249, 115, 22, 0.25);
  color: #fb923c;
}

.btn-action-danger:hover:not(:disabled) {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.5);
  color: #fdba74;
}

/* Delete — red/destructive */
.btn-action-destructive {
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 5px 8px;
}

.btn-action-destructive:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

/* Processing state — spinner + disabled */
.btn-action:disabled,
.btn-processing {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-processing {
  opacity: 0.7;
}

/* Email cell — prevent overflow on small screens */
.table-cell-email {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Responsive Users Table ──────────────────────────────── */

@media (max-width: 1024px) {
  .user-actions {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .btn-action {
    font-size: 10px;
    padding: 4px 8px;
  }

  .table-cell-email {
    max-width: 160px;
  }
}

@media (max-width: 768px) {
  .premium-badge {
    font-size: 10px;
    padding: 3px 7px;
  }

  .user-actions {
    flex-direction: column;
    gap: 3px;
  }

  .table-cell-email {
    max-width: 120px;
  }
}

/* ─── Debug Modal ──────────────────────────────────────────── */

.debug-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.debug-modal {
  background: #111111;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.debug-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.debug-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.debug-modal-header h3 i {
  color: #f59e0b;
}

.debug-modal-close {
  background: none;
  border: 1px solid #333;
  color: #999;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.debug-modal-close:hover {
  background: #2a2a2a;
  color: #fff;
  border-color: #555;
}

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

.debug-loading, .debug-error {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.debug-loading i {
  font-size: 24px;
  margin-bottom: 12px;
  display: block;
  color: #60a5fa;
}

.debug-error {
  color: #ef4444;
}

.debug-error i {
  font-size: 24px;
  margin-bottom: 12px;
  display: block;
}

/* Debug Sections */
.debug-section {
  margin-bottom: 24px;
}

.debug-section:last-child {
  margin-bottom: 0;
}

.debug-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #e5e5e5;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1f1f1f;
  display: flex;
  align-items: center;
  gap: 8px;
}

.debug-section h4 i {
  color: #60a5fa;
  font-size: 13px;
}

/* Debug Grid (key-value rows) */
.debug-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debug-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #161616;
}

.debug-row:hover {
  background: #1a1a1a;
}

.debug-label {
  font-size: 12px;
  font-weight: 500;
  color: #888;
  min-width: 160px;
  flex-shrink: 0;
  padding-top: 2px;
}

.debug-value {
  font-size: 13px;
  color: #e5e5e5;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.debug-value code {
  background: #1e1e1e;
  border: 1px solid #333;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 11px;
  color: #a5b4fc;
}

/* Debug Badges */
.debug-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.debug-badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.debug-badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.debug-badge-yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.debug-badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.debug-badge-gray {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Debug Diagnostics */
.debug-diagnostics {
  margin-bottom: 20px;
}

.debug-diag {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 6px;
  line-height: 1.5;
}

.debug-diag:last-child {
  margin-bottom: 0;
}

.debug-diag-critical {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-left: 3px solid #ef4444;
}

.debug-diag-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-left: 3px solid #f59e0b;
}

.debug-diag-ok {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-left: 3px solid #22c55e;
}

.debug-diag-info {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-left: 3px solid #3b82f6;
}

.debug-empty {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 13px;
  background: #161616;
  border-radius: 8px;
}

.debug-empty i {
  margin-right: 6px;
}

/* Debug Button Style */
.btn-debug {
  background: #1e293b !important;
  color: #f59e0b !important;
  border: 1px solid #334155 !important;
}

.btn-debug:hover {
  background: #334155 !important;
  border-color: #f59e0b !important;
}

/* Responsive debug modal */
@media (max-width: 768px) {
  .debug-modal {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 12px;
  }

  .debug-modal-body {
    padding: 16px;
  }

  .debug-label {
    min-width: 120px;
    font-size: 11px;
  }

  .debug-row {
    flex-direction: column;
    gap: 4px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Create Partner Form
   ═══════════════════════════════════════════════════════════ */

.partner-form-group {
  margin-bottom: 16px;
}

.partner-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 6px;
}

.partner-form-label i {
  width: 16px;
  text-align: center;
  margin-right: 6px;
  color: #888;
}

.partner-form-input,
.partner-form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1.5px solid #333;
  border-radius: 10px;
  background: #0a0a0a;
  color: #e5e5e5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.partner-form-input:focus,
.partner-form-select:focus {
  border-color: #00D9FF;
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.partner-form-input::placeholder {
  color: #555;
}

.partner-form-input:disabled,
.partner-form-select:disabled {
  background: #161616;
  color: #555;
  cursor: not-allowed;
}

.partner-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.partner-btn-cancel {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid #333;
  border-radius: 10px;
  background: #1a1a1a;
  color: #999;
  cursor: pointer;
  transition: all 0.15s ease;
}

.partner-btn-cancel:hover:not(:disabled) {
  background: #252525;
  border-color: #555;
  color: #e5e5e5;
}

.partner-btn-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.partner-btn-submit {
  flex: 1.5;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #003F52, #005A75);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.partner-btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #004d63, #006d8a);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 63, 82, 0.25);
}

.partner-btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.partner-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.partner-btn-submit.btn-processing {
  pointer-events: none;
}

/* Partner result states */
.partner-result-success {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  margin-bottom: 12px;
}

.partner-result-icon {
  font-size: 28px;
  color: #10b981;
  flex-shrink: 0;
}

.partner-result-text strong {
  display: block;
  font-size: 14px;
  color: #4ade80;
  margin-bottom: 2px;
}

.partner-result-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: #161616;
  border: 1px solid #252525;
  border-radius: 8px;
  margin-bottom: 16px;
}

.partner-result-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #d1d5db;
}

.partner-result-detail i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.partner-result-error {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1.5px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #f87171;
  font-size: 13px;
  margin-bottom: 12px;
}

.partner-result-error i {
  margin-right: 6px;
}

@media (max-width: 480px) {
  .partner-form-actions {
    flex-direction: column;
  }
  .partner-btn-cancel,
  .partner-btn-submit {
    flex: none;
  }
}
