/* ============================================================
   YAER Australia — Admin console
   Design language: deep ocean navy + eucalyptus sand + aqua accent
   ============================================================ */
:root {
  --ink-950: #04141b;
  --ink-900: #071b24;
  --ink-800: #0b2a36;
  --ink-700: #10394a;
  --aqua-600: #1f7f8f;
  --aqua-500: #2e97a8;
  --aqua-300: #7fc9d4;
  --aqua-100: #e3f2f4;
  --sand-50: #faf8f4;
  --sand-100: #f3efe6;
  --sand-200: #e7e0d2;
  --line: #e5dfd2;
  --white: #fff;
  --text: #14252c;
  --muted: #6b7a80;
  --danger: #b4423c;
  --ok: #2f7d5a;
  --warn: #b07a24;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(5, 20, 27, .06), 0 8px 24px -18px rgba(5, 20, 27, .28);
  --shadow-lg: 0 20px 60px -30px rgba(5, 20, 27, .45);
  --font-display: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  --font-body: 'Manrope', 'Noto Sans SC', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font-body); color: var(--text); background: var(--sand-50);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--aqua-300); color: var(--ink-900); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.side {
  width: 272px; flex: none; position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, #0e3242 0%, #071b24 55%, #04141b 100%);
  color: #dbe7ea; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.side::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  opacity: .05; mix-blend-mode: overlay;
}
.side-brand {
  display: flex; align-items: center; gap: 13px; padding: 26px 26px 22px; position: relative; z-index: 1;
}
.side-brand svg { width: 42px; height: 42px; flex: none; color: #fff; }
.side-brand .word { font-family: var(--font-display); font-size: 24px; letter-spacing: .19em; line-height: 1; }
.side-brand .word small { display: block; margin-top: 6px; font-family: var(--font-body); font-size: 9px; font-weight: 700; letter-spacing: .42em; opacity: .55; }
.side-sep { height: 1px; margin: 0 26px 14px; background: linear-gradient(90deg, rgba(127, 201, 212, .4), transparent); }

.side-nav { padding: 6px 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; position: relative; z-index: 1; }
.side-nav::-webkit-scrollbar { width: 0; }
.nav-label { margin: 16px 14px 7px; font-size: 10px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: rgba(219, 231, 234, .38); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; letter-spacing: .01em; color: rgba(219, 231, 234, .74);
  border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(46, 151, 168, .22), rgba(46, 151, 168, .04));
  border-color: rgba(127, 201, 212, .28); color: #fff;
}
.nav-item.active svg { color: var(--aqua-300); opacity: 1; }
.nav-item .dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--aqua-300); opacity: 0; }
.nav-item.active .dot { opacity: 1; }

