    * { box-sizing: border-box; margin: 0; padding: 0; }
    body { font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif; background: #f5f5f7; color: #1d1d1f; }

    header { background: #1d1d1f; color: white; padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; }
    header h1 { font-size: 18px; font-weight: 600; }
    header .right { display: flex; align-items: center; gap: 16px; }
    header .right span { font-size: 13px; color: #999; }
    .refresh-btn { background: #333; border: 1px solid #555; color: #ccc; padding: 6px 14px; border-radius: 8px; font-size: 12px; cursor: pointer; }
    .refresh-btn:hover { background: #444; color: white; }

    .tab-nav { background: white; border-bottom: 1px solid #e5e5e5; display: flex; padding: 0 32px; gap: 0; overflow-x: auto; }
    .tab-btn { padding: 14px 24px; border: none; background: none; font-size: 14px; color: #666; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; white-space: nowrap; }
    .tab-btn:hover { color: #1d1d1f; }
    .tab-btn.active { color: #007aff; border-bottom-color: #007aff; font-weight: 600; }
    .tab-content { display: none; }
    .tab-content.active { display: block; }

    .container { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }

    .filter-bar { background: white; border-radius: 12px; padding: 14px 20px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
    .filter-bar label { font-size: 12px; color: #666; font-weight: 600; }
    .filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
    .pill { padding: 6px 14px; border-radius: 20px; border: 1px solid #ddd; background: white; font-size: 12px; cursor: pointer; transition: all 0.15s; }
    .pill:hover { border-color: #007aff; color: #007aff; }
    .pill.active { background: #007aff; border-color: #007aff; color: white; }
    .filter-bar input[type="date"] { padding: 5px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 12px; }
    .filter-bar select { padding: 5px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 12px; }
    .filter-bar .checkbox-label { font-size: 12px; color: #666; display: flex; align-items: center; gap: 4px; cursor: pointer; }

    .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
    .kpi-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
    .kpi-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
    .kpi-card { background: white; border-radius: 12px; padding: 20px 24px; }
    .kpi-card .label { font-size: 12px; color: #666; margin-bottom: 8px; }
    .kpi-card .value { font-size: 24px; font-weight: 700; }
    .kpi-card .sub { font-size: 12px; color: #999; margin-top: 4px; }
    .positive { color: #34c759; }
    .negative { color: #ff3b30; }

    .card { background: white; border-radius: 12px; padding: 24px; margin-bottom: 20px; }
    .card h2 { font-size: 14px; color: #666; font-weight: 600; margin-bottom: 16px; }

    .chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
    .chart-grid .card { margin-bottom: 0; }

    .table-wrap { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; font-size: 13px; }
    th { font-size: 12px; color: #666; font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 2px solid #e5e5e5; white-space: nowrap; cursor: pointer; user-select: none; }
    th:hover { color: #007aff; }
    th .sort-icon { font-size: 10px; margin-left: 4px; opacity: 0.3; }
    th .sort-icon.active { opacity: 1; color: #007aff; }
    td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
    tr:hover { background: #fafafa; }
    tr.clickable { cursor: pointer; }
    tr.clickable:hover { background: #f0f7ff; }

    .badge-red { background: #ffe8e6; color: #ff3b30; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
    .badge-orange { background: #fff3e0; color: #ff9500; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
    .badge-green { background: #e8f8ec; color: #34c759; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
    .badge-blue { background: #e6f0ff; color: #007aff; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
    .badge-gray { background: #f0f0f0; color: #666; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }

    .section-title { font-size: 14px; font-weight: 600; color: #666; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }

    .drill-down { display: none; background: #fafbfc; border-radius: 12px; padding: 24px; margin-bottom: 20px; border: 1px solid #e5e5e5; }
    .drill-down.show { display: block; }
    .drill-down h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

    .progress-bar-wrap { margin-bottom: 20px; }
    .progress-bar-label { font-size: 12px; color: #666; margin-bottom: 6px; display: flex; justify-content: space-between; }
    .progress-bar-bg { height: 12px; background: #e5e5e5; border-radius: 6px; overflow: hidden; }
    .progress-bar-fill { height: 100%; border-radius: 6px; transition: width 0.3s; }
    .progress-green { background: #34c759; }
    .progress-orange { background: #ff9500; }
    .progress-red { background: #ff3b30; }

    .row-excluded { opacity: 0.6; }
    .row-low-score { border-left: 3px solid #ff3b30; }

    .text-right { text-align: right; }
    .totals-row { font-weight: 700; background: #f9f9fb; }

    /* Loading overlay */
    #loading-overlay {
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(255,255,255,0.95); display: flex; flex-direction: column;
      align-items: center; justify-content: center; z-index: 9999;
    }
    #loading-overlay .spinner {
      width: 40px; height: 40px; border: 4px solid #e5e5e5;
      border-top-color: #007aff; border-radius: 50%;
      animation: spin 0.8s linear infinite; margin-bottom: 16px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    #loading-overlay .loading-text { font-size: 14px; color: #666; }
    #loading-overlay .loading-detail { font-size: 12px; color: #999; margin-top: 8px; }

    /* Error banner */
    .error-banner {
      background: #ffe8e6; color: #ff3b30; padding: 12px 20px; border-radius: 8px;
      margin: 20px auto; max-width: 1200px; font-size: 13px; display: none;
    }
    .error-banner.show { display: block; }

    @media (max-width: 768px) {
      .kpi-grid, .kpi-grid-3, .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
      .chart-grid { grid-template-columns: 1fr; }
      header { padding: 12px 16px; }
      .tab-nav { padding: 0 16px; }
      .container { padding: 16px 12px; }
    }

    #login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #f5f5f7; z-index: 10000; display: flex; align-items: center; justify-content: center; }
    #login-overlay.hidden { display: none; }
    .login-box { background: white; border-radius: 16px; padding: 40px; width: 340px; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
    .login-box h2 { font-size: 18px; margin-bottom: 6px; }
    .login-box p { font-size: 13px; color: #666; margin-bottom: 24px; }
    .login-box input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
    .login-box input:focus { outline: none; border-color: #007aff; }
    .login-box button { width: 100%; padding: 12px; background: #1d1d1f; color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
    .login-box button:hover { background: #333; }
    .login-error { color: #ff3b30; font-size: 12px; margin-bottom: 12px; display: none; }

    #feedback-btn { position: fixed; bottom: 24px; right: 24px; z-index: 8000; background: #1d1d1f; color: white; border: none; width: 48px; height: 48px; border-radius: 50%; font-size: 20px; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.2); transition: transform 0.15s, background 0.15s; display: flex; align-items: center; justify-content: center; }
    #feedback-btn:hover { transform: scale(1.1); background: #333; }
    #feedback-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9000; background: rgba(0,0,0,0.4); align-items: center; justify-content: center; }
    #feedback-modal.show { display: flex; }
    .feedback-box { background: white; border-radius: 16px; padding: 28px; width: 400px; max-width: 90vw; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
    .feedback-box h3 { font-size: 16px; margin-bottom: 4px; }
    .feedback-box .sub { font-size: 12px; color: #999; margin-bottom: 16px; }
    .feedback-box input, .feedback-box textarea, .feedback-box select { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; margin-bottom: 10px; font-family: inherit; }
    .feedback-box textarea { height: 100px; resize: vertical; }
    .feedback-box select { appearance: auto; }
    .feedback-box .btn-row { display: flex; gap: 8px; justify-content: flex-end; }
    .feedback-box .btn-row button { padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
    .feedback-box .btn-cancel { background: #f0f0f0; color: #666; }
    .feedback-box .btn-send { background: #007aff; color: white; }
    .feedback-box .btn-send:hover { background: #0063d1; }
    .feedback-box .btn-send:disabled { background: #ccc; cursor: not-allowed; }
    .feedback-sent { color: #34c759; font-size: 13px; font-weight: 600; text-align: center; padding: 20px 0; }
