@font-face {
  font-family: "Gill Sans MT Std";
  src: url("/assets/gill-sans-mt-std-light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gill Sans MT Std";
  src: url("/assets/gill-sans-mt-std-medium.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #282c46;
  --ink: #222638;
  --gold: #e0ad22;
  --mist: #f4f7f8;
  --line: #dce3e7;
  --blue-soft: #c9e2f3;
  --blue-line: #edf7fc;
  --danger: #b3283d;
  --success: #226b51;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(26, 31, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f8faf9;
  font-family: "Gill Sans MT Std", "Gill Sans", Calibri, Arial, sans-serif;
  font-weight: 300;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.shell {
  min-height: 100vh;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.login-brand,
.topbar,
.workspace,
.status-banner,
.tool-intro {
  width: min(1380px, calc(100vw - 48px));
  margin-inline: auto;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 22px;
  text-align: center;
}

.login-brand img {
  width: min(260px, 55vw);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--navy);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: 0;
}

.login-brand p,
.brand-block p {
  color: var(--gold);
  font-size: clamp(19px, 2vw, 28px);
  font-weight: 600;
  text-transform: uppercase;
}

.login-panel {
  width: min(520px, calc(100vw - 48px));
  margin-top: 34px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-weight: 600;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd6dc;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(224, 173, 34, 0.26);
  outline-offset: 2px;
}

.primary-button,
.ghost-button,
.login-panel button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 600;
}

.primary-button,
.login-panel button {
  color: var(--white);
  background: var(--navy);
}

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

.ghost-button {
  color: var(--navy);
  background: var(--white);
  border-color: var(--line);
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--danger);
  font-weight: 600;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-block img {
  width: 92px;
  height: auto;
}

.brand-block h1 {
  font-size: clamp(23px, 2.6vw, 36px);
}

.status-banner {
  white-space: pre-line;
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  background: #fff8e2;
  border-radius: 6px;
  font-weight: 600;
}

.status-banner.success {
  color: var(--success);
  border-left-color: var(--success);
  background: #eef8f3;
}

.status-banner.error {
  color: var(--danger);
  border-left-color: var(--danger);
  background: #fff0f1;
}

.tool-intro {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #eadfbd;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fffaf0;
  color: #3c4358;
  line-height: 1.35;
}

.tool-intro strong {
  flex: 0 0 auto;
  color: var(--navy);
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 14px 0 42px;
}

.work-area,
.preview-panel,
.mode-panel,
.notes-panel {
  min-width: 0;
}

.mode-panel,
.notes-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(26, 31, 51, 0.06);
}

.mode-panel,
.notes-panel {
  padding: 20px;
}

.mode-control {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(26, 31, 51, 0.04);
}

.mode-control label {
  margin: 0;
}

.mode-control select {
  min-height: 40px;
  border: 1px solid #cbd6dc;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--white);
  font-weight: 600;
}

.notes-panel {
  margin-top: 16px;
}

.panel-heading,
.preview-header,
.dialog-actions,
.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2,
.confirm-dialog h2 {
  color: var(--navy);
  font-size: 24px;
  font-weight: 600;
}

.entry-grid {
  display: grid;
  gap: 14px;
}

.entry-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid #e4ebef;
  border-radius: 8px;
  background: var(--mist);
}

.entry-block.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.entry-title {
  grid-column: 1 / -1;
  color: var(--navy);
  font-weight: 600;
}

.field-error {
  border-color: var(--danger);
}

.cc-quick {
  display: grid;
  gap: 8px;
  align-content: start;
}

.cc-quick span {
  color: var(--navy);
  font-weight: 600;
}

.cc-quick label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  border: 1px solid #cbd6dc;
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--white);
  color: var(--ink);
  font-weight: 300;
}

.cc-quick input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--navy);
}

.password-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.password-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: var(--navy);
  font-weight: 600;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  border: 1px solid #cbd6dc;
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--white);
  color: var(--ink);
}

.radio-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--navy);
}

.password-value {
  grid-column: 1 / -1;
  min-height: 34px;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--navy);
  background: #fff8e2;
  font-weight: 600;
}

.upload-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.upload-row input {
  max-width: 560px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

#bulkTable {
  min-width: 1330px;
  table-layout: fixed;
}

#bulkTable th:nth-child(1),
#bulkTable td:nth-child(1) {
  width: 190px;
}

#bulkTable th:nth-child(2),
#bulkTable td:nth-child(2) {
  width: 120px;
}

#bulkTable th:nth-child(3),
#bulkTable td:nth-child(3) {
  width: 260px;
}

#bulkTable th:nth-child(4),
#bulkTable td:nth-child(4),
#bulkTable th:nth-child(5),
#bulkTable td:nth-child(5) {
  width: 210px;
}

#bulkTable th:nth-child(6),
#bulkTable td:nth-child(6) {
  width: 130px;
}

#bulkTable th:nth-child(7),
#bulkTable td:nth-child(7) {
  width: 150px;
}

#bulkTable th:nth-child(8),
#bulkTable td:nth-child(8) {
  width: 150px;
}

#bulkTable th:nth-child(9),
#bulkTable td:nth-child(9) {
  width: 140px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--navy);
  font-weight: 600;
  background: #f3f6f7;
}