.side-foot { padding: 16px 22px 22px; font-size: 11px; color: rgba(219, 231, 234, .42); position: relative; z-index: 1; }
.side-foot .logout {
  display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 14px; padding: 9px 12px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px;
  color: #dbe7ea; font-size: 12px; font-weight: 600; transition: .2s;
}
.side-foot .logout:hover { background: rgba(255, 255, 255, .1); }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 16px 34px; background: rgba(250, 248, 244, .86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .crumb { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.topbar .crumb b { color: var(--ink-900); font-weight: 800; }
.topbar .grow { flex: 1; }
.lang-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.lang-toggle button {
  border: 0; background: transparent; padding: 5px 13px; border-radius: 999px; font-size: 11.5px;
  font-weight: 800; letter-spacing: .08em; color: var(--muted); transition: .2s;
}
.lang-toggle button.on { background: var(--ink-900); color: #fff; }
.top-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 700; color: var(--ink-800);
}
.top-link:hover { border-color: var(--aqua-500); color: var(--aqua-600); }

.view { padding: 30px 34px 56px; animation: viewIn .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; color: var(--aqua-600); }
.page-head h1 { margin: 6px 0 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 3vw, 42px); line-height: 1.05; letter-spacing: -.01em; }
.page-head p { margin: 8px 0 0; max-width: 620px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.page-head .tools { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---------- cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 24px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 20px 22px; position: relative; overflow: hidden; }
.kpi::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 151, 168, .14), transparent 70%);
}
.kpi .lab { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.kpi .val { margin-top: 12px; font-family: var(--font-display); font-size: 36px; line-height: 1; font-weight: 600; letter-spacing: -.01em; }
.kpi .sub { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.kpi .sub b { color: var(--ok); font-weight: 800; }
.kpi .sub.bad b { color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.panel-head .hint { font-size: 11.5px; color: var(--muted); }
.panel-head .grow { flex: 1; }
.chart-wrap { padding: 18px 14px 6px; }
.chart-wrap svg { width: 100%; height: 220px; display: block; overflow: visible; }

/* ---------- table ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl thead th {
  text-align: left; padding: 11px 16px; font-size: 10px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); background: #fbf9f5; border-bottom: 1px solid var(--line);
}
.tbl tbody td { padding: 12px 16px; border-bottom: 1px solid #f1ece1; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fcfaf6; }
.tbl .mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 11.5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.pill.ok { background: #e8f3ee; color: var(--ok); }
.pill.warn { background: #fbf1de; color: var(--warn); }
.pill.bad { background: #f9e7e5; color: var(--danger); }
.pill.mute { background: #f1eee6; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 800; letter-spacing: .02em; transition: .2s;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--ink-900); color: #fff; }
.btn-primary:hover { background: var(--ink-800); transform: translateY(-1px); }
.btn-aqua { background: var(--aqua-500); color: #fff; }
.btn-aqua:hover { background: var(--aqua-600); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-800); }
.btn-ghost:hover { border-color: var(--aqua-500); color: var(--aqua-600); }
.btn-danger { background: #fff; border-color: #eccfcc; color: var(--danger); }
.btn-danger:hover { background: #fdf3f2; }
.btn-sm { padding: 7px 13px; font-size: 11.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font-size: 13px; line-height: 1.55; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: 0; border-color: var(--aqua-500); box-shadow: 0 0 0 3px rgba(46, 151, 168, .14);
}
.textarea { min-height: 84px; resize: vertical; }
.textarea.tall { min-height: 150px; }
.textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.65; }

/* ---------- CMS editor ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 12px; font-weight: 700; color: var(--ink-800); transition: .2s;
}
.chip:hover { border-color: var(--aqua-500); }
.chip.on { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.chip .n { margin-left: 7px; font-size: 10px; opacity: .6; }

.searchbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 15px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; margin-bottom: 16px; max-width: 420px;
}
.searchbar svg { width: 15px; height: 15px; color: var(--muted); }
.searchbar input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 12.5px; }

.cms-list { display: flex; flex-direction: column; gap: 12px; }
.cms-row {
  display: grid; grid-template-columns: 190px 1fr 1fr; gap: 14px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: #fff;
}
.cms-row.changed { border-color: var(--aqua-300); box-shadow: 0 0 0 3px rgba(46, 151, 168, .1); }
.cms-row .key { display: flex; flex-direction: column; gap: 5px; }
.cms-row .key b { font-size: 12.5px; font-weight: 800; }
.cms-row .key span { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; color: var(--muted); word-break: break-all; }
.cms-row .key .flag { margin-top: 2px; font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--aqua-600); }
.cms-row .lang-col { display: flex; flex-direction: column; gap: 5px; }
.cms-row .lang-col small { font-size: 9.5px; font-weight: 800; letter-spacing: .16em; color: var(--muted); }
.cms-row .lang-col textarea { min-height: 62px; }

.savebar {
  position: sticky; bottom: 18px; z-index: 15; display: flex; align-items: center; gap: 14px;
  margin-top: 22px; padding: 14px 20px; border-radius: 999px;
  background: rgba(7, 27, 36, .95); color: #dbe7ea; box-shadow: var(--shadow-lg);
}
.savebar .info { flex: 1; font-size: 12px; }
.savebar .info b { color: #fff; }
.savebar .btn-primary { background: var(--aqua-500); }
.savebar .btn-primary:hover { background: var(--aqua-600); }
.savebar .btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .2); color: #dbe7ea; }

/* ---------- journal ---------- */
.news-row { display: flex; align-items: center; gap: 16px; }
.news-thumb {
  width: 76px; height: 54px; flex: none; border-radius: 8px; object-fit: cover; background: var(--sand-100);
  border: 1px solid var(--line);
}
.news-main { min-width: 0; }
.news-main b { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-main span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 7px; justify-content: flex-end; }

/* ---------- drawer ---------- */
.drawer-mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(4, 20, 27, .38); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .28s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 94vw); z-index: 61;
  background: var(--sand-50); border-left: 1px solid var(--line); box-shadow: -30px 0 80px -40px rgba(4, 20, 27, .5);
  transform: translateX(102%); transition: transform .4s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 26px; background: #fff; border-bottom: 1px solid var(--line);
}
.drawer-head h3 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.drawer-head .grow { flex: 1; }
.drawer-body { padding: 24px 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.drawer-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 26px; background: #fff; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.sec-label {
  margin: 10px 0 -4px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 10.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--aqua-600);
}

