/* ======================================================== */
:root {
  --brand:      #c9a227;
  --on-brand:   #1c1503;
  
  --bg:         #f8fafc;
  --surface:    #ffffff;
  --surface2:   #f1f5f9;
  --line:       #e2e8f0;
  --ink:        #0f172a;
  --muted:      #64748b;
  
  --primary:    var(--brand);
  --primary-fg: var(--on-brand);
  --ptext:      color-mix(in srgb, var(--brand) 70%, #000);
  --warn:       #b45309;
  --danger:     #ef4444;
  --shadow:     0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.dark {
  --bg:       #121212;
  --surface:  #1b1b1b;
  --surface2: #252525;
  --line:     #303030;
  --ink:      #ececec;
  --muted:    #9b9b9b;
  --ptext:    color-mix(in srgb, var(--brand) 78%, #fff);
  --warn:     #f59e0b;
  --danger:   #ef7a68;
  --shadow:   0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px -14px rgba(0, 0, 0, .7);
}

html      { color-scheme: light; }
html.dark { color-scheme: dark; }

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Figtree, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main#app { flex: 1; display: flex; flex-direction: column; }

body:has(> main#app > .spin) > header.top,
body:has(> main#app > .spin) > footer.foot { display: none !important; }

h1, h2, h3 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  letter-spacing: -.02em;
  margin: 0;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1rem; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ==========================================================================
   3. UTILITIES & ANIMATIONS
   ========================================================================== */
.hidden { display: none !important; }
.muted  { color: var(--muted); }
.small  { font-size: .8rem; }
.grow   { flex: 1; }

.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 2rem 1rem; width: 100%; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-view {
  animation: fadeSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes spin-btn { to { transform: rotate(360deg); } }
.spin-small {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%; border-top-color: #fff;
  animation: spin-btn 0.8s linear infinite;
  margin-right: 6px; vertical-align: middle;
}

/* ==========================================================================
   4. COMPONENTS — CARD, BUTTONS, FORMS, BADGES
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1.25rem; box-shadow: var(--shadow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: .6rem 1rem; border-radius: .9rem; font: inherit; font-weight: 500;
  font-size: .875rem; cursor: pointer; text-decoration: none; transition: all .2s ease;
}
.btn:hover    { background: var(--surface2); transform: translateY(-1px); }
.btn:active   { transform: scale(0.96) translateY(0); }
.btn:disabled { opacity: .7; pointer-events: none; }

.btn-primary { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.btn-primary:hover { background: var(--primary); filter: brightness(1.1); }

.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: var(--danger); filter: brightness(1.1); }

.btn-sm    { padding: .4rem .7rem; font-size: .8rem; }
.btn-ghost { border-color: transparent; background: none; }

/* Tombol aksi di tabel admin (jarak antar tombol + panah naik/turun yang jelas) */
.act-wrap { display: inline-flex; align-items: center; gap: .6rem; }
.act-move { display: inline-flex; gap: .4rem; margin-right: .5rem; padding-right: 1rem; border-right: 1px solid var(--line); }
.btn-move { width: 2.25rem; height: 2.25rem; padding: 0; border-radius: .7rem; background: var(--surface2); color: var(--ink); }
.btn-move:disabled { opacity: .3; }

input, select, textarea {
  width: 100%; font: inherit; font-size: .875rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: .9rem; padding: .6rem .85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { 
  border-color: var(--primary); outline: none; 
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
input[type=checkbox] { width: auto; }
textarea { resize: vertical; min-height: 4.5rem; }

.pass-wrap { position: relative; display: flex; align-items: center; }
.pass-wrap input { padding-right: 2.5rem; }
.pass-toggle {
  position: absolute; right: 0.5rem; background: none; border: none;
  color: var(--muted); cursor: pointer; padding: 0.4rem;
  display: flex; align-items: center; justify-content: center; transition: color 0.15s;
}
.pass-toggle:hover { color: var(--ink); }
.pass-toggle svg { pointer-events: none; display: block; }
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }

label.f, .f { display: block; margin-bottom: 1.5rem; }
label.f > span, .f > span {
  display: block; font-size: .85rem; font-weight: 600;
  margin-bottom: .5rem; color: var(--ink);
}
label.f small, .f small { display: block; color: var(--muted); margin-top: .4rem; }
.err { color: var(--danger); font-size: .8rem; margin-top: .4rem; }

.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .1rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 600;
  background: var(--surface2); color: var(--muted);
}
.badge.green { background: color-mix(in srgb, var(--primary) 20%, transparent); color: var(--ptext); }
.badge.gold  { background: color-mix(in srgb, var(--warn)    16%, transparent); color: var(--warn); }
.badge.red   { background: color-mix(in srgb, var(--danger)  14%, transparent); color: var(--danger); }
.badge.blue  { background: color-mix(in srgb, #0ea5e9        16%, transparent); color: #0284c7; }

/* ==========================================================================
   5. HEADER & FOOTER
   ========================================================================== */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1120px; margin: 0 auto; padding: .65rem 1rem; display: flex; align-items: center; gap: .75rem; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; min-width: 0; }
.brand b { font: 700 .95rem "Bricolage Grotesque", sans-serif; text-transform: uppercase; letter-spacing: .02em; line-height: 1.15; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { color: var(--muted); font-size: .72rem; }

.logo { width: 40px; height: 40px; border-radius: .8rem; object-fit: contain; flex: none; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); background: var(--surface2); font-size: 1.2rem; }
img.logo { border: 0; background: none; }

nav.menu { margin-left: auto; display: flex; gap: .15rem; }
nav.menu a { padding: .5rem .8rem; border-radius: .6rem; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .875rem; transition: all 0.2s; }
nav.menu a:hover { color: var(--ink); background: var(--surface2); }
nav.menu a.on { background: var(--surface2); color: var(--ptext); }

.iconbtn { border: 0; background: none; color: var(--muted); padding: .5rem .6rem; border-radius: .7rem; cursor: pointer; font-size: 1.05rem; transition: all 0.2s; }
.iconbtn:hover { background: var(--surface2); color: var(--ink); }
.iconbtn:active { transform: scale(0.9); }

.loginbtn { letter-spacing: .06em; font-weight: 700; padding: .5rem 1.1rem; }
#burger { display: none; }

footer.foot { margin-top: 4rem; border-top: 1px solid var(--line); background: var(--surface); flex-shrink: 0; }
footer.foot .in { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; }

/* ==========================================================================
   6. HERO & STATS
   ========================================================================== */
.hero { padding: clamp(2rem, 5vw, 3.5rem) 0 1rem 0; background: transparent; color: var(--ink); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.5rem); line-height: 1.1; letter-spacing: -.03em; max-width: 46rem; }
.hero p { color: var(--muted); max-width: 36rem; font-size: 1.1rem; margin: 1rem 0 0; }

.hero form { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: .4rem; max-width: 42rem; margin-top: 2rem; box-shadow: var(--shadow); }
.hero form input { border: 0; background: transparent; color: var(--ink); padding: .8rem 1rem; font-size: 1rem; }
.hero form input:focus { outline: none; box-shadow: none; }
.hero form button { border: 0; border-radius: .7rem; background: var(--primary); color: var(--primary-fg); padding: 0 1.5rem; height: 2.8rem; font: 600 .9rem inherit; cursor: pointer; transition: .15s; }
.hero form button:hover { filter: brightness(1.1); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: var(--line);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--ptext);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.stat-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
}

.stat-content dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
  white-space: nowrap;
}

.stat-content dd {
  margin: 0;
  font: 700 1.5rem "Bricolage Grotesque", sans-serif;
  line-height: 1.1;
  color: var(--ink);
}

.stat-content .stat-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.title-truncate {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  font-size: 1.1rem;
  line-height: 1.2;
  color: var(--ink);
  font-weight: 700;
  margin-top: 0.2rem;
}

/* ==========================================================================
   7. SECTION HEADER & LINK CARDS
   ========================================================================== */
.sec { margin-top: 2.6rem; }

.sec .head { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-end; 
  margin-bottom: 1.5rem; 
  gap: 1rem; 
  flex-wrap: wrap;
}
.sec .head > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sec .head a { 
  color: var(--ptext); 
  font-weight: 600; 
  font-size: .875rem; 
  text-decoration: none;
  padding-bottom: 0.25rem;
}
.sec .head a:hover { text-decoration: underline; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); align-items: stretch; }
.list { display: grid; gap: .75rem; }

.link { padding: 1.25rem; display: flex; flex-direction: column; height: 100%; transition: all .2s ease; }
.link:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 24px -10px rgba(0,0,0,0.15); }

.l-main { display: flex; align-items: flex-start; gap: .75rem; min-width: 0; }
.l-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.l-txt h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.l-txt p { margin: 0; line-height: 1.4; }

.desc { margin-top: .4rem !important; color: var(--muted); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }

.fav-ico { width: 44px; height: 44px; border-radius: .9rem; border: 1px solid var(--line); background: var(--surface2); display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.fav-ico img { width: 24px; height: 24px; object-fit: contain; }

.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: 1rem; margin-bottom: .75rem; }
.actions { display: flex; gap: .5rem; }

.link.list { flex-direction: row; flex-wrap: wrap; align-items: center; height: auto; padding: 1rem; gap: 1rem; }
.link.list .l-main { flex: 1 1 280px; }
.link.list .badges { margin-top: 0; padding-top: 0; margin-bottom: 0; flex: 0 1 260px; }
.link.list .actions { margin-top: 0; }

/* ==========================================================================
   8. FILTERS
   ========================================================================== */
.filters { padding: 1rem; display: grid; gap: .6rem; margin: 1rem 0; }
.filters .sel { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.seg { display: inline-flex; gap: .2rem; border: 1px solid var(--line); background: var(--surface); border-radius: .9rem; padding: .2rem; }
.seg button { border: 0; background: none; color: var(--muted); padding: .45rem .9rem; border-radius: .65rem; font: 500 .85rem inherit; cursor: pointer; transition: .15s; }
.seg button.on { background: var(--primary); color: var(--primary-fg); }

/* ==========================================================================
   9. STATES — EMPTY, NOTICE, LOADER
   ========================================================================== */
.empty { padding: 3.5rem 1.5rem; text-align: center; }
.empty p { margin: .5rem auto 0; max-width: 30rem; }
.notice { max-width: 34rem; margin: 6rem auto; padding: 1.5rem; text-align: center; }

.spin {
  --o: calc(50% - 32.5px); /* pojok kiri-atas kotak loader 65px, tepat di tengah */
  --n: calc(var(--o) + 35px);
  position: relative;
  display: block;
  width: 100%;
  min-height: 60vh;
  margin: 0;
  font-size: 0;
}
#boot.spin, main#app > .spin { min-height: 100vh; }

.spin::before,
.spin::after {
  content: "";
  position: absolute;
  border-radius: 50px;
  box-shadow: 0 0 0 3px inset var(--ink);
  animation: l4 2.5s infinite;
}
.spin::after { animation-delay: -1.25s; }

@keyframes l4 {
  0%      { inset: var(--o) var(--n) var(--n) var(--o); }
  12.5%   { inset: var(--o) var(--n) var(--o) var(--o); }
  25%     { inset: var(--n) var(--n) var(--o) var(--o); }
  37.5%   { inset: var(--n) var(--o) var(--o) var(--o); }
  50%     { inset: var(--n) var(--o) var(--o) var(--n); }
  62.5%   { inset: var(--o) var(--o) var(--o) var(--n); }
  75%     { inset: var(--o) var(--o) var(--n) var(--n); }
  87.5%   { inset: var(--o) var(--o) var(--n) var(--o); }
  100%    { inset: var(--o) var(--n) var(--n) var(--o); }
}

/* Loader hasil pencarian / filter (lingkaran berputar; warna ikut tema lewat --ink) */
.loader {
  width: 50px;
  aspect-ratio: 1;
  margin: 3rem auto;
  border-radius: 50%;
  padding: 6px;
  color: var(--ink);
  background:
    conic-gradient(from 135deg at top, currentColor 90deg, #0000 0) 0 calc(50% - 4px) / 17px 8.5px,
    radial-gradient(farthest-side at bottom left, #0000 calc(100% - 6px), currentColor calc(100% - 5px) 99%, #0000) top right / 50% 50% content-box content-box,
    radial-gradient(farthest-side at top, #0000 calc(100% - 6px), currentColor calc(100% - 5px) 99%, #0000) bottom / 100% 50% content-box content-box;
  background-repeat: no-repeat;
  animation: l-spin 1s infinite linear;
}
@keyframes l-spin {
  100% { transform: rotate(1turn); }
}

/* ==========================================================================
   10. TABLE
   ========================================================================== */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 600; padding: .75rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border: 0; }
td.act { white-space: nowrap; text-align: right; }

/* ==========================================================================
   11. MODAL & TOAST
   ========================================================================== */
.ov { 
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); 
  display: flex; align-items: center; justify-content: center; 
  padding: 1rem; z-index: 80; 
  animation: fade-in 0.3s ease-out forwards; backdrop-filter: blur(2px);
}
.modal { 
  width: 100%; max-width: 32rem; max-height: 92vh; overflow: auto; 
  animation: modal-in 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.modal.wide { max-width: 42rem; }
.modal .h { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal .b  { padding: 1.25rem; }
.modal .ft { display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { 0% { opacity: 0; transform: scale(0.9) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

#toasts {
  position: fixed; top: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; align-items: center;
  gap: .5rem; width: max-content; max-width: 92vw; pointer-events: none;
}
.toast {
  position: relative; display: flex; align-items: center; justify-content: center; gap: .75rem;
  padding: .85rem 1.5rem; border-radius: 1rem; font-size: .95rem; font-weight: 600;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3), 0 4px 10px -2px rgba(0, 0, 0, 0.2);
  overflow: hidden; min-width: 280px; max-width: 100%; pointer-events: auto; text-align: center;
  opacity: 0; transform: translateY(-30px) scale(0.9);
}
@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-30px) scale(0.9); }
  60% { opacity: 1; transform: translateY(5px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.95); }
}
.toast.show { animation: toastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.toast.hide { animation: toastOut 0.3s ease forwards; }
.toast svg { flex: none; width: 20px; height: 20px; }
.toast.ok  { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.toast.err { background: var(--danger); color: #fff; border-color: transparent; }
.toast:not(.ok):not(.err) { background: var(--surface2); color: var(--ink); }
.toast-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: rgba(0, 0, 0, 0.2); width: 100%; transform-origin: left;
}
.toast.ok .toast-progress, .toast.err .toast-progress { background: rgba(255, 255, 255, 0.4); }
.toast.show .toast-progress { animation: toast-progress 3.5s linear forwards; }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ==========================================================================
   12. ADMIN LAYOUT (PERBAIKAN KOTAK STATISTIK 1 BARIS)
   ========================================================================== */
.admin { display: grid; grid-template-columns: 17rem 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.side .brand { padding: 1rem; border-bottom: 1px solid var(--line); }
.side nav { flex: 1; padding: .75rem; overflow: auto; display: grid; gap: .2rem; align-content: start; }
.side nav a { display: block; padding: .6rem .8rem; border-radius: .8rem; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .875rem; transition: all 0.2s; }
.side nav a:hover { background: var(--surface2); color: var(--ink); }
.side nav a.on { background: var(--primary); color: var(--primary-fg); }

.side-footer { padding: 1rem; border-top: 1px solid var(--line); margin-top: auto; }
.btn-logout {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: .65rem 1rem;
  background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger);
  border: 1px solid transparent; border-radius: .8rem; font: inherit; font-weight: 600;
  font-size: .875rem; cursor: pointer; transition: .15s; text-align: left;
}
.btn-logout:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-logout svg { flex: none; }

.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }

.main    { min-width: 0; }
.content { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }
.ph { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; }
.ph p { margin: .25rem 0 0; color: var(--muted); font-size: .875rem; max-width: 40rem; }

/* PERBAIKAN: Memaksa 7 kolom dalam 1 baris */
.sgrid { 
  display: grid; 
  grid-template-columns: repeat(7, 1fr); /* 7 Kotak sejajar */
  gap: 0.5rem; /* Jarak antar kotak lebih tipis */
  margin-bottom: 1.5rem;
}

.sc { 
  padding: 1rem 0.5rem; /* Padding dikurangi agar muat */
  text-align: center; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.sc:hover { transform: translateY(-3px); border-color: var(--primary); }
.sc small { color: var(--muted); font-size: .7rem; margin-bottom: 0.2rem; line-height: 1.2; display: block;}
.sc b { display: block; font: 700 1.5rem "Bricolage Grotesque", sans-serif; } /* Font sedikit dikecilkan */

.two { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; margin-bottom: 1.5rem; }
.two > .f { margin-bottom: 0; }

.formgrid { display: grid; gap: 1.5rem; grid-template-columns: 1fr 19rem; align-items: start; }
.pad { padding: 1.5rem; }

/* ==========================================================================
   13. LOGIN
   ========================================================================== */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login form { width: 100%; max-width: 24rem; padding: 1.75rem; animation: modal-in 0.5s ease-out; }

/* ==========================================================================
   14. SIDEBAR TOGGLE
   ========================================================================== */
#sidebtn { display: none; }

/* ==========================================================================
   15. THEME TOGGLE ANIMATION (BULAT)
   ========================================================================== */
#themebtn, .themebtn {
  position: relative; width: 2.5rem; height: 2.5rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; background-color: #f1f5f9; color: #475569;
  transition: background-color 0.3s, color 0.3s, transform 0.2s; border: none; cursor: pointer;
}
#themebtn:active, .themebtn:active { transform: scale(0.9); }
.dark #themebtn, .dark .themebtn { background-color: #334155; color: #f8fafc; }

#themebtn .ti, .themebtn .ti {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#themebtn .sun, .themebtn .sun { opacity: 0; transform: scale(0.5) rotate(-90deg); }
.dark #themebtn .sun, .dark .themebtn .sun { opacity: 1; transform: scale(1) rotate(0); }
#themebtn .moon, .themebtn .moon { opacity: 1; transform: scale(1) rotate(0); }
.dark #themebtn .moon, .dark .themebtn .moon { opacity: 0; transform: scale(0.5) rotate(90deg); }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }
html.theme-fade, html.theme-fade * { transition: background-color .45s, color .45s, border-color .45s !important; }

/* ==========================================================================
   16. RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
  .sgrid { grid-template-columns: repeat(4, 1fr); } /* Jika layar kecil, jadi 4 kolom */
}

@media (max-width: 900px) {
  .sgrid { grid-template-columns: repeat(3, 1fr); }
  .two { grid-template-columns: 1fr; gap: 0; margin-bottom: 0; }
  .two > .f { margin-bottom: 1.5rem; }
  .formgrid { grid-template-columns: 1fr; }
  footer.foot .in { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; }
  nav.menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; padding: .5rem 1rem; }
  nav.menu.open { display: flex; }
  #burger       { display: inline-block; }
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 17rem; z-index: 60; transform: translateX(-100%); transition: .3s cubic-bezier(0.16, 1, 0.3, 1); }
  .side.open { transform: none; }
  #sidebtn   { display: inline-block !important; }
}

@media (max-width: 600px) {
  .sgrid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   17. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   18. TOMBOL LIHAT PORTAL (Header Admin)
   ========================================================================== */
.btn-portal {
  display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem;
  border-radius: .6rem; font-size: .85rem; font-weight: 600; color: var(--muted);
  text-decoration: none; border: 1px solid transparent; transition: all .2s ease; margin-left: .5rem;
}
.btn-portal:hover { color: var(--ink); background: var(--surface2); border-color: var(--line); }
.btn-portal svg { opacity: .6; transition: opacity .2s ease, transform .2s ease; }
.btn-portal:hover svg { opacity: 1; transform: translate(2px, -2px); }
