:root {
      --white: #ffffff;
      --pink-50: #fff1f7;
      --pink-100: #ffe4f0;
      --pink-200: #fecde2;
      --pink-300: #f9a8d4;
      --pink-500: #ec4899;
      --pink-700: #be185d;
      --green-100: #dcfce7;
      --green-500: #22c55e;
      --green-700: #15803d;
      --gray-100: #f8fafc;
      --gray-200: #e5e7eb;
      --gray-500: #6b7280;
      --gray-700: #374151;
      --gray-900: #111827;
      --danger: #ef4444;
      --shadow: 0 12px 30px rgba(236, 72, 153, 0.12);
      --radius: 18px;
      --radius-sm: 12px;
      --container: 1200px;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      margin: 0;
      padding: 0;
      font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
      background: linear-gradient(180deg, var(--white) 0%, var(--pink-50) 100%);
      color: var(--gray-900);
      min-height: 100%;
    }

    body {
      padding-bottom: 120px;
    }

    button,
    input,
    select {
      font: inherit;
    }

    .app {
      width: 100%;
      max-width: var(--container);
      margin: 0 auto;
      padding: 16px;
    }

    .header {
      position: sticky;
      top: 0;
      z-index: 30;
      padding: 12px 0;
      backdrop-filter: blur(12px);
      background: rgba(255, 255, 255, 0.88);
    }

    .hero {
      background: linear-gradient(135deg, var(--white) 0%, var(--pink-50) 60%, var(--pink-100) 100%);
      border: 1px solid var(--pink-200);
      border-radius: 24px;
      padding: 18px;
      box-shadow: var(--shadow);
    }

    .hero-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
    }

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

    .brand-icon {
      width: 54px;
      height: 54px;
      border-radius: 16px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, var(--pink-500), var(--pink-300));
      color: var(--white);
      font-size: 28px;
      box-shadow: 0 14px 26px rgba(236, 72, 153, 0.25);
      flex: 0 0 auto;
    }

    .brand h1 {
      margin: 0;
      font-size: 1.35rem;
      line-height: 1.1;
    }

    .brand p {
      margin: 6px 0 0;
      color: var(--gray-500);
      font-size: 0.95rem;
    }

    .header-controls {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .input,
    .month-input {
      min-height: 46px;
      border: 1px solid var(--pink-200);
      border-radius: 14px;
      background: var(--white);
      color: var(--gray-900);
      padding: 10px 12px;
      outline: none;
      transition: 0.18s ease;
    }

    .input:focus,
    .month-input:focus {
      border-color: var(--pink-500);
      box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.12);
    }

    .cards {
      margin-top: 14px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .card {
      background: var(--white);
      border: 1px solid var(--pink-200);
      border-radius: 20px;
      padding: 14px;
      box-shadow: 0 10px 24px rgba(236, 72, 153, 0.08);
    }

    .card small {
      display: block;
      color: var(--gray-500);
      margin-bottom: 6px;
      font-size: 0.82rem;
    }

    .card strong {
      display: block;
      font-size: 1.22rem;
    }

    .card.total {
      border-color: #bbf7d0;
      background: linear-gradient(135deg, #f0fdf4, var(--white));
    }

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

    .tab-button {
      border: 1px solid var(--pink-200);
      background: var(--white);
      color: var(--gray-900);
      border-radius: 16px;
      padding: 12px 14px;
      min-height: 48px;
      font-weight: 700;
      cursor: pointer;
      transition: 0.18s ease;
    }

    .tab-button.active {
      color: var(--pink-700);
      border-color: var(--pink-500);
      background: linear-gradient(135deg, var(--pink-50), var(--white));
      box-shadow: 0 10px 24px rgba(236, 72, 153, 0.14);
    }

    .tab-panel {
      display: none;
    }

    .tab-panel.active {
      display: block;
    }

    .panel {
      background: var(--pink-50);
      border: 1px solid var(--pink-200);
      border-radius: 24px;
      padding: 16px;
      box-shadow: var(--shadow);
      margin-bottom: 14px;
    }

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

    .panel-header h2,
    .panel-header h3 {
      margin: 0;
      font-size: 1.05rem;
    }

    .panel-header p {
      margin: 6px 0 0;
      color: var(--gray-500);
      font-size: 0.92rem;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: 999px;
      padding: 8px 10px;
      background: var(--white);
      border: 1px solid var(--pink-200);
      color: var(--pink-700);
      font-size: 0.82rem;
      font-weight: 700;
    }

    .table-wrap {
      overflow: auto;
      border: 1px solid var(--pink-200);
      border-radius: 18px;
      background: var(--white);
    }

    table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      min-width: 760px;
    }

    thead th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: #fff8fc;
      color: var(--pink-700);
      border-bottom: 1px solid var(--pink-200);
      font-size: 0.85rem;
      text-align: left;
      padding: 12px 10px;
      white-space: nowrap;
    }

    tbody td,
    tfoot td {
      padding: 8px 10px;
      border-bottom: 1px solid #fce7f3;
      background: var(--white);
      vertical-align: middle;
    }

    tbody tr:hover td {
      background: #fffafd;
    }

    thead th:first-child,
    tbody td:first-child,
    tfoot td:first-child {
      position: sticky;
      left: 0;
      z-index: 1;
      box-shadow: 8px 0 16px rgba(255, 255, 255, 0.95);
    }

    thead th:first-child {
      z-index: 3;
      background: #fff8fc;
    }

    tbody td:first-child,
    tfoot td:first-child {
      background: inherit;
    }

    .day-cell {
      font-weight: 800;
    }

    .muted {
      color: var(--gray-500);
      font-size: 0.85rem;
    }

    .qty-input {
      width: 100%;
      min-width: 90px;
      min-height: 42px;
      text-align: center;
      border: 1px solid var(--pink-200);
      border-radius: 12px;
      padding: 8px 10px;
      background: var(--white);
      outline: none;
      font-weight: 700;
      color: var(--gray-900);
      transition: 0.18s ease;
    }

    .qty-input:focus {
      border-color: var(--pink-500);
      box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.12);
    }

    tfoot td {
      background: #fff8fc;
      color: var(--pink-700);
      font-weight: 800;
    }

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

    .stack {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .row-item {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(140px, 220px) auto;
      gap: 10px;
      align-items: center;
      border: 1px solid var(--pink-200);
      border-radius: 16px;
      padding: 10px;
      background: var(--white);
    }

    .empty {
      border: 1px dashed var(--pink-300);
      border-radius: 18px;
      padding: 18px;
      text-align: center;
      color: var(--gray-500);
      background: rgba(255, 255, 255, 0.85);
    }

    .btn {
      appearance: none;
      border: 0;
      border-radius: 14px;
      min-height: 46px;
      padding: 12px 14px;
      font-weight: 800;
      cursor: pointer;
      transition: 0.18s ease;
      color: var(--white);
      background: var(--green-500);
      box-shadow: 0 10px 22px rgba(34, 197, 94, 0.18);
    }

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

    .btn:active {
      transform: translateY(0);
    }

    .btn.secondary {
      background: var(--pink-500);
      box-shadow: 0 10px 22px rgba(236, 72, 153, 0.18);
    }

    .btn.ghost {
      background: var(--white);
      color: var(--gray-900);
      border: 1px solid var(--pink-200);
      box-shadow: none;
    }

    .btn.danger {
      background: var(--danger);
      box-shadow: 0 10px 22px rgba(239, 68, 68, 0.18);
    }

    .btn.icon {
      width: 48px;
      padding: 0;
      border-radius: 999px;
      display: grid;
      place-items: center;
      font-size: 1.4rem;
      line-height: 1;
    }

    .toolbar {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
    }

    .report-box {
      background: var(--white);
      border: 1px solid var(--pink-200);
      border-radius: 18px;
      padding: 14px;
    }

    .report-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .report-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 12px;
      border: 1px solid var(--pink-200);
      border-radius: 14px;
      background: #fff8fc;
    }

    .hint {
      margin-top: 8px;
      color: var(--gray-500);
      font-size: 0.88rem;
    }

    .footer-bar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 25;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
      background: rgba(255, 255, 255, 0.94);
      backdrop-filter: blur(14px);
      border-top: 1px solid var(--pink-200);
    }

    .footer-bar small {
      display: block;
      color: var(--gray-500);
    }

    .footer-bar strong {
      font-size: 1.2rem;
      color: var(--green-700);
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      clip-path: inset(50%);
    }

    @media (max-width: 920px) {

      .cards,
      .summary-grid,
      .report-grid {
        grid-template-columns: 1fr;
      }
    }

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

      .row-item {
        grid-template-columns: 1fr;
      }

      .footer-bar {
        flex-direction: column;
        align-items: flex-start;
      }
    }
