@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;450;500;550;600;650;700;750;800&family=Geist+Mono:wght@500;600&display=swap');

:root {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #302e30;
  background: #181818;
  font-synthesis: none;
  --ink: #302e30;
  --muted: #777174;
  --accent: #893e48;
  --accent-hover: #713039;
  --line: #65545b20;
  --panel-bg: rgba(255, 252, 250, 0.88);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  overflow-x: hidden;
}

button, input, select, textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  border: 0;
  transition: background 0.2s cubic-bezier(.22,1,.36,1), transform 0.15s, opacity 0.2s;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.48;
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Sora Mail Wallpaper & Falling Petals */
.wallpaper, .scrim, .petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.wallpaper {
  z-index: -3;
  background: url('/crimson-parasol.png') center/cover no-repeat;
  animation: sky-drift 55s ease-in-out infinite alternate;
  transform: scale(1.03);
}

.wallpaper.plain {
  background: #1d1d20;
  animation: none;
  transform: none;
}

.scrim {
  z-index: -2;
  background: linear-gradient(135deg, rgba(22, 16, 19, 0.45), rgba(32, 21, 25, 0.55));
}

.petals {
  z-index: -1;
  overflow: hidden;
}

.petals i {
  position: absolute;
  left: calc(var(--n) * 8.3%);
  top: -30px;
  width: 6px;
  height: 4px;
  background: #f9d3c8;
  border-radius: 90% 0 90% 10%;
  opacity: 0;
  animation: petal-fall calc(22s + var(--n) * 2s) linear infinite;
  animation-delay: calc(var(--n) * -3s);
}

@keyframes sky-drift {
  0% { transform: scale(1.03) translate(0, 0); }
  100% { transform: scale(1.07) translate(-1.2%, -0.8%); }
}

@keyframes petal-fall {
  0% { transform: translateY(-20px) rotate(0deg) translateX(0); opacity: 0; }
  12% { opacity: 0.75; }
  85% { opacity: 0.65; }
  100% { transform: translateY(105vh) rotate(340deg) translateX(45px); opacity: 0; }
}

/* Main Shell */
.sora-shell {
  isolation: isolate;
  min-height: 100dvh;
  padding: 28px 36px 28px;
  max-width: 1460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Big Vhaey Onji Header */
.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  color: #fff;
  flex-wrap: wrap;
}

.vhaey-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-emblem {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -1px;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  margin: 0;
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 800;
  letter-spacing: -1.8px;
  line-height: 1.02;
  color: #ffffff;
  text-shadow: 0 4px 28px rgba(20, 10, 14, 0.5);
}

.brand-subtitle {
  font-size: 12px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: rgba(255, 245, 242, 0.82);
  margin-top: 4px;
  font-weight: 500;
}

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

.glass-pill {
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(14px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.glass-pill:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* PIN Gate Card (Sora Private Login Aesthetic) */
.pin-gate-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 20px 0 40px;
}

.pin-card {
  width: min(430px, 100%);
  padding: 38px 36px;
  background: rgba(255, 253, 250, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(35, 14, 18, 0.34);
  backdrop-filter: blur(26px);
  color: #353136;
}

.pin-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.pin-card h2 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 0 0 10px;
  color: #2f2428;
}

.pin-target-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #f5ebe9;
  border: 1px solid #e5d2cf;
  border-radius: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: #6d3440;
  margin-bottom: 14px;
  word-break: break-all;
}

.pin-card p.desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: #6e6469;
  margin: 0 0 24px;
}

.pin-form {
  display: grid;
  gap: 16px;
}

.pin-form label {
  display: grid;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 550;
  color: #54474d;
}

.pin-input {
  width: 100%;
  background: #fff;
  border: 1px solid #dcd0d3;
  border-radius: 10px;
  padding: 13px 14px;
  font-family: 'Geist Mono', monospace;
  font-size: 16px;
  letter-spacing: 2px;
  color: #2f2428;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.pin-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(137, 62, 72, 0.15);
}

.primary-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.error-banner {
  padding: 11px 14px;
  border-radius: 9px;
  background: #fdf0f1;
  border: 1px solid #ecc6ca;
  color: #9e2a3b;
  font-size: 13px;
  line-height: 1.5;
}

.quick-jump-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #ebe2e4;
  display: grid;
  gap: 10px;
}

.quick-jump-form span {
  font-size: 12px;
  color: #7d7277;
}

.quick-jump-row {
  display: flex;
  gap: 8px;
}

.quick-jump-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #dcd0d3;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

.quick-jump-row button {
  padding: 9px 14px;
  border-radius: 8px;
  background: #efe6e8;
  color: #5d3a43;
  font-size: 12.5px;
  font-weight: 600;
}

.quick-jump-row button:hover {
  background: #e4d5d8;
}

/* Surface Glass Container (Sora Inbox Surface) */
.surface-card {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(26px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.surface-header {
  padding: 32px 36px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.surface-header h2 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -1.1px;
  margin: 0;
  color: #38252d;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-count {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  padding: 4px 11px;
  border-radius: 999px;
  background: #f2e6e8;
  border: 1px solid #dfc8cc;
  color: #793a45;
}

.surface-desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: #77686f;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #4f6859;
  background: rgba(255, 255, 255, 0.68);
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(114, 140, 119, 0.25);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #679476;
}

/* Admin Create Form Grid */
.admin-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 520px;
}

