@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap");
@import url("https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css");

:root {
  --primary: #242c6d;
  --primary-2: #283179;
  --primary-soft: rgba(36, 44, 109, 0.08);
  --success: #29b348;
  --info: #44a2d2;
  --warning: #f5b225;
  --danger: #ec536c;
  --text: #2d3b48;
  --muted: #a1a7cc;
  --muted-2: #6c757d;
  --border: #e9ecef;
  --bg: #eff3f6;
  --sidebar-w: 240px;
  --topbar-h: 70px;
  --radius: 6px;
  --shadow: 1px 0 20px rgba(0, 0, 0, 0.05);
  --shadow-top: 1px 0 20px rgba(0, 0, 0, 0.2);
  --font: "Work Sans", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; outline: none !important; }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--muted-2); text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, h4, h5 { margin: 0 0 0.75rem; font-weight: 600; color: var(--text); }
.page-title { font-size: 20px; margin: 0; }
.muted { color: var(--muted) !important; }
.text-muted { color: var(--muted-2) !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.req { color: var(--danger); font-weight: 600; margin-left: 2px; }

button, .btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 0.25rem;
  border: 1px solid #ced4da;
  padding: 0.375rem 0.9rem;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  vertical-align: middle;
}
button:hover, .btn:hover { background: #f8f9fa; border-color: #b1b7c1; }
button:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: #1e245a;
  border-color: #1e245a;
  color: #fff;
}
.btn-danger {
  background-color: #fff;
  border-color: rgba(236, 83, 108, 0.45);
  color: var(--danger);
}
.btn-danger:hover {
  background-color: rgba(236, 83, 108, 0.08);
  color: var(--danger);
}
button.ghost {
  background: transparent;
  border-color: transparent;
  color: #fff;
}
button.ghost:hover { background: rgba(255,255,255,0.08); }
.btn-sm { padding: 0.25rem 0.55rem; font-size: 12.5px; }
.btn-submit {
  min-width: 140px;
  height: 40px;
  padding: 0 1.5rem !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(36, 44, 109, 0.28);
}
.btn-submit:hover {
  box-shadow: 0 8px 20px rgba(36, 44, 109, 0.36);
  transform: translateY(-1px);
}
.btn-reset {
  min-width: 96px;
  height: 40px;
  background: #fff;
  border-color: #ced4da;
  color: var(--muted-2);
}
.btn-danger-solid {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(236, 83, 108, 0.3) !important;
}
.header-actions { display: flex; gap: 0.5rem; align-items: center; }

.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 12.5px;
  color: var(--muted-2);
}
.form-control,
input.form-control,
select.form-control,
textarea.form-control {
  display: block;
  width: 100%;
  height: calc(2.25rem + 2px);
  padding: 0.375rem 0.75rem;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out;
  appearance: none;
  -webkit-appearance: none;
}
textarea.form-control {
  height: auto;
  min-height: 100px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.45;
}
select.form-control {
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 8px 10px;
}
.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: var(--primary);
  outline: 0;
  box-shadow: none;
}
.form-control:disabled,
.form-control[readonly] {
  background-color: #e9ecef;
  opacity: 1;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: calc(2.25rem + 2px);
}
.form-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.form-grid .full { grid-column: 1 / -1; }

/* Icon upload */
.icon-field {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.icon-preview-wrap {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8f9fb;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.icon-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 12px 12px;
}
.icon-preview-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 28px;
}
.icon-field-main { flex: 1; min-width: 0; }
.icon-field-main .form-control { margin-bottom: 0.55rem; }

.file-upload { position: relative; }
.file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.file-upload-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: #fff;
  border: 1px dashed #ced4da;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.file-upload:hover .file-upload-box,
.file-upload.has-file .file-upload-box {
  border-color: var(--primary);
  background: rgba(36, 44, 109, 0.03);
}
.file-upload-icon {
  width: 40px;
  height: 40px;
  border-radius: 10%;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--primary);
  background: var(--primary-soft);
  flex-shrink: 0;
}
.file-upload-meta { flex: 1; min-width: 0; }
.file-upload-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-upload-hint {
  margin-top: 0.1rem;
  font-size: 12px;
  color: var(--muted-2);
}
.file-upload-btn { flex-shrink: 0; }

.wrapper { min-height: 100vh; position: relative; }
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 1001;
  display: flex;
  flex-direction: column;
}
.topbar-left {
  height: var(--topbar-h);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.logo:hover, .logo:focus { color: #fff; }
.sidebar-inner {
  flex: 1;
  overflow: auto;
  padding: 0.5rem 0 1.5rem;
}
.menu-title {
  padding: 14px 25px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 11px 25px;
  color: #5d5b6f;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: 0.15s ease;
  cursor: pointer;
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
}
.side-nav a i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  color: #a1a7cc;
}
.side-nav a:hover,
.side-nav a.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-left-color: var(--primary);
}
.side-nav a:hover i,
.side-nav a.active i {
  color: var(--primary);
}

.content-page {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: var(--primary-2);
  height: var(--topbar-h);
  box-shadow: var(--shadow-top);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  color: #fff;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .brand-mobile { display: none; font-weight: 700; }
.topbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-cta {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}
.topbar-cta:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}
.user-menu { position: relative; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.user-chip:hover,
.user-chip[aria-expanded="true"] {
  background: rgba(255,255,255,0.16);
}
.user-chip-caret {
  font-size: 18px;
  opacity: 0.75;
  transition: transform 0.15s ease;
}
.user-chip-caret.open { transform: rotate(180deg); }
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 0.35rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(36, 44, 109, 0.22);
  z-index: 120;
  animation: fadeIn 0.12s ease;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.user-dropdown-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.user-dropdown-item i { font-size: 16px; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.user-meta { line-height: 1.2; padding-right: 0.4rem; }
.user-meta small { display: block; opacity: 0.75; font-size: 11px; }

.content {
  padding: 1.25rem 1.5rem 2rem;
  flex: 1;
}
.page-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.breadcrumb {
  display: flex;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--muted-2);
}
.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--muted);
}
.breadcrumb a { color: #5d5b6f; }
.footer-note {
  padding: 0.75rem 1.5rem 1.25rem;
  color: var(--muted-2);
  font-size: 12px;
}

.card {
  background: #fff;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.card-body { padding: 1.15rem 1.25rem; }
.card-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(45, 59, 72, 0.05);
  font-weight: 600;
}
.card-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem;
}
.stat-card .stat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.stat-card .round {
  width: 48px;
  height: 48px;
  border-radius: 12%;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #f8f9fa;
  flex-shrink: 0;
}
.stat-card .round.success { color: var(--success); background: rgba(41,179,72,0.1); }
.stat-card .round.info { color: var(--info); background: rgba(68,162,210,0.12); }
.stat-card .round.warning { color: var(--warning); background: rgba(245,178,37,0.14); }
.stat-card .round.danger { color: var(--danger); background: rgba(236,83,108,0.12); }
.stat-card .stat-text { flex: 1; text-align: right; }
.stat-card .stat-text h5 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}
.stat-card .stat-text p {
  margin: 0.15rem 0 0;
  color: var(--muted-2);
  font-size: 13px;
}
.progress {
  height: 3px;
  background: #eef1f5;
  border-radius: 99px;
  margin-top: 0.9rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
  width: 100%;
}
.progress-bar.info { background: var(--info); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th, td {
  text-align: left;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid rgba(45, 59, 72, 0.06);
  vertical-align: middle;
}
th {
  color: var(--muted-2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tr:hover td { background: #fbfcfd; }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 50rem;
  font-size: 11px;
  font-weight: 600;
  background: #f1f3f8;
  color: var(--muted-2);
}
.badge.ok, .badge-success { background: rgba(41,179,72,0.12); color: var(--success); }
.badge.bad, .badge-danger { background: rgba(236,83,108,0.12); color: var(--danger); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.info { background: rgba(68,162,210,0.14); color: var(--info); }
.badge.warning { background: rgba(245,178,37,0.16); color: #c48a0d; }

.alert {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1.1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  border: 0;
  background: #fff;
}
.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 10%;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.alert-body { min-width: 0; flex: 1; }
.alert-body strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text);
}
.alert-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted-2);
}
.alert-info {
  background: linear-gradient(90deg, rgba(68, 162, 210, 0.12), #fff 48%);
  border-left: 3px solid var(--info);
}
.alert-info .alert-icon {
  color: var(--info);
  background: rgba(68, 162, 210, 0.15);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(36, 44, 109, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.15s ease;
}
#passwordModal {
  z-index: 2600;
}
.modal-backdrop[hidden] { display: none !important; }
.modal-dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 2.5rem);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.18s ease;
}
.modal-dialog-sm { width: min(420px, 100%); }
.modal-dialog-lg { width: min(760px, 100%); }
.modal-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(36, 44, 109, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2.5rem);
  min-height: 0;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}
