/* ==========================================================================
   Giorgione Airlines · area crew (admin)
   ========================================================================== */

.admin {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.admin-main {
  flex: 1;
  padding-block: clamp(24px, 4vw, 56px) clamp(56px, 8vw, 96px);
}

/* views fade in when switched */
.view-in { animation: view-in .6s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Header ---------- */

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.6rem;
  padding-block: clamp(14px, 2.2vw, 26px);
}
.admin-header .brand__logo { --h: clamp(30px, 3.4vw, 44px); }
.admin-header__tag { font-size: .85rem; }
.admin-header__user {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  font-size: .85rem;
}
.admin-header__user[hidden] { display: none; }
@media (max-width: 560px) { .admin-header__who { display: none; } }

/* ---------- Login ---------- */

.login {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(68vh, 640px);
}
.login__shape {
  position: absolute;
  z-index: -1;
  right: -8vw;
  bottom: -4vw;
  width: clamp(360px, 60vw, 900px);
  height: calc(clamp(360px, 60vw, 900px) / 1.919);
  color: var(--fog);
  pointer-events: none;
}
.login__card { width: min(100%, 460px); }
.login__title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}
.login__lead { margin: .5rem 0 0; color: var(--muted); font-size: .92rem; }

/* ---------- Dashboard ---------- */

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
  margin-bottom: 2rem;
  padding: .9rem 1.1rem;
  border: 2px solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--fog) 0 10px, var(--white) 10px 20px);
  font-size: .9rem;
}
.notice .icon { width: 1.4em; height: 1.4em; }
.notice span { flex: 1 1 260px; }
.notice[hidden] { display: none; }

.dash__head { margin-bottom: clamp(24px, 3.5vw, 40px); }
.dash__head .eyebrow { margin-bottom: .8rem; }
.dash__title { font-size: clamp(1.7rem, 4.6vw, 3.4rem); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: clamp(32px, 4vw, 48px);
}
.stat {
  display: grid;
  gap: .4rem;
  padding: 1.1rem 1.3rem 1.2rem;
  border: 2px solid var(--ink);
  background: var(--white);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.stat:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--black); }
.stat--dark { background: var(--black); color: var(--white); border-color: var(--black); }
.stat--dark:hover { box-shadow: 6px 6px 0 var(--fog-2); }
.stat__label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.stat__value {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__value--sm { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.3; }

/* ---------- Tabs ---------- */

.tabs {
  position: relative;
  display: flex;
  gap: .4rem;
  margin-bottom: 1.6rem;
  border-bottom: 2px solid var(--ink);
}
.tabs__tab {
  position: relative;
  padding: .85rem 1.3rem;
  border: 0;
  background: none;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--t-fast);
}
.tabs__tab:hover,
.tabs__tab[aria-selected='true'] { color: var(--black); }
.tabs__ink {
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 6px;
  width: 0;
  background: var(--black);
  transition: transform .45s var(--ease-out), width .45s var(--ease-out);
}
.tabs__panel[hidden] { display: none; }

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.toolbar__search { flex: 1 1 280px; max-width: 460px; }
.toolbar__search .input { height: 50px; padding-left: 3rem; font-size: 1rem; }
.toolbar__search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  z-index: 1;
  pointer-events: none;
  transition: transform var(--t-med) var(--ease-out);
}
.toolbar__search .field__control:focus-within .toolbar__search-icon { transform: translate(-2px, -2px); }
.toolbar__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.toolbar .btn .icon { width: 1.1em; height: 1.1em; }
#refresh-btn.is-spinning .icon { animation: spin .7s linear; }

/* ---------- Manifest table ---------- */

.manifest-wrap {
  border: 2px solid var(--ink);
  background: var(--white);
  overflow-x: auto;
}
.manifest {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.manifest th {
  padding: .8rem 1rem;
  background: var(--black);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.manifest td {
  padding: .85rem 1rem;
  border-top: 1px solid var(--fog-2);
  vertical-align: middle;
}
.manifest tbody tr { transition: background var(--t-fast); }
.manifest tbody tr:hover { background: var(--fog); }
.manifest tbody tr.is-new { animation: row-in .7s var(--ease-out) both; }
.manifest tbody tr.is-removing { animation: row-out .35s var(--ease-snap) forwards; }
@keyframes row-in { from { opacity: 0; transform: translateX(-12px); } }
@keyframes row-out { to { opacity: 0; transform: translateX(24px); } }

.manifest__num { color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; }
.manifest__name { font-weight: 700; }
.manifest__seats { font-variant-numeric: tabular-nums; }
.manifest__seats b {
  display: inline-grid;
  place-items: center;
  min-width: 2.2em;
  padding: .15em .5em;
  background: var(--black);
  color: var(--white);
}
.manifest__code { font-variant-numeric: tabular-nums; letter-spacing: .06em; white-space: nowrap; }
.manifest__date { color: var(--muted); white-space: nowrap; font-size: .88rem; }
.manifest__actions { text-align: right; white-space: nowrap; width: 1%; }

.badge {
  display: inline-block;
  margin-left: .5rem;
  padding: .1em .45em;
  border: 1.5px solid currentColor;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--muted);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-med) var(--ease-out);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--ink); background: var(--white); transform: translateY(-2px); }
