:root {
  --ink: #152238;
  --muted: #6f7b8d;
  --cream: #f5f2e9;
  --paper: #fffefa;
  --coral: #ff665c;
  --coral-dark: #e95048;
  --teal: #42b8ad;
  --blue: #4f79df;
  --yellow: #f3bd57;
  --line: #e5e2da;
  --shadow: 0 18px 45px rgba(21, 34, 56, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--cream); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 10px; font-size: 11px; letter-spacing: .18em; font-weight: 800; color: rgba(255,255,255,.65); }
.eyebrow.coral { color: var(--coral); }

.login-view { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: var(--paper); }
.login-art { position: relative; overflow: hidden; padding: 72px; color: #fff; background: var(--ink); display: flex; flex-direction: column; justify-content: center; }
.login-art h1 { position: relative; z-index: 2; margin: 12px 0 24px; font-size: clamp(42px, 5vw, 74px); line-height: 1.08; letter-spacing: -.04em; }
.login-copy { position: relative; z-index: 2; max-width: 520px; color: #b9c5d6; font-size: 18px; line-height: 1.8; }
.brand-mark { position: relative; z-index: 2; width: 66px; height: 66px; display: grid; place-items: center; border-radius: 20px 20px 20px 6px; background: var(--coral); color: #fff; font-weight: 900; font-size: 24px; transform: rotate(-4deg); box-shadow: 0 18px 50px rgba(255,102,92,.28); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px 13px 13px 5px; font-size: 15px; }
.art-orbit { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.orbit-one { width: 530px; height: 530px; right: -180px; bottom: -120px; }
.orbit-two { width: 320px; height: 320px; right: -65px; bottom: -15px; border-color: rgba(255,102,92,.48); }
.login-card { width: min(420px, 78%); margin: auto; }
.login-card h2 { margin: 0 0 8px; font-size: 34px; }
.login-card > p:not(.eyebrow) { margin: 0 0 40px; color: var(--muted); }
.login-card label, .project-form label, .settings-form label { display: grid; gap: 9px; color: var(--ink); font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--ink); background: #fff; outline: none; transition: .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(66,184,173,.13); }
textarea { resize: vertical; }
.login-card small { display: block; margin-top: 18px; color: #9da6b3; text-align: center; }

.primary, .secondary, .danger, .ghost { border: 0; border-radius: 11px; padding: 11px 18px; font-weight: 800; }
.primary { background: var(--coral); color: #fff; box-shadow: 0 8px 20px rgba(255,102,92,.18); }
.primary:hover { background: var(--coral-dark); transform: translateY(-1px); }
.secondary { background: #eef1f5; color: var(--ink); }
.danger { background: #ffe9e7; color: #c6423a; }
.ghost { background: transparent; color: var(--blue); border: 1px solid #dce4f8; }
.wide { width: 100%; margin-top: 22px; padding: 14px; }
.text-button { border: 0; background: none; color: #b6c1d2; margin-left: auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; background: var(--ink); color: #fff; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 13px; padding: 0 10px 34px; }
.sidebar-brand div:last-child { display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 18px; }
.sidebar-brand span { color: #91a0b6; font-size: 12px; }
nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 13px; border: 0; border-radius: 12px; padding: 13px 14px; color: #b8c3d3; background: transparent; text-align: left; }
.nav-item span { color: #62728b; font-size: 10px; font-weight: 800; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active span { color: var(--coral); }
.sidebar-foot { display: flex; align-items: center; margin-top: auto; padding: 18px 10px 0; color: #93a0b3; font-size: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #55d58b; margin-right: 8px; box-shadow: 0 0 0 4px rgba(85,213,139,.12); }

.main { min-width: 0; padding: 34px 42px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.topbar h1 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.admin-badge { display: grid; gap: 3px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.55); text-align: right; }
.admin-badge span { color: var(--muted); font-size: 11px; }
.admin-badge strong { font-size: 13px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { position: relative; overflow: hidden; min-height: 155px; padding: 22px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.stat-card::after { content: ''; position: absolute; width: 90px; height: 90px; right: -32px; bottom: -32px; border-radius: 50%; background: var(--accent, var(--coral)); opacity: .13; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin-top: 28px; font-size: 34px; letter-spacing: -.04em; }
.stat-card small { color: var(--muted); }
.panel { margin-top: 20px; padding: 24px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.inline-actions { display: flex; align-items: center; gap: 9px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); border-radius: 100px; padding: 7px 13px; background: #fff; color: var(--muted); font-size: 12px; }
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { padding: 12px 10px; color: #8993a2; font-size: 11px; letter-spacing: .04em; text-align: left; border-bottom: 1px solid var(--line); }
td { padding: 16px 10px; font-size: 13px; border-bottom: 1px solid #efede7; vertical-align: top; }
tbody tr:hover { background: #fbfaf6; }
.title-cell { display: grid; gap: 4px; }
.title-cell strong { font-size: 14px; }
.title-cell small { color: var(--muted); }
.money { color: var(--coral-dark); font-weight: 900; }
.tag { display: inline-flex; align-items: center; border-radius: 100px; padding: 5px 9px; font-size: 11px; font-weight: 700; background: #edf1f6; color: #5e6a7c; }
.tag.published, .tag.approved, .tag.paid, .tag.active, .tag.settled { background: #ddf5ec; color: #1d8660; }
.tag.pending, .tag.draft { background: #fff1d7; color: #a36b00; }
.tag.rejected, .tag.suspended, .tag.ended, .tag.inactive { background: #ffe5e2; color: #c34d45; }
.tag.paused { background: #e8e8ee; color: #626575; }
.row-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.row-actions button { border: 0; border-radius: 8px; padding: 7px 10px; font-size: 11px; font-weight: 700; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.proofs { display: flex; gap: 5px; }
.proofs img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; padding: 30px; background: rgba(13,25,43,.64); display: grid; place-items: center; }
.modal-card { width: min(900px, 100%); max-height: calc(100vh - 60px); overflow: auto; border-radius: 22px; background: var(--paper); box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 24px 28px 18px; background: rgba(255,254,250,.96); border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #efede8; font-size: 25px; color: var(--muted); }
.project-form, .settings-form { display: grid; gap: 18px; padding: 24px 28px 28px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.staff-assignment { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fbfaf6; }
.assignment-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.assignment-head h3 { margin: 0 0 5px; font-size: 15px; }
.assignment-head p { margin: 0; color: var(--muted); font-size: 12px; }
.assignment-head > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.selected-staff { display: flex; flex-wrap: wrap; gap: 10px; }
.staff-chip { min-width: 190px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 13px; border: 1px solid #cfe6e3; border-radius: 12px; background: #fff; }
.staff-chip span { display: grid; gap: 3px; }
.staff-chip strong { font-size: 13px; }
.staff-chip small { color: var(--muted); font-size: 10px; }
.staff-chip button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #ffe9e7; color: #c6423a; font-size: 18px; line-height: 1; }
.staff-empty { width: 100%; padding: 18px; border: 1px dashed #d7d4cb; border-radius: 12px; color: var(--muted); text-align: center; font-size: 12px; }
.staff-add-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; }
.staff-add-row button:disabled { cursor: not-allowed; opacity: .5; }
.settings-form { max-width: 900px; padding: 0; }
.staff-form { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.settings-form .form-section { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.form-section h3 { margin: 0 0 18px; }
.toast { position: fixed; z-index: 100; left: 50%; top: 22px; transform: translate(-50%, -20px); padding: 11px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .app-shell { grid-template-columns: 200px 1fr; }
  .main { padding: 28px 24px; }
}
@media (max-width: 760px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; }
  nav { grid-template-columns: repeat(2, 1fr); }
  .sidebar-foot { display: none; }
  .stats-grid, .form-grid.two { grid-template-columns: 1fr; }
  .topbar { align-items: flex-end; }
}