.modal-header-danger { background: #b83a4d !important; }
.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.modal-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 20px;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.85;
}
.modal-close:hover { opacity: 1; background: rgba(255,255,255,0.12); }
.modal-body {
  padding: 1.25rem;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.9rem 1.25rem 1.15rem;
  border-top: 1px solid rgba(45, 59, 72, 0.06);
  background: #fbfcfd;
  flex-shrink: 0;
}
.modal-footer .btn-danger { margin-right: auto; }
.dialog-backdrop { z-index: 3000; }
.dialog-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}

.btn-menu {
  display: none;
  font-size: 22px;
  padding: 0.2rem 0.4rem;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
}
.sidebar-backdrop[hidden] { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 992px) {
  .side-menu {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .side-menu.open { transform: translateX(0); }
  .content-page { margin-left: 0; }
  .topbar .brand-mobile { display: block; }
  .btn-menu { display: inline-flex !important; }
  .sidebar-backdrop:not([hidden]) { display: block; }
}

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

/* Auth / Login — Zoter-like */
.auth-body {
  min-height: 100%;
  background: #1a2248;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(36, 44, 109, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(68, 162, 210, 0.18), transparent 50%),
    linear-gradient(160deg, #1a2248, #12183a 60%, #0e1230);
}
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(18, 24, 58, 0.45);
}
.auth-brand {
  background: linear-gradient(165deg, var(--primary) 0%, #1a2058 55%, #151a48 100%);
  color: #fff;
  padding: 2rem 1.75rem;
}
.auth-mark {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: 0.75rem;
}
.auth-brand-title {
  margin: 0 0 0.65rem;
  font-size: 28px;
  color: #fff;
}
.auth-brand-desc {
  margin: 0 0 1.5rem;
  font-size: 13.5px;
  line-height: 1.55;
  opacity: 0.85;
}
.auth-brand-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.auth-brand-points li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.auth-point-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.12);
  font-size: 18px;
  flex-shrink: 0;
}
.auth-brand-points strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 0.1rem;
}
.auth-brand-points span {
  font-size: 12px;
  opacity: 0.75;
}
.auth-panel {
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-panel-head h2 {
  margin: 0 0 0.35rem;
  font-size: 22px;
}
.auth-panel-head p {
  margin: 0 0 1.35rem;
  color: var(--muted-2);
  font-size: 13.5px;
}
.auth-form .btn-block { width: 100%; margin-top: 0.5rem; }
.auth-form .err {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(236, 83, 108, 0.35);
  background: rgba(236, 83, 108, 0.1);
  color: #c0392b;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 500;
}
.auth-form .err[hidden] { display: none !important; }

.auth-captcha {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}
.auth-captcha .form-control {
  flex: 1;
  min-width: 0;
}
.auth-captcha-img {
  flex: 0 0 140px;
  height: calc(2.25rem + 2px);
  padding: 0;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  background: #f4f6fb;
  cursor: pointer;
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-captcha-img:hover {
  border-color: rgba(36, 44, 109, 0.35);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.auth-captcha-img:disabled {
  opacity: 0.7;
  cursor: wait;
}
.auth-captcha-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mail-search-results {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow: auto;
}
.mail-search-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.75rem;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.mail-search-item:hover {
  border-color: rgba(36, 44, 109, 0.35);
  background: var(--primary-soft);
}
.mail-search-item.is-added {
  border-color: rgba(10, 179, 156, 0.45);
  background: rgba(10, 179, 156, 0.08);
}
.mail-search-item strong { grid-column: 1; }
.mail-search-item span { font-size: 12px; color: var(--muted-2); }
.mail-search-item .mono { grid-column: 1 / -1; font-size: 12px; word-break: break-all; }

@media (max-width: 800px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}
