/* winner-portal/app/style.css — brand IngatanGajah: tosca #0FBEC4 + oranye #FF7A1A */
:root {
  --tosca: #0FBEC4;
  --tosca-dark: #0A9298;
  --tosca-deep: #06666B;
  --oranye: #FF7A1A;
  --oranye-soft: #FFF1E6;
  --ink: #123A3C;
  --muted: #5E7A7C;
  --bg: #F4FAFA;
  --card: #FFFFFF;
  --line: #D9EBEC;
  --gold: #F5B301;
  --silver: #9FB2BC;
  --bronze: #C77B45;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(6, 102, 107, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif; font-size: 15px;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--tosca-dark); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--tosca-deep) 0%, var(--tosca-dark) 45%, var(--tosca) 100%);
  color: #fff; padding: 34px 0 30px; border-bottom: 5px solid var(--oranye);
}
.hero-brand { display: flex; align-items: center; gap: 14px; }
.hero-logo { font-size: 44px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.hero h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: .3px; }
.hero-sub { margin: 2px 0 0; font-weight: 600; color: #CFF3F4; font-size: 14px; }
.hero-tag { margin: 14px 0 16px; color: #E4FAFA; max-width: 560px; font-size: 14px; }
.searchbar { display: flex; gap: 8px; max-width: 620px; }
.searchbar input {
  flex: 1; padding: 13px 18px; border-radius: 999px; border: 0; font: inherit;
  font-size: 16px; outline: 3px solid transparent; transition: outline .15s;
}
.searchbar input:focus { outline-color: var(--oranye); }
.searchbar button {
  padding: 13px 26px; border-radius: 999px; border: 0; background: var(--oranye);
  color: #fff; font: inherit; font-weight: 700; cursor: pointer; font-size: 16px;
}
.searchbar button:hover { filter: brightness(1.07); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.filters select {
  padding: 8px 12px; border-radius: 10px; border: 0; font: inherit; font-size: 13px;
  color: var(--ink); background: #fff; max-width: 195px;
}
.filters .ghost {
  padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.5);
  background: transparent; color: #fff; font: inherit; font-size: 13px; cursor: pointer;
}
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; color: #D8F6F7; }
.stats b { color: #fff; font-size: 17px; margin-right: 4px; }

/* ---------- Hasil ---------- */
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 0 14px; flex-wrap: wrap; }
.result-head h2 { margin: 0; font-size: 20px; }
.viewtoggle { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.viewtoggle button { border: 0; background: transparent; padding: 8px 16px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.viewtoggle button.on { background: var(--tosca); color: #fff; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding-bottom: 40px; }
.person {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
}
.person:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(6,102,107,.14); }
.person h3 { margin: 0 0 2px; font-size: 16px; }
.person .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.medals { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; }
.medals span { display: inline-flex; align-items: center; gap: 4px; }
.badge-total {
  margin-left: auto; background: var(--oranye-soft); color: var(--oranye);
  border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700;
}
.chips { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: #EAF8F8; color: var(--tosca-deep); border-radius: 999px;
  padding: 3px 10px; font-size: 11.5px; font-weight: 600;
}
.chip.murid { background: var(--oranye-soft); color: var(--oranye); }
.empty { text-align: center; color: var(--muted); padding: 50px 0 70px; font-size: 15px; }

/* tabel records publik & admin */
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); grid-column: 1 / -1; }
table.rec { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 760px; }
table.rec th {
  text-align: left; padding: 10px 12px; background: var(--tosca-deep); color: #fff;
  font-weight: 600; white-space: nowrap; position: sticky; top: 0;
}
table.rec td { padding: 9px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
table.rec tr:hover td { background: #F2FBFB; }
.rk { display: inline-block; min-width: 26px; text-align: center; border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 12px; color: #fff; background: var(--muted); }
.rk.r1 { background: var(--gold); } .rk.r2 { background: var(--silver); } .rk.r3 { background: var(--bronze); }
.rk:empty { display: none; } /* penghargaan tanpa peringkat (mis. Essay Terbaik) → tanpa badge kosong */

/* ---------- Modal profil ---------- */
.modal { position: fixed; inset: 0; background: rgba(9, 46, 48, .55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px; z-index: 50; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 18px; max-width: 680px; width: 100%; padding: 26px 26px 22px; position: relative; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.modal-x { position: absolute; top: 12px; right: 14px; border: 0; background: #EAF3F3; border-radius: 999px; width: 32px; height: 32px; cursor: pointer; font-size: 14px; color: var(--muted); }
.profil-head h2 { margin: 0 0 4px; font-size: 22px; }
.profil-head .sub { color: var(--muted); font-size: 13px; }
.profil-medals { display: flex; gap: 16px; margin: 14px 0 6px; font-weight: 700; }
.tahun-blok { margin-top: 18px; }
.tahun-blok h4 { margin: 0 0 8px; font-size: 14px; color: var(--tosca-deep); border-bottom: 2px solid var(--tosca); display: inline-block; padding-bottom: 2px; }
.prestasi { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; font-size: 13.5px; flex-wrap: wrap; background: #FBFEFE; }
.prestasi .kat { color: var(--muted); font-size: 12px; }
.prestasi .tk { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--tosca-deep); background: #EAF8F8; padding: 2px 9px; border-radius: 999px; }

footer { border-top: 1px solid var(--line); background: #fff; padding: 18px 0; color: var(--muted); font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
footer p { margin: 0; }

/* ================= ADMIN ================= */
.adminbar { background: var(--tosca-deep); color: #fff; padding: 12px 0; }
.adminbar .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.adminbar h1 { font-size: 17px; margin: 0; }
.adminbar .who { margin-left: auto; font-size: 13px; color: #CFF3F4; }
.adminbar button, .btn {
  border: 0; background: var(--oranye); color: #fff; font: inherit; font-size: 13px;
  font-weight: 600; padding: 8px 16px; border-radius: 9px; cursor: pointer;
}
.btn.sec { background: #fff; color: var(--tosca-deep); border: 1px solid var(--line); }
.btn.danger { background: #D64545; }
.btn:disabled { opacity: .5; cursor: default; }
.tabs { display: flex; gap: 4px; margin: 18px 0 14px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line); background: #fff; padding: 9px 18px; font: inherit;
  font-size: 13.5px; border-radius: 10px 10px 0 0; cursor: pointer; color: var(--muted);
}
.tabs button.on { background: var(--tosca); border-color: var(--tosca); color: #fff; font-weight: 600; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 18px; margin-bottom: 40px; box-shadow: var(--shadow); }

.drop {
  border: 2.5px dashed var(--tosca); border-radius: var(--radius); padding: 36px 20px;
  text-align: center; color: var(--muted); background: #F6FDFD; cursor: pointer; transition: background .15s;
}
.drop.over { background: #E2F7F8; }
.drop b { color: var(--tosca-deep); }
.filequeue { margin-top: 16px; }
.fileblok { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.fileblok-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #F2FBFB; flex-wrap: wrap; font-size: 13.5px; }
.fileblok-head .jenis { font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--oranye-soft); color: var(--oranye); }
.commonbar { display: flex; gap: 8px; padding: 10px 14px; flex-wrap: wrap; border-top: 1px solid var(--line); background: #FFFDF9; align-items: center; font-size: 13px; }
.commonbar input, .commonbar select { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; width: 130px; }
.gridwrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
table.prev { border-collapse: collapse; font-size: 12.5px; width: 100%; }
table.prev th { background: var(--tosca-deep); color: #fff; padding: 6px 8px; position: sticky; top: 0; z-index: 2; }
table.prev th select { font-size: 11.5px; border-radius: 6px; border: 0; padding: 3px 4px; max-width: 130px; }
table.prev td { border: 1px solid var(--line); padding: 5px 8px; min-width: 70px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.prev td[contenteditable]:focus { outline: 2px solid var(--oranye); background: #FFF8F2; white-space: normal; }
table.prev td.delcell { cursor: pointer; color: #D64545; text-align: center; min-width: 30px; }
.fileblok-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); }
.okmsg { color: #1B8A4C; font-weight: 600; font-size: 13px; }
.errmsg { color: #D64545; font-weight: 600; font-size: 13px; }

.login-card { max-width: 380px; margin: 60px auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 6px; }
.login-card p { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.login-card button { width: 100%; margin-top: 18px; padding: 11px; }
.toolrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolrow input[type=search] { padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 13.5px; width: 240px; }
.pill { font-size: 12px; background: #EAF8F8; color: var(--tosca-deep); padding: 3px 10px; border-radius: 999px; font-weight: 600; }

@media (max-width: 640px) {
  .hero h1 { font-size: 24px; }
  .searchbar button { padding: 13px 18px; }
  .filters select { max-width: 47%; }
  footer .wrap { justify-content: center; }
}
