:root {
  --bg: #0b1120;
  --bg-elevated: #020617;
  --bg-panel: #020617;
  --border-subtle: #1e293b;
  --text-primary: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.15);
  --neutral-soft: rgba(148, 163, 184, 0.15);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
}

html {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #020617 100%);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 20px 22px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.99);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.6);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.login-subtitle {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.login-field label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-field input {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
  padding: 7px 9px;
  font-size: 0.86rem;
}

.login-error {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #fecaca;
}

.login-btn {
  width: 100%;
  margin-top: 12px;
}

.login-remember {
  margin: 2px 0 4px;
}

.settings-test-toggle {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(148, 163, 184, 0.6);
  transition: 0.2s;
  border-radius: 999px;
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: #0f172a;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked+.switch-slider {
  background: linear-gradient(135deg, #3b82f6, #22c55e);
}

.switch input:checked+.switch-slider::before {
  transform: translateX(18px);
}

.switch-text {
  font-size: 0.85rem;
  color: #cbd5f5;
}

.app-header {
  padding: 18px 32px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
}

.app-header h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
}

.app-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-tabs {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
}

.header-tab {
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  padding: 4px 10px;
  color: var(--text-muted);
}

.header-tab.header-tab-active {
  background: rgba(37, 99, 235, 0.25);
  color: var(--text-primary);
}

.app-main {
  flex: 1;
  display: grid;
  gap: 16px;
  padding: 16px 24px 24px;
  min-height: 0;
  overflow: hidden;
}

#dashboardMain {
  grid-template-columns: minmax(260px, 68%) 6px minmax(0, 32%);
}

#settingsMain {
  grid-template-columns: minmax(0, 38%) minmax(0, 62%);
}

.panel {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 64, 175, 0.28);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-left: -10px;
  margin-right: -10px;
}

.panel-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(30, 64, 175, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.splitter-vertical {
  align-self: stretch;
  border-radius: 999px;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splitter-vertical::before {
  content: "";
  width: 2px;
  height: 32px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.9);
}

.sync-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.sync-timer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sync-progress {
  width: 220px;
  max-width: 40vw;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(37, 99, 235, 0.6);
  overflow: hidden;
}

.sync-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background-image: repeating-linear-gradient(45deg,
      #38bdf8,
      #38bdf8 6px,
      #6366f1 6px,
      #6366f1 12px);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  transition: width 0.3s linear;
}

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

select,
input[type="search"],
textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
  padding: 7px 9px;
  font-size: 0.85rem;
}

select:focus,
input[type="search"]:focus,
textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.table-wrapper {
  padding: 6px 10px 10px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.cases-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.cases-table thead {
  background: linear-gradient(to right, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
}

.cases-table th,
.cases-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

.cases-table th:nth-child(2),
.cases-table td:nth-child(2) {
  width: 52px;
  padding-right: 4px;
}

.cases-table th {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cases-table tbody tr {
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.04s ease;
}

.cases-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.5);
}

.cases-table tbody tr:hover {
  background: rgba(30, 64, 175, 0.35);
}

.cases-table td.analyse-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-row-action {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}

.btn-row-action svg {
  width: 16px;
  height: 16px;
}

.btn-row-valid {
  border-color: rgba(34, 197, 94, 0.7);
}

.btn-row-valid .icon-success {
  fill: #bbf7d0;
}

.btn-row-refuse {
  border-color: rgba(239, 68, 68, 0.7);
}

.btn-row-refuse .icon-danger {
  fill: #fecaca;
}

.btn-row-mail {
  border-color: rgba(56, 189, 248, 0.7);
}

.btn-row-mail .icon-mail {
  fill: #bae6fd;
}

.btn-row-action:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 1);
}

.photo-thumb-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at top, #111827, #020617);
}

.photo-thumb-multi {
  display: flex;
  align-items: center;
}

.photo-thumb-extra {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at top, #1d283a, #020617);
  flex-shrink: 0;
  margin-right: -24px;
  /* décalage constant par rapport à la vignette de droite */
  z-index: 1;
}

.photo-thumb-extra img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.photo-thumb-multi .photo-thumb {
  position: relative;
  flex-shrink: 0;
  z-index: 2;
  /* la vignette principale reste au-dessus des extra */
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.empty,
.error {
  text-align: center;
  color: var(--text-muted);
}

.error {
  color: #fecaca;
}

.detail-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.detail-content {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.detail-top {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
}

.detail-photo {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.9);
  background: #020617;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-photo-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
}

.detail-photo-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
}

.detail-photo-arrow {
  border-radius: 999px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.detail-photo-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.detail-photo-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 8px 4px;
}

.btn-debug-image {
  margin: 0 6px 6px;
  align-self: flex-start;
  font-size: 0.78rem;
}

.btn-detail-carousel {
  margin-top: 6px;
  font-size: 0.78rem;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.86rem;
}

.detail-line {
  display: flex;
  gap: 6px;
}

.detail-line .label {
  color: var(--text-muted);
  width: 90px;
  flex-shrink: 0;
}

.detail-section {
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
}

.detail-section h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.analyse-resume {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(30, 64, 175, 0.4);
  font-size: 0.87rem;
}

.analyse-raisons {
  margin: 6px 0 8px;
  padding-left: 18px;
  font-size: 0.86rem;
}

