@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://sanpaolovietnam.org/assets/fonts/dm-sans-normal-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("https://sanpaolovietnam.org/assets/fonts/playfair-display-normal-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("https://sanpaolovietnam.org/assets/fonts/playfair-display-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #241c18;
  --muted: #6f645c;
  --line: #e3d9ce;
  --paper: #f4f0e8;
  --panel: #fbf8f3;
  --rail: #1c1614;
  --rail-soft: #2a221f;
  --cream: #f3e7df;
  --red: #892f23;
  --red-deep: #6e241b;
  --ok: #1f6b45;
  --ok-soft: #e5f2ea;
  --wait: #8a5a12;
  --wait-soft: #f8efd8;
  --draft: #5c534c;
  --draft-soft: #ece7e1;
  --shadow: 0 18px 40px rgba(36, 28, 24, 0.06);
  --sans: "DM Sans", "Segoe UI", sans-serif;
  --display: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 42vw) 1fr;
}
.login-side {
  background:
    radial-gradient(1200px 400px at -10% -10%, rgba(137, 47, 35, 0.45), transparent 50%),
    var(--rail);
  color: #f6efe8;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.brand-lockup {
  display: flex;
  gap: 14px;
  align-items: center;
}
.brand-lockup img { width: 54px; height: auto; }
.brand-lockup b { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; }
.brand-lockup span { color: #d9c7bc; font-size: 13px; }
.login-side h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 0.95;
  margin: 0 0 16px;
}
.login-side p { margin: 0; max-width: 36ch; color: #eadfd6; }
.login-note { font-size: 13px; color: #cbb8ad; }
.login-main { padding: 48px 8vw; display: flex; flex-direction: column; justify-content: center; }
.login-main h2 { font-family: var(--display); font-weight: 500; font-size: 32px; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 22px; max-width: 52ch; }
.account-list { display: grid; gap: 10px; max-width: 560px; }
.account {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.account:hover { border-color: #c9b5a8; }
.account strong { font-size: 16px; }
.account small { color: var(--muted); }
.account em { font-style: normal; color: var(--red); font-size: 13px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.rail {
  background: var(--rail);
  color: #f4ebe4;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail-brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 18px; }
.rail-brand img { width: 36px; height: auto; }
.rail-brand b { display: block; font-family: var(--display); font-size: 18px; font-weight: 600; }
.rail-brand span { color: #cbb8ad; font-size: 12px; }
.rail nav { display: grid; gap: 4px; }
.rail button.nav {
  text-align: left;
  background: transparent;
  color: #f4ebe4;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
}
.rail button.nav[aria-current="page"] { background: var(--rail-soft); box-shadow: inset 3px 0 0 var(--red); }
.rail button.nav:hover { background: rgba(255, 255, 255, 0.04); }
.rail-foot { margin-top: auto; padding: 12px 8px 0; display: grid; gap: 8px; }
.who small { display: block; color: #cbb8ad; }
.ghost, .primary, .quiet, .danger {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 8px 14px;
}
.ghost { background: transparent; color: #f4ebe4; border-color: #5c4b44; }
.primary { background: var(--red); color: white; }
.primary:hover { background: var(--red-deep); }
.quiet { background: transparent; border-color: var(--line); }
.danger { background: transparent; color: var(--red); border-color: #e7c9c3; }
button:disabled, .primary:disabled { opacity: 0.45; cursor: not-allowed; }

.workspace { min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 28px 0;
}
.crumb { color: var(--muted); font-size: 13px; margin: 0; }
.topbar h1 { font-family: var(--display); font-weight: 500; font-size: 34px; margin: 0; line-height: 1.05; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.menu-toggle { display: none; }

.canvas { padding: 18px 28px 48px; display: grid; gap: 16px; }
.banner {
  background: var(--cream);
  border-radius: 14px;
  padding: 12px 14px;
  color: #5c4036;
  font-size: 14px;
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat, .card, .editor, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.stat { padding: 16px; }
.stat b { display: block; font-family: var(--display); font-size: 32px; font-weight: 500; line-height: 1; }
.stat span { color: var(--muted); font-size: 13px; }
.card { padding: 16px 18px; }
.card h2, .editor h2 { font-size: 16px; margin: 0 0 12px; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 12px; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.activity li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.activity time, .muted { color: var(--muted); font-size: 13px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.row-link { background: none; border: 0; padding: 0; text-align: left; }
.row-link strong { display: block; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: var(--draft-soft);
  color: var(--draft);
}
.pill.xuat-ban { background: var(--ok-soft); color: var(--ok); }
.pill.cho-duyet { background: var(--wait-soft); color: var(--wait); }
.tools { display: flex; gap: 6px; }

.editor { padding: 18px; display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 180px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.lock-note { margin: 0; color: var(--wait); }

.menu-row, .slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.menu-row:last-child, .slot:last-child { border-bottom: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: white;
  color: var(--ink);
}
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.asset {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.asset .frame {
  aspect-ratio: 4 / 3;
  background: #ebe4da center/cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.asset .frame img, .asset .frame audio { width: 100%; height: 100%; object-fit: cover; }
.asset figcaption { padding: 10px 12px 12px; display: grid; gap: 2px; }
.asset strong { font-size: 14px; }
.roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.role-card { padding: 16px; }
.role-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .stats, .split, .roles, .login { grid-template-columns: 1fr; }
  .login-side { min-height: auto; }
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed;
    z-index: 5;
    transform: translateX(-105%);
    width: min(280px, 86vw);
    transition: transform 0.2s ease;
  }
  .rail.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .topbar, .canvas { padding-left: 16px; padding-right: 16px; }
  .form-grid { grid-template-columns: 1fr; }
}
