:root{
  --bg:#faf7f2;
  --card:#ffffff;
  --text:#121212;
  --muted:#6c6c6c;
  --border:#e8e2d9;
  --accent:#c7b39a;
  --accent-2:#a88f73;
  --danger:#b84b4b;
  --ok:#2f7d4a;

  --r:14px;
  --r2:18px;

  --s8:8px; --s12:12px; --s16:16px; --s24:24px; --s32:32px; --s48:48px;

  --shadow: 0 10px 26px rgba(17,17,17,.06);
  --shadow2: 0 18px 38px rgba(17,17,17,.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:none; }

.hidden{ display:none !important; }
.muted{ color:var(--muted); }

.app{ min-height:100%; display:flex; flex-direction:column; }

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background: rgba(250,247,242,.72);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(232,226,217,.75);
}

.topbar__inner{
  max-width:1100px;
  margin:0 auto;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand{ display:flex; align-items:center; gap:12px; }
.brand__logo{ width:34px; height:34px; border-radius:12px; }
.brand__name{ font-weight:700; letter-spacing:-.02em; }
.brand__sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.topbar__right{ display:flex; align-items:center; gap:12px; }

.main{
  flex:1;
  padding: 24px 16px 48px;
}

.view{
  max-width:1100px;
  margin:0 auto;
}

.footer{
  border-top:1px solid rgba(232,226,217,.75);
  padding: 18px 16px;
}
.footer__inner{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:12px;
}

/* Cards + layout */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
@media(min-width:860px){
  .grid{ grid-template-columns: 1fr 1fr; gap:16px; }
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--r2);
  padding: 16px;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover{
  transform: translateY(-1px);
  border-color: rgba(199,179,154,.65);
  box-shadow: var(--shadow);
}
.card__title{
  font-weight:650;
  letter-spacing:-.015em;
  margin:0 0 6px 0;
}
.card__meta{
  display:flex; flex-wrap:wrap;
  gap:8px 10px;
  color:var(--muted);
  font-size:12px;
  margin-bottom:10px;
}
.card__excerpt{
  color:#2a2a2a;
  line-height:1.55;
  font-size:14px;
}
.tags{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.tag{
  font-size:12px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  color:#2b2b2b;
  background: rgba(250,247,242,.6);
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: #fff;
}
.badge--pending{ border-color: rgba(199,179,154,.65); }
.badge--approved{ border-color: rgba(47,125,74,.35); }
.badge--rejected{ border-color: rgba(184,75,75,.35); }
.badge--archived{ border-color: rgba(108,108,108,.35); }

.h{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom: 16px;
}
.h__title{ font-size:22px; letter-spacing:-.02em; margin:0; }
.h__sub{ color:var(--muted); font-size:13px; margin-top:6px; }

.controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.input, .select, .textarea{
  width:100%;
  border:1px solid var(--border);
  background:#fff;
  border-radius: 12px;
  padding: 11px 12px;
  outline:none;
  font-size:14px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(167,143,115,.7);
  box-shadow: 0 0 0 4px rgba(199,179,154,.18);
}
.textarea{ min-height: 240px; resize: vertical; line-height:1.55; }
.row{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}
@media(min-width:860px){
  .row{ grid-template-columns: 1.2fr .8fr; }
}

.btn{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight:600;
  font-size:14px;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(199,179,154,.75);
  box-shadow: 0 10px 22px rgba(17,17,17,.06);
}
.btn:active{ transform: translateY(0px); box-shadow:none; }

.btn--primary{
  background: rgba(199,179,154,.25);
  border-color: rgba(199,179,154,.65);
}
.btn--ghost{
  background: transparent;
}
.btn--danger{
  border-color: rgba(184,75,75,.35);
  background: rgba(184,75,75,.08);
}

.iconbtn{
  border:1px solid var(--border);
  background:#fff;
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
}

.userbox{ position:relative; }
.userbox__btn{
  display:flex; align-items:center; gap:10px;
  border:1px solid var(--border);
  background:#fff;
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  cursor:pointer;
}
.avatar{
  width:30px; height:30px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(199,179,154,.18);
  object-fit:cover;
}
.userbox__name{ font-weight:650; font-size:13px; }
.chev{ color:var(--muted); font-size:12px; margin-left:2px; }

.menu{
  position:absolute;
  right:0;
  top:44px;
  width: 190px;
  background:#fff;
  border:1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow2);
  padding: 8px;
}
.menu__item{
  display:block;
  width:100%;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--text);
  font-weight:600;
  font-size:13px;
}
.menu__item:hover{ background: rgba(199,179,154,.16); }
.menu__sep{ height:1px; background:var(--border); margin: 8px 0; }
.menu__item--btn{
  text-align:left;
  border:none;
  background:transparent;
  cursor:pointer;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow2);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.modal{
  position:fixed;
  inset:0;
  z-index:100;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
}
.modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(17,17,17,.38);
}
.modal__card{
  position:relative;
  width: min(720px, 100%);
  background:#fff;
  border:1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow2);
  overflow:hidden;
}
.modal__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 14px;
  border-bottom:1px solid var(--border);
}
.modal__title{ font-weight:700; letter-spacing:-.015em; }
.modal__body{ padding: 14px; }
.modal__actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding: 14px;
  border-top:1px solid var(--border);
}

.split{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media(min-width:980px){
  .split{ grid-template-columns: 1fr 1fr; gap: 16px; }
}

.preview{
  border:1px solid var(--border);
  border-radius: 14px;
  background: rgba(250,247,242,.45);
  padding: 14px;
  min-height: 240px;
  overflow:auto;
}
.preview h1,.preview h2,.preview h3{ letter-spacing:-.02em; }
.preview p{ line-height:1.7; }
.preview code{ background: rgba(199,179,154,.22); padding: 2px 6px; border-radius: 8px; }
.preview pre{ background: rgba(17,17,17,.04); padding: 12px; border-radius: 12px; overflow:auto; }
.preview a{ text-decoration: underline; text-decoration-color: rgba(199,179,154,.9); }

.table{
  width:100%;
  border-collapse:collapse;
  border:1px solid var(--border);
  border-radius: 14px;
  overflow:hidden;
}
.table th, .table td{
  text-align:left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table th{ background: rgba(250,247,242,.65); color:#2a2a2a; }
.table tr:hover td{ background: rgba(199,179,154,.10); }

.kbd{
  font-size:12px;
  padding: 3px 8px;
  border:1px solid var(--border);
  border-radius: 8px;
  background:#fff;
  color:var(--muted);
}