/* ---------- logs ---------- */
.log-settings {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: #fff; font-size: 12px; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap;
}
.log-settings .mono { color: var(--ink-800); font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.range { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.range button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--muted); }
.range button.on { background: var(--ink-900); color: #fff; }
.bars { display: flex; flex-direction: column; gap: 10px; padding: 18px 22px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 46px; gap: 12px; align-items: center; font-size: 11.5px; }
.bar-row .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-800); font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.bar-row .track { height: 7px; border-radius: 999px; background: #f0ece3; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--aqua-600), var(--aqua-300)); }
.bar-row .v { text-align: right; font-weight: 800; color: var(--muted); }

/* ---------- login ---------- */
.login {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 110% at 20% 0%, #0e3242 0%, #071b24 55%, #04141b 100%);
  color: #dbe7ea;
}
.login::before {
  content: ''; position: absolute; inset: 0; opacity: .35;
  background: radial-gradient(50% 40% at 80% 90%, rgba(46, 151, 168, .35), transparent 70%);
}
.login-card {
  position: relative; width: min(430px, 100%); padding: 38px 36px 32px; border-radius: 24px;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(18px); box-shadow: 0 30px 90px -40px #000;
  animation: loginIn .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes loginIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.login-card .brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-card .brand svg { width: 50px; height: 50px; color: #fff; }
.login-card .brand .word { font-family: var(--font-display); font-size: 27px; letter-spacing: .18em; line-height: 1; }
.login-card .brand .word small { display: block; margin-top: 7px; font-family: var(--font-body); font-size: 9px; font-weight: 800; letter-spacing: .42em; opacity: .55; }
.login-card h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.login-card p.sub { margin: 0 0 22px; font-size: 12.5px; line-height: 1.7; color: rgba(219, 231, 234, .62); }
.login-card .input {
  background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); color: #fff; padding: 13px 16px;
}
.login-card .input::placeholder { color: rgba(255, 255, 255, .35); }
.login-card .btn { width: 100%; margin-top: 16px; padding: 13px; background: var(--aqua-500); color: #fff; }
.login-card .err { margin-top: 12px; min-height: 16px; font-size: 11.5px; font-weight: 700; color: #f2a7a1; }
.login-card .switch { display: flex; justify-content: center; margin-top: 20px; }
.login-card .lang-toggle { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
.login-card .lang-toggle button { color: rgba(255, 255, 255, .6); }
.login-card .lang-toggle button.on { background: rgba(255, 255, 255, .9); color: var(--ink-900); }

/* ---------- misc ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px); z-index: 90;
  padding: 12px 22px; border-radius: 999px; background: var(--ink-900); color: #fff;
  font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: .3s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.banner {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 16px;
  border-radius: var(--r-md); background: #fbf1de; color: #7a5313; font-size: 12px; font-weight: 600;
}
.empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #efeade, #f7f4ec, #efeade); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .cms-row { grid-template-columns: 160px 1fr 1fr; }
}
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .35s; }
  .side.open { transform: none; }
  .main { margin-left: 0; }
  .topbar { padding: 14px 18px; }
  .view { padding: 22px 18px 48px; }
  .cms-row { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn {
  display: none; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
