:root {
  --navy: #1d3677;
  --orange: #f89b12;
  --coral: #f15c24;
  --green: #1eb574;
  --cream: #fdf4ed;
  --dark: #2c2c2c;
  --text: #747577;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Kumbh Sans", sans-serif; background: var(--cream); color: var(--dark); }
a { color: var(--navy); text-decoration: none; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--login-img) center/cover no-repeat, var(--navy);
  position: relative;
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(29, 54, 119, 0.48);
}
.login-box {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--navy);
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  text-align: center;
}
.login-box img {
  height: 52px;
  margin: 0 auto 12px;
  display: block;
}
.login-box h1 {
  font-family: Poppins, sans-serif;
  color: #fff;
  font-size: 22px;
  margin-bottom: 12px;
}
.login-box label { color: #fff; text-align: left; }
.login-box .alert { text-align: left; }
.login-box input,
.login-box .pw-wrap input {
  border-color: rgba(255,255,255,.35);
  background: #fff;
}
.login-box .btn { margin-top: 4px; }
.pw-wrap { position: relative; text-align: left; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 8px; top: 8px;
  width: 36px; height: 36px; border: 0; background: transparent;
  color: var(--navy); cursor: pointer; font-size: 16px;
}
.status-pill {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--orange);
}
.status-pill.ok { background: var(--green); }
.status-form { margin: 0; }
.status-form select {
  width: auto;
  min-width: 140px;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
}

label { display: block; font-weight: 700; color: var(--navy); margin: 0 0 6px; font-size: 14px; }
input, select, textarea {
  width: 100%; padding: 12px; font-size: 16px; margin-bottom: 12px;
  border: 1px solid #d7ccc4; background: #fff; font-family: inherit;
}
textarea { min-height: 140px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--orange); color: #fff; border: 0; padding: 10px 14px;
  font-weight: 700; cursor: pointer; border-radius: 4px; font-size: 13px;
}
.btn.navy { background: var(--navy); }
.btn.red { background: var(--coral); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.sm { padding: 7px 10px; font-size: 12px; }

.cms-bar {
  background: var(--navy); color: #fff;
  position: sticky; top: 0; z-index: 40;
  border-bottom: 3px solid var(--orange);
}
.cms-top {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 4px;
}
.cms-brand {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-family: Poppins, sans-serif; font-weight: 700;
}
.cms-brand img { height: 34px; width: auto; }
.cms-menu-btn {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border: 0; border-radius: 4px;
  background: #15275a; color: #fff; font-size: 18px; cursor: pointer;
}
.cms-nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 10px 8px; }
.cms-nav a {
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 10px; border-radius: 4px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.cms-nav a i { margin-right: 2px; }
.cms-nav a.active, .cms-nav a:hover { background: var(--orange); color: #fff; }
.nav-badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--green); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1;
}
.cms-user { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: 13px; flex-shrink: 0; }
.cms-user span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-user a { color: #fff; }
.cms-user a:hover { color: var(--orange); }

.wrap { width: min(1180px, calc(100% - 24px)); margin: 0 auto; padding: 18px 0 32px; }
.wrap h1 { font-family: Poppins, sans-serif; color: var(--navy); margin: 0 0 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; padding: 14px; border-top: 4px solid var(--orange); }
.stat b { display: block; font-size: 26px; color: var(--navy); font-family: Poppins, sans-serif; }
.table-wrap { overflow-x: auto; background: #fff; box-shadow: 0 8px 24px rgba(25,14,8,.08); }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; min-width: 680px; }
th, td { padding: 10px; border-bottom: 1px solid #eadfd6; text-align: left; vertical-align: middle; }
th { background: var(--navy); color: #fff; }
.tbl-thumb { width: 72px; height: 54px; object-fit: cover; display: block; background: #33231b; }
.tbl-thumb.empty { display: inline-block; }
.crud { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.crud-del { display: inline; margin: 0; }
.alert { background: #fff; border-left: 4px solid var(--green); padding: 10px 12px; margin-bottom: 12px; }
.alert.err { border-color: var(--coral); }
.thumb { width: 96px; height: 72px; object-fit: cover; display: block; margin-bottom: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.check input { width: auto; margin: 0; }
.hint { margin: -6px 0 12px; color: #5b657a; font-size: 0.92rem; }
.file-list { display: grid; gap: 10px; margin: 0 0 14px; }
.file-item { display: grid; grid-template-columns: 88px 1fr auto; gap: 10px; align-items: center; background: #fff; padding: 8px; }
.file-item video, .file-item img { width: 88px; height: 64px; object-fit: cover; background: #000; }
.file-doc { width: 88px; height: 64px; display: grid; place-items: center; background: var(--navy); color: #fff; }

.row-new { background: rgba(30, 181, 116, 0.08); }
.dot-new {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(30,181,116,.2);
}
.msg-view {
  background: #fff; padding: 18px; box-shadow: 0 8px 24px rgba(25,14,8,.08);
  max-width: 760px;
}
.msg-view-top {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #eadfd6;
}
.msg-kicker {
  color: var(--orange); font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; font-size: 12px; margin-bottom: 4px;
}
.msg-view h1 { margin: 0 0 4px; font-size: 1.45rem; }
.msg-meta { color: #5b657a; font-size: 13px; margin: 0; }
.msg-from {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px; padding: 12px; background: var(--cream);
}
.msg-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 800; flex-shrink: 0;
}
.msg-from p { margin: 2px 0 0; color: #5b657a; font-size: 14px; }
.msg-body {
  background: #fff; border: 1px solid #eadfd6; padding: 14px;
  line-height: 1.55; margin-bottom: 16px; white-space: normal;
}
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.cms-toast {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(18, 22, 40, 0.45);
  padding: 20px;
  animation: cmsToastIn .18s ease-out;
}
.cms-toast.closing { opacity: 0; transition: opacity .18s ease; }
.cms-toast-card {
  width: min(380px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 22px 20px 18px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.2);
}
.cms-toast-icon {
  width: 52px; height: 52px; margin: 0 auto 10px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(30, 181, 116, 0.14);
  color: var(--green);
  font-size: 26px;
}
.cms-toast-card h2 {
  font-family: Poppins, sans-serif;
  color: var(--navy);
  font-size: 1.25rem;
  margin-bottom: 6px;
}
.cms-toast-card p { color: var(--text); margin-bottom: 16px; line-height: 1.45; }
.cms-toast-card .btn { min-width: 110px; }
@keyframes cmsToastIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .cms-menu-btn { display: grid; place-items: center; }
  .cms-nav { display: none; flex-direction: column; padding-bottom: 10px; }
  .cms-nav.open { display: flex; }
  .cms-user span { display: none; }
  .row { grid-template-columns: 1fr; }
}
