/* ALL RIGHTS RESERVED. COPYRIGHT 2026 OCTAGONAX.COM */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, sans-serif;
  background: #ffffff;
  color: #333333;
  font-size: 16px;
}

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

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.topbar {
  height: 60px;
  background: #1e3a8a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.topbar-title {
  margin: 0;
  font-size: 22px;
  font-weight: bold;
}

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

#user-label {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.auth-button {
  border: none;
  border-radius: 7px;
  padding: 8px 14px;
  background: #000000;
  color: #ffffff;
  font-size: 15px;
  transition: background 0.2s ease;
}

.auth-button:hover {
  background: #333333;
}

.container {
  display: flex;
  min-height: 100vh;
  padding-top: 60px;
}

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: #ffffff;
  border-right: 1px solid #dddddd;
  display: flex;
  flex-direction: column;
  padding: 8px 0 20px;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 15px 20px;
  cursor: pointer;
  text-align: left;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  font-size: 16px;
  line-height: 1.25;
  color: #333333;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.menu-item:hover {
  background: #e8f0fe;
  color: #007bff;
}

.menu-item.active {
  font-weight: bold;
  border-left-color: #007bff;
  background: #e8f0fe;
  color: #007bff;
}

.menu-divider {
  border-top: 1px solid #dddddd;
  margin: 10px 12px;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 24px;
  overflow-y: auto;
  background: #ffffff;
}

.page-title {
  font-size: 25px;
  margin: 0 0 20px;
  color: #1e3a8a;
}

.loading,
.empty-state {
  padding: 35px 15px;
  color: #777777;
  text-align: center;
}

.notice {
  padding: 12px 15px;
  border: 1px solid #dddddd;
  border-radius: 7px;
  margin-bottom: 15px;
  line-height: 1.5;
}

.notice.error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.malformed-warning {
  color: #b91c1c;
  font-weight: bold;
  margin: 8px 0;
}

.malformed-warning .triangle {
  color: #d4a000;
  font-size: 20px;
  margin-right: 6px;
}

.email-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.email-card:hover {
  transform: translateY(-2px);
  border-color: #c9d8f7;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.email-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 5px;
}

.email-star {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  color: #b8b8b8;
}

.email-subject {
  font-weight: bold;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.subject-blue {
  color: #2563eb;
}

.subject-green {
  color: #16a34a;
}

.subject-red {
  color: #dc2626;
}

.subject-purple {
  color: #7c3aed;
}

.subject-orange {
  color: #ea580c;
}

.email-meta {
  font-size: 14px;
  color: #777777;
  margin: 7px 0 10px;
  overflow-wrap: anywhere;
}

.email-snippet {
  font-size: 15px;
  color: #444444;
  line-height: 1.45;
  max-height: 4.35em;
  overflow: hidden;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.email-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.email-label {
  border-radius: 4px;
  display: inline-block;
  padding: 4px 8px;
  background: #eeeeee;
  color: #444444;
  font-size: 12px;
}

.email-label.yellow {
  background: #fff3b0;
  color: #765800;
}

.email-label.red {
  background: #fee2e2;
  color: #991b1b;
}

.back-btn {
  display: inline-block;
  margin-bottom: 15px;
  cursor: pointer;
  color: #007bff;
  font-size: 16px;
  font-weight: bold;
  border: 0;
  background: transparent;
  padding: 0;
}

.back-btn:hover {
  text-decoration: underline;
}

.full-email {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  padding: 22px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.10);
  min-width: 0;
}

.full-email h2 {
  margin: 0 0 14px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.email-detail {
  font-size: 14px;
  line-height: 1.7;
  color: #444444;
  overflow-wrap: anywhere;
}

.email-body {
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.6;
  color: #333333;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.email-html-frame {
  display: block;
  width: 100%;
  min-height: 250px;
  height: 450px;
  border: 1px solid #dddddd;
  border-radius: 5px;
  margin-top: 18px;
  background: #ffffff;
}

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

.action-button {
  padding: 9px 13px;
  border: 1px solid #cccccc;
  border-radius: 6px;
  background: #ffffff;
  color: #333333;
}

.action-button:hover {
  background: #f0f4fa;
}

.action-button.primary {
  border-color: #007bff;
  background: #007bff;
  color: #ffffff;
}

.action-button.primary:hover {
  background: #0056b3;
}

.action-button.danger {
  border-color: #dc2626;
  color: #b91c1c;
}

.reply-box,
.form-container,
.panel {
  margin-top: 20px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  padding: 22px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  min-width: 0;
}

.form-container {
  max-width: 500px;
  margin: 38px auto;
  padding: 30px;
  border-radius: 10px;
}

.form-container h2 {
  margin: 0 0 22px;
  text-align: center;
  color: #1e3a8a;
  font-size: 24px;
}

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 7px;
  border: 1px solid #cccccc;
  background: #ffffff;
  color: #222222;
  outline: none;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.10);
}

