/* Email Marketing Admin — layout helpers (Tailwind handles most styling) */

:root {
  --sidebar-width: 16rem;
  --sidebar-collapsed: 4.5rem;
  --brand-500: #0ea5e9;
  --brand-600: #0284c7;
  --brand-700: #0369a1;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Auth page background */
.auth-bg {
  background-color: #0f172a;
  background-image:
    radial-gradient(at 20% 20%, rgba(14, 165, 233, 0.18) 0, transparent 50%),
    radial-gradient(at 80% 10%, rgba(56, 189, 248, 0.12) 0, transparent 45%),
    radial-gradient(at 50% 80%, rgba(2, 132, 199, 0.15) 0, transparent 50%);
}

.form-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

/* Desktop collapsed sidebar */
#app-shell.sidebar-collapsed #sidebar {
  width: var(--sidebar-collapsed);
}

#app-shell.sidebar-collapsed #main-column {
  margin-left: var(--sidebar-collapsed);
}

#app-shell.sidebar-collapsed .sidebar-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

#app-shell.sidebar-collapsed #sidebar-collapse i {
  transform: rotate(180deg);
}

#app-shell.sidebar-collapsed #sidebar .sidebar-link,
#app-shell.sidebar-collapsed #sidebar a {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#app-shell.sidebar-collapsed #sidebar .sidebar-link .sidebar-label + span,
#app-shell.sidebar-collapsed #sidebar .ml-auto.sidebar-label {
  display: none;
}

@media (max-width: 1023px) {
  #main-column {
    margin-left: 0 !important;
  }

  #app-shell.sidebar-collapsed #sidebar {
    width: var(--sidebar-width);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
  background: #161b22;
}

.dark ::-webkit-scrollbar-thumb {
  background: #30363d;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* ------------------------------------------------------------------
   DataTables — match admin theme
------------------------------------------------------------------ */
.dataTables_wrapper {
  font-family: inherit;
}

/* Footer: info + pagination */
.dataTables_wrapper .dt-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  background: rgba(248, 250, 252, 0.7);
}

@media (min-width: 640px) {
  .dataTables_wrapper .dt-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.dataTables_wrapper .dt-footer .dataTables_info,
.dataTables_wrapper .dt-footer .dataTables_paginate {
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.dataTables_wrapper .dt-footer .dataTables_info {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.25rem;
}

.dataTables_wrapper .dt-footer .dataTables_paginate {
  display: flex !important;
  visibility: visible !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

/* Page numbers are wrapped in a <span> — use the same gap */
.dataTables_wrapper .dt-footer .dataTables_paginate > span {
  display: inline-flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0 !important;
  padding: 0 !important;
}

.dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 2.25rem;
  height: 2.25rem;
  margin: 0 !important;
  padding: 0 0.5rem !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem !important;
  background: #fff !important;
  color: #475569 !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.next {
  margin: 0 !important;
  padding: 0 !important;
}

.dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
  background: #f8fafc !important;
  color: var(--brand-600) !important;
  border-color: #cbd5e1 !important;
}

.dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.current:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #fff !important;
}

.dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.4;
  cursor: default;
  background: #fff !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
}

.dataTables_wrapper .dt-footer .dataTables_paginate .ellipsis {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  margin: 0 !important;
  padding: 0 !important;
  color: #94a3b8;
}

/* Processing overlay */
.dataTables_wrapper .dataTables_processing {
  top: 50% !important;
  left: 50% !important;
  width: auto !important;
  margin: 0 !important;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.75rem !important;
  color: #475569 !important;
  font-size: 0.875rem;
  padding: 0.75rem 1.25rem !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  z-index: 20;
}

/* Table */
table.dataTable {
  border-collapse: collapse !important;
  width: 100% !important;
  margin: 0 !important;
}

table.dataTable thead th,
table.dataTable thead td {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85rem 1rem !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-top: 0 !important;
}

table.dataTable tbody td {
  padding: 0.85rem 1rem !important;
  border-top: 0 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle;
  color: #334155;
}

table.dataTable.no-footer,
table.dataTable thead th,
table.dataTable tbody td {
  border-left: 0 !important;
  border-right: 0 !important;
}

table.dataTable.no-footer {
  border-bottom: 0 !important;
}

table.dataTable tbody tr {
  background: #fff !important;
}

table.dataTable tbody tr:hover {
  background: #f8fafc !important;
}

table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
  background: #fff !important;
}

table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover {
  background: #f8fafc !important;
}

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
  background-image: none !important;
  cursor: pointer;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.65rem;
  opacity: 0.45;
  color: #94a3b8;
}

table.dataTable thead .sorting:after {
  content: '↕';
  opacity: 0.3;
}

table.dataTable thead .sorting_asc:after {
  content: '↑';
  opacity: 0.8;
  color: var(--brand-600);
}

