  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f5f6f8; color: #202124; }
  button, input, select, textarea { font: inherit; }
  button { cursor: pointer; }

  #login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
  .login-box { width: 360px; background: #fff; padding: 38px; border-radius: 18px; box-shadow: 0 18px 50px rgba(31, 41, 55, .12); }
  .login-box h2 { text-align: center; margin-bottom: 24px; font-size: 22px; }
  .login-box input { width: 100%; padding: 12px 14px; margin-bottom: 12px; border: 1px solid #e4e7ec; border-radius: 10px; outline: none; }
  .login-box input:focus { border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79,110,247,.12); }
  .login-box button { width: 100%; padding: 12px; background: #4f6ef7; color: #fff; border: none; border-radius: 10px; font-weight: 700; }
  .login-box .err { color: #d92d20; font-size: 13px; text-align: center; margin-top: 10px; min-height: 18px; }

  #main-page { display: none; min-height: 100vh; }
  .layout { display: flex; min-height: 100vh; }
  .sidebar { width: 236px; background: #111827; color: #fff; padding: 20px 14px; display: flex; flex-direction: column; }
  .brand { padding: 8px 10px 18px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
  .brand h1 { font-size: 18px; margin-bottom: 5px; }
  .brand p { font-size: 12px; color: rgba(255,255,255,.58); }
  .nav { display: flex; flex-direction: column; gap: 6px; }
  .nav button { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: transparent; color: rgba(255,255,255,.72); padding: 11px 12px; border-radius: 12px; text-align: left; }
  .nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
  .nav button.active { background: #fff; color: #111827; font-weight: 800; }
  .nav .icon { width: 20px; text-align: center; }
  .sidebar-footer { margin-top: auto; padding: 14px 10px 2px; color: rgba(255,255,255,.5); font-size: 12px; }

  .content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .topbar { height: 64px; background: #fff; border-bottom: 1px solid #edf0f3; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
  .topbar h2 { font-size: 18px; }
  .topbar-actions { display: flex; gap: 10px; }
  .ghost-btn { border: 1px solid #e4e7ec; background: #fff; color: #344054; padding: 8px 14px; border-radius: 10px; }
  .ghost-btn:hover { border-color: #4f6ef7; color: #4f6ef7; }
  .primary-btn { border: none; background: #4f6ef7; color: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 700; }
  .danger-btn { border: 1px solid #fecdca; background: #fff5f5; color: #b42318; padding: 6px 10px; border-radius: 8px; }
  .success-btn { border: 1px solid #abefc6; background: #ecfdf3; color: #067647; padding: 6px 10px; border-radius: 8px; }

  .page { padding: 24px; }
  .stats { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; margin-bottom: 18px; }
  .stat-card { background: #fff; border-radius: 16px; padding: 16px; border: 1px solid #edf0f3; }
  .stat-card span { display: block; color: #667085; font-size: 12px; margin-bottom: 8px; }
  .stat-card strong { font-size: 24px; }

  .toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
  .toolbar input, .toolbar select { padding: 10px 12px; border: 1px solid #e4e7ec; border-radius: 10px; background: #fff; outline: none; }
  .toolbar input { width: 230px; }
  .toolbar input:focus, .toolbar select:focus { border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79,110,247,.1); }
  .billing-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .tabs { display: inline-flex; gap: 4px; padding: 4px; background: #edf0f3; border-radius: 12px; margin-bottom: 14px; }
  .billing-header .tabs { margin-bottom: 0; }
  .tabs button { border: 0; background: transparent; color: #344054; padding: 9px 14px; border-radius: 9px; font-weight: 700; }
  .tabs button.active { background: #fff; color: #111827; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
  .tabs.subtabs { margin: 14px 18px 0; }

  .card { background: #fff; border: 1px solid #edf0f3; border-radius: 16px; overflow: hidden; }
  .card-title { padding: 16px 18px; border-bottom: 1px solid #edf0f3; display: flex; align-items: center; justify-content: space-between; }
  .card-title h3 { font-size: 16px; }
  .card-title p { color: #667085; font-size: 12px; margin-top: 4px; }
  .table-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; min-width: 960px; }
  th { background: #fafbfc; text-align: left; padding: 12px 16px; font-size: 12px; color: #667085; font-weight: 700; white-space: nowrap; }
  td { padding: 13px 16px; border-top: 1px solid #f1f3f5; font-size: 14px; vertical-align: middle; }
  tr:hover td { background: #f8faff; }
  .muted { color: #667085; font-size: 12px; }
  .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

  .badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; margin: 2px 4px 2px 0; }
  .badge-owner { background: #e3f2fd; color: #1565c0; }
  .badge-designer { background: #e8f5e9; color: #2e7d32; }
  .badge-merchant { background: #fff3e0; color: #e65100; }
  .badge-project_manager { background: #f3e8ff; color: #6b21a8; }
  .badge-project_supervisor { background: #dbeafe; color: #1d4ed8; }
  .status-pending { background: #fff7e6; color: #b54708; }
  .status-approved { background: #ecfdf3; color: #067647; }
  .status-rejected { background: #fff1f3; color: #b42318; }
  .status-hidden { background: #f2f4f7; color: #344054; }
  .status-draft { background: #f2f4f7; color: #344054; }
  .status-active { background: #ecfdf3; color: #067647; }
  .status-suspended { background: #fff7e6; color: #b54708; }
  .status-deleted { background: #fff1f3; color: #b42318; }
  .share-title { font-weight: 700; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .share-content { max-width: 360px; color: #667085; font-size: 12px; line-height: 1.45; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cover-thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: #f2f4f7; display: inline-flex; align-items: center; justify-content: center; color: #98a2b3; font-size: 12px; overflow: hidden; }
  .logo-thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: #eef4ff; display: inline-flex; align-items: center; justify-content: center; color: #4f6ef7; font-weight: 800; }
  .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 10px; padding: 16px 18px; border-bottom: 1px solid #edf0f3; }
  .detail-cell { background: #fafbfc; border: 1px solid #edf0f3; border-radius: 12px; padding: 11px 12px; }
  .detail-cell span { display: block; color: #667085; font-size: 12px; margin-bottom: 5px; }
  .detail-cell strong { font-size: 14px; font-weight: 700; }
  .cover-video { position: relative; }
  .cover-video::after { content: "▶"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.55); font-size: 18px; pointer-events: none; }
  .detail-text { max-width: 360px; color: #667085; font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .stack { display: flex; flex-direction: column; gap: 14px; }
  .item-panel { margin-top: 14px; }

  .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .action-btn { border: 1px solid #e4e7ec; background: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
  .action-btn:hover { border-color: #4f6ef7; color: #4f6ef7; }
  .pagination { display: flex; align-items: center; justify-content: flex-end; padding: 14px 16px; gap: 8px; font-size: 13px; color: #667085; border-top: 1px solid #edf0f3; }
  .pagination button { border: 1px solid #e4e7ec; background: #fff; padding: 6px 12px; border-radius: 8px; }
  .pagination button:disabled { opacity: .45; cursor: default; }

  .placeholder { background: #fff; border: 1px dashed #d0d5dd; border-radius: 18px; padding: 40px; color: #667085; }
  .placeholder h3 { color: #202124; margin-bottom: 10px; }
  .progress-admin { display: grid; grid-template-columns: 230px minmax(520px, 1fr) 340px; gap: 14px; align-items: start; }
  .stage-tree, .item-editor { background: #fff; border: 1px solid #edf0f3; border-radius: 16px; overflow: hidden; }
  .stage-tree h3, .item-editor h3 { font-size: 15px; padding: 15px 16px; border-bottom: 1px solid #edf0f3; }
  .stage-list { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
  .stage-node { width: 100%; border: 0; background: transparent; text-align: left; border-radius: 10px; padding: 10px; display: flex; align-items: center; justify-content: space-between; color: #344054; }
  .stage-node:hover { background: #f8faff; }
  .stage-node.active { background: #eef4ff; color: #3448d5; font-weight: 800; }
  .stage-node small { color: #667085; font-weight: 600; }
  .progress-summary { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
  .mini-stat { background: #fff; border: 1px solid #edf0f3; border-radius: 14px; padding: 12px; }
  .mini-stat span { display: block; color: #667085; font-size: 12px; margin-bottom: 6px; }
  .mini-stat strong { font-size: 20px; }
  .inline-edit { width: 100%; border: 1px solid #e4e7ec; border-radius: 8px; padding: 8px 9px; outline: none; background: #fff; }
  .inline-edit:focus { border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79,110,247,.1); }
  .editor-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
  .editor-body label { font-size: 12px; color: #667085; font-weight: 700; margin-bottom: 5px; display: block; }
  .editor-body input, .editor-body select, .editor-body textarea { width: 100%; border: 1px solid #e4e7ec; border-radius: 10px; padding: 9px 10px; outline: none; background: #fff; }
  .editor-body textarea { min-height: 76px; resize: vertical; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .editor-note { background: #f8faff; border: 1px solid #dbe4ff; color: #344054; border-radius: 12px; padding: 10px; font-size: 12px; line-height: 1.45; }
  .empty-editor { padding: 24px; color: #667085; line-height: 1.55; }
  .tree-title { display: flex; flex-direction: column; gap: 3px; }
  .tree-child { padding-left: 18px; position: relative; }
  .tree-child::before { content: ""; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px; border-left: 1px solid #98a2b3; border-bottom: 1px solid #98a2b3; }

  .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(17,24,39,.42); z-index: 100; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
  .modal-overlay.show { display: flex; }
  .modal { background: #fff; border-radius: 18px; padding: 24px; width: 420px; max-height: calc(100vh - 48px); overflow-y: auto; box-shadow: 0 24px 70px rgba(0,0,0,.2); }
  .modal h3 { margin-bottom: 16px; }
  .modal label { display: block; margin-bottom: 5px; font-size: 13px; color: #667085; }
  .modal input, .modal select { width: 100%; padding: 10px 12px; margin-bottom: 13px; border: 1px solid #e4e7ec; border-radius: 10px; }
  .modal textarea { width: 100%; min-height: 96px; padding: 10px 12px; margin-bottom: 13px; border: 1px solid #e4e7ec; border-radius: 10px; resize: vertical; outline: none; }
  .modal textarea.billing-action-textarea { min-height: 88px; line-height: 1.45; }
  .modal .confirm-box { background: #f8faff; border: 1px solid #dbe4ff; color: #344054; border-radius: 12px; padding: 10px 12px; font-size: 12px; line-height: 1.55; margin-bottom: 13px; }
  .modal .field-error { color: #b42318; font-size: 13px; min-height: 18px; margin: -4px 0 10px; }
  .modal .btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
  .modal .btns button { padding: 9px 18px; border-radius: 10px; border: 1px solid #e4e7ec; background: #fff; }
  .modal .btns button.primary { background: #4f6ef7; color: #fff; border-color: #4f6ef7; }
  .modal .btns button.danger-btn { background: #fff5f5; color: #b42318; border-color: #fecdca; }
  .billing-guide-modal { width: min(760px, calc(100vw - 40px)); padding: 0; }
  .billing-guide-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid #edf0f3; }
  .billing-guide-title h3 { margin-bottom: 5px; }
  .billing-guide-title p { color: #667085; font-size: 13px; line-height: 1.45; }
  .billing-guide-body { display: grid; gap: 12px; padding: 18px 24px 24px; }
  .billing-guide-body section { background: #fafbfc; border: 1px solid #edf0f3; border-radius: 12px; padding: 14px 16px; }
  .billing-guide-body h4 { font-size: 15px; margin-bottom: 8px; }
  .billing-guide-body ol { padding-left: 20px; color: #344054; font-size: 13px; line-height: 1.65; }
  .billing-guide-body li + li { margin-top: 4px; }
  .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 11px 22px; border-radius: 10px; font-size: 14px; z-index: 200; opacity: 0; transition: opacity .25s; pointer-events: none; }
  .toast.show { opacity: 1; }

  @media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .billing-header { flex-direction: column; align-items: stretch; }
    .billing-header .tabs { overflow-x: auto; }
    .billing-header > .ghost-btn { align-self: flex-end; }
    .progress-admin { grid-template-columns: 1fr; }
    .progress-summary { grid-template-columns: repeat(2, 1fr); }
  }
