:root {
  --ocop-ink: #12241a;
  --ocop-gold: #d4a017;
  --ocop-gold-2: #f0d060;
  --ocop-green: #1b5e3b;
  --ocop-green-2: #0f3d28;
  --ocop-red: #c41e3a;
  --ocop-blue: #1e4d8c;
  --ocop-font: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --ocop-header-h: 110px;
  --ocop-logo-w: 130px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--ocop-font);
  color: var(--ocop-ink);
}

.ocop-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.ocop-map-body {
  background: #0c1a13;
  overflow: hidden;
}
.ocop-map-body .ocop-app { height: 100%; min-height: 0; }
.ocop-page-body { background: #f4f7f2; }

/* ===== Header ===== */
.ocop-header {
  flex: 0 0 auto;
  min-height: var(--ocop-header-h);
  display: flex;
  align-items: center;
  gap: 12px 16px;
  padding: 10px 16px 10px 12px;
  background: linear-gradient(90deg, #fbfbfb 0%, #17a34a 48%, #0f8a40 100%);
  border-bottom: 3px solid #f5d76e;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
  z-index: 1200;
  position: relative;
  box-sizing: border-box;
}
.ocop-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: min(560px, 48vw);
  text-decoration: none;
  color: #0f3d28;
  flex: 0 1 auto;
}
/* Không dùng icon trên header — chặn cache cũ phình full màn hình */
.ocop-header .ocop-icon,
.ocop-brand > img.ocop-icon {
  display: none !important;
}
.ocop-logo-plate {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: linear-gradient(180deg, #fffefb, #fff4d0);
  border: 1px solid #f0d060;
  border-radius: 8px;
  box-sizing: border-box;
}
.ocop-logo,
.ocop-header img.ocop-logo,
.ocop-logo-plate img {
  width: var(--ocop-logo-w) !important;
  max-width: var(--ocop-logo-w) !important;
  min-width: var(--ocop-logo-w) !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block !important;
}
.ocop-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  border-left: 1px solid rgba(15, 61, 40, .16);
  padding-left: 12px;
}
.ocop-brand-name {
  font-weight: 900;
  font-size: clamp(.88rem, 1.5vw, 1.18rem);
  line-height: 1.2;
  letter-spacing: .03em;
  color: #0b3d24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.ocop-brand-sub {
  font-weight: 700;
  font-size: clamp(.68rem, 1.05vw, .8rem);
  color: #9a7209;
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.ocop-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}
.ocop-kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 68px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
}
.ocop-kpi b {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ocop-gold-2);
}
.ocop-kpi span {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .8;
}

.ocop-account {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}
.ocop-map-body .ocop-account { margin-left: 0; }
.ocop-page-body .ocop-account { margin-left: auto; }

.ocop-hi {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 240px;
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  padding: .35rem .55rem;
  white-space: nowrap;
}
.ocop-hi i { color: var(--ocop-gold-2); font-size: 1.15rem; flex-shrink: 0; }
.ocop-hi span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ocop-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: inherit;
  font-weight: 800;
  font-size: .86rem;
  padding: .42rem .9rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.ocop-btn-login {
  background: var(--ocop-gold);
  color: #2a1d02 !important;
  box-shadow: 0 4px 12px rgba(212, 160, 23, .35);
}
.ocop-btn-login:hover { filter: brightness(1.08); color: #1a1200 !important; }
.ocop-btn-ghost {
  background: rgba(255, 255, 255, .1);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .18);
}
.ocop-btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.ocop-btn-logout {
  background: transparent;
  color: #fecaca !important;
  border: 1px solid rgba(248, 113, 113, .45);
}
.ocop-btn-logout:hover { background: rgba(248, 113, 113, .15); }
.ocop-logout-form { margin: 0; }