.icon-btn--danger:hover { border-color: var(--danger); color: var(--danger); }

.manifest__empty {
  display: grid;
  justify-items: center;
  gap: .8rem;
  padding: 3.5rem 1rem;
  color: var(--muted);
  text-align: center;
}
.manifest__empty .icon { width: 34px; height: 34px; opacity: .5; }
.manifest__empty p { margin: 0; font-weight: 700; letter-spacing: .06em; }
.manifest__empty[hidden] { display: none; }
.manifest__meta { margin: .8rem 0 0; font-size: .8rem; color: var(--muted); }

@media (max-width: 720px) {
  .manifest thead { display: none; }
  .manifest,
  .manifest tbody { display: block; }
  .manifest tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .25rem 1rem;
    padding: 1rem;
    border-top: 1px solid var(--fog-2);
  }
  .manifest tbody tr:first-child { border-top: 0; }
  .manifest td { padding: 0; border: 0; }
  .manifest__num { display: none; }
  .manifest__name { grid-column: 1; }
  .manifest__seats { grid-column: 2; grid-row: 1; text-align: right; }
  .manifest__code,
  .manifest__date { grid-column: 1; font-size: .82rem; }
  .manifest__actions { grid-column: 2; grid-row: 2 / span 2; align-self: end; width: auto; }
}

/* ---------- Security ---------- */

.security {
  display: grid;
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}
@media (min-width: 900px) { .security { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); } }

.strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.strength span {
  height: 5px;
  background: var(--fog-2);
  transition: background .3s var(--ease-out);
}
.strength[data-score='1'] span:nth-child(-n+1),
.strength[data-score='2'] span:nth-child(-n+2),
.strength[data-score='3'] span:nth-child(-n+3),
.strength[data-score='4'] span:nth-child(-n+4) { background: var(--black); }

.security__aside {
  padding: 1.4rem 1.5rem;
  border-left: 6px solid var(--black);
  background: var(--fog);
  font-size: .9rem;
}
.security__title {
  margin: 0 0 .8rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.security__aside ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .6rem; }
.security__aside code {
  padding: .1em .35em;
  background: var(--white);
  border: 1px solid var(--fog-2);
  font-family: var(--font);
  font-size: .85em;
}

/* ---------- Dialogs ---------- */

.dialog {
  width: min(calc(100% - 32px), 980px);
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  box-shadow: 14px 14px 0 var(--black);
}
.dialog::backdrop { background: rgba(10, 10, 10, .72); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in .45s var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .7rem .7rem 1.4rem;
  background: var(--black);
  color: var(--white);
}
.dialog__title {
  margin: 0;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.dialog__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--t-med) var(--ease-out);
}
.dialog__close:hover { transform: rotate(90deg); }
.dialog__close svg { width: 22px; height: 22px; }
.dialog__ticket { padding: clamp(16px, 3vw, 32px); background: var(--fog); }
.dialog__ticket .tk-svg { box-shadow: 0 20px 40px -24px rgba(0,0,0,.5); }
.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1rem;
  padding: 1.2rem clamp(16px, 3vw, 32px) 1.4rem;
}

.dialog--confirm { width: min(calc(100% - 32px), 480px); padding: 1.8rem 1.8rem .4rem; }
.dialog--confirm .dialog__title { font-size: 1.1rem; letter-spacing: .04em; }
.dialog--confirm .dialog__text { margin: .9rem 0 0; color: var(--muted); }
.dialog--confirm .dialog__text b { color: var(--ink); }
.dialog--confirm .dialog__actions { padding-inline: 0; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  padding: .85rem 1.3rem;
  background: var(--black);
  color: var(--white);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .04em;
  transform: translateX(-50%);
  box-shadow: 6px 6px 0 var(--fog-2);
  animation: toast-in .45s var(--ease-out);
}
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } }
