/* KosBumul 4.6 — original styling inspired by 21st.dev dashboard, score cards and dock patterns.
   Load after styles.css and before device-ui.css. No remote fonts or runtime CSS dependencies. */

@media screen {
  [hidden] { display: none !important; }

  :root {
    --ink: #192035;
    --muted: #596377;
    --canvas: #f3f5f8;
    --line: #dce1e9;
    --soft: #eef1f6;
    --radius: 22px;
    --control-border: #818b9f;
    --surface-shadow: 0 2px 3px #17203903, 0 10px 26px #17203904;
  }

  body { font-size: 16px; }
  h1, h2, h3 { text-wrap: balance; }
  h1 { font-size: clamp(30px, 2.6vw, 40px); line-height: 1.16; letter-spacing: -.045em; }

  .btn { min-height: 46px; font-size: 14px; border-radius: 12px; }
  .btn.primary { box-shadow: 0 3px 8px #354ed91a; }
  .btn.ghost { box-shadow: none; }
  .text-button { font-size: 14px; }

  .btn:focus-visible,
  .filter-pill:focus-visible,
  .role-switch button:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
  }

  .sidebar { border-right: 1px solid #30374c; }
  .brand { padding-bottom: 22px; border-bottom: 1px solid #363c52; }
  .brandmark { border-radius: 12px; }
  .brand strong { font-size: 22px; }
  .brand p, .side-footer p, .side-plan > p:last-child { font-size: 12px; }
  .nav-caption { margin-top: 26px; font-size: 11px; }
  .nav { gap: 7px; }
  .nav a { min-height: 49px; font-size: 14px; border: 1px solid transparent; }
  .nav a.active { border-color: #f3f6bc; box-shadow: 0 3px 12px #0000000d; }
  .nav a:active { background: #373e56; color: white; }
  .nav a.active:active { background: #dee58e; color: var(--navy); }

  .side-plan { border-radius: 18px; background: #22283e; }
  .side-plan .eyebrow { font-size: 11px; }
  .side-footer strong { font-size: 13px; }

  .topbar { background: var(--paper); min-height: 82px; }
  .crumb { font-size: 13px; gap: 12px; }
  .top-actions .btn { font-size: 13px; }
  .connection { font-size: 12px; padding: 7px 10px; background: var(--soft); border-radius: 999px; }

  .main { padding-top: 34px; }
  .page-heading { margin-bottom: 28px; gap: 24px; }
  .page-heading .eyebrow { font-size: 11px; letter-spacing: .08em; }
  .page-heading h1 + p { font-size: 14px; line-height: 1.75; }

  .month-field, .search-box, .toolbar select {
    border-color: var(--control-border);
    border-radius: 12px;
  }

  .month-field { min-height: 46px; }
  .month-field input { font-size: 16px; width: 148px; min-height: 44px; }

  .summary-grid { gap: 18px; }
  .balance, .summary-grid .metric { min-height: 190px; padding: 24px; }
  .balance { border-color: #d3db85; background: #ebefa1; box-shadow: var(--surface-shadow); }
  .balance-label { font-size: 14px; }
  .balance-label > svg { width: 22px; height: 22px; }
  .balance-value { font-size: clamp(28px, 2.4vw, 38px); font-weight: 700; margin-block: 25px 20px; }
  .balance-footer { font-size: 12px; }

  .metric, .panel, .occupancy-stats article { box-shadow: var(--surface-shadow); }
  .metric-top { font-size: 13px; color: #4e586d; font-weight: 550; }
  .metric-icon { width: 35px; height: 35px; border-radius: 11px; }
  .metric-value { font-size: clamp(26px, 2.1vw, 33px); font-weight: 650; margin-block: 22px 17px; }
  .metric-foot { font-size: 12px; }
  .metric-value.long-value, .balance-value.long-value { font-size: 24px; }

  .deadline-card { padding: 22px 24px; background: #edf0f7; border-radius: 18px; }
  .deadline-icon { border: 1px solid var(--line); width: 48px; height: 50px; }
  .deadline-leading .eyebrow { font-size: 11px; }
  .deadline-leading h2 { font-size: 25px; }
  .deadline-leading p:last-child, .deadline-status p { font-size: 13px; }
  .deadline-link { font-size: 13px; }

  .panel-head { padding: 24px 24px 0; flex-wrap: wrap; }
  .panel-head h2 { font-size: 20px; }
  .panel-head p { font-size: 13px; line-height: 1.7; }

  .legend { font-size: 12px; }
  .chart-wrap { padding-top: 26px; }
  .chart-note { font-size: 12px; padding: 15px 24px; background: #fbfcfd; border-radius: 0 0 22px 22px; }
  .progress-number b { font-size: 34px; font-weight: 650; }
  .progress-number span, .progress-total span, .progress-stats p { font-size: 12px; }
  .progress-total strong { font-size: 17px; }
  .progress-panel > .btn { font-size: 13px; border-color: var(--control-border); }

  .list-controls { margin-block: 26px 22px; }
  .filter-pills { background: #e8edf4; padding: 5px; gap: 6px; border-radius: 15px; }
  .filter-pill { font-size: 13px; min-height: 46px; color: #4c576c; }
  .pill-count { font-size: 11px; min-width: 23px; min-height: 22px; }
  .filter-pill[aria-pressed="true"] { box-shadow: 0 2px 4px #171a2d14; }
  .count, .pagination p, .pagination span { font-size: 13px; }

  .table-wrap { padding-top: 20px; }
  th { font-size: 11px; letter-spacing: .045em; background: #f4f6fa; padding-block: 15px; }
  td { font-size: 14px; padding-block: 18px; }
  .transaction-cell strong { font-size: 14px; }
  .transaction-cell small, .person small { font-size: 12px; }
  .tx-icon { width: 38px; height: 38px; border-radius: 12px; }
  .badge { font-size: 12px; border-radius: 999px; padding: 5px 10px; }
  .amount { font-weight: 650; letter-spacing: -.015em; }

  .resident-card { padding: 25px; }
  .resident-top .avatar { width: 46px; height: 46px; border-radius: 15px; }
  .resident-card h2 { font-size: 23px; }
  .room-label, .stay-period dt { font-size: 13px; }
  .stay-period dd { font-size: 14px; }
  .resident-actions { padding-top: 2px; gap: 8px; }
  .resident-actions .btn { font-size: 13px; }
  .occupancy-stats p { font-size: 13px; }

  .payment-info { padding: 26px; background: #fff; border-color: #cbd2e2; }
  .payment-info-icon, .settings-icon, .access-icon { background: #e9edf8; color: #344d96; }
  .payment-info .eyebrow { font-size: 11px; color: #495674; }
  .payment-info h2 { font-size: 21px; }
  .payment-info p, .settings-card > p, .settings-heading p { font-size: 14px; line-height: 1.75; }

  .settings-card { padding: 28px; }
  .settings-card .table-wrap { margin-inline: -28px; }
  .settings-list dt { font-size: 11px; letter-spacing: .06em; }
  .settings-list dd { font-size: 15px; }
  .settings-list dd small { font-size: 13px; }
  .settings-icon { width: 48px; height: 48px; border-radius: 15px; }

  .announcement { background: #edf1fd; border-color: #d7dff5; border-left-color: var(--blue); }
  .announcement strong, .announcement p { font-size: 14px; }

  .empty { padding-block: 50px; }
  .empty strong { font-size: 19px; }
  .empty p, .context-note { font-size: 13px; }
  .bottom-note { font-size: 12px; }

  dialog { border-radius: 24px; box-shadow: 0 24px 90px #0c17314d; }
  dialog::backdrop { background: #10182db3; }
  .modal-head { padding: 26px 28px 24px; background: #f7f9fc; }
  .modal-head h2 { font-size: 25px; }
  .modal-head p { font-size: 14px; }
  .modal-form { padding: 26px 28px 28px; }
  .field label { font-size: 14px; }

  .field input, .field select, .field textarea {
    border-radius: 12px;
    border-color: var(--control-border);
    font-size: 16px;
  }

  .field small, .field-help { font-size: 13px; line-height: 1.7; }
  .form-note { background: #eef2fa; border-color: #d8e0ef; color: #495570; font-size: 13px; }
  .form-error { font-size: 14px; }
  .modal-actions { padding-top: 20px; border-top: 1px solid var(--line); }

  .qris-payment-amount { padding: 24px; border-radius: 18px; }
  .qris-payment-amount strong { color: var(--citron); }
  #wa-preview { min-height: 240px; background: #f7f9fc; font-size: 16px; line-height: 1.8; }

  .access-page { gap: clamp(28px, 5vw, 80px); padding: 24px; max-width: 1440px; }

  .access-story {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 44px;
    border-radius: 28px;
  }

  .access-story::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
      linear-gradient(#ffffff04 1px, transparent 1px),
      linear-gradient(90deg, #ffffff04 1px, transparent 1px);
    background-size: 44px 44px;
  }

  .access-brand { font-size: 27px; }
  .access-story h1 { font-size: clamp(48px, 5.4vw, 78px); max-width: 12ch; }
  .access-story h1 + p { font-size: 16px; }
  .access-points { gap: 17px; }
  .access-points span { font-size: 14px; }

  .access-card {
    max-width: 460px;
    padding: 36px 32px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: white;
    box-shadow: var(--surface-shadow);
  }

  .access-icon { width: 52px; height: 52px; border-radius: 16px; }
  .access-card > .eyebrow { font-size: 11px; letter-spacing: .075em; }
  .access-card h2 { font-size: 33px; }
  .access-description { font-size: 15px; line-height: 1.75; }

  .role-switch { background: var(--soft); padding: 5px; border-radius: 14px; }
  .role-switch button { font-size: 14px; min-height: 48px; border-radius: 10px; }
  .access-submit { min-height: 52px; font-size: 15px; }
  .access-help { font-size: 13px; }

  .captcha-panel { padding-block: 18px 4px; }
  #captcha-status { font-size: 13px; }

  .mobile-nav a { transition: background-color .16s ease, color .16s ease; }
  .mobile-nav a.active { background: var(--citron); color: var(--navy); }
  .mobile-nav a:active { background: #e3e8f2; }

  /* The motion layer takes ownership of route entrance, without hiding content. */
  html[data-motion="ready"] .route-enter { animation: none; }
}

@media screen and (hover: hover) and (pointer: fine) {
  .resident-card:hover {
    border-color: #aebbd0;
    box-shadow: 0 8px 24px #1720390a;
  }

  tbody tr:hover { background: #f4f7fc; }
  .mobile-nav a:hover { background: #edf1f7; }
  .mobile-nav a.active:hover { background: #e4ea94; }
}

@media screen and (min-width: 1280px) {
  .overview-grid { gap: 24px; }

  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

@media screen and (max-width: 767px) {
  h1 { font-size: clamp(28px, 7vw, 34px); }
  .page-heading { margin-bottom: 24px; }
  .page-heading h1 + p { font-size: 14px; }

  .balance, .summary-grid .metric { padding: 22px; }
  .summary-grid .metric { min-height: 148px; }
  .balance-value { font-size: 34px; }
  .summary-grid .metric-value { font-size: 29px; }

  .summary-grid .metric-value.long-value,
  .balance-value.long-value {
    font-size: 23px;
  }

  .panel-head { padding: 23px 20px 0; }
  .progress-panel { padding: 22px 20px; }
  .progress-panel .panel-head { padding: 0; }
  .deadline-card { padding: 21px 20px; }
  .deadline-leading h2 { font-size: 24px; }
  .chart-note { padding-inline: 20px; }
  .filter-pill { font-size: 12px; }

  .dues-table tr, .transaction-table tr, .recent-table tr {
    padding: 18px 20px;
    gap: 5px;
  }

  .dues-table td, .transaction-table td, .recent-table td {
    font-size: 14px;
  }

  .dues-table .badge { font-size: 12px; }
  .resident-card, .settings-card { padding: 24px; }
  .settings-card .table-wrap { margin-inline: -24px; }

  .payment-info { padding: 23px 20px; }
  .payment-info > div:nth-child(2) { min-width: min(165px, 100%); }

  .modal-head { padding: 25px 22px 22px; }
  .modal-form { padding: 24px 22px; }
  .modal-head h2 { font-size: 24px; }

  .access-page { padding: 16px; max-width: 620px; }
  .access-story { padding: 28px; gap: 28px; border-radius: 24px; }
  .access-story h1 { font-size: 44px; max-width: none; }
  .access-story h1 + p { font-size: 14px; margin-top: 18px; }
  .access-story .eyebrow { margin-bottom: 16px; }

  .access-card {
    margin-top: 16px;
    padding: 28px 22px;
    max-width: none;
    border-radius: 22px;
  }

  .access-card h2 { font-size: 30px; }
  .access-description { font-size: 14px; }
}

@media screen and (prefers-reduced-motion: reduce) {
  .mobile-nav a, .resident-card, .nav a, .btn {
    transition: none;
  }
}
