/* KakaBatao theme: Kaka's yellow + cap navy on warm cream.
   Headings and the wordmark in Kalam (handwritten), everything else in Inter. */
:root {
  --navy: #16264a; --navy-2: #22355f; --yellow: #ffc72c; --yellow-d: #f2b400; --yellow-soft: #fff1c7;
  --cream: #fff8e1; --cream-2: #ffedb3;
  --bg: #f6f7fb; --card: #ffffff; --text: #16264a; --muted: #6b7690; --line: #e3e7ef; --soft: #f1f4fa;
  --green-soft: #dff5e6; --green: #1f8a4c; --blue-soft: #e2efff; --blue: #2f6fd6; --purple-soft: #ece6ff; --purple: #6a4fd1;
  --error-bg: #fdecec; --error: #a32020; --code-bg: #f8f9fc;
  --hand: "Kalam", "Comic Sans MS", cursive;
  --shadow: 0 12px 34px rgba(22, 38, 74, .08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- brand ---------- */
.wordmark { font-family: var(--hand); font-weight: 700; letter-spacing: -.01em; line-height: 1; }
.wordmark .kaka { color: var(--navy); }
.wordmark .batao { color: var(--yellow); -webkit-text-stroke: .5px var(--yellow-d); }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none !important; }
.logo img { display: block; height: auto; }   /* the logo as provided: never cropped */
.hand-note { font-family: var(--hand); color: var(--navy); font-size: 22px; line-height: 1.15; position: absolute; pointer-events: none; }
.hand-note svg { display: block; stroke: var(--navy); fill: none; stroke-width: 2.5; stroke-linecap: round; }

/* ---------- login / sign-up ----------
   One composition, designed at 1536 x 864 and scaled to fit the window like a
   slide: --s is one design pixel (the tighter of width/1536 and height/864).
   Everything is always shown, in the same places, at any size or zoom level;
   text never drops below a readable size. Phones get their own layout below. */
.auth { --s: min(calc(100vw / 1536), calc(100vh / 864)); display: grid; grid-template-columns: 1.12fr 1fr; height: 100vh; overflow: hidden; }
.auth-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: calc(46 * var(--s)) calc(56 * var(--s));
  background: radial-gradient(120vh 60vh at -10% -10%, #fffdf5 0%, transparent 60%), linear-gradient(160deg, #fff9e6 0%, #ffefbd 100%);
}
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 50%; background: #ffe39a; opacity: .55; z-index: 0; }
.auth-hero::before { width: calc(620 * var(--s)); height: calc(620 * var(--s)); right: calc(-210 * var(--s)); top: calc(130 * var(--s)); }
.auth-hero::after { width: calc(900 * var(--s)); height: calc(400 * var(--s)); left: calc(-200 * var(--s)); bottom: calc(-230 * var(--s)); background: #ffd970; opacity: .45; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .logo { gap: calc(14 * var(--s)); }
.auth-hero .logo img { width: calc(86 * var(--s)); }
.auth-hero .wordmark { font-size: calc(60 * var(--s)); }
/* The headline stays clearly smaller than the KakaBatao name */
.auth-hero .hero-title { font-family: var(--hand); font-weight: 700; font-size: max(17px, calc(32 * var(--s))); line-height: 1.2;
  margin: calc(30 * var(--s)) 0 calc(12 * var(--s)); max-width: calc(640 * var(--s)); color: var(--navy); text-transform: none; letter-spacing: 0; }
.hero-title .hl { color: var(--yellow-d); display: block; }
.hero-text { max-width: calc(430 * var(--s)); font-size: max(12px, calc(15.5 * var(--s))); color: #2b3a5c; margin: 0 0 calc(24 * var(--s)); }
.features { list-style: none; padding: 0; margin: 0; width: fit-content; }
.features li { display: flex; gap: calc(14 * var(--s)); align-items: center; margin-bottom: calc(14 * var(--s)); }
.features .ic { width: calc(46 * var(--s)); height: calc(46 * var(--s)); border-radius: calc(12 * var(--s)); display: grid; place-items: center; flex: none; }
.features .ic svg.i { width: calc(22 * var(--s)); height: calc(22 * var(--s)); }
.features b { display: block; font-size: max(11.5px, calc(14 * var(--s))); white-space: nowrap; }
.features small { display: block; color: #4b587a; font-size: max(10.5px, calc(12.5 * var(--s))); white-space: nowrap; }   /* one line each, at any zoom */
.ic.y { background: var(--yellow-soft); color: #b98200; } .ic.g { background: var(--green-soft); color: var(--green); }
.ic.b { background: var(--blue-soft); color: var(--blue); } .ic.p { background: var(--purple-soft); color: var(--purple); }
.hero-mascot { position: absolute !important; right: 2%; bottom: 0; height: calc(400 * var(--s)); width: auto; z-index: 1;
  max-width: calc(100% - max(400px, calc(430 * var(--s)))); object-fit: contain; object-position: bottom right;   /* narrow windows: stays beside the feature list */
  filter: drop-shadow(0 calc(18 * var(--s)) calc(24 * var(--s)) rgba(22,38,74,.15)); }
.auth-hero .hand-note { position: absolute; left: calc(48 * var(--s)); bottom: calc(42 * var(--s)); transform: rotate(-9deg); font-size: max(13px, calc(22 * var(--s))); }
.hand-note svg { width: 100%; height: auto; }

.auth-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: calc(32 * var(--s)); background: var(--bg); }
.auth-panel .hand-note { right: calc(44 * var(--s)); top: calc(30 * var(--s)); transform: rotate(-12deg); text-align: center; font-size: max(13px, calc(21 * var(--s))); }
.auth-card { width: 100%; max-width: calc(520 * var(--s)); min-width: min(400px, 100%); background: var(--card); border-radius: calc(20 * var(--s)); padding: calc(36 * var(--s)) calc(42 * var(--s)) calc(26 * var(--s));
  box-shadow: var(--shadow); border: 1px solid #edf0f6; margin-top: calc(34 * var(--s)); }
.auth-card h1 { font-size: max(20px, calc(34 * var(--s))); margin: 0 0 calc(4 * var(--s)); font-weight: 700; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); margin: 0 0 calc(22 * var(--s)); font-size: max(12.5px, calc(15 * var(--s))); }
.auth-card .field { margin-bottom: calc(16 * var(--s)); }
.auth-card .field > label { display: block; font-size: max(12px, calc(14 * var(--s))); font-weight: 600; margin-bottom: calc(6 * var(--s)); color: var(--navy); text-transform: none; letter-spacing: 0; }
.auth-card .input { position: relative; }
.auth-card .input > svg.i { position: absolute; left: calc(15 * var(--s)); top: 50%; transform: translateY(-50%); width: max(15px, calc(18 * var(--s))); height: max(15px, calc(18 * var(--s))); color: #8a94ab; pointer-events: none; z-index: 1; }
/* type=text too: the eye button turns the password into a text field, which must keep room for the icon */
.auth-card .input input, .auth-card .input input[type=text] { width: 100%; height: max(36px, calc(50 * var(--s))); padding: 0 max(38px, calc(46 * var(--s))); border: 1.5px solid var(--line);
  border-radius: calc(12 * var(--s)); font: inherit; font-size: max(13px, calc(15 * var(--s))); color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
.auth-card .input input:focus { outline: none; border-color: var(--yellow-d); box-shadow: 0 0 0 4px rgba(255,199,44,.22); }
.auth-card .input .eye { position: absolute; right: calc(8 * var(--s)); top: 50%; transform: translateY(-50%); background: none; border: 0; color: #8a94ab; cursor: pointer; padding: calc(8 * var(--s)); border-radius: 8px; display: grid; z-index: 1; }
.auth-card .input .eye svg.i { width: max(15px, calc(18 * var(--s))); height: max(15px, calc(18 * var(--s))); }
.auth-card .input .eye:hover { color: var(--navy); }
.auth-card .row { display: flex; justify-content: space-between; align-items: center; margin: 0 0 calc(20 * var(--s)); font-size: max(12.5px, calc(14 * var(--s))); }
.auth-card .check { display: flex; align-items: center; gap: calc(9 * var(--s)); color: #46536f; cursor: pointer; margin: 0; font-size: max(12.5px, calc(14 * var(--s))); font-weight: 400; text-transform: none; letter-spacing: 0; }
.auth-card .check input { width: max(15px, calc(18 * var(--s))); height: max(15px, calc(18 * var(--s))); accent-color: var(--yellow-d); }
.btn-yellow { width: 100%; height: max(38px, calc(52 * var(--s))); border: 0; border-radius: calc(12 * var(--s)); background: var(--yellow); color: var(--navy); font: inherit; font-size: max(14px, calc(16 * var(--s))); font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--s)); transition: background .15s, transform .05s; }
.btn-yellow:hover { background: #ffbe0f; }
.btn-yellow:active { transform: translateY(1px); }
.btn-yellow:disabled { opacity: .6; cursor: wait; }
.btn-outline { width: 100%; height: max(36px, calc(50 * var(--s))); border: 1.5px solid var(--line); border-radius: calc(12 * var(--s)); background: #fff; color: var(--navy); font: inherit; font-size: max(13px, calc(15 * var(--s))); font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--s)); }
.btn-outline:hover { border-color: var(--navy); }
.btn-yellow svg.i, .btn-outline svg.i { width: max(15px, calc(18 * var(--s))); height: max(15px, calc(18 * var(--s))); }
.or { display: flex; align-items: center; gap: calc(14 * var(--s)); color: var(--muted); font-size: max(11.5px, calc(13 * var(--s))); margin: calc(20 * var(--s)) 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.help { display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--s)); margin-top: calc(22 * var(--s)); color: #46536f; font-size: max(12.5px, calc(14 * var(--s))); cursor: pointer; background: none; border: 0; width: 100%; font-family: inherit; }
.help img { width: max(24px, calc(34 * var(--s))); height: auto; }
.help b { color: var(--navy); }
.notice { background: var(--yellow-soft); color: #6b4e00; border-radius: 10px; padding: 10px 14px; margin-top: 12px; font-size: max(12.5px, calc(13.5 * var(--s))); }
.auth-card .error { margin-top: 12px; font-size: max(12.5px, calc(13.5 * var(--s))); }

/* Phones and small tablets: one column, normal sizes, scrolls normally */
@media (max-width: 980px) {
  .auth { --s: 1px; grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .auth-hero { padding: 24px 22px 22px; }
  .auth-hero .wordmark { font-size: 40px; }
  .auth-hero .logo img { width: 56px; }
  .auth-hero .hero-title { font-size: 24px; margin: 16px 0 6px; }
  .hero-text, .features, .hero-mascot, .auth-hero .hand-note, .auth-panel .hand-note { display: none; }
  .auth-panel { padding: 20px 16px 36px; }
  .auth-card { min-width: 0; margin-top: 0; padding: 26px 22px 20px; }
}

/* ---------- app layout: sidebar + content ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c7d0e3; display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 0 6px 24px; }
.side .logo img { width: 50px; }
.side .wordmark { font-size: 30px; }
.side .wordmark .kaka { color: #fff; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c7d0e3; margin-bottom: 4px; font-weight: 500; text-decoration: none; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.active { background: var(--yellow); color: var(--navy); font-weight: 600; }
.side nav a .lock { margin-left: auto; opacity: .75; }
.side nav a .lock svg.i { width: 15px; height: 15px; }
.side .me { margin-top: auto; display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.06); border-radius: 12px; padding: 11px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-weight: 700; flex: none; }
.side .me .me-link { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; color: inherit; text-decoration: none; border-radius: 9px; }
.side .me .me-link:hover .who b, .side .me .me-link.active .who b { color: var(--yellow); }
.side .me .who { min-width: 0; font-size: 12.5px; flex: 1; }
.side .me .who b { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me .who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me button { background: none; border: 0; color: #c7d0e3; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.side .me button:hover { color: var(--yellow); background: rgba(255,255,255,.08); }
.content { padding: 28px 34px 40px; min-width: 0; }
.page-title { font-family: var(--hand); font-weight: 700; font-size: 32px; margin: 0; line-height: 1.2; }
.page-sub { color: var(--muted); margin: 4px 0 22px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; }
  .side .logo { padding: 0; }
  .side .wordmark { font-size: 24px; }
  .side nav { display: flex; gap: 4px; flex-wrap: wrap; order: 3; width: 100%; }
  .side nav a { margin: 0; padding: 7px 10px; }
  .side .me { margin: 0 0 0 auto; padding: 4px; background: none; }
  .side .me .who { display: none; }
  .side .me .avatar { width: 32px; height: 32px; font-size: 14px; }   /* phones: the avatar is the link to My Account */
  .content { padding: 18px 16px 32px; }
}

/* ---------- home ---------- */
.banner { position: relative; overflow: hidden; border-radius: 20px; padding: 30px 34px; min-height: 190px; margin-bottom: 26px;
  background: linear-gradient(120deg, #fff9e6 0%, #ffeaa8 100%); border: 1px solid #ffe08a; }
.banner::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: #ffd970; opacity: .4; right: -60px; top: -120px; }
.banner > * { position: relative; z-index: 1; }
.banner .page-title { font-size: 36px; max-width: 70%; }
.banner p { max-width: 60%; color: #2b3a5c; font-size: 15px; margin: 8px 0 0; }
.banner img { position: absolute; right: 26px; bottom: -14px; height: 205px; filter: drop-shadow(0 10px 16px rgba(22,38,74,.15)); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { display: flex; gap: 14px; text-decoration: none !important; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { border-color: var(--yellow-d); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tile b { display: block; margin-bottom: 3px; font-size: 15px; }
.tile small { color: var(--muted); display: block; }
.tile.soon { opacity: .6; cursor: default; }
.tile.soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; margin-top: 10px; }
.badge.on { background: var(--green-soft); color: var(--green); }
.badge.off { background: var(--soft); color: var(--muted); }
.badge svg.i { width: 13px; height: 13px; }
.hint-card { margin-top: 18px; background: var(--card); border: 1px dashed #e4c46b; border-radius: 14px; padding: 14px 18px; display: flex; gap: 12px; align-items: center; color: #4b587a; }
@media (max-width: 860px) { .banner img { display: none; } .banner .page-title, .banner p { max-width: 100%; } .banner .page-title { font-size: 28px; } }

/* ---------- account page ---------- */
.account-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.profile-head b { display: block; font-size: 17px; }
.profile-head span { color: var(--muted); }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.f { margin-bottom: 14px; }
.f input { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font: inherit; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--navy); margin: 0 0 14px; font-weight: 700; }
.inline-check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13.5px; color: var(--text); margin: 0 0 6px; cursor: pointer; }
.inline-check input { accent-color: var(--yellow-d); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0 0 12px; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.facts .badge { margin-top: 0; }
.msg { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.msg.ok { background: var(--green-soft); color: var(--green); }
.msg.bad { background: var(--error-bg); color: var(--error); }
@media (max-width: 1000px) { .account-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- shared bits ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
select, input[type=date], input[type=text], textarea {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font: inherit;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--yellow-d); box-shadow: 0 0 0 3px rgba(255,199,44,.2); }
.btn { border: 1.5px solid var(--navy); background: #fff; color: var(--navy); padding: 9px 18px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.btn.primary:hover { background: #ffbe0f; }
.btn:disabled { opacity: .5; cursor: wait; }
.error { background: var(--error-bg); color: var(--error); padding: 11px 14px; border-radius: 10px; margin-top: 14px; white-space: pre-wrap; font-size: 13.5px; }
.hidden { display: none !important; }
.locked { text-align: center; padding: 40px 20px 46px; }
.locked img { width: 150px; margin-bottom: 8px; }
.locked h2 { font-family: var(--hand); font-size: 26px; text-transform: none; letter-spacing: 0; color: var(--navy); margin: 0 0 6px; }
.locked p { color: var(--muted); margin: 0; }

/* ---------- data portal ---------- */
.tabs { display: inline-flex; gap: 4px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px 18px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; }
.tabs button.active { background: var(--navy); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
textarea { font-family: Consolas, "Courier New", monospace; min-height: 190px; resize: vertical; background: var(--code-bg); }
h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 9px; font-weight: 600; }
h2:first-child { margin-top: 0; }
details.pick { border: 1.5px solid var(--line); border-radius: 10px; background: #fff; position: relative; }
details.pick[open] { border-color: var(--yellow-d); }
details.pick summary { padding: 9px 11px; cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.pick summary::after { content: "▾"; float: right; color: var(--muted); }
details.pick .box { position: absolute; z-index: 5; left: -1.5px; right: -1.5px; top: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 0 0 10px 10px; max-height: 280px; overflow: auto; padding: 6px 9px; box-shadow: var(--shadow); }
details.pick .box label { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); font-size: 13px; display: flex; gap: 7px; align-items: center; margin: 4px 0; cursor: pointer; }
details.pick .box input[type=checkbox] { accent-color: var(--yellow-d); }
details.pick .box input[type=text] { margin-bottom: 6px; padding: 5px 8px; }
.links { font-size: 12px; margin-bottom: 4px; }
.links a { cursor: pointer; margin-right: 10px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#status { color: var(--muted); }
.sql-layout { display: grid; grid-template-columns: 1fr 290px; gap: 16px; }
.table-list { max-height: 300px; overflow: auto; border: 1.5px solid var(--line); border-radius: 10px; }
.table-list div { padding: 7px 11px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
.table-list div:hover { background: var(--yellow-soft); }
.table-list .cols { cursor: default; background: var(--soft); font-family: Consolas, monospace; font-size: 12px; color: var(--muted); }
.preview { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
th, td { padding: 7px 11px; border-bottom: 1px solid var(--line); text-align: left; }
th { position: sticky; top: 0; background: var(--navy); color: #fff; font-weight: 600; }
tbody tr:nth-child(even) td { background: #fbfcfe; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
@media (max-width: 760px) { .sql-layout { grid-template-columns: 1fr; } }