.ocop-main { flex: 1; min-height: 0; }
.ocop-main.is-map {
  position: relative;
  display: flex;
  flex-direction: column;
}
.ocop-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.ocop-admin-placeholder {
  max-width: 720px;
  margin: 40px auto;
  padding: 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 61, 40, .08);
}
.ocop-admin-placeholder h1 { margin: 0 0 8px; color: var(--ocop-green-2); }
.ocop-admin-placeholder p { color: #5c6f64; }
.ocop-page-body .ocop-btn-login { color: #2a1d02; }

/* ===== Login ===== */
.login-body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(900px 420px at 8% 0%, rgba(212, 160, 23, .18), transparent 55%),
    linear-gradient(165deg, #050505, #0c1a13 55%, #123325);
  font-family: var(--ocop-font);
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  background: #0a120e;
  border: 1px solid rgba(240, 208, 96, .28);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.login-left {
  padding: 36px 32px;
  background: linear-gradient(165deg, #0d7a38, #159a45 55%, #0c6b32);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px 8px 8px;
  background: linear-gradient(180deg, #fffefb, #fff4d0);
  border: 1.5px solid #f0d060;
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .7),
    0 6px 18px rgba(0, 0, 0, .2);
  align-self: flex-start;
}
.login-logo {
  width: 160px !important;
  max-width: 160px !important;
  height: auto !important;
  max-height: 72px !important;
  object-fit: contain !important;
  display: block !important;
}
.login-icon { display: none !important; }
.login-app-name {
  margin: 12px 0 0;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.login-app-sub {
  margin: 0;
  color: #fff4c2;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.login-lead {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: .92rem;
  line-height: 1.5;
  max-width: 36ch;
}
.login-back {
  margin-top: auto;
  color: var(--ocop-gold-2);
  font-weight: 700;
  text-decoration: none;
  font-size: .88rem;
}
.login-back:hover { color: #fff; }
.login-right {
  padding: 36px 32px;
  background: #f7f3ea;
}
.login-right h2 {
  margin: 0 0 18px;
  color: var(--ocop-green-2);
  font-weight: 900;
  font-size: 1.4rem;
}
.login-label {
  display: block;
  font-weight: 800;
  font-size: .82rem;
  color: var(--ocop-green-2);
  margin: 10px 0 6px;
}
.login-input {
  width: 100%;
  border: 1px solid #d7c9a4;
  border-radius: 12px;
  padding: .7rem .85rem;
  font: inherit;
  background: #fff;
}
.login-input:focus {
  outline: 2px solid rgba(212, 160, 23, .45);
  border-color: var(--ocop-gold);
}
.login-err { display: block; color: #b91c1c; font-size: .78rem; font-weight: 700; margin-top: 4px; }
.login-alert {
  margin: 10px 0;
  color: #b91c1c;
  font-weight: 800;
}
.login-submit {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  padding: .75rem 1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #f0d060, #d4a017);
  color: #2a1d02;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.login-submit:hover { filter: brightness(1.05); }

/* ===== Popup đổi mật khẩu ===== */
.pwd-modal-bg {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(6, 14, 10, .62);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 16px;
}
.pwd-modal-bg[hidden] { display: none !important; }
.pwd-modal {
  position: relative;
  width: min(400px, 100%);
  background: #fffdf8;
  border: 1px solid #ead9a8;
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 28px 70px rgba(0,0,0,.35);
  font-family: var(--ocop-font);
}
.pwd-modal h3 {
  margin: 0 0 4px;
  color: #0f3d28;
  font-size: 1.2rem;
  font-weight: 900;
}
.pwd-modal-sub {
  margin: 0 0 14px;
  color: #5c6f64;
  font-size: .86rem;
  font-weight: 600;
}
.pwd-modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: #eef2ee; color: #0f3d28;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.pwd-modal-close:hover { background: #e2e8e0; }
.pwd-label {
  display: block;
  margin: 10px 0 5px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #5c6f64;
}
.pwd-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7e3da;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  background: #fff;
}
.pwd-msg {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 700;
}
.pwd-msg.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pwd-msg.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pwd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.pwd-actions .ocop-btn { cursor: pointer; }
.pwd-actions .ocop-btn-login { color: #2a1d02; }
.pwd-actions .ocop-btn-ghost {
  background: #fff;
  color: #0f3d28 !important;
  border: 1px solid #d7e3da;
}
#pwdSubmit.is-busy { opacity: .7; pointer-events: none; }
body.pwd-modal-open { overflow: hidden; }

@media (max-width: 900px) {
  .login-card { grid-template-columns: 1fr; }
  .login-left { padding: 24px 22px 16px; }
  .ocop-kpis { display: none; }
  .ocop-brand-sub { display: none; }
  .ocop-hi span { max-width: 120px; }
}
@media (max-width: 640px) {
  .ocop-logo,
  .ocop-header img.ocop-logo,
  .ocop-logo-plate img {
    width: var(--ocop-logo-w) !important;
    max-width: var(--ocop-logo-w) !important;
    min-width: var(--ocop-logo-w) !important;
  }
  .ocop-logo-plate { padding: 4px 8px; border-radius: 8px; }
  .ocop-brand { max-width: none; }
  .ocop-brand-text { display: none; }
  .ocop-header { padding: 6px 10px; gap: 8px; }
  .ocop-btn-ghost { display: none; }
}