td.invalid {
  color: var(--danger);
  font-weight: 600;
}

.preview-panel {
  position: sticky;
  top: 16px;
  align-self: start;
  overflow: hidden;
}

.preview-header {
  padding: 14px 16px;
  color: var(--white);
  background: var(--navy);
  font-weight: 600;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-controls button {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.preview-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.email-preview {
  padding: 22px;
  background: var(--white);
  font-family: "Gill Sans MT Std", "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif;
}

.email-subject {
  margin-bottom: 18px;
  color: var(--navy);
  font-size: 18px;
  font-weight: 600;
}

.recipient-summary {
  display: grid;
  gap: 4px;
  color: #354054;
  font-size: 13px;
  line-height: 1.35;
}

.recipient-summary span {
  display: inline-block;
  width: 36px;
  color: var(--navy);
  font-weight: 700;
}

.preview-recipient-summary {
  margin: -8px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.email-body {
  color: #111827;
  font-family: "Gill Sans MT Std", "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.48;
}

.email-body,
.email-body *,
.account-table,
.account-table * {
  font-family: "Gill Sans MT Std", "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif !important;
}

.welcome-hero {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 0 20px;
}

.email-body h3 {
  margin: 0 0 18px;
  font-size: 18px;
}

.email-body p {
  margin: 0 0 16px;
}

.email-body .account-table + p {
  margin-top: 4px;
}

.email-body .outlook-button-row {
  margin: 24px 0 22px;
}

.highlight {
  display: inline;
  color: #2157ca;
  background: #fff76a;
  font-weight: 700;
}

.account-table {
  width: 100%;
  min-width: 0;
  margin: 18px 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.account-detail-col {
  width: 34%;
}

.account-info-col {
  width: 66%;
}

.account-table th,
.account-table td {
  border: 2px solid var(--blue-line);
  background: var(--blue-soft);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.account-table th {
  color: #0f172a;
  font-weight: 700;
}

.account-table tr:first-child th {
  text-decoration: underline;
}

.outlook-button-row {
  margin: 24px 0 22px;
}

.outlook-button {
  display: inline-block;
  min-width: 148px;
  border-radius: 6px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--navy);
  font-family: "Gill Sans MT Std", "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  text-decoration: none;
}

.signature-guidance {
  margin: 22px 0 20px;
  padding: 14px 16px;
  border: 1px solid #eadfbd;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: #fffaf0;
}

.signature-guidance h4 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 16px;
}

.email-body .signature-guidance p {
  margin-bottom: 10px;
}

.email-body .signature-guidance p:last-child {
  margin-bottom: 0;
}

.email-signature-image {
  display: block;
  width: min(100%, 510px);
  height: auto;
  margin-top: 28px;
}

.email-signature-block {
  display: grid;
  grid-template-columns: 160px 1px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  max-width: 620px;
  margin-top: 28px;
}

.email-signature-block img {
  width: 160px;
  max-width: 100%;
  height: auto;
}

.signature-divider {
  width: 1px;
  min-height: 118px;
  background: var(--gold);
}

.signature-contact {
  display: grid;
  gap: 8px;
  color: var(--navy);
}

.signature-contact strong {
  font-size: 34px;
  line-height: 1;
}

.signature-contact a,
.signature-contact span {
  color: var(--navy);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.muted-preview {
  color: #687382;
}

.confirm-dialog {
  width: min(640px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(24, 29, 48, 0.42);
}

.confirm-list {
  max-height: 280px;
  overflow: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.confirm-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.confirm-recipient-summary {
  margin-top: 6px;
}

.confirm-item:last-child {
  border-bottom: 0;
}

.log-recipient {
  min-width: 260px;
  padding: 6px 0;
}

.log-recipient + .log-recipient {
  border-top: 1px solid var(--line);
}

.log-recipient-summary {
  margin-top: 4px;
}

.log-status,
.log-error {
  margin-top: 4px;
  font-size: 13px;
}

.log-status {
  color: #354054;
}

.log-error {
  color: var(--danger);
}

.dialog-actions {
  justify-content: flex-end;
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .login-brand,
  .topbar,
  .workspace,
  .status-banner,
  .tool-intro {
    width: min(100% - 24px, 1380px);
  }

  .tool-intro {
    display: grid;
    gap: 4px;
  }

  .topbar,
  .brand-block,
  .panel-heading,
  .password-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  .brand-block {
    text-align: center;
  }

  .brand-block {
    display: grid;
    justify-items: center;
  }

	  .mode-control {
	    grid-template-columns: 1fr;
	  }

	  .entry-block,
  .entry-block.compact,
  .password-choice {
    grid-template-columns: 1fr;
  }

  .email-signature-image {
    width: 100%;
  }

  .email-signature-block {
    grid-template-columns: 120px 1px minmax(0, 1fr);
    gap: 16px;
  }

  .email-signature-block img {
    width: 120px;
  }

  .signature-divider {
    min-height: 96px;
  }

  .signature-contact strong {
    font-size: 26px;
  }

  .signature-contact a,
  .signature-contact span {
    font-size: 15px;
  }
}
