:root {
  --navy: #071d29;
  --ink: #142a35;
  --muted: #5c6d75;
  --line: #d9e2e6;
  --paper: #ffffff;
  --surface: #f4f8fa;
  --cyan: #00a8cc;
  --green: #16a36a;
  --yellow: #f2b705;
  --red: #c83e4d;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/1.55 Arial, sans-serif; }
a { color: #087c9c; }
.portal-header { min-height: 72px; padding: 10px max(20px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--navy); color: #fff; }
.portal-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; text-decoration: none; }
.portal-brand img { width: 112px; max-height: 48px; object-fit: contain; }
.portal-header nav { display: flex; align-items: center; gap: 18px; }
.portal-header nav a { color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; }
.portal-main { width: min(1120px, calc(100% - 32px)); min-height: calc(100vh - 132px); margin: 0 auto; padding: 42px 0 64px; }
.portal-footer { padding: 20px; background: #04141d; color: #b9c7cd; text-align: center; font-size: 14px; }
h1, h2, h3 { line-height: 1.2; margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: #087c9c; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.panel, .course-card { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 8px 24px rgba(7, 29, 41, .06); }
.auth-panel { width: min(520px, 100%); margin: 0 auto; }
label { display: block; margin: 0 0 7px; font-size: 14px; font-weight: 800; }
input, select, textarea { width: 100%; min-height: 46px; margin: 0 0 16px; padding: 11px 13px; border: 1px solid #b9c7cd; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
textarea { min-height: 100px; resize: vertical; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 18px; border: 0; border-radius: 6px; background: var(--cyan); color: #fff; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-secondary { background: var(--navy); }
.button-light { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button-success { background: var(--green); }
.button-danger { background: var(--red); }
.button-small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.notice { margin-bottom: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.notice-success { border-color: #8bd8b6; background: #edf9f3; }
.notice-error { border-color: #efabb3; background: #fff2f3; }
.notice-warning { border-color: #eed47c; background: #fff9df; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #e8eef1; font-size: 12px; font-weight: 800; }
.status-paid, .status-active { background: #dff6ea; color: #08794b; }
.status-reported { background: #fff2bf; color: #755900; }
.status-expired { background: #fde8ea; color: #9b2634; }
.access-period { display: grid; gap: 2px; margin: 16px 0; padding: 12px 14px; border-left: 4px solid var(--cyan); background: #edf9fc; }
.access-period span, .access-note { color: var(--muted); font-size: 14px; }
.access-summary, .access-offer { display: grid; gap: 2px; }
.price { margin: 16px 0; font-size: 28px; font-weight: 900; color: var(--navy); }
.lesson-list { margin: 0; padding: 0; list-style: none; }
.lesson-list li { display: flex; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.lesson-list li:last-child { border-bottom: 0; }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.pix-box { padding: 22px; border: 2px solid var(--cyan); border-radius: 8px; background: #f2fcff; }
.pix-qr { display: grid; width: min(292px, 100%); min-height: 276px; margin: 18px auto; padding: 8px; place-items: center; background: #fff; }
.pix-qr img, .pix-qr canvas { display: block; width: min(260px, 100%) !important; height: auto !important; aspect-ratio: 1; }
.code { padding: 10px 12px; border: 1px dashed #79909a; border-radius: 6px; background: #fff; word-break: break-all; font-family: Consolas, monospace; }
.code-short { display: inline-block; font-weight: 800; letter-spacing: 0; }
.pix-copy { max-height: 130px; overflow: auto; font-size: 13px; line-height: 1.45; }
.copy-feedback { min-height: 20px; color: var(--muted); font-size: 14px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eaf1f4; font-size: 13px; }
.admin-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.admin-heading h1 { margin-bottom: 8px; }
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.stat strong { display: block; color: var(--navy); font-size: 30px; line-height: 1; }
.stat span { display: block; margin-top: 8px; color: var(--muted); }
.admin-search { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 10px; align-items: end; margin-bottom: 20px; }
.admin-search input { margin-bottom: 0; }
.table-summary { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.students-table small { color: var(--muted); }
.students-table a { overflow-wrap: anywhere; }
.compact-list { margin: 0; padding-left: 18px; }
.compact-list li + li { margin-top: 4px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.privacy-note { margin: 18px 0 0; padding: 14px 16px; border-left: 4px solid var(--cyan); background: #edf9fc; color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
  .portal-header { align-items: flex-start; flex-direction: column; }
  .portal-header nav { width: 100%; overflow-x: auto; padding-bottom: 6px; }
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .admin-heading { flex-direction: column; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-search { grid-template-columns: 1fr; }
  .admin-search .button { width: 100%; }
  .table-summary { align-items: flex-start; flex-direction: column; }
  .portal-main { padding-top: 28px; }
}
