/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/.pnpm/next@15.5.23_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!../../node_modules/.pnpm/next@15.5.23_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
:root {
  /* Zilomail brand theme — dark, royal blue (primary) + maroon red (secondary) */
  --bg: #0a0d1c;
  --bg-alt: #121631;
  --bg-elevated: #191f47;
  --border: #2b3163;
  --text: #eef0fa;
  --text-muted: #9299c2;

  --primary: #4160e0;
  --primary-hover: #5c79ea;
  --primary-soft: rgba(65, 96, 224, 0.16);

  --secondary: #8c1e3d;
  --secondary-hover: #a8264a;
  --secondary-soft: rgba(140, 30, 61, 0.22);
  --secondary-bright: #ff5c7c;

  --danger: var(--secondary-bright);
  --success: #34c98a;
  --warning: #e0a83a;

  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

a {
  color: var(--primary-hover);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

/* --- Auth pages --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 15%, var(--primary-soft), transparent 45%),
    radial-gradient(circle at 85% 85%, var(--secondary-soft), transparent 45%),
    var(--bg);
}

.auth-card {
  width: 340px;
  padding: 32px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 3px solid var(--primary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.auth-card-admin {
  border-top-color: var(--secondary);
}

.auth-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--primary-hover), var(--secondary-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}

.auth-card h1 {
  font-size: 18px;
  margin: 0 0 8px;
}

.auth-lead {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.auth-switch {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.field {
  margin-bottom: 14px;
}

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

.field input,
.field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover {
  background: var(--primary-hover);
}
.btn.secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover {
  background: var(--border);
}

.hostinger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hostinger-logo {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}
.btn-secondary-brand {
  background: var(--secondary);
}
.btn-secondary-brand:hover {
  background: var(--secondary-hover);
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

/* --- Mail layout --- */
.mail-shell {
  display: grid;
  grid-template-columns: 220px 320px 1fr;
  /* Without an explicit row height, a Grid row sizes to fit its tallest item's
     content instead of the container's 100vh, so a long list would grow the
     whole page instead of scrolling inside .message-list. */
  grid-template-rows: 100vh;
  height: 100vh;
}

.sidebar,
.message-list,
.message-view,
.admin-content {
  /* Grid items default to min-height: auto (their content size), which
     overrides overflow-y: auto and lets content push the row taller than the
     100vh track above — this lets them actually shrink and scroll instead. */
  min-height: 0;
}

.sidebar {
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar .brand {
  padding: 0 16px 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--primary-hover), var(--secondary-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.sidebar .brand .brand-tag {
  background: none;
  -webkit-text-fill-color: var(--text-muted);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}

.sidebar .compose-link {
  margin: 0 16px 16px;
}

.sidebar nav {
  flex: 1 1;
}

.sidebar nav a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  border-left: 3px solid transparent;
}
.sidebar nav a:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--bg-elevated);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar .unseen {
  float: right;
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar .footer {
  padding: 12px 16px 0;
  border-top: 1px solid var(--border);
}

.sidebar .footer .who {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  word-break: break-all;
}

.message-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.message-list .search-box {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.message-list .search-box input {
  width: 100%;
}

.swipe-row {
  position: relative;
  overflow: hidden;
}

.swipe-trash-action {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}
.swipe-trash-btn {
  width: 84px;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.message-list .item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  position: relative;
  background: var(--bg);
  touch-action: pan-y;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.message-list .item:hover {
  background: var(--bg-alt);
  text-decoration: none;
}
.message-list .item.swipe-snap {
  transition: transform 0.18s ease;
}
.message-list .item.selected {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
}
.message-list .item.unseen .subject {
  font-weight: 700;
}

.message-list .from {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
}
.message-list .from:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}
.message-list .subject {
  font-size: 13px;
  margin: 2px 0;
}
.message-list .date {
  font-size: 11px;
  color: var(--text-muted);
}

.trash-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 14px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.message-list .empty,
.message-view .empty {
  padding: 24px;
  color: var(--text-muted);
}

.message-view {
  overflow-y: auto;
  padding: 20px 28px;
}

.message-view .subject-line {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.message-view .meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.message-view .actions {
  margin: 16px 0;
}

.message-view .body-html {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.message-view .body-text {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.attachments {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.attachments .attachment-link {
  display: inline-block;
  margin: 4px 8px 0 0;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
}

.compose-form textarea {
  height: 260px;
  resize: vertical;
}

/* --- Admin --- */
.admin-shell {
  grid-template-columns: 220px 1fr;
}

.mobile-topbar,
.sidebar-backdrop {
  display: none;
}

.admin-content {
  overflow-y: auto;
  padding: 24px 32px;
}

.admin-content h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.admin-content h2 {
  font-size: 15px;
  margin: 28px 0 10px;
}

.admin-content .subtitle {
  color: var(--text-muted);
  margin: 0 0 20px;
}

.stat-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.stat-card {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 140px;
}

.stat-card .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-hover);
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

/* --- Icon buttons (table action columns) --- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--border);
  text-decoration: none;
}
.icon-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.icon-btn.danger {
  color: var(--secondary-bright);
}
.icon-btn.danger:hover {
  background: var(--secondary-soft);
}

.actions-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.mailbox-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mailbox-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-weight: 700;
  font-size: 13px;
}
.mailbox-cell .name {
  font-weight: 600;
}
.mailbox-cell .address {
  font-size: 12px;
  color: var(--text-muted);
}

table.admin-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

table.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.admin-table tr:hover td {
  background: var(--bg-alt);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge.active,
.badge.delivered,
.badge.released {
  background: rgba(52, 201, 138, 0.16);
  color: var(--success);
}
.badge.pending,
.badge.queued,
.badge.deferred {
  background: rgba(224, 168, 58, 0.16);
  color: var(--warning);
}
.badge.verifying,
.badge.delivering {
  background: var(--primary-soft);
  color: var(--primary-hover);
}
.badge.suspended,
.badge.bounced,
.badge.failed,
.badge.disabled,
.badge.deleted {
  background: var(--secondary-soft);
  color: var(--secondary-bright);
}

.inline-form {
  display: inline;
}

.value-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  max-width: 420px;
}

.admin-form {
  max-width: 420px;
  margin-bottom: 20px;
}

.admin-form .field {
  margin-bottom: 12px;
}

.card {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.action-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

/* --- Modal (Hostinger auto-configure progress) --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-card h2 {
  font-size: 16px;
  margin: 0 0 16px;
}

.modal-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.modal-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-icon.updated {
  background: rgba(65, 96, 224, 0.22);
  color: var(--primary-hover);
}
.step-icon.unchanged {
  background: rgba(52, 201, 138, 0.16);
  color: var(--success);
}

.step-host {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  flex: 1 1;
  word-break: break-all;
}

.step-action {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Buttons: loading spinner + danger variant --- */
.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
.btn.secondary .btn-spinner {
  border-color: var(--border);
  border-top-color: var(--text);
}
button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--secondary);
}
.btn-danger:hover:not(:disabled) {
  background: var(--secondary-hover);
}
.btn-danger:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.modal-warning {
  font-size: 13px;
  color: var(--secondary-bright);
  background: var(--secondary-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0 0 16px;
}

.danger-zone {
  border-color: var(--secondary);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-back {
  display: none;
}

/* --- Mobile responsive layout --- */
@media (max-width: 860px) {
  .mail-shell,
  .admin-shell {
    display: flex;
    flex-direction: column;
    /* Bounded (not auto) height keeps .mobile-topbar a non-scrolling flex item —
       only the panes below it (.message-list/.message-view/.admin-content, each
       already overflow-y:auto) scroll, so the header never moves with them. */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  /* mail 3-pane: only one pane visible at a time, toggled by MailShell (see MailShell.tsx) */
  .mail-shell:not(.detail-open) .message-view {
    display: none;
  }
  .mail-shell.detail-open .message-list {
    display: none;
  }
  .message-list {
    border-right: none;
    max-height: none;
    flex: 1 1;
  }
  .message-view {
    flex: 1 1;
    padding: 16px;
  }

  .mobile-back {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 13px;
  }

  /* 16px prevents iOS Safari from auto-zooming the page on input focus */
  .field input,
  .field textarea {
    font-size: 16px;
  }

  .admin-content {
    padding: 16px;
  }

  /* sidebar: off-canvas drawer toggled by the burger button (see MobileTopbar.tsx,
     AdminShell.tsx, MailShell.tsx) */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }
  .mobile-topbar-brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, var(--primary-hover), var(--secondary-bright));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .mobile-topbar-brand .brand-tag {
    background: none;
    -webkit-text-fill-color: var(--text-muted);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
  }
  .mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .topbar-compose {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: var(--radius);
    color: #fff;
  }
  .topbar-compose:hover {
    background: var(--primary-hover);
    text-decoration: none;
  }
  .topbar-compose svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }

  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
  }
  .burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
  }

  .admin-shell .sidebar,
  .mail-shell .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 80vw;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    padding: 16px 0;
    border-bottom: none;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 50;
    overflow-y: auto;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.35);
  }
  .admin-shell .sidebar .brand,
  .mail-shell .sidebar .brand {
    padding: 0 16px 16px;
  }
  .admin-shell .sidebar .compose-link,
  .mail-shell .sidebar .compose-link {
    margin: 0 16px 16px;
  }
  .admin-shell .sidebar nav,
  .mail-shell .sidebar nav {
    flex: 1 1 auto;
    display: block;
    overflow-x: visible;
  }
  .admin-shell .sidebar nav a,
  .mail-shell .sidebar nav a {
    white-space: normal;
    padding: 8px 16px;
    border-radius: 0;
    border-left: 3px solid transparent;
  }
  .admin-shell .sidebar nav a.active,
  .mail-shell .sidebar nav a.active {
    border-left-color: var(--primary);
    background: var(--primary-soft);
  }
  .admin-shell .sidebar .footer,
  .mail-shell .sidebar .footer {
    border-top: 1px solid var(--border);
    padding: 12px 16px 0;
    margin: 12px 0 0;
    display: block;
  }
  .admin-shell .sidebar .footer .who,
  .mail-shell .sidebar .footer .who {
    display: block;
  }
  .admin-shell.sidebar-open .sidebar,
  .mail-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
  }

  .stat-cards {
    flex-wrap: wrap;
  }
  .stat-card {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: calc(50% - 8px);
    min-width: 0;
  }

  table.admin-table {
    font-size: 12px;
  }
  table.admin-table th,
  table.admin-table td {
    padding: 8px 6px;
  }

  .value-cell {
    max-width: 220px;
  }

  /* Card-per-row table, for tables opted in via .responsive-cards (e.g. mailboxes) —
     a wide table stops making sense at phone width even with horizontal scroll. */
  table.responsive-cards,
  table.responsive-cards thead,
  table.responsive-cards tbody,
  table.responsive-cards tr,
  table.responsive-cards td {
    display: block;
    width: 100%;
  }
  table.responsive-cards thead {
    display: none;
  }
  table.responsive-cards tr {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 12px;
  }
  table.responsive-cards td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }
  table.responsive-cards td:last-child {
    border-bottom: none;
  }
  table.responsive-cards td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
  }
  table.responsive-cards td[data-label=""]::before,
  table.responsive-cards td:not([data-label])::before {
    content: none;
  }
  table.responsive-cards .mailbox-cell {
    flex: 1 1;
    min-width: 0;
  }
  table.responsive-cards .mailbox-cell .address {
    word-break: break-all;
  }

  .auth-card {
    width: 100%;
  }

  .modal-card {
    width: 100%;
  }

  .action-row {
    flex-wrap: wrap;
  }
}

