:root {
      color-scheme: light;
      --ink: #18212f;
      --muted: #607085;
      --line: #d9e2ec;
      --surface: #ffffff;
      --surface-soft: #f6f8fb;
      --brand: #14635f;
      --brand-strong: #0c4845;
      --blue: #2452d6;
      --amber: #b66512;
      --rose: #b42346;
      --green: #187447;
      --coral: #d85b42;
      --shadow: 0 18px 45px rgba(24, 33, 47, 0.12);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--ink);
      background:
        linear-gradient(180deg, #eef4f4 0, #f8fafc 340px, #f2f5f8 100%);
      font-family: Arial, Helvetica, sans-serif;
      letter-spacing: 0;
    }

    button,
    input {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    .hidden {
      display: none !important;
    }

    .login-page {
      min-height: 100vh;
      display: grid;
      grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
      align-items: stretch;
    }

    .login-brand {
      background:
        linear-gradient(140deg, rgba(20, 99, 95, 0.96), rgba(12, 72, 69, 0.98)),
        url("assets/time-center-logo.png") center 24% / 66% auto no-repeat;
      color: #fff;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 42px;
      min-height: 520px;
    }

    .login-brand img {
      width: 180px;
      max-width: 70%;
      height: auto;
      background: #fff;
      border: 1px solid rgba(255, 255, 255, 0.8);
      border-radius: 8px;
      padding: 12px;
      margin-bottom: auto;
    }

    .login-brand h1 {
      margin: 0 0 12px;
      max-width: 540px;
      font-size: 38px;
      line-height: 1.05;
      letter-spacing: 0;
    }

    .login-brand p {
      margin: 0;
      max-width: 560px;
      color: rgba(255, 255, 255, 0.84);
      font-size: 16px;
      line-height: 1.55;
    }

    .login-panel {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 40px 24px;
    }

    .login-card {
      width: min(440px, 100%);
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
      padding: 28px;
    }

    .login-card h2 {
      margin: 0 0 8px;
      font-size: 26px;
      line-height: 1.15;
      letter-spacing: 0;
    }

    .login-card p {
      margin: 0 0 22px;
      color: var(--muted);
      line-height: 1.5;
    }

    .field {
      display: grid;
      gap: 8px;
      margin-bottom: 16px;
    }

    .field span {
      font-weight: 700;
      font-size: 13px;
      color: #26374d;
    }

    .field input {
      width: 100%;
      min-height: 46px;
      border: 1px solid #c7d3df;
      border-radius: 6px;
      padding: 10px 12px;
      color: var(--ink);
      background: #fff;
    }

    .field input:focus {
      outline: 3px solid rgba(36, 82, 214, 0.16);
      border-color: var(--blue);
    }

    .primary-button,
    .secondary-button,
    .icon-button {
      border: 0;
      border-radius: 6px;
      font-weight: 700;
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      white-space: nowrap;
    }

    .primary-button {
      width: 100%;
      color: #fff;
      background: var(--brand);
      padding: 10px 16px;
    }

    .primary-button:hover {
      background: var(--brand-strong);
    }

    .secondary-button {
      color: var(--brand-strong);
      background: #e6f1ef;
      padding: 10px 14px;
    }

    .icon-button {
      width: 42px;
      color: var(--ink);
      background: #eef2f6;
      padding: 0;
    }

    .demo-access {
      margin-top: 18px;
      padding: 14px;
      border-radius: 8px;
      border: 1px dashed #b6c5d4;
      background: #f8fafc;
      color: #42526a;
      font-size: 13px;
      line-height: 1.5;
    }

    .demo-access code {
      font-family: Arial, Helvetica, sans-serif;
      font-weight: 800;
      color: #26374d;
    }

    .demo-access .divider {
      height: 1px;
      margin: 12px 0;
      background: #dbe4ee;
    }

    .error-box {
      margin: 0 0 14px;
      padding: 10px 12px;
      border: 1px solid #f2a3b5;
      border-radius: 6px;
      background: #fff1f4;
      color: var(--rose);
      font-weight: 700;
      font-size: 13px;
    }

    .app-page {
      min-height: 100vh;
    }

    .topbar {
      min-height: 72px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      padding: 14px 28px;
      border-bottom: 1px solid var(--line);
      background: rgba(255, 255, 255, 0.94);
      position: sticky;
      top: 0;
      z-index: 10;
      backdrop-filter: blur(10px);
    }

    .brand-lockup {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .brand-lockup img {
      width: 48px;
      height: 48px;
      object-fit: contain;
      border-radius: 8px;
      background: #fff;
      border: 1px solid var(--line);
      padding: 4px;
      flex: 0 0 auto;
    }

    .brand-lockup strong,
    .student-title strong {
      display: block;
      font-size: 16px;
      line-height: 1.2;
    }

    .brand-lockup span,
    .student-title span {
      display: block;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
    }

    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 0 0 auto;
    }

    .shell {
      width: min(1240px, calc(100% - 32px));
      margin: 0 auto;
      padding: 26px 0 42px;
    }

    .student-band {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 22px;
      align-items: end;
      padding: 28px;
      border: 1px solid #bfd0dc;
      border-radius: 8px;
      background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 245, 0.92)),
        linear-gradient(90deg, rgba(216, 91, 66, 0.12), rgba(36, 82, 214, 0.08));
      box-shadow: 0 12px 28px rgba(24, 33, 47, 0.08);
    }

    .student-title {
      display: flex;
      align-items: center;
      gap: 16px;
      min-width: 0;
    }

    .avatar {
      width: 62px;
      height: 62px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: #fff;
      background: var(--brand);
      font-weight: 800;
      font-size: 20px;
      flex: 0 0 auto;
    }

    .student-title h2 {
      margin: 0 0 6px;
      font-size: 30px;
      line-height: 1.15;
      letter-spacing: 0;
    }

    .portal-id {
      display: grid;
      grid-template-columns: repeat(3, minmax(120px, 1fr));
      gap: 10px;
      min-width: 430px;
    }

    .mini-stat {
      background: rgba(255, 255, 255, 0.78);
      border: 1px solid #d4e0ea;
      border-radius: 8px;
      padding: 12px;
    }

    .mini-stat span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .mini-stat strong {
      display: block;
      margin-top: 5px;
      font-size: 17px;
    }

    .tabs {
      margin-top: 18px;
      display: flex;
      gap: 8px;
      overflow-x: auto;
      border-bottom: 1px solid var(--line);
      padding-bottom: 0;
    }

    .tab-button {
      border: 1px solid transparent;
      border-bottom: 0;
      background: transparent;
      color: #40516a;
      border-radius: 8px 8px 0 0;
      min-height: 46px;
      padding: 0 16px;
      font-weight: 800;
      white-space: nowrap;
    }

    .tab-button.active {
      color: var(--brand-strong);
      background: #fff;
      border-color: var(--line);
      box-shadow: 0 -2px 0 var(--coral) inset;
    }

    .tab-panel {
      padding-top: 20px;
    }

    .dashboard-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 18px;
    }

    .metric-card,
    .data-card,
    .document-card,
    .note-card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: 0 8px 20px rgba(24, 33, 47, 0.06);
    }

    .metric-card {
      min-height: 118px;
      padding: 18px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 14px;
    }

    .metric-card span {
      color: var(--muted);
      font-size: 13px;
      font-weight: 700;
    }

    .metric-card strong {
      font-size: 28px;
      line-height: 1;
    }

    .metric-card small {
      color: var(--muted);
      line-height: 1.35;
    }

    .section-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      align-items: start;
    }

    .data-card {
      overflow: hidden;
    }

    .card-header {
      min-height: 64px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .card-header h3 {
      margin: 0;
      font-size: 18px;
      line-height: 1.2;
    }

    .card-header span {
      color: var(--muted);
      font-size: 13px;
    }

    .table-wrap {
      overflow-x: auto;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
      min-width: 720px;
    }

    th,
    td {
      text-align: left;
      border-bottom: 1px solid #e4ebf2;
      padding: 12px 16px;
      vertical-align: middle;
      font-size: 14px;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }

    th {
      color: #50627a;
      background: #f8fafc;
      font-size: 12px;
      text-transform: uppercase;
      white-space: nowrap;
    }

    tr:last-child td {
      border-bottom: 0;
    }

    .table-primary {
      display: block;
      font-weight: 800;
      color: var(--ink);
      line-height: 1.35;
    }

    .table-secondary {
      display: block;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
      margin-top: 3px;
      overflow-wrap: anywhere;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 28px;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
      border: 1px solid transparent;
      white-space: nowrap;
    }

    .badge.present {
      color: var(--green);
      background: #e9f7ef;
      border-color: #bce5ca;
    }

    .badge.absent {
      color: var(--rose);
      background: #fff1f4;
      border-color: #f3b4c1;
    }

    .badge.warning {
      color: var(--amber);
      background: #fff6e8;
      border-color: #f2d5a5;
    }

    .badge.info {
      color: var(--blue);
      background: #eef3ff;
      border-color: #cad8ff;
    }

    .documents-grid,
    .notes-list {
      display: grid;
      gap: 12px;
    }

    .documents-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .empty-state {
      border: 1px dashed #c8d5e2;
      border-radius: 8px;
      background: #f8fafc;
      color: var(--muted);
      padding: 18px;
      line-height: 1.5;
    }

    .documents-grid .empty-state,
    .notes-list .empty-state {
      grid-column: 1 / -1;
    }

    .document-card,
    .note-card {
      padding: 16px;
      display: grid;
      gap: 12px;
    }

    .document-card h4,
    .note-card h4 {
      margin: 0;
      font-size: 16px;
      line-height: 1.25;
    }

    .document-card p,
    .note-card p {
      margin: 0;
      color: var(--muted);
      line-height: 1.45;
      font-size: 14px;
    }

    .card-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .document-button {
      border: 0;
      border-radius: 6px;
      min-height: 38px;
      padding: 8px 12px;
      background: #eef2f6;
      color: #223146;
      font-weight: 800;
    }

    .document-button:hover {
      background: #e1e8ef;
    }

    .table-wrap .document-button {
      min-height: 32px;
      padding: 6px 10px;
      font-size: 13px;
    }

    .profile-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      padding: 16px 18px 18px;
    }

    .profile-item {
      min-height: 76px;
      border: 1px solid #e1e8ef;
      border-radius: 8px;
      padding: 12px;
      background: #fbfcfe;
    }

    .profile-item span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .profile-item strong {
      display: block;
      margin-top: 6px;
      font-size: 15px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .section-heading {
      margin: 18px 0 12px;
      display: flex;
      align-items: end;
      justify-content: space-between;
      gap: 14px;
    }

    .section-heading h3 {
      margin: 0;
      font-size: 18px;
      line-height: 1.25;
    }

    .section-heading p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }

    .parent-grid,
    .registration-list {
      display: grid;
      gap: 14px;
    }

    .parent-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .parent-card,
    .registration-card,
    .document-list-card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: 0 8px 20px rgba(24, 33, 47, 0.06);
      overflow: hidden;
    }

    .parent-title {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      background: #eef5ff;
      border-bottom: 1px solid var(--line);
    }

    .parent-title.father {
      background: #f2efff;
    }

    .parent-title span {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: #fff;
      background: var(--blue);
      font-weight: 800;
      flex: 0 0 auto;
    }

    .parent-title.father span {
      background: #6b55c7;
    }

    .parent-title h4 {
      margin: 0;
      font-size: 15px;
    }

    .parent-title p {
      margin: 2px 0 0;
      color: var(--muted);
      font-size: 12px;
    }

    .parent-details {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      padding: 14px;
    }

    .registration-card {
      padding: 16px;
      display: grid;
      gap: 14px;
    }

    .registration-main {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
      gap: 14px;
      align-items: start;
    }

    .registration-title {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .registration-title h3 {
      margin: 0;
      font-size: 18px;
      line-height: 1.25;
    }

    .registration-title p {
      margin: 4px 0 0;
      color: var(--muted);
      line-height: 1.4;
    }

    .registration-summary {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .document-list {
      display: grid;
      gap: 8px;
      padding: 14px 16px 16px;
    }

    .document-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 14px;
      align-items: center;
      min-height: 76px;
      padding: 12px 14px;
      border: 1px solid #e1e8ef;
      border-radius: 8px;
      background: #fff;
    }

    .document-row > div:first-child {
      min-width: 0;
    }

    .document-row .card-actions {
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: nowrap;
      min-width: 156px;
    }

    .document-row .badge {
      min-height: 26px;
      padding: 3px 9px;
      white-space: nowrap;
    }

    .document-row .document-button {
      min-height: 34px;
      padding: 7px 11px;
      font-size: 13px;
      white-space: nowrap;
    }

    .document-row strong,
    .document-row small {
      display: block;
    }

    .document-row small {
      margin-top: 3px;
      color: var(--muted);
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .amount-paid {
      color: var(--green);
    }

    .amount-due {
      color: var(--rose);
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.48);
      display: grid;
      place-items: center;
      padding: 20px;
      z-index: 40;
    }

    .modal {
      width: min(620px, 100%);
      background: #fff;
      border-radius: 8px;
      box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
      overflow: hidden;
      border: 1px solid #d6e0ea;
    }

    .modal-header {
      min-height: 64px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--line);
    }

    .modal-header h3 {
      margin: 0;
      font-size: 18px;
    }

    .modal-body {
      padding: 18px;
      display: grid;
      gap: 12px;
    }

    .preview-document {
      min-height: 260px;
      border: 1px solid #cad6e2;
      border-radius: 8px;
      background:
        linear-gradient(180deg, #fff 0, #fff 18%, #f8fafc 18%, #f8fafc 100%);
      padding: 26px;
      display: grid;
      align-content: start;
      gap: 16px;
    }

    .preview-document strong {
      font-size: 22px;
    }

    .preview-line {
      height: 10px;
      width: 100%;
      border-radius: 999px;
      background: #dde6ef;
    }

    .preview-line.short {
      width: 62%;
    }

    @media (max-width: 980px) {
      .login-page,
      .student-band,
      .section-grid,
      .registration-main {
        grid-template-columns: 1fr;
      }

      .login-brand {
        min-height: 360px;
      }

      .dashboard-grid,
      .parent-grid,
      .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .portal-id {
        min-width: 0;
      }
    }

    @media (max-width: 640px) {
      .login-brand,
      .login-panel {
        padding: 24px 16px;
      }

      .login-brand h1 {
        font-size: 30px;
      }

      .topbar {
        padding: 12px 14px;
      }

      .brand-lockup span {
        display: none;
      }

      .shell {
        width: min(100% - 20px, 1240px);
        padding-top: 16px;
      }

      .student-band {
        padding: 18px;
      }

      .student-title {
        align-items: flex-start;
      }

      .student-title h2 {
        font-size: 24px;
      }

      .dashboard-grid,
      .documents-grid,
      .parent-grid,
      .parent-details,
      .profile-grid,
      .portal-id,
      .registration-summary,
      .document-row {
        grid-template-columns: 1fr;
      }

      .secondary-button {
        padding-inline: 10px;
      }

      .document-row .card-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        min-width: 0;
        padding-top: 8px;
        border-top: 1px solid #eef2f6;
      }
    }
