/* Floures Admin: the homepage's Bạch Kim palette, fonts and chamfered shapes */
:root {
  --paper: #f1f2f3;
  --paper-deep: #e6e8ea;
  --line: #d3d6da;
  --ink: #15171b;
  --ink-800: #1d2025;
  --ink-700: #2a2e35;
  --ink-500: #50555e;
  --ink-400: #6c717a;
  --silver: #c3c8cf;
  --steel: #6f7783;
  --steel-dark: #545b66;
  --gold: #977640;
  --gold-dark: #7d6234;
  --champagne: #dcc592;
  --ok: #3f7d5a;
  --display: 'Geologica', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

.chamfer { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.eyebrow { margin: 0; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.22em; color: var(--ink-400); }

/* Layout */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 40px; padding: 28px 22px; background: var(--ink); color: #fff; }
.side .eyebrow { color: rgb(255 255 255 / 0.45); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { width: 36px; height: 36px; }
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand b { font: 600 19px var(--display); letter-spacing: -0.01em; }
.brand small { margin-top: 5px; font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: 0.3em; color: var(--champagne); }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav .eyebrow { margin-bottom: 10px; }
.navlink { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-decoration: none; font-weight: 500; color: rgb(255 255 255 / 0.7); border: 1px solid transparent; }
.navlink.active { color: #fff; background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.1); }
.navlink .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--steel); }
.navlink.active .dot { background: var(--champagne); }
.who { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.email { margin: 0; font-size: 13px; color: rgb(255 255 255 / 0.85); word-break: break-all; }
.logout { padding: 0; border: 0; background: none; text-align: left; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--silver); text-decoration: none; }
.logout:hover { color: #fff; }

.main { padding: 48px clamp(20px, 4vw, 56px) 80px; display: flex; flex-direction: column; gap: 36px; max-width: 1280px; }
.title { margin: 10px 0 0; font: 600 clamp(40px, 6vw, 64px)/0.95 var(--display); text-transform: uppercase; letter-spacing: -0.02em; }
.lead { margin: 14px 0 0; max-width: 620px; color: var(--ink-500); }
.h2 { margin: 0 0 16px; font: 600 15px var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.hint { margin: -8px 0 0; font-size: 13px; color: var(--ink-400); }

/* Current theme */
.status { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 20px 24px; background: #fff; border: 1px solid var(--line); }
.status-name { margin: 8px 0 0; font: 600 24px var(--display); }
.status-meta { margin: 0; font: 500 12px var(--mono); color: var(--ink-400); }

/* Theme cards */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.theme { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; background: #fff; border: 1px solid var(--line); color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.theme:hover { border-color: var(--steel); transform: translateY(-2px); }
.theme[aria-pressed='true'] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.theme .sw { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; height: 92px; }
.theme .sw i { display: block; }
.theme .sw .glow { grid-column: 1 / -1; height: 6px; }
.theme .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.theme .name { font: 600 18px var(--display); }
.theme .tag { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-400); }
.theme .desc { font-size: 13px; color: var(--ink-500); }
.badge { position: absolute; top: 10px; right: 10px; padding: 3px 8px; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: 0.14em; background: var(--ink); color: var(--champagne); }

/* Preview */
.preview-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border: 0; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.16em; text-decoration: none; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
.btn.cta { color: #fff; background: linear-gradient(90deg, var(--steel), var(--gold)); }
.btn.cta:hover:not(:disabled) { background: linear-gradient(90deg, var(--steel-dark), var(--gold-dark)); }
.btn.cta:disabled { cursor: default; background: var(--paper-deep); color: var(--ink-400); }
.btn.ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.frame { position: relative; overflow: hidden; background: var(--ink); border: 1px solid var(--line); }
.frame iframe { position: absolute; top: 0; left: 0; width: 1440px; height: 900px; border: 0; transform-origin: 0 0; }

/* History */
.history { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.history li { display: grid; grid-template-columns: 180px 1fr auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.history time, .history .by { font: 500 12px var(--mono); color: var(--ink-400); }
.history .empty { display: block; color: var(--ink-400); }

.toast { position: fixed; right: 24px; bottom: 24px; margin: 0; max-width: 360px; padding: 14px 18px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.25); }
.toast.err { background: #7a2d2d; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 16px 20px; }
  .nav { flex-direction: row; align-items: center; }
  .nav .eyebrow { display: none; }
  .who { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 12px; }
  .who .eyebrow, .email { display: none; }
  .main { padding-top: 32px; }
  .history li { grid-template-columns: 1fr; gap: 2px; }
}

/* Sign-in and set-password pages */
.auth { background: var(--paper); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 56px; background: var(--ink); color: #fff; }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(to right, rgb(255 255 255 / 0.05) 1px, transparent 1px), linear-gradient(to bottom, rgb(255 255 255 / 0.05) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 40% 45%, black, transparent 75%); }
.auth-glow { position: absolute; left: -20%; top: 10%; width: 36rem; height: 36rem; border-radius: 50%; background: rgb(111 119 131 / 0.35); filter: blur(120px); }
.auth-glow::after { content: ''; position: absolute; right: -60%; bottom: -40%; width: 28rem; height: 28rem; border-radius: 50%; background: rgb(151 118 64 / 0.28); filter: blur(120px); }
.auth-mark { position: relative; width: min(46vh, 340px); height: auto; margin: auto; filter: drop-shadow(0 30px 60px rgb(0 0 0 / 0.45)); }
.auth-copy { position: relative; display: flex; flex-direction: column; gap: 14px; }
.auth-copy .eyebrow { color: rgb(255 255 255 / 0.5); }
.auth-tagline { margin: 0; font: 600 clamp(30px, 3.4vw, 46px)/1.02 var(--display); letter-spacing: -0.02em; }
.shine { background: linear-gradient(90deg, var(--silver), #f4f5f7, var(--champagne)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.auth-panel { display: flex; flex-direction: column; justify-content: center; gap: 32px; padding: 48px clamp(24px, 6vw, 88px); }
.brand.dark { color: var(--ink); }
.brand.dark small { color: var(--ink-400); }
.auth-form { display: flex; flex-direction: column; gap: 18px; max-width: 420px; padding: 36px 32px; background: #fff; border: 1px solid var(--line); }
.auth-step { display: flex; flex-direction: column; gap: 18px; }
.auth-step[hidden] { display: none; }
.auth-step.busy { opacity: 0.7; }
.auth-form input.otp { font: 600 28px var(--mono); letter-spacing: 0.5em; text-align: center; padding: 14px 10px 14px calc(10px + 0.5em); }
.auth-actions { display: flex; justify-content: center; gap: 10px; margin: 0; color: var(--ink-400); }
.linkbtn { padding: 0; border: 0; background: none; font: 500 12px var(--mono); letter-spacing: 0.06em; color: var(--ink-500); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:disabled { color: var(--ink-400); text-decoration: none; cursor: default; }
.auth-title { margin: 4px 0 4px; font: 600 40px/0.95 var(--display); text-transform: uppercase; letter-spacing: -0.02em; }
.auth-lead { margin: -4px 0 0; color: var(--ink-500); font-size: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 8px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-500); }
.auth-form input { padding: 13px 14px; font: 15px var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); outline: none; transition: border-color .15s, background .15s; }
.auth-form input:focus { background: #fff; border-color: var(--steel); box-shadow: 0 0 0 3px rgb(111 119 131 / 0.15); }
.auth-error { margin: 0; min-height: 1.2em; font-size: 14px; color: #9b3434; }
.btn.wide { width: 100%; padding: 16px 20px; }
.auth-foot { margin: 0; font: 500 11px var(--mono); letter-spacing: 0.12em; color: var(--ink-400); }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { min-height: 220px; padding: 28px 24px; flex-direction: row; align-items: flex-end; }
  .auth-mark { position: absolute; right: 16px; top: 16px; width: 130px; margin: 0; }
  .auth-panel { padding: 32px 20px 48px; }
  .auth-panel > .brand { display: none; }
}

/* Shared */
[hidden] { display: none !important; }
code { font: 500 0.9em var(--mono); background: var(--paper-deep); padding: 1px 5px; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.empty { margin: 0; color: var(--ink-400); }
.chip { display: inline-block; padding: 4px 10px; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: 0.14em; background: var(--paper-deep); color: var(--ink-500); }
.chip.published { background: var(--ink); color: var(--champagne); }
.backlink { display: inline-block; margin-bottom: 12px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-400); text-decoration: none; }
.backlink:hover { color: var(--ink); }
.linkbtn.danger { color: #9b3434; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Blog list */
.post-list { border-top: 1px solid var(--line); }
.post-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 120px 200px; gap: 16px; align-items: center; padding: 16px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .15s; }
.post-row:hover { background: #fff; }
.post-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.post-title { font: 600 16px var(--display); }
.post-slug, .post-date, .post-updated { font: 500 12px var(--mono); color: var(--ink-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history a.what { color: var(--ink); text-decoration: none; }
.history a.what:hover { text-decoration: underline; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.ed-main, .ed-side { display: flex; flex-direction: column; gap: 18px; }
.ed-side { position: sticky; top: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-500); }
.field input, .field textarea, .panel > input { width: 100%; padding: 12px 14px; font: 15px/1.55 var(--sans); text-transform: none; letter-spacing: normal; color: var(--ink); background: #fff; border: 1px solid var(--line); outline: none; resize: vertical; }
.field input:focus, .field textarea:focus, .panel > input:focus { border-color: var(--steel); box-shadow: 0 0 0 3px rgb(111 119 131 / 0.15); }
.field.invalid input, .field.invalid textarea { border-color: #9b3434; box-shadow: 0 0 0 3px rgb(155 52 52 / 0.12); }
.ed-title { font: 600 26px/1.2 var(--display) !important; }
.slug { display: flex; align-items: stretch; border: 1px solid var(--line); background: #fff; }
.slug span { display: flex; align-items: center; padding: 0 2px 0 14px; font: 500 13px var(--mono); text-transform: none; letter-spacing: 0; color: var(--ink-400); white-space: nowrap; }
.slug input { border: 0 !important; box-shadow: none !important; padding-left: 0 !important; font: 500 13px var(--mono) !important; }
.slug:focus-within { border-color: var(--steel); box-shadow: 0 0 0 3px rgb(111 119 131 / 0.15); }
.ed-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; border: 0; background: none; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-400); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--ink); }
.ed-tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px; }
.ed-tools.off { visibility: hidden; }
.ed-tools button { min-width: 34px; padding: 6px 8px; border: 1px solid transparent; background: none; font: 500 12px var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink-500); }
.ed-tools button:hover { border-color: var(--line); background: #fff; color: var(--ink); }
.ed-body { min-height: 520px; font: 14px/1.7 var(--mono) !important; tab-size: 2; }
.ed-side .panel { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: #fff; border: 1px solid var(--line); }
.ed-side .hint { margin: 0; text-transform: none; letter-spacing: 0; }
.cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); background: var(--paper-deep); }

/* Preview: close to the article typography on floures.tech */
.article { min-height: 520px; padding: 28px 32px; background: #fff; border: 1px solid var(--line); font: 17px/1.75 var(--sans); color: rgb(21 23 27 / 0.82); text-transform: none; letter-spacing: normal; }
.article h1, .article h2, .article h3, .article h4 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); line-height: 1.2; margin: 1.6em 0 0.6em; }
.article h1 { font-size: 2em; } .article h2 { font-size: 1.5em; } .article h3 { font-size: 1.25em; }
.article > article > :first-child, .article > :first-child { margin-top: 0; }
.article a { color: var(--steel-dark); }
.article img { max-width: 100%; border-radius: 12px; }
.article pre { padding: 16px 18px; overflow: auto; background: var(--ink); color: rgb(255 255 255 / 0.9); font: 13px/1.6 var(--mono); }
.article code { background: var(--paper-deep); }
.article pre code { background: none; padding: 0; }
.article blockquote { margin: 1.4em 0; padding-left: 1em; border-left: 3px solid var(--line); color: var(--ink-500); font-style: italic; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.article table { border-collapse: collapse; } .article th, .article td { border: 1px solid var(--line); padding: 6px 10px; }
.article .warn { padding: 10px 14px; background: #fdf3e6; color: #7d4e14; font-size: 14px; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .ed-side { position: static; }
  .post-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .post-date, .post-updated { display: none; }
}
