:root {
  --red: #B02330; --red-dark: #8f1c26;
  --ink: #14161A; --ink-2: #1D2026; --ink-3: #262A32;
  --steel: #6C7A99; --line: #E6E6E2; --paper: #F7F7F4;
  --green: #1D6F42; --green-soft: #E3F3EA;
  --amber: #B36B00; --amber-soft: #FFF4E3;
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--paper); color: var(--ink); font-size: 15px;
  padding-bottom: 24px;
}

header.top {
  background: var(--ink); color: #fff; padding: 16px 18px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 3px solid var(--red);
}
header.top h1 { font-size: 19px; margin: 0; font-weight: 800; }
header.top .sub { font-size: 12.5px; color: #B8BCC6; margin-top: 2px; }
header.top .logo-img { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
header.top a.out {
  margin-left: auto; color: #fff; text-decoration: none;
  background: rgba(255,255,255,.12); padding: 7px 12px; border-radius: 8px; font-size: 13px;
}

.flash {
  background: var(--green-soft); color: var(--green);
  padding: 12px 16px; font-size: 14px; font-weight: 600;
}
.flash.warn { background: #FBE4E4; color: var(--red-dark); }

.wrap { padding: 16px; max-width: 480px; margin: 0 auto; }

h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
     color: var(--steel); margin: 22px 0 10px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
}
.card .nm { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.card .meta { color: var(--steel); font-size: 13.5px; }
.card .when { color: var(--steel); font-size: 12px; margin-top: 6px; }
.card img { width: 100%; border-radius: 8px; margin-bottom: 10px; }

.tag {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 7px;
}
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.overdue { background: #FBE4E4; color: var(--red-dark); }

.btn {
  display: inline-block; text-decoration: none; text-align: center;
  padding: 13px 18px; border-radius: 10px; font-weight: 700; font-size: 14.5px;
  border: 0; cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.grey { background: #EEEEEA; color: var(--ink); }
.btn.green { background: var(--green); color: #fff; }
.btn.block { display: block; width: 100%; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.nav-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px;
}
.nav-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 10px; text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: 13.5px; text-align: center;
  box-shadow: 0 1px 3px rgba(20,22,26,.06);
  transition: transform .12s ease, box-shadow .12s ease;
}
.nav-grid a:active {
  transform: scale(.97);
  box-shadow: 0 1px 2px rgba(20,22,26,.08);
}
.nav-grid .ic {
  font-size: 24px; width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FBEAEA, #FFF4E3);
  position: relative;
}
.nav-grid .badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
  min-width: 20px; height: 20px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; border: 2px solid #fff;
}

.app-footer {
  text-align: center; color: var(--steel); font-size: 12px;
  padding: 24px 16px 16px; opacity: .75; line-height: 1.8;
}

.hist-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px;
}
.hist-grid .hist-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 10px; text-align: center;
}
.hist-grid .hist-ic { font-size: 24px; margin-bottom: 6px; }
.hist-grid .hist-nm { font-weight: 700; font-size: 13px; }
.hist-grid .hist-amt { color: var(--red); font-weight: 700; font-size: 14px; margin-top: 4px; }
.hist-grid .hist-date { color: var(--steel); font-size: 11px; margin-top: 4px; }

input[type=text], textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; font-family: inherit;
}
textarea { resize: vertical; min-height: 100px; }

label { display: block; font-size: 13px; font-weight: 700; color: var(--steel);
        margin-bottom: 6px; }

.empty { text-align: center; color: var(--steel); padding: 30px 16px; font-size: 14px; }

.login-box { text-align: center; padding-top: 40px; }
.login-box .logo { font-size: 42px; font-weight: 900; color: var(--red); margin-bottom: 4px; }
.login-box .tag-line { color: var(--steel); font-size: 14px; margin-bottom: 30px; }
.login-box input { text-align: center; font-size: 22px; letter-spacing: 4px;
                    font-weight: 700; margin-bottom: 14px; }

.poll-opt {
  display: block; width: 100%; text-align: left; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  margin-bottom: 8px; cursor: pointer; font-family: inherit; font-size: 14.5px;
}
.poll-opt.mine { border-color: var(--red); background: var(--red); color: #fff; font-weight: 700; }