.admin-Create-pane {
  padding: 28px 30px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pane-title {
  font-size: 15px;
  font-weight: 650;
  color: #482e38;
  margin: 0;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  font-size: 12px;
  font-weight: 550;
  color: #66525b;
}

.email-builder {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #d9cbd0;
  border-radius: 9px;
  overflow: hidden;
}

.email-builder:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(137, 62, 72, 0.12);
}

.email-builder input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
  color: #2f2428;
}

.email-builder select {
  border: 0;
  border-left: 1px solid #e7dcdf;
  background: #faf5f6;
  padding: 0 10px;
  font-size: 12.5px;
  color: #6c4652;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.text-input, .bulk-textarea {
  width: 100%;
  background: #fff;
  border: 1px solid #d9cbd0;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #2f2428;
  outline: none;
}

.text-input:focus, .bulk-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(137, 62, 72, 0.12);
}

.pin-row-inline {
  display: flex;
  gap: 8px;
}

.pin-row-inline input {
  flex: 1;
  font-family: 'Geist Mono', monospace;
  letter-spacing: 1.5px;
}

.secondary-btn {
  padding: 9px 13px;
  border-radius: 9px;
  background: #f1e7e9;
  border: 1px solid #dfd0d3;
  color: #5e3b46;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
}

.secondary-btn:hover:not(:disabled) {
  background: #e6d6da;
}

.admin-list-pane {
  padding: 24px 30px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* Toolbar & Controls */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #ded2d6;
  border-radius: 9px;
  padding: 8px 13px;
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: #30262a;
}

/* Tables (Mailboxes & Inbox Messages) */
.table-wrap {
  overflow-x: auto;
}

.sora-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.sora-table th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #847078;
  padding: 11px 14px;
  background: rgba(242, 234, 236, 0.85);
}

.sora-table th:first-child { border-radius: 9px 0 0 9px; }
.sora-table th:last-child { border-radius: 0 9px 9px 0; }

.sora-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(137, 62, 72, 0.09);
  vertical-align: middle;
  font-size: 13.5px;
}

.sora-table tr:hover td {
  background: rgba(255, 255, 255, 0.55);
}

.mono-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 7px;
  background: #f3e9eb;
  border: 1px solid #e1cfd3;
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: #65313d;
  font-weight: 500;
}

.otp-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: #efe5d8;
  border: 1px solid #dfd0bc;
  border-radius: 8px;
  color: #5c4028;
}

.otp-badge-btn:hover {
  background: #e6d8c5;
}

.otp-badge-btn code {
  font-family: 'Geist Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
}

.otp-copy-hint {
  font-size: 11px;
  color: #876c52;
  font-weight: 500;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-btn {
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 550;
  background: #f3ecee;
  color: #5c3d47;
  border: 1px solid #e1d4d8;
}

.mini-btn:hover {
  background: #e7dade;
}

.mini-btn.danger {
  color: #9e2a3b;
  background: #fdf2f3;
  border-color: #f0cfd3;
}

.mini-btn.danger:hover {
  background: #f9dfe2;
}

/* Inbox Reader Split / Detail */
.inbox-body-pad {
  padding: 22px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sender-title {
  font-weight: 600;
  color: #3d2730;
  display: block;
}

.subject-trigger {
  background: none;
  padding: 0;
  text-align: left;
  color: #705862;
  font-size: 13.5px;
  margin-top: 3px;
  display: block;
}

.subject-trigger:hover {
  color: var(--accent);
  text-decoration: underline;
}

.message-detail-box {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #e5d8dc;
  border-radius: 12px;
  padding: 22px 24px;
  margin: 6px 0 12px;
}

.detail-meta-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: #7c6871;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee4e7;
  margin-bottom: 16px;
}

.message-detail-box h3 {
  margin: 0 0 14px;
  font-size: 20px;
  color: #35222a;
}

.message-pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  line-height: 1.75;
  color: #49363e;
}

.html-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid #eadfe2;
  border-radius: 8px;
  background: #fff;
  margin-top: 14px;
}

.empty-box {
  text-align: center;
  padding: 56px 24px;
  color: #7f6b74;
}

.empty-box h3 {
  font-size: 20px;
  color: #4f3842;
  margin: 10px 0 6px;
}

.empty-box p {
  font-size: 13.5px;
  margin: 0;
}

.page-foot {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 245, 242, 0.72);
  flex-wrap: wrap;
  gap: 10px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 12, 15, 0.6);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-box {
  width: min(460px, 100%);
  background: #fffdfa;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 16px;
}

.modal-box h3 {
  margin: 0;
  font-size: 20px;
  color: #35222a;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: #2b1d22;
  color: #fff8f6;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 12px 20px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
}

@media (max-width: 980px) {
  .sora-shell { padding: 20px 16px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-Create-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .surface-header { padding: 24px 20px; }
  .inbox-body-pad, .admin-list-pane { padding: 20px; }
}
