﻿/* ============================================================
   MIOSI Character Report — Muhammadiyah Royal Blue & Sun Gold
   ============================================================ */

:root {
  --royal-950: #0F1C3A;
  --royal-900: #162952;
  --royal-800: #1E3A73;
  --royal-700: #26488F;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --gold-400: #FBBF24;
  --gold-500: #F59E0B;
  --gold-600: #D97706;
  --gold-100: #FEF3C7;
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --border: #E2E8F0;
  --text: #162447;
  --muted: #64748B;
  --shadow-sm: 0 2px 8px rgba(15, 28, 58, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 28, 58, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== Sidebar ===== */
aside {
  position: fixed;
  width: 248px;
  height: 100vh;
  background: linear-gradient(175deg, var(--royal-950) 0%, var(--royal-900) 55%, var(--royal-800) 100%);
  color: white;
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 4px 0 24px rgba(15, 28, 58, 0.14);
  z-index: 10;
}

aside h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--gold-400);
}

aside small {
  color: #B4C4E4;
  font-size: 12px;
}

nav {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ===== Tombol umum ===== */
button, input, select, textarea { font: inherit; }

button {
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  background: var(--royal-800);
  color: white;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

button:hover:not(:disabled) {
  background: var(--royal-700);
  box-shadow: 0 4px 12px rgba(30, 58, 115, 0.18);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

button.secondary {
  background: #EDF2F8;
  color: var(--royal-900);
  border: 1px solid #D5DFEE;
}

button.secondary:hover:not(:disabled) {
  background: #E2EAF5;
  box-shadow: none;
}

/* Tombol aksi utama (Sun Gold selaras matahari Muhammadiyah) */
button.pink {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--royal-950);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

button.pink:hover:not(:disabled) {
  background: linear-gradient(135deg, #FCD34D, var(--gold-600));
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.36);
}

nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  padding: 10px 14px;
  margin: 0;
  border-radius: 9px;
  color: #D7E2F5;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
}

nav button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: white;
  box-shadow: none;
}

nav button.active {
  background: rgba(251, 191, 36, 0.16);
  color: var(--gold-400);
  font-weight: 600;
  border-left-color: var(--gold-400);
}

/* ===== Main ===== */
main {
  margin-left: 248px;
  padding: 28px 34px 40px;
  max-width: 1520px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 4px 0 0;
  color: var(--royal-950);
  letter-spacing: -0.3px;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 4px 0 10px;
  color: var(--royal-900);
}

h3 {
  font-size: 15px;
  color: var(--royal-900);
}

p {
  color: var(--muted);
  margin: 6px 0 12px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ===== Kartu & Panel ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.panel, .stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.stat {
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--royal-800);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.stat:nth-child(2) { border-top-color: #10B981; }
.stat:nth-child(3) { border-top-color: var(--gold-500); }

.stat strong {
  display: block;
  font-size: 34px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--royal-950);
  line-height: 1.1;
}

/* ===== Toolbar & Input ===== */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

input, select, textarea {
  border: 1px solid #CBD5E1;
  border-radius: 9px;
  padding: 9px 12px;
  background: white;
  color: var(--text);
  max-width: 100%;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ===== Tabel ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

td, th {
  text-align: left;
  padding: 12px 13px;
  border-bottom: 1px solid #EDF2F7;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--royal-900);
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-bottom: 2px solid var(--border);
}

tbody tr:hover td {
  background: #F8FAFF;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

.group {
  background: #E8EFFC;
  color: var(--royal-900);
  font-weight: 700;
}

.muted { color: var(--muted); }

/* ===== Bar progres ===== */
.bar {
  display: flex;
  height: 10px;
  background: #E8EEF7;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--royal-700), var(--blue-600));
}

/* ===== Form fields ===== */
.fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.fields label {
  display: grid;
  gap: 6px;
}

.printonly { display: none; }

/* ===== Laporan cetak (rapor) ===== */
.reporthead {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 126px;
  text-align: center;
  border-bottom: 3px solid #111;
  padding: 6px 0 12px;
  margin-bottom: 20px;
  font-family: "Times New Roman", Georgia, serif;
  color: #111;
}
.reporthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  border-bottom: 1px solid #111;
}
.reporthead img {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 116px;
  height: 116px;
  object-fit: contain;
}
.reporthead .kop-text {
  width: 100%;
  text-align: center;
  padding: 0 130px;
  line-height: 1.28;
}
.reporthead .kop-line {
  font-size: 14px;
  letter-spacing: 0.4px;
}
.reporthead h2 {
  margin: 2px 0;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #000;
}
.reporthead .kop-addr {
  font-size: 13.5px;
  letter-spacing: 0.3px;
}
.reporthead .kop-contact {
  font-size: 11.5px;
  margin-top: 2px;
}

.identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  margin: 18px 0;
}
.identity div {
  display: grid;
  grid-template-columns: 115px 12px 1fr;
  align-items: start;
}
.sign {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  text-align: center;
  margin-top: 8px;
  break-inside: avoid;
}
.sign b { display: block; margin-top: 52px; }
.reporttitle { text-align: center; margin: 14px 0; }
.reporttable { font-size: 12px; }
.reporttable td:first-child { width: 48%; }
.reporttable td:nth-child(2) { width: 8%; text-align: center; }
.reporttable td small { color: inherit; font-size: inherit; line-height: 1.3; }
.reporttable .group td { text-align: center; }
.reporttable th { text-align: center; }
.reporttable td { line-height: 1.35; }
.reporttable tbody tr:hover td { background: transparent; }

/* ===== Entri nilai ===== */
.entryscroll {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.entrytable { min-width: 1450px; font-size: 12px; }
.entrytable th {
  min-width: 105px;
  background: #EEF3FB;
  color: var(--royal-900);
  position: sticky;
  top: 0;
  z-index: 1;
}
.entrytable td select { min-width: 68px; font-size: 12px; padding: 6px 8px; }
.entrytable td:first-child, .entrytable th:first-child { min-width: 190px; }
.entrytable tbody td:first-child {
  position: sticky;
  left: 0;
  background: white;
  z-index: 2;
  font-weight: 500;
  box-shadow: 2px 0 6px rgba(15, 28, 58, 0.04);
}

/* ===== Print (Rapor Resmi A4) ===== */
@media print {
  @page { size: A4; margin: 12mm; }
  body { font: 10pt Arial; color: black; background: white; }
  aside, header, .printonly, .no-print, .noprint { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; }
  .panel, .stat { border: 0; padding: 0; margin: 0; box-shadow: none; border-radius: 0; }
  .reporttable { font-size: 9pt; }
  .reporttable td, .reporttable th { padding: 4px; color: black; border: 1px solid #999; background: transparent; }
  .reporttable .group td { background: #eef2f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .identity { font-size: 10pt; margin: 12px 0; }
  .reporthead { min-height: 30mm; padding: 2mm 0 3mm; border-bottom-color: black; }
  .reporthead::after { border-bottom-color: black; }
  .reporthead img { left: 4mm; width: 28mm; height: 28mm; }
  .reporthead .kop-text { padding: 0 32mm; }
  .reporthead .kop-line { font-size: 11pt; }
  .reporthead h2 { font-size: 15pt; }
  .reporthead .kop-addr { font-size: 10.5pt; }
  .reporthead .kop-contact { font-size: 9pt; }
  .sign { font-size: 10pt; }
  .sign b { margin-top: 42px; }
  .reporttitle { font-size: 13pt; color: black; }
  p { color: black; }
  .bar { border: 1px solid #999; }
  .bar i { background: #555; }
}

/* ===== Responsif ===== */
@media (max-width: 750px) {
  aside {
    position: static;
    width: auto;
    height: auto;
    padding: 16px 14px;
  }
  nav {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
  }
  nav button {
    width: auto;
    flex: 1 1 140px;
    text-align: center;
    margin: 4px 4px 0 0;
    border-left: 0;
  }
  main { margin: 0; padding: 16px; }
  .cards, .fields { grid-template-columns: 1fr; }
  .panel { overflow: auto; }
}
@media screen and (max-width: 600px) {
  .identity { grid-template-columns: 1fr; }
  .sign { gap: 8px; }
}

/* ===== Login & Akun ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, #26488F 0%, var(--royal-900) 48%, var(--royal-950) 100%);
}
.login-card {
  width: 100%;
  max-width: 390px;
  background: white;
  border-radius: 18px;
  padding: 34px 30px 28px;
  box-shadow: 0 24px 60px rgba(9, 18, 40, 0.42);
  border-top: 4px solid var(--gold-400);
  text-align: center;
}
.login-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin-bottom: 8px;
}
.login-card h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 800;
  color: var(--royal-950);
}
.login-card h1 span {
  color: var(--gold-500);
}
.login-sub {
  margin: 4px 0 22px;
  font-size: 13px;
  color: var(--muted);
}
.login-card form {
  text-align: left;
  display: grid;
  gap: 13px;
}
.login-card label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--royal-900);
}
.login-error {
  color: #DC2626;
  font-size: 12px;
  min-height: 16px;
}
.login-foot {
  margin-top: 20px;
  font-size: 12px;
  color: #94A3B8;
  letter-spacing: 0.3px;
}
.user-box {
  margin-top: auto;
  padding: 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.user-box .user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}
.user-box .user-role {
  display: inline-block;
  width: fit-content;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--gold-400);
  color: var(--royal-950);
  font-weight: 700;
}
.user-box .user-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.user-box .user-actions button {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
}
.user-box .user-actions button:hover {
  background: rgba(255, 255, 255, 0.24);
  box-shadow: none;
}
.sidebar-copy {
  font-size: 11px;
  color: #8EA3CC;
  margin-top: 2px;
}
.app-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