.analyse-raisons li {
  margin-bottom: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
}

.badge-success {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.7);
  color: #bbf7d0;
}

.badge-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fecaca;
}

.badge-warning {
  background: var(--warning-soft);
  border-color: rgba(245, 158, 11, 0.7);
  color: #fed7aa;
}

.badge-neutral {
  background: var(--neutral-soft);
  border-color: rgba(148, 163, 184, 0.8);
  color: #e5e7eb;
}

.btn-primary {
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.6);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.08s ease;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.8);
}

.btn-primary:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.1s ease, transform 0.05s ease, border-color 0.1s ease;
}

.btn-secondary:hover {
  background: rgba(30, 64, 175, 0.45);
  border-color: rgba(59, 130, 246, 0.8);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: default;
}

.mode-toggle-btn {
  font-size: 0.78rem;
  padding-inline: 14px;
}

.mode-toggle-btn.mode-auto {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(22, 163, 74, 0.25);
}

.decision-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.86rem;
}

.decision-controls label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
}

.comment-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

textarea {
  width: 100%;
  resize: vertical;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.84rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn-terminate {
  font-size: 0.8rem;
}

.hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mail-section {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(30, 64, 175, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mail-title {
  margin: 0;
  font-size: 0.9rem;
}

.mail-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 6px;
}

.settings-content {
  gap: 14px;
}

.settings-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 18px;
}

.settings-column h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.settings-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.settings-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 16px;
}

.settings-template-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(30, 64, 175, 0.5);
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.9);
}

.settings-template-card h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

/* Styles pour le sélecteur de dossiers IMAP */
.folders-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(30, 64, 175, 0.5);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.5);
  margin-top: 1rem;
}

.folder-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.8rem;
  gap: 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s;
}

.folder-item:hover {
  background: rgba(30, 64, 175, 0.2);
}

.folder-item input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.folder-item label {
  cursor: pointer;
  flex: 1;
  font-size: 0.9rem;
  user-select: none;
}

.folders-loading,
.folders-error {
  padding: 1rem;
  text-align: center;
  margin-top: 1rem;
}

.folders-error .error-text {
  color: var(--danger);
  margin: 0;
}


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

.icon-success {
  fill: var(--success);
}

.icon-danger {
  fill: var(--danger);
}

.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .app-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .detail-top {
    grid-template-columns: 1fr;
  }
}

/* Modal générique */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}

.modal-dialog {
  position: relative;
  max-width: 700px;
  width: 90vw;
  max-height: 80vh;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(37, 99, 235, 0.6);
  box-shadow: var(--shadow-soft);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-dialog h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-body {
  margin-top: 4px;
  padding: 8px 0;
  border-top: 1px solid rgba(30, 64, 175, 0.5);
  border-bottom: 1px solid rgba(30, 64, 175, 0.5);
  max-height: 48vh;
  overflow: auto;
}

.modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dag-emails-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.dag-emails-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dag-emails-list li:nth-child(2n) {
  background: rgba(15, 23, 42, 0.9);
}

.dag-email-address {
  font-weight: 500;
}

.dag-email-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.dag-email-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
}

.dag-email-pill-processed {
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.9);
  background: rgba(22, 163, 74, 0.15);
}

.dag-email-address-processed {
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.9);
  border-radius: 999px;
  padding: 1px 8px;
  background: rgba(22, 163, 74, 0.15);
}

.case-email-cell {
  cursor: pointer;
}

.dag-carousel-dialog {
  max-width: 640px;
}

.dag-carousel-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dag-carousel-photo-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#dagCarouselImage {
  max-width: 280px;
  max-height: 220px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.dag-carousel-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dag-carousel-arrow {
  border-radius: 999px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dag-carousel-arrow:hover {
  border-color: rgba(59, 130, 246, 0.9);
}

.dag-carousel-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dag-carousel-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dag-carousel-actions-buttons {
  display: flex;
  gap: 8px;
}

.dag-carousel-open {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  padding: 2px 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Database Management Styles */
.danger-zone {
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.danger-zone .panel-header h2 {
  color: var(--danger);
}

.db-info-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(30, 64, 175, 0.5);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.db-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.db-info-item .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.db-info-item .value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.db-actions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.db-action-group {
  padding: 1rem;
  border: 1px solid rgba(30, 64, 175, 0.5);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.3);
}

.db-action-group.danger {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(127, 29, 29, 0.1);
}

.db-action-group h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.db-action-group .hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(185, 28, 28, 0.9));
  color: white;
  border: 1px solid rgba(239, 68, 68, 0.8);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.9), rgba(153, 27, 27, 0.9));
  border-color: rgba(220, 38, 38, 1);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Time Filter Bar */
.time-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(30, 64, 175, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.time-filter-buttons {
  display: flex;
  gap: 0.5rem;
}

.time-filter-btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(59, 130, 246, 0.5);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.time-filter-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.8);
}

.time-filter-btn.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 1);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.new-cases-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(30, 64, 175, 0.3);
}

/* New Case Badge */
.new-case-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.5rem;
  text-transform: uppercase;
}

/* New Case Row Highlighting */
.case-row.new-case {
  border-left: 3px solid rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.05);
}

.case-row.new-case:hover {
  background: rgba(59, 130, 246, 0.1);
}