.green-btn {
  margin-top: 12px;
  padding: 12px 18px;
  border: none;
  border-radius: 7px;
  background: linear-gradient(to bottom, #4caf50, #2e7d32);
  color: #ffffff;
  font-size: 16px;
}

.green-btn:hover {
  background: linear-gradient(to bottom, #66bb6a, #388e3c);
}

.attachment-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

.attachment-list li {
  border-bottom: 1px solid #eeeeee;
  padding: 12px 0;
  overflow-wrap: anywhere;
}

.attachment-size {
  color: #777777;
  font-size: 13px;
  margin-left: 5px;
}

.raw-view {
  display: block;
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f5f5f5;
  border: 1px solid #dddddd;
  padding: 15px;
  margin-top: 15px;
  font-family: monospace;
  font-size: 13px;
}

.thread-message {
  border-top: 1px solid #dddddd;
  margin-top: 20px;
  padding-top: 18px;
}

.thread-message:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.thread-heading {
  font-size: 13px;
  color: #777777;
  margin-bottom: 12px;
}

.editor-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: 13px;
  background: #f6f6f6;
  padding: 12px;
  border-radius: 5px;
}

.template-row,
.blacklist-row {
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  padding: 14px;
  margin-bottom: 10px;
}

.template-row h3,
.blacklist-row h3 {
  font-size: 16px;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 2000;
  max-width: calc(100vw - 36px);
  padding: 12px 16px;
  border-radius: 7px;
  color: #ffffff;
  background: #222222;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  overflow-wrap: anywhere;
}

.toast.error {
  background: #b91c1c;
}

.muted {
  color: #777777;
}

@media (max-width: 700px) {
  .sidebar {
    width: 180px;
    flex-basis: 180px;
  }

  .menu-item {
    padding: 14px 16px;
  }

  .content {
    padding: 18px;
  }

  .topbar-title {
    font-size: 19px;
  }

  .auth-button {
    padding: 7px 10px;
    font-size: 14px;
  }

  .email-subject {
    font-size: 17px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 0 12px;
  }

  .topbar-title {
    font-size: 17px;
  }

  .auth-buttons {
    gap: 5px;
  }

  #user-label {
    display: none;
  }

  .auth-button {
    padding: 6px 8px;
    font-size: 13px;
  }

  .sidebar {
    width: 125px;
    flex-basis: 125px;
  }

  .menu-item {
    padding: 13px 10px;
    font-size: 14px;
  }

  .content {
    padding: 12px;
  }

  .email-card {
    padding: 14px;
  }

  .full-email,
  .reply-box,
  .panel {
    padding: 14px;
  }

  .form-container {
    padding: 20px;
  }

  .email-html-frame {
    height: 350px;
  }
}

/* ALL RIGHTS RESERVED. COPYRIGHT 2026 OCTAGONAX.COM */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.confirm-dialog {
  width: 100%;
  max-width: 420px;
  padding: 26px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  animation: dialog-appear 0.16s ease-out;
}

.confirm-dialog h2 {
  margin: 0 0 12px;
  color: #1e3a8a;
  font-size: 22px;
}

.confirm-dialog p {
  margin: 0;
  color: #555555;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.dialog-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 24px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.dialog-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #ffffff;
  color: #333333;
}

.dialog-button:hover {
  background: #f3f4f6;
}

.dialog-button.danger {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #ffffff;
}

.dialog-button.danger:hover {
  background: #991b1b;
}

.dialog-button.primary {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #ffffff;
}

@keyframes dialog-appear {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 520px) {
  .confirm-dialog {
    padding: 22px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-button {
    width: 100%;
  }
}

/* ALL RIGHTS RESERVED. COPYRIGHT 2026 OCTAGONAX.COM */

.content {
  padding-bottom: 100px;
}

.load-status {
  display: none;
  position: fixed;
  z-index: 1500;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 16px 12px;
  background: #ffffff;
  border-top: 1px solid #d7dce3;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.load-status.visible {
  display: block;
}

.load-status-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  color: #333333;
  font-size: 13px;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  background: #111111;
  border: 1px solid #000000;
  border-radius: 2px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: #7dd3fc;
  transition: width 0.15s linear;
}

.load-status-count {
  margin-top: 5px;
  color: #666666;
  font-size: 12px;
  text-align: right;
}

@media (max-width: 520px) {
  .load-status {
    padding: 9px 12px 10px;
  }

  .load-status-top {
    font-size: 12px;
  }
}

/* ALL RIGHTS RESERVED. COPYRIGHT 2026 OCTAGONAX.COM */

/* Read messages have a normal white background and regular-weight title. */
.email-card .email-subject {
  font-weight: 400;
}

/* Unread messages stand out with a light blue background. */
.email-card.unread {
  background: #e8f0fe;
  border-color: #c9d8f7;
}

/* Unread message titles are bold. */
.email-card.unread .email-subject {
  font-weight: 700;
}

/* Retain a subtle blue highlight when hovering over unread messages. */
.email-card.unread:hover {
  background: #dbeafe;
}

/* ALL RIGHTS RESERVED. COPYRIGHT 2026 OCTAGONAX.COM */

.email-header {
  width: 100%;
}

.email-header .thread-count {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

