    :root {
      --brand-orange: #f8991d;
      --brand-blue: #003366;
      --text-main: #000000;
      --bg: #f4f7fb;
      --white: #ffffff;
      --border: #d8dfe8;
      --danger: #d62828;
      --danger-soft: #fde3e3;
      --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
      --radius: 10px;
    }

    * {
      box-sizing: border-box;
    }

    [hidden] {
      display: none !important;
    }

    body {
      margin: 0;
      font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
      background: linear-gradient(180deg, #eef3f9 0%, #f8fbff 100%);
      color: var(--text-main);
    }

    .top-header {
      background: var(--brand-blue);
      color: var(--white);
      padding: 16px 20px 18px;
      box-shadow: var(--shadow);
      position: sticky;
      top: 0;
      z-index: 10;
    }

    .header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    body.management-view .header-row,
    body.period-centered .header-row {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      width: 100%;
      min-height: 56px;
    }

    body.management-view .title,
    body.period-centered .title {
      max-width: clamp(260px, 32vw, 420px);
      flex: 0 1 clamp(260px, 32vw, 420px);
      overflow-wrap: anywhere;
    }

    body.management-view .week-controls,
    body.period-centered .week-controls {
      position: absolute;
      left: 50%;
      transform: translate(-50%, -50%);
      top: 50%;
      z-index: 1;
      justify-content: center;
      margin: 0;
      white-space: nowrap;
    }

    body.management-view .session-controls,
    body.period-centered .session-controls {
      margin-left: auto;
      justify-content: flex-end;
      position: relative;
      z-index: 2;
    }

    .title {
      margin: 0;
      display: flex;
      align-items: center;
      gap: 12px;
      line-height: 1.2;
      max-width: 100%;
    }

    .title-copy {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }

    .title-logo {
      width: 44px;
      height: 44px;
      object-fit: contain;
      border-radius: 12px;
      flex: 0 0 auto;
      background: rgba(255, 255, 255, 0.1);
      padding: 2px;
      align-self: flex-start;
    }

    .title-main {
      font-size: 1.4rem;
      font-weight: 700;
    }

    .title-sub {
      font-size: 0.98rem;
      font-weight: 600;
      color: rgba(255, 255, 255, 0.9);
    }

    .title .highlight {
      color: var(--brand-orange);
    }

    .week-controls {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .month-label {
      min-width: 180px;
      text-align: center;
      font-weight: 700;
      color: var(--brand-orange);
    }

    .session-controls {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin-left: auto;
      flex-wrap: wrap;
    }

    .session-meta {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
    }

    .session-name {
      font-size: 0.92rem;
      font-weight: 700;
    }

    .role-chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 9px;
      border-radius: 999px;
      font-size: 0.76rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      background: rgba(248, 153, 29, 0.18);
      color: var(--white);
      border: 1px solid rgba(255, 255, 255, 0.18);
    }

    .auth-gate {
      min-height: calc(100vh - 86px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 28px 16px;
    }

    .auth-card {
      width: min(460px, 100%);
      padding: 24px;
    }

    .auth-logo {
      display: block;
      width: min(220px, 68%);
      height: auto;
      margin: 0 auto 14px;
    }

    .eyebrow {
      margin: 0 0 8px;
      font-size: 0.8rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--brand-orange);
    }

    .auth-title {
      margin: 0 0 10px;
      color: var(--brand-blue);
      font-size: 1.7rem;
      line-height: 1.1;
    }

    .auth-text {
      margin: 0 0 18px;
      color: #526273;
      line-height: 1.5;
    }

    .auth-error,
    .auth-feedback {
      margin: 0;
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 0.92rem;
      line-height: 1.45;
      font-weight: 700;
    }

    .auth-error {
      background: #fff0f0;
      border: 1px solid #efb6b6;
      color: #9a1717;
    }

    .auth-feedback.is-success {
      background: #e9f8ee;
      border: 1px solid #b8e0c3;
      color: #166936;
    }

    .auth-feedback.is-error {
      background: #fff0f0;
      border: 1px solid #efb6b6;
      color: #9a1717;
    }


    .layout {
      display: grid;
      grid-template-columns: 320px 1fr;
      gap: 16px;
      padding: 16px;
      max-width: 1400px;
      margin: 0 auto;
      align-items: start;
    }

    .layout.sidebar-hidden {
      grid-template-columns: 1fr;
    }

    .layout.sidebar-hidden .sidebar {
      display: none;
    }

    .layout.sidebar-hidden .grid-panel,
    .layout.sidebar-hidden .finance-panel {
      grid-column: 1;
    }

    .panel {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

    .sidebar {
      padding: 14px;
      align-self: start;
      grid-row: 1 / span 3;
      position: sticky;
      top: 100px;
    }

    .app-banner {
      margin-bottom: 14px;
      border-radius: 10px;
      padding: 12px;
      background: linear-gradient(135deg, #fdf2df 0%, #fff9ef 100%);
      border: 1px solid #f2d5a5;
    }

    .app-banner-title {
      margin: 0 0 5px;
      font-weight: 800;
      color: var(--brand-blue);
    }

    .app-banner-text,
    .password-panel-text {
      margin: 0;
      color: #5a6775;
      line-height: 1.45;
    }

    .lock-section {
      margin-top: 18px;
      padding-top: 4px;
      border-top: 1px solid #e4ebf4;
    }

    .sidebar-nav-section {
      margin-bottom: 18px;
    }

    .view-nav {
      display: grid;
      gap: 8px;
    }

    .lock-section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .lock-section-header .section-title {
      margin-right: 8px;
      margin-bottom: 8px;
    }

    .lock-message {
      margin: 0 0 10px;
      line-height: 1.45;
    }

    .password-panel {
      margin-bottom: 14px;
      padding: 12px;
      border: 1px solid #d8e3ef;
      border-radius: 10px;
      background: #f8fbff;
    }

    .section-title {
      margin: 6px 0 10px;
      font-size: 1rem;
      color: var(--brand-blue);
      border-bottom: 2px solid #e7edf6;
      padding-bottom: 6px;
    }

    label {
      display: block;
      margin-bottom: 6px;
      font-weight: 600;
      font-size: 0.9rem;
    }

    input,
    button {
      font-family: inherit;
      font-size: 0.95rem;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    select {
      width: 100%;
      border: 1px solid #c7d2df;
      border-radius: 8px;
      padding: 9px 10px;
      margin-bottom: 10px;
      background: #fff;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    input[type="text"]:focus,
    input[type="number"]:focus,
    input[type="date"]:focus,
    input[type="password"]:focus,
    select:focus {
      outline: none;
      border-color: var(--brand-orange);
      box-shadow: 0 0 0 3px rgba(248, 153, 29, 0.22);
    }

    .btn {
      border: 1px solid transparent;
      border-radius: 8px;
      padding: 8px 12px;
      cursor: pointer;
      font-weight: 600;
      transition: transform 0.05s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

    .btn:active {
      transform: translateY(1px);
    }

    .btn:focus {
      outline: none;
      box-shadow: 0 0 0 3px rgba(248, 153, 29, 0.25);
    }

    .btn:disabled {
      cursor: not-allowed;
      opacity: 0.65;
      box-shadow: none;
      transform: none;
    }

    .btn-primary {
      background: var(--brand-orange);
      color: #1a1a1a;
    }

    .btn-primary:hover {
      background: #e68a14;
    }

    .btn-secondary {
      background: #ffffff;
      border-color: #9fb4cc;
      color: var(--brand-blue);
    }

    .btn-secondary:hover {
      background: #f2f7ff;
    }

    .view-nav .btn.is-active {
      background: var(--brand-blue);
      border-color: var(--brand-blue);
      color: var(--white);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    .btn-danger-lite {
      background: #fff2f2;
      color: #8e1010;
      border-color: #f3b3b3;
    }

    .full {
      width: 100%;
    }

    .project-list {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    .project-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      border: 1px solid #e4ebf4;
      border-radius: 8px;
      padding: 8px 10px;
      margin-bottom: 8px;
      background: #fbfdff;
    }

    .project-name {
      font-weight: 600;
      word-break: break-word;
    }

    .project-meta {
      display: block;
      margin-top: 2px;
      font-size: 0.82rem;
      color: #506275;
    }

    .project-info {
      min-width: 0;
    }

    .project-cap {
      display: block;
      margin-top: 2px;
      font-size: 0.82rem;
      color: #506275;
      font-weight: 600;
    }

    .checkbox-row {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin: 6px 0 10px;
      font-size: 0.92rem;
      color: #304255;
    }

    .checkbox-row input[type="checkbox"] {
      margin: 0;
    }

    .project-actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .edit-btn {
      border: 1px solid #b8cae1;
      background: #f2f7ff;
      color: #1c4d7a;
      cursor: pointer;
      font-weight: 700;
      line-height: 1;
      padding: 5px 8px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      min-height: 32px;
    }

    .edit-btn:hover,
    .edit-btn:focus {
      background: #e6f0ff;
      outline: none;
    }

    .edit-btn svg {
      width: 16px;
      height: 16px;
      display: block;
    }
    .delete-btn {
      border: 1px solid #f1c2c2;
      background: #fff5f5;
      color: #a50000;
      cursor: pointer;
      font-weight: 700;
      line-height: 1;
      padding: 5px 8px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 32px;
    }

    .delete-btn:hover,
    .delete-btn:focus {
      background: #ffe9e9;
      outline: none;
    }

    .delete-btn svg {
      width: 16px;
      height: 16px;
      display: block;
    }

    .delete-btn.confirm {
      border-color: #9ad8aa;
      background: #ecfff1;
      color: #0a7d2f;
    }

    .delete-btn.confirm:hover,
    .delete-btn.confirm:focus {
      background: #dcffe7;
    }

    .sure-label {
      font-size: 0.82rem;
      font-weight: 700;
    }

    .progress-list {
      margin: 0;
      padding: 0;
      list-style: none;
      display: grid;
      gap: 8px;
    }

    .progress-item {
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid #e4ebf4;
      background: #fcfdff;
      font-size: 0.92rem;
    }

    .progress-item.exceeded {
      border-color: #f3aaaa;
      background: #fff3f3;
      color: var(--danger);
      font-weight: 700;
    }

    .grid-panel {
      padding: 14px;
      overflow-x: auto;
    }

    .finance-panel {
      grid-column: 2;
      padding: 18px;
    }

    .finance-header {
      display: flex;
      align-items: end;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .finance-title {
      margin-bottom: 0;
      border-bottom: 0;
      padding-bottom: 0;
    }

    .finance-controls {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 14px;
      align-items: end;
    }

    .finance-controls input[type="text"],
    .finance-controls input[type="number"],
    .finance-controls input[type="password"],
    .finance-controls select {
      margin-bottom: 0;
    }

    .finance-action {
      display: flex;
      align-items: end;
    }

    #financeFeedback {
      margin-bottom: 12px;
    }

    .finance-summary-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }

    .finance-card {
      appearance: none;
      width: 100%;
      text-align: left;
      border: 1px solid #d7e1ec;
      border-radius: 10px;
      padding: 12px;
      background: #fbfdff;
    }

    .finance-card.is-clickable {
      cursor: pointer;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.05s ease;
    }

    .finance-card.is-clickable:hover {
      background: #f3f8ff;
      border-color: #aac1da;
    }

    .finance-card.is-clickable:focus {
      outline: none;
      box-shadow: 0 0 0 3px rgba(248, 153, 29, 0.2);
    }

    .finance-card.is-active {
      border-color: var(--brand-blue);
      background: #eef5ff;
      box-shadow: inset 0 0 0 1px rgba(0, 51, 102, 0.08);
    }

    .finance-card-label {
      display: block;
      margin-bottom: 6px;
      color: #5f6f80;
      font-size: 0.82rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .finance-card-value {
      margin: 0;
      color: var(--brand-blue);
      font-size: 1.25rem;
      font-weight: 800;
    }

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

    .finance-subsection {
      margin-top: 20px;
      padding-top: 4px;
      border-top: 1px solid #e4ebf4;
    }

    .finance-subsection-header {
      display: flex;
      align-items: end;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }

    .finance-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 760px;
    }

    .finance-table th,
    .finance-table td {
      border: 1px solid #dde7f3;
      padding: 10px 8px;
      text-align: left;
      background: #fff;
      vertical-align: middle;
    }

    .finance-table th {
      background: #edf4fc;
      color: var(--brand-blue);
      font-size: 0.9rem;
    }

    .finance-status {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 0.78rem;
      font-weight: 700;
      background: #eef5ff;
      color: #315a82;
      text-align: center;
    }

    .finance-table .status-cell {
      text-align: center;
    }

    .finance-status.is-warning {
      background: #fff3db;
      color: #8c5a00;
    }

    .finance-status.is-danger {
      background: #ffe6e6;
      color: #a11a1a;
    }

    .finance-status.is-success {
      background: #e6f8eb;
      color: #116b2f;
    }

    .finance-actions {
      display: inline-flex;
      gap: 8px;
      flex-wrap: nowrap;
      align-items: center;
      white-space: nowrap;
    }

    .user-management-actions {
      grid-template-columns: 220px;
      margin-top: -2px;
      margin-bottom: 14px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 780px;
    }

    thead th {
      background: #edf4fc;
      color: var(--brand-blue);
      border: 1px solid #d4e0ee;
      padding: 10px 8px;
      text-align: center;
      font-size: 0.93rem;
    }

    tbody td,
    tbody th,
    tfoot td,
    tfoot th {
      border: 1px solid #dde7f3;
      padding: 8px;
      text-align: center;
      background: #fff;
    }

    tbody th,
    tfoot th {
      text-align: left;
      background: #f8fbff;
      color: var(--brand-blue);
      min-width: 180px;
    }

    .hours-input {
      width: 100%;
      min-width: 72px;
      text-align: center;
      margin: 0;
    }

    .hours-input:disabled {
      background: #f5f8fc;
      color: #5a6775;
      cursor: not-allowed;
    }

    .hours-input.has-value {
      font-weight: 700;
    }

    .hours-input.is-over-limit {
      border-color: #d9534f;
      background: #fff0f0;
      color: #9f1515;
    }

    td.is-over-limit {
      background: #ffe3e3;
    }

    .daily-total.over-8 {
      background: var(--danger-soft);
      color: #8f0f0f;
      font-weight: 700;
    }

    .daily-total.exact-8 {
      background: #e6f8eb;
      color: #116b2f;
      font-weight: 700;
    }

    .muted {
      color: #6a7785;
      font-size: 0.9rem;
      margin: 0;
    }

    .stack-sm > * + * {
      margin-top: 8px;
    }

    .data-transfer-note {
      margin: 8px 0 0;
      line-height: 1.4;
    }

    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.45);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      z-index: 50;
    }

    .modal-overlay[hidden] {
      display: none;
    }

    .modal {
      width: min(560px, 100%);
      background: var(--white);
      border: 2px solid var(--brand-blue);
      border-top: 7px solid var(--brand-orange);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 18px;
    }

    .modal-title {
      margin: 0 0 8px;
      color: var(--brand-blue);
      font-size: 1.2rem;
    }

    .modal-text {
      margin: 0 0 14px;
      line-height: 1.45;
      font-weight: 600;
    }

    .modal-list {
      margin: 0 0 14px 20px;
      padding: 0;
      line-height: 1.45;
      font-weight: 600;
    }

    .modal-list li {
      margin-bottom: 6px;
    }

    @media (max-width: 980px) {
      .layout {
        grid-template-columns: 1fr;
      }

      .sidebar {
        grid-row: auto;
        position: static;
      }

      .month-label {
        min-width: 0;
      }

      .session-controls {
        margin-left: 0;
      }

      .session-meta {
        align-items: flex-start;
      }

      .finance-controls,
      .finance-summary-grid {
        grid-template-columns: 1fr;
      }

      .finance-panel {
        grid-column: 1;
      }
    }
