[hidden] { display: none !important; }

.auth-page { background: var(--cream); }

.login-layout {
  display: grid;
  min-height: calc(100vh - 96px);
  grid-template-columns: 1.05fr 0.95fr;
}

.login-visual { position: relative; min-height: 720px; overflow: hidden; }
.login-visual img { width: 100%; height: 100%; object-fit: cover; }
.login-visual span { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(41,26,18,.28)); }

.login-panel { display: grid; align-items: center; padding: 4rem clamp(2rem, 7vw, 6rem); }
.login-card { width: min(100%, 480px); margin: 0 auto; }
.login-logo { display: inline-block; margin-bottom: 1.5rem; }
.login-logo img { width: 92px; height: 92px; object-fit: contain; }
.login-card h1 { margin-bottom: 1rem; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.login-intro { margin-bottom: 2rem; color: var(--ink-soft); }

.auth-field { margin-bottom: 1rem; }
.auth-field label { display: block; margin-bottom: .5rem; font-size: .85rem; font-weight: 700; }
.auth-field input { width: 100%; height: 54px; padding: 0 1rem; border: 1px solid rgba(41,26,18,.28); border-radius: 0; outline: none; background: #fff; color: var(--ink); }
.auth-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(181,138,72,.14); }
.code-input { font-size: 1.35rem !important; letter-spacing: .35em; text-align: center; }

.form-message { min-height: 1.55rem; margin: .4rem 0 .8rem; color: #9b3228; font-size: .78rem; }
.form-message.is-success { color: #3d6b49; }
.auth-button { display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: space-between; padding: 0 1rem; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; font-weight: 600; }
.auth-button:hover, .auth-button:focus-visible { border-color: var(--gold); background: var(--gold); }
.auth-button:disabled { cursor: wait; opacity: .65; }
.text-button { margin-top: .75rem; padding: .45rem 0; border: 0; background: transparent; color: #875f28; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.code-sent { padding: .85rem 1rem; border-left: 3px solid var(--gold); background: #fff; color: var(--ink-soft); font-size: .83rem; }
.code-sent strong { color: var(--ink); }
.security-note { margin: 1.4rem 0; color: var(--ink-soft); font-size: .75rem; }
.back-link { font-size: .8rem; font-weight: 600; text-decoration: none; }

.admin-page { background: #20140f; color: #f7eee2; }
.session-loader { position: fixed; z-index: 50; inset: 0; display: grid; align-content: center; justify-items: center; gap: 1rem; background: #20140f; color: rgba(255,255,255,.68); }
.session-loader span { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.2); border-top-color: var(--gold); border-radius: 50%; animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.admin-header { display: flex; min-height: 96px; align-items: center; justify-content: space-between; padding: 1rem var(--pad); border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-logo img { width: 74px; height: 74px; object-fit: contain; }
.admin-account { display: flex; align-items: center; gap: 1.5rem; }
.admin-account > div { display: flex; align-items: flex-end; flex-direction: column; }
.admin-account span { color: rgba(255,255,255,.45); font-size: .72rem; }
.admin-account strong { max-width: 260px; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { min-height: 42px; padding: 0 .9rem; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; cursor: pointer; }
.logout-button:hover { border-color: var(--gold); background: var(--gold); color: var(--ink); }

.admin-main { width: min(100%, 1320px); margin: 0 auto; padding: clamp(3.5rem, 7vw, 6rem) var(--pad); }
.admin-intro { display: grid; align-items: end; grid-template-columns: 1fr minmax(260px,400px); gap: 2rem; margin-bottom: 2.5rem; }
.admin-intro h1 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3rem); }
.admin-intro > p { margin-bottom: .3rem; color: rgba(255,255,255,.58); }

.dashboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.14); }
.dashboard-card { position: relative; display: flex; min-height: 280px; justify-content: space-between; flex-direction: column; padding: clamp(1.5rem,3vw,2.5rem); background: #20140f; color: #fff; text-decoration: none; transition: background .2s ease, color .2s ease; }
.dashboard-card-featured { grid-row: span 2; min-height: 561px; background: #d3b47e; color: var(--ink); }
.dashboard-card:hover, .dashboard-card:focus-visible { background: #d3b47e; color: var(--ink); }
.dashboard-card span, .dashboard-card small { font-size: .72rem; }
.dashboard-card small { display: block; margin-bottom: .5rem; opacity: .55; }
.dashboard-card h2 { max-width: 420px; margin: 0; font-size: clamp(1.5rem,3vw,2.25rem); }
.dashboard-card b { position: absolute; right: 1.5rem; bottom: 1.5rem; font-size: 1.2rem; }

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: calc(100vh - 96px); padding: 3rem 1.25rem; }
  .admin-intro { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-card-featured { grid-row: auto; min-height: 340px; }
}

@media (max-width: 620px) {
  .admin-header { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .admin-account { width: 100%; justify-content: space-between; }
  .admin-account > div { align-items: flex-start; }
  .dashboard-card { min-height: 240px; }
}
