/* Greeneration Group — dashboard admin */
:root {
  --navy: #1c4a73; --navy-900: #0f2b45; --green: #3e9a70; --green-700: #2b7a55; --mint: #e3f1e8;
  --sky: #d9e5f2; --yellow: #e7c34b; --yellow-soft: #fbf3d6; --red: #b3362a; --red-soft: #fbe6e3;
  --paper: #f7f7f4; --ink: #15212d; --muted: #5a6672; --line: #dce2e6;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1.5px solid var(--navy); background: var(--navy); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px; white-space: nowrap;
}
.btn:hover { background: var(--navy-900); border-color: var(--navy-900); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.danger { background: #fff; color: var(--red); border-color: #efc7c1; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.icon-btn { border: 1px solid var(--line); background: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; font-size: 14px; color: var(--muted); }
.icon-btn:hover { border-color: var(--navy); color: var(--navy); }
.icon-btn:disabled { opacity: .35; cursor: default; border-color: var(--line); color: var(--muted); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(800px 600px at 100% 0%, rgba(62,154,112,.35), transparent 60%), radial-gradient(500px 400px at 100% 60%, rgba(28,74,115,.3), transparent 60%), var(--paper); }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; display: grid; gap: 10px; box-shadow: 0 20px 50px -30px rgba(15,43,69,.4); }
.login-logo { height: 38px; width: auto; justify-self: start; mix-blend-mode: multiply; margin-bottom: 8px; }
.login-card h1 { margin: 0; font-size: 26px; font-weight: 900; font-stretch: 115%; font-variation-settings: "wdth" 115; color: var(--navy); text-transform: uppercase; }
.login-card p { margin: 0 0 8px; color: var(--muted); }
.login-card label { font-weight: 600; font-size: 14px; }
.login-card input { border: 1.5px solid var(--line); border-radius: 8px; padding: 11px 12px; background: var(--paper); outline: none; }
.login-card input:focus { border-color: var(--navy); background: #fff; }
.login-card .btn { margin-top: 6px; padding: 11px; }
.login-err { color: var(--red); font-size: 14px; min-height: 20px; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; }

/* layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; text-decoration: none; border-bottom: 1px solid var(--line); }
.side-brand img { height: 28px; mix-blend-mode: multiply; }
.side-brand span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--navy); color: #fff; padding: 2px 6px; border-radius: 4px; }
.side-nav { padding: 10px; display: grid; gap: 1px; }
.side-nav .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 14px 10px 4px; }
.side-nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 7px; text-decoration: none; color: var(--ink); font-size: 14px; }
.side-nav a:hover { background: var(--paper); }
.side-nav a.on { background: var(--sky); color: var(--navy); font-weight: 600; }
.side-nav .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-nav .badge { background: var(--yellow); color: var(--navy-900); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.side-foot a { text-decoration: none; }
.side-foot button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.side-foot button:hover { color: var(--red); }

.main { min-width: 0; }
.main-top { position: sticky; top: 0; z-index: 10; background: rgba(247,247,244,.95); border-bottom: 1px solid var(--line); height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.crumb { font-weight: 700; color: var(--navy); }
.save-state { margin-left: auto; font-size: 13px; color: var(--muted); }
.save-state.ok { color: var(--green-700); }
.save-state.err { color: var(--red); }
.side-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 36px; height: 36px; cursor: pointer; }
.view { padding: 28px; max-width: 1160px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 50px -30px rgba(0,0,0,.4); }
  .side.open { transform: none; }
  .side-toggle { display: inline-grid; place-items: center; }
  .main-top { padding: 0 16px; }
  .view { padding: 18px 16px; }
}

/* headings */
.vh { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.vh h1 { margin: 0; font-size: 26px; color: var(--navy); font-weight: 800; }
.vh p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; }

/* overview */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 24px; }
.stat { padding: 16px; text-decoration: none; color: inherit; display: grid; gap: 2px; transition: border-color .15s; }
.stat:hover { border-color: var(--navy); }
.stat b { font-size: 30px; font-weight: 900; color: var(--navy); line-height: 1.1; font-stretch: 110%; font-variation-settings: "wdth" 110; }
.stat span { color: var(--muted); font-size: 14px; }
.stat.hl { background: var(--yellow-soft); border-color: #eedc9b; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.card-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h2 { margin: 0; font-size: 16px; color: var(--navy); }
.card-b { padding: 6px 18px 14px; }
.mini-msg { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.mini-msg:last-child { border-bottom: 0; }
.mini-msg b { font-weight: 600; }
.mini-msg .s { grid-column: 1 / -1; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-msg time { font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check:last-child { border-bottom: 0; }
.check .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--green); }
.check.warn .dot { background: var(--yellow); }
.empty { color: var(--muted); padding: 18px 0; }

/* collection table */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid var(--line); }
.toolbar input[type=search] { flex: 1; min-width: 200px; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--paper); outline: none; }
.toolbar input[type=search]:focus { border-color: var(--navy); background: #fff; }
.toolbar select { border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fafbf9; }
.row .thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--paper); overflow: hidden; display: grid; place-items: center; color: var(--navy); font-weight: 800; font-size: 14px; border: 1px solid var(--line); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .thumb.round { border-radius: 50%; }
.row .tt { min-width: 0; cursor: pointer; }
.row .tt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tt span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tags { display: flex; gap: 6px; }
.row .acts { display: flex; gap: 4px; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 5px; white-space: nowrap; background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.pill.foundation { background: var(--mint); color: var(--green-700); border-color: transparent; }
.pill.ecoxyztem { background: var(--sky); color: var(--navy); border-color: transparent; }
.pill.off { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill.new { background: var(--yellow); color: var(--navy-900); border-color: transparent; }
.foot-note { font-size: 13px; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .row { grid-template-columns: 40px 1fr; } .row .tags { display: none; } .row .acts { grid-column: 1 / -1; justify-content: flex-end; } }

/* forms */
.form-card { padding: 22px; display: grid; gap: 16px; }
.f { display: grid; gap: 6px; }
.f > label, .f > .lbl { font-weight: 600; font-size: 14px; }
.f .help { font-size: 13px; color: var(--muted); margin-top: -2px; }
.f input[type=text], .f input[type=password], .f input[type=url], .f select, .f textarea, .sub input, .sub textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; outline: none;
}
.f input:focus, .f select:focus, .f textarea:focus, .sub input:focus, .sub textarea:focus { border-color: var(--navy); }
.f textarea { min-height: 96px; resize: vertical; }
.f textarea.short { min-height: 70px; }
.f.invalid input, .f.invalid textarea { border-color: var(--red); }
.f .err { color: var(--red); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { width: 38px; height: 22px; appearance: none; -webkit-appearance: none; background: #cfd6dc; border-radius: 99px; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(16px); }
.sub { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; background: var(--paper); }
.sub-row { display: grid; gap: 8px; align-items: start; }
.sub-row .icon-btn { margin-top: 3px; }
.sub-add { justify-self: start; }
.img-field { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.img-prev { width: 84px; height: 84px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.img-ctl { display: grid; gap: 6px; }
.img-ctl .btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* panel */
.panel-backdrop { position: fixed; inset: 0; background: rgba(15,43,69,.4); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.panel-backdrop.open { opacity: 1; pointer-events: auto; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--paper); z-index: 70; transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.7,.2,1); box-shadow: -20px 0 60px -30px rgba(0,0,0,.4); }
.panel.open { transform: none; }
.panel form { height: 100%; display: flex; flex-direction: column; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.panel-head h2 { margin: 0; font-size: 18px; color: var(--navy); }
.panel-body { flex: 1; overflow-y: auto; padding: 22px; display: grid; gap: 16px; align-content: start; }
.panel-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: #fff; }

/* messages */
.msg-list { display: grid; }
.msg { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.msg:last-child { border-bottom: 0; }
.msg.unread { background: #fffdf4; box-shadow: inset 3px 0 0 var(--yellow); }
.msg-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.msg-h b { font-size: 16px; }
.msg-h .who { color: var(--muted); font-size: 14px; }
.msg-h time { font-size: 13px; color: var(--muted); }
.msg-t { display: flex; gap: 6px; flex-wrap: wrap; }
.msg p { margin: 2px 0 4px; white-space: pre-wrap; }
.msg-a { display: flex; gap: 6px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--yellow-soft); border: 1px solid #eedc9b; font-size: 14px; margin-bottom: 16px; }

/* v2: kolom bahasa Inggris, logo, status */
.f.en { border-left: 3px solid var(--sky); padding-left: 12px; margin-top: -6px; }
.f.en > label::before { content: "EN"; display: inline-block; font-size: 11px; font-weight: 700; color: var(--navy); background: var(--sky); border-radius: 4px; padding: 1px 5px; margin-right: 6px; vertical-align: 1px; }
.row .thumb.contain { background: #fff; }
.row .thumb.contain img { object-fit: contain; padding: 3px; }
.pill.ok { background: var(--mint); color: var(--green-700); border-color: transparent; }
.pill.warn { background: #fbf3d6; color: #8a6a12; border-color: transparent; }
.sub-row input { min-width: 0; }
