:root {
  --brand-blue: #075dbb;
  --brand-blue-2: #004da4;
  --soft-blue: rgba(255,255,255,.12);
  --panel-blue: #1e6dbf;
  --text: #172033;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue-2) 100%);
}

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.hero-wrap {
  background: linear-gradient(180deg, #075dbb 0%, #0557ad 100%);
  padding-bottom: 112px;
}
.brand-link { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .75rem; }
.brand-link:hover { color: #fff; }
.brand-icon { font-size: 3.5rem; line-height: 1; display: inline-flex; }
.brand-text { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.04em; font-family: Georgia, 'Times New Roman', serif; }
.lang-select { width: 76px; border-radius: 10px; border: 0; box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.main-panel { padding-top: 30px; }
.mail-control { max-width: 1024px; }
.current-email-wrap { position: relative; }
.current-email-select,
.custom-input,
.domain-box {
  min-height: 56px;
  border: 0;
  border-radius: 7px;
  background: rgba(255,255,255,.13);
  color: #fff;
  box-shadow: none !important;
  font-weight: 600;
}
.current-email-select option { color: #172033; }
.current-email-select:focus,
.custom-input:focus { background: rgba(255,255,255,.18); color: #fff; border: 0; }
.custom-input::placeholder { color: rgba(255,255,255,.92); }
.domain-box { display: flex; align-items: center; padding: 0 18px; font-size: 1.05rem; }
#durationSelect option { color: #172033; }
.action-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.action-btn {
  background: rgba(255,255,255,.11);
  color: #fff;
  min-height: 64px;
  border: 1px solid rgba(255,255,255,.02);
  font-size: 1rem;
  font-weight: 650;
}
.action-btn:hover, .action-btn:focus { background: rgba(255,255,255,.19); color: #fff; }
.new-email-box { padding: 0; }
.status-pill {
  width: fit-content;
  max-width: 100%;
  background: rgba(0,0,0,.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .9rem;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.dot-sep { color: rgba(255,255,255,.45); }

.inbox-section { margin-top: -64px; flex: 1; }
.inbox-card {
  min-height: 440px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
}
.inbox-table thead th {
  background: #e6eef8;
  padding: 20px 28px;
  font-weight: 650;
  color: #172033;
  border-bottom: 0;
}
.inbox-table tbody td { padding: 18px 28px; border-color: #edf1f6; }
.inbox-row { cursor: pointer; }
.inbox-row:hover { background: #f8fbff; }
.inbox-row.unread td { font-weight: 700; }
.sender-name { display: block; }
.sender-email { font-size: .86rem; color: #5d6675; }
.empty-cell { height: 330px; text-align: center; color: #6b7280 !important; font-size: 1.1rem; }
.message-toolbar { background: #6d9ed4; padding: 18px 28px; }
.message-meta { padding: 18px 28px; border-bottom: 1px solid #edf1f6; }
.email-frame { width: 100%; height: 520px; border: 0; background: #fff; display: block; }
.attachment-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; background: #f3f6fb; color: #172033; border-radius: 999px; text-decoration: none; margin: 0 .5rem .5rem 0; }
.attachment-chip:hover { background: #e9eef7; color: #172033; }
.footer { margin-top: auto; font-weight: 650; }
.toast { border-radius: 14px; }
.modal-content { overflow: hidden; }
.auth-page { background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue-2) 100%); }
.auth-card { max-width: 480px; background: #fff; border-radius: 24px; padding: 36px; box-shadow: 0 22px 60px rgba(0,0,0,.22); }

@media (max-width: 991.98px) {
  .hero-wrap { padding-bottom: 84px; }
  .main-panel { padding-top: 16px; }
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-btn { min-height: 58px; }
  .brand-icon { font-size: 2.6rem; }
  .brand-text { font-size: 2.3rem; }
  .status-pill { border-radius: 16px; }
  .inbox-section { margin-top: -48px; }
}

@media (max-width: 575.98px) {
  .hero-wrap { padding-bottom: 64px; }
  .action-grid { grid-template-columns: 1fr; }
  .inbox-section { padding-left: 10px !important; padding-right: 10px !important; }
  .inbox-table thead { display: none; }
  .inbox-table tbody td { display: block; padding: 8px 16px; border: 0; }
  .inbox-table tbody tr { display: block; padding: 12px 0; border-bottom: 1px solid #edf1f6; }
  .inbox-table tbody td.text-end { text-align: left !important; color: #6b7280; font-size: .9rem; }
  .empty-cell { display: table-cell !important; height: 260px; }
  .message-toolbar, .message-meta { padding: 14px 16px; }
  .email-frame { height: 460px; }
}

/* MOBILE_NAV_FIX_20260515: mobile navigation and horizontal overflow fix */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.page-shell,
.hero-wrap,
.inbox-section,
.inbox-card {
  max-width: 100%;
  overflow-x: hidden;
}
#langSelect,
.lang-select {
  display: none !important;
}
.mobile-top-menu {
  display: none !important;
}

@media (max-width: 575.98px) {
  .hero-wrap > nav {
    width: 100%;
    max-width: 100%;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: visible;
  }
  .hero-wrap > nav > .d-flex {
    flex: 0 0 auto;
    gap: 0 !important;
  }
  .brand-link {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100vw - 118px);
    gap: 8px;
    overflow: hidden;
  }
  .brand-icon {
    font-size: 2.15rem !important;
    flex: 0 0 auto;
  }
  .brand-text {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    font-size: clamp(1.75rem, 9.5vw, 2.55rem) !important;
    letter-spacing: -0.05em;
  }
  #btnAdmin,
  #btnInfoOpen,
  #btnLoginOpen,
  #btnProfile,
  #btnLogout,
  #langSelect,
  .lang-select {
    display: none !important;
  }
  .mobile-top-menu {
    display: block !important;
    flex: 0 0 auto;
    position: relative;
    z-index: 1050;
  }
  .mobile-menu-btn {
    min-height: 42px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
  }
  .mobile-menu-dropdown {
    min-width: 170px;
    border: 0;
    border-radius: 14px;
    padding: 8px;
  }
  .mobile-menu-dropdown .dropdown-item {
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 650;
  }
  .container.main-panel,
  .mail-control,
  .current-email-wrap,
  .new-email-box,
  .status-pill,
  .inbox-section,
  .inbox-card {
    width: 100%;
    max-width: 100%;
  }
  .container.main-panel {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .current-email-select,
  .custom-input,
  .domain-box,
  .action-btn {
    width: 100%;
    max-width: 100%;
  }
  .action-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .status-pill {
    border-radius: 18px;
    padding: 12px 14px;
    text-align: center;
  }
  .inbox-section {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .inbox-card {
    border-radius: 8px;
  }
  .message-view,
  .inbox-table-wrap,
  .table-responsive {
    max-width: 100%;
    overflow-x: hidden;
  }
  .toast-container {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
  }
}


/* INFO_MODAL_20260515 */
.info-modal-content {
  overflow: hidden;
}
.info-box {
  background: #f7faff;
  border: 1px solid #e6eef8;
  border-radius: 18px;
  padding: 16px 18px;
}
.info-steps li {
  margin-bottom: 8px;
}
.info-steps li:last-child {
  margin-bottom: 0;
}

/* FIX_EMPTY_INBOX_CENTER_MOBILE */
@media (max-width: 575.98px) {
  .inbox-table tbody td.empty-cell {
    display: flex !important;
    width: 100% !important;
    min-height: 260px;
    height: 260px;
    padding: 0 16px !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    border: 0 !important;
  }

  .inbox-table tbody tr:has(td.empty-cell) {
    padding: 0 !important;
    border-bottom: 0 !important;
  }
}

/* INFO_MODAL_CONTENT_CARDS_20260515 */
.info-mini-card {
  background: #ffffff;
  border: 1px solid #e6eef8;
  border-radius: 14px;
  padding: 14px 16px;
}

@media (max-width: 575.98px) {
  .info-modal-content .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .info-mini-card {
    padding: 12px 14px;
  }
}


/* OUTBOUND_EMAIL_FEATURE_20260515 */
.compose-modal-content {
  overflow: hidden;
}
.compose-editor {
  min-height: 220px;
  background: #fff;
}
.compose-modal-content .ql-toolbar {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.compose-modal-content .ql-container {
  min-height: 220px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  font-size: 15px;
}
.compose-modal-content .ql-editor {
  min-height: 220px;
}
#sendLimitText {
  border: 0;
}
@media (max-width: 575.98px) {
  .message-toolbar {
    align-items: flex-start !important;
    gap: 10px;
  }
  .message-toolbar > .d-flex {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px !important;
  }
  .compose-modal-content .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .compose-editor,
  .compose-modal-content .ql-container,
  .compose-modal-content .ql-editor {
    min-height: 190px;
  }
}


/* FIX_COMPOSE_SEND_BUTTON_VISIBLE */
#composeModal .modal-dialog {
  max-height: calc(100vh - 24px);
}

#composeModal .modal-content {
  max-height: calc(100vh - 24px);
}

#composeModal .modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 230px);
}

#composeModal .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: #fff;
  border-top: 1px solid #edf1f6 !important;
  padding-top: 12px !important;
  padding-bottom: 16px !important;
}

/* SENT_HISTORY_LIST_20260515 */
.inbox-row.sent td {
  background: #fbfdff;
}
.inbox-row.sent:hover td {
  background: #f3f8ff;
}
.outbound-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #075dbb;
  font-size: .78rem;
  font-weight: 700;
  vertical-align: middle;
}
.inbox-row.sent .sender-name {
  color: #075dbb;
  font-weight: 700;
}
.inbox-row.sent .sender-email {
  color: #6b7280;
}

@media (max-width: 575.98px) {
  .outbound-badge {
    margin-bottom: 6px;
  }
}