table.dataTable thead .sorting_desc:after {
  content: '↓';
  opacity: 0.8;
  color: var(--brand-600);
}

.dataTables_wrapper:after {
  display: none;
}

/* Dark mode */
.dark .dataTables_wrapper .dt-footer {
  border-top-color: #21262d;
  background: rgba(13, 17, 23, 0.4);
}

.dark .dataTables_wrapper .dt-footer .dataTables_info {
  color: #8b949e;
}

.dark .dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button {
  border-color: #30363d !important;
  background: #161b22 !important;
  color: #c9d1d9 !important;
}

.dark .dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
  background: #21262d !important;
  color: var(--brand-500) !important;
  border-color: #484f58 !important;
}

.dark .dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.current,
.dark .dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.current:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #fff !important;
}

.dark .dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.disabled,
.dark .dataTables_wrapper .dt-footer .dataTables_paginate .paginate_button.disabled:hover {
  background: #161b22 !important;
  color: #484f58 !important;
  border-color: #30363d !important;
}

.dark .dataTables_wrapper .dt-footer .dataTables_paginate .ellipsis {
  color: #484f58;
}

.dark .dataTables_wrapper .dataTables_processing {
  background: rgba(22, 27, 34, 0.95) !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.dark table.dataTable thead th,
.dark table.dataTable thead td {
  background: #161b22;
  color: #8b949e;
  border-bottom-color: #30363d !important;
}

.dark table.dataTable tbody td {
  border-bottom-color: #21262d !important;
  color: #c9d1d9;
}

.dark table.dataTable tbody tr {
  background: #0d1117 !important;
}

.dark table.dataTable tbody tr:hover {
  background: #161b22 !important;
}

.dark table.dataTable.stripe tbody tr.odd,
.dark table.dataTable.display tbody tr.odd {
  background: #0d1117 !important;
}

.dark table.dataTable.hover tbody tr:hover,
.dark table.dataTable.display tbody tr:hover {
  background: #161b22 !important;
}

.dark table.dataTable thead .sorting:after,
.dark table.dataTable thead .sorting_asc:after,
.dark table.dataTable thead .sorting_desc:after {
  color: #484f58;
}

.dark table.dataTable thead .sorting_asc:after,
.dark table.dataTable thead .sorting_desc:after {
  color: var(--brand-500);
}

/* ------------------------------------------------------------------
   SweetAlert2 — theme-matched (brand / slate / danger)
------------------------------------------------------------------ */
.swal2-container {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
  z-index: 10000 !important;
}

.app-swal-popup {
  border-radius: 1rem !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12) !important;
  padding: 1.75rem 1.5rem 1.5rem !important;
}

.app-swal-title {
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
}

.app-swal-text {
  font-size: 0.875rem !important;
  color: #64748b !important;
  margin-top: 0.35rem !important;
}

.app-swal-icon {
  margin-top: 0.25rem !important;
  margin-bottom: 0.5rem !important;
}

.app-swal-actions {
  margin-top: 1.25rem !important;
  gap: 0.625rem !important;
}

.app-swal-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  padding: 0.625rem 1.15rem !important;
  margin: 0 !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.app-swal-btn-primary {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #fff !important;
}

.app-swal-btn-primary:hover {
  background: #0369a1 !important;
  border-color: #0369a1 !important;
}

.app-swal-btn-danger {
  background: #e11d48 !important;
  border-color: #e11d48 !important;
  color: #fff !important;
}

.app-swal-btn-danger:hover {
  background: #be123c !important;
  border-color: #be123c !important;
}

.app-swal-btn-muted {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

.app-swal-btn-muted:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

/* Override default SweetAlert button colors if any slip through */
.swal2-styled.swal2-confirm,
.swal2-styled.swal2-cancel,
.swal2-styled.swal2-deny {
  box-shadow: none !important;
}

.app-swal-toast {
  border-radius: 0.875rem !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1) !important;
  font-size: 0.875rem !important;
}

.app-swal-toast-title {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
}

.swal2-timer-progress-bar {
  background: #0284c7 !important;
}

/* Dark mode */
.dark .app-swal-popup {
  background: #161b22 !important;
  border-color: #30363d !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55) !important;
}

.dark .app-swal-title {
  color: #f0f6fc !important;
}

.dark .app-swal-text {
  color: #8b949e !important;
}

.dark .app-swal-btn-muted {
  background: #161b22 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

.dark .app-swal-btn-muted:hover {
  background: #21262d !important;
  border-color: #484f58 !important;
  color: #f0f6fc !important;
}

.dark .app-swal-toast {
  background: #161b22 !important;
  border-color: #30363d !important;
}

.dark .app-swal-toast-title {
  color: #f0f6fc !important;
}
