:root {
  --ink: #17252a;
  --muted: #46707f;
  --paper: #f3f7f9;
  --card: #fff;
  --brand: #0056a7;
  --gold: #ff6400;
  --line: #d7e2e7;
}

body {
  background: linear-gradient(180deg, #fff 0, #f3f7f9 330px);
  font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
}

.topbar {
  height: 82px;
  background: #fff;
  border-bottom: 0;
  box-shadow: 0 4px 18px rgba(23, 37, 42, .08);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand) 0 72%, var(--gold) 72%);
}

.brand { gap: 14px; }
.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
}
.brand span {
  width: 58px;
  height: 42px;
  border-radius: 5px;
  background: var(--brand);
  font-family: "Open Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: .06em;
  position: relative;
  overflow: hidden;
}
.brand span::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  border-style: solid;
  border-width: 0 0 15px 15px;
  border-color: transparent transparent var(--gold) transparent;
}
.brand b { font: 700 18px "Open Sans", "Segoe UI", sans-serif; color: #333; }
.topbar nav a, .link-button { font-weight: 600; color: #333; }
.topbar nav a:hover, .link-button:hover { color: var(--gold); }

.eyebrow { color: var(--brand); font-size: 12px; letter-spacing: .12em; }
.hero h1, .login-copy h1, .secret-panel h1, .admin-heading h1 {
  font-family: "Open Sans", "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: -.035em;
  color: #333;
}
.hero h1 em, .login-copy h1 em { font-style: normal; font-weight: 700; color: var(--brand); }
.hero::after { content: ""; display: block; width: 64px; height: 5px; background: var(--gold); border-radius: 5px; margin: 28px auto 0; }

.panel { border: 0; border-radius: 12px; box-shadow: 0 12px 38px rgba(0, 86, 167, .09); }
.compose-panel { border-top: 5px solid var(--brand); }
.step-title > span { background: var(--brand); box-shadow: 0 4px 10px rgba(0, 86, 167, .18); }
.form-control { border-color: #ccdbe2; background: #fff; border-radius: 8px; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(0, 86, 167, .12); }
.dropzone { background: #f4f9fc; border: 2px dashed #93b9d3; border-radius: 10px; }
.dropzone:hover { border-color: var(--brand); background: #eef7fc; }
.upload-symbol { color: var(--gold); }
.duration-grid label > span { border-radius: 8px; }
.duration-grid input:checked + span { border-color: var(--brand); background: #eff7fd; box-shadow: inset 0 0 0 1px var(--brand); }

.btn-brand { background: var(--gold); border-color: var(--gold); border-radius: 10px; font-weight: 600; }
.btn-brand:hover, .btn-brand:focus { background: #e85900; border-color: #e85900; box-shadow: 0 8px 18px rgba(255, 100, 0, .2); }
.success-icon, .lock-icon { background: #edf6fc; color: var(--brand); }
.soft-warning { background: #fff3e9; color: #8d4517; border-left: 4px solid var(--gold); }
.features { color: var(--brand); }
.login-panel { border-top: 5px solid var(--gold); }
.admin-nav .nav-link.active { background: var(--brand); }
.mail-preview { border-color: #e8eff2; }
.avatar { background: #e6f1f8; color: var(--brand); }
.role-badge { background: #fff0e6; color: #9b450e; }
.delete-user-form { margin: 0; }
.user-row { flex-wrap: wrap; }
.user-row .btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.user-row .btn-outline-primary:hover { color: #fff; background: var(--brand); }
.modal-content { border: 0; border-radius: 12px; box-shadow: 0 18px 60px rgba(23, 37, 42, .18); }
.messages-panel { padding: 30px; }
.messages-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.messages-heading h2 { margin: 0 0 5px; font-size: 28px; }
.messages-heading p { margin: 0; color: var(--muted); }
.active-count { white-space: nowrap; padding: 7px 11px; border-radius: 20px; background: #e7f3fb; color: var(--brand); font-size: 12px; font-weight: 700; }
.messages-table { margin: 0; }
.messages-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border-bottom-width: 1px; white-space: nowrap; }
.messages-table td { padding-block: 15px; white-space: nowrap; }
.messages-table td:first-child { white-space: normal; min-width: 170px; }
.messages-table td strong, .messages-table td small { display: block; }
.messages-table td small, .muted-value { color: var(--muted); font-size: 12px; }
.status-active { display: inline-block; padding: 5px 9px; border-radius: 20px; background: #e9f6ee; color: #287044; font-size: 11px; font-weight: 700; }
.revoke-secret-form { margin: 0; }
.privacy-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.empty-state { padding: 45px 20px; text-align: center; }
.empty-state h3 { margin-top: 12px; }
.empty-state p { color: var(--muted); }
.requests-hero { margin-bottom: 30px; }
.request-alert { max-width: 1000px; margin-inline: auto; }
.request-layout { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
.request-form, .request-list-panel { padding: 30px; }
.request-form h2, .request-list-panel h2 { font-size: 28px; margin: 0 0 6px; }
.request-form > p { color: var(--muted); margin-bottom: 24px; }
.request-cards { display: grid; gap: 12px; }
.request-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.request-card-main { min-width: 0; }
.request-card h3 { margin: 5px 0; font-size: 17px; }
.request-card p { margin: 0; color: var(--muted); font-size: 12px; }
.request-state { color: #8d5b25; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.request-state.answered { color: #287044; }
.request-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.mail-sent-note { color: #287044; font-size: 11px; font-weight: 700; white-space: nowrap; }
.mail-config-status { padding: 11px 13px; border-radius: 8px; background: #eef7fc; color: var(--muted); font-size: 12px; line-height: 1.65; }
.mail-config-status strong { color: var(--ink); }
.revoke-request-form { margin: 0; }
.upload-hero h1 { font-size: clamp(34px, 5vw, 52px); }
#request-result { max-width: 1000px; }
#response-modal h3 { font-size: 18px; margin-top: 15px; }
.preview-label { color: var(--brand); }
footer { border-top: 4px solid var(--brand); color: var(--muted); }

@media (max-width: 650px) {
  .brand img { width: 48px; height: 48px; }
  .topbar nav { gap: 10px !important; }
  .messages-panel { padding: 20px; }
  .messages-heading { flex-direction: column; }
  .request-layout { grid-template-columns: 1fr; }
  .request-form, .request-list-panel { padding: 22px; }
  .request-card { align-items: flex-start; flex-direction: column; }
}
