/* Linkvelle creator dashboard + staff panel */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: #F7F7F5; }
html[data-theme] .app { background: var(--bg); }
html[data-theme] .kpi3, html[data-theme] .range-pills a:not(.on), html[data-theme] .range-custom, html[data-theme] .chart-tabs button:not(.on), html[data-theme] .pcard2, html[data-theme] .mail, html[data-theme] .quick input:not(.hero-box *) { background: var(--card); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 26px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
html[data-theme] .side { background: var(--card); }
.side .logo { justify-self: start; font-size: 30px; margin: 0 8px 4px; }
.side .who { display: flex; align-items: center; gap: 10px; margin: 22px 6px 22px; padding: 12px; border: 1px solid var(--line); }
.side .who img, .side .who .ph { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--soft); flex: none; display: grid; place-items: center; font-family: var(--serif); font-size: 18px; }
.side .who b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.side .who span { font-size: 12px; color: var(--muted); }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; font-size: 14px; color: var(--ink-2); border-radius: 8px; }
.side nav a svg { width: 18px; height: 18px; flex: none; }
.side nav a:hover { background: var(--soft); }
.side nav a.on { background: var(--ink); color: #fff; }
.side .bottom { margin-top: auto; display: grid; gap: 6px; font-size: 13px; }
.side .bottom a { padding: 8px 12px; color: var(--muted); }
.side .bottom a:hover { color: var(--ink); }
.main { padding: 36px 44px 80px; min-width: 0; }
.main-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.main-head h1 { font-family: var(--serif); font-size: 44px; line-height: 1; }
.main-head p { color: var(--muted); margin: 8px 0 0; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
html[data-theme] .box:not(.hero-box) { background: var(--card); }
.box h2 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.box .sub { font-size: 13px; color: var(--muted); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: grid; gap: 16px; }
.kpi2 .lab { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi2 .val { font-family: var(--serif); font-size: 40px; line-height: 1.05; margin-top: 8px; }
.kpi2 .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.quick { display: flex; gap: 10px; margin-top: 14px; }
.quick input { flex: 1; height: 50px; border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; font: 15px var(--sans); background: #fff; min-width: 0; }
.quick input:focus { outline: 0; border-color: var(--ink); }
.quick .btn, .box .btn, .main .btn { border-radius: 10px; height: 48px; }
.hero-box { background: var(--ink); color: #fff; border-color: var(--ink); }
.hero-box .sub { color: #BDBDBD; }
.hero-box .quick input { background: #fff; color: var(--ink); border-color: #fff; }
.hero-box .btn-light { border-radius: 10px; }
.chart-tabs { display: flex; gap: 6px; }
.chart-tabs button { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 999px; font: 600 12px var(--sans); cursor: pointer; }
.chart-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chartbox svg { width: 100%; height: 200px; display: block; margin-top: 16px; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.balance .row2 { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.balance .row2:first-of-type { border-top: 0; }
.dotc { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.d-pending { background: #C9C2B6; } .d-approved { background: #6B8F71; } .d-paid { background: var(--ink); } .d-reversed { background: #C24D4D; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .pimg { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.tbl .pt { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.tbl .pt b { font-weight: 600; display: block; }
.tbl .pt span { font-size: 12.5px; color: var(--muted); }
.st { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.st-pending { background: #F1EEE8; color: #6E665D; } .st-approved { background: #E6EFE7; color: #2F5A37; } .st-paid { background: var(--ink); color: #fff; } .st-reversed { background: #F6E3E3; color: #8A2E2E; }
.st-new { background: #FFF4D6; color: #7A5B00; } .st-rejected { background: #F6E3E3; color: #8A2E2E; }
.copy { display: inline-flex; align-items: center; gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--soft); padding: 6px 10px; border-radius: 8px; cursor: pointer; border: 0; white-space: nowrap; }
.copy:hover { background: var(--line); }
.flash { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; background: #E6EFE7; color: #2F5A37; border: 1px solid #CFE0D2; word-break: break-all; }
.flash.info { background: #F1EEE8; color: #5E554B; border-color: var(--line); }
.form2 .field { margin-bottom: 16px; }
.form2 .field label { font-size: 12px; letter-spacing: .06em; }
.form2 .field input:not([type=checkbox]), .form2 .field select, .form2 .field textarea { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.form2 .field select { background-position: right 14px center; }
.form2 .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.prev { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: start; }
.prev img { width: 140px; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; background: var(--soft); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.pcard2 { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.pcard2 img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--soft); }
.pcard2 .b { padding: 12px; font-size: 13px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pcard2 .b b { font-weight: 600; line-height: 1.3; }
.pcard2 .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pcard2 .tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--soft); }
.pcard2 .acts { display: flex; border-top: 1px solid var(--line); }
.pcard2 .acts form, .pcard2 .acts a { flex: 1; }
.pcard2 .acts button, .pcard2 .acts a { width: 100%; border: 0; background: none; padding: 10px; font: 600 12px var(--sans); cursor: pointer; text-align: center; display: block; }
.pcard2 .acts > * + * { border-left: 1px solid var(--line); }
.pcard2.hidden { opacity: .5; }
.steps-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.steps-line div { border-top: 3px solid var(--line); padding-top: 10px; font-size: 12.5px; color: var(--muted); }
.steps-line div.on { border-color: var(--ink); color: var(--ink); }
.steps-line b { display: block; font-size: 13px; }
.mail { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 12px; }
.mail summary { padding: 14px 18px; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.mail summary b { font-weight: 600; }
.mail summary span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mail pre { margin: 0; padding: 0 18px 18px; white-space: pre-wrap; font: 13.5px/1.6 var(--sans); color: var(--ink-2); }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .pic { position: relative; }
.auth .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth .pane { display: flex; flex-direction: column; justify-content: center; padding: 60px max(40px, 8vw); }
.auth .pane .logo { justify-self: start; font-size: 40px; margin-bottom: 40px; }
.auth h1 { font-family: var(--serif); font-size: 48px; margin-bottom: 10px; }
.auth .form2 { margin-top: 26px; max-width: 420px; }
.auth .btn { width: 100%; border-radius: 10px; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: #B00020; font-size: 13px; }
.mob-nav { display: none; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .mob-nav { display: flex; position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 10px 12px; gap: 6px; align-items: center; }
  .mob-nav .logo { font-size: 24px; margin-right: 8px; }
  .mob-nav a:not(.logo) { white-space: nowrap; font-size: 13px; padding: 8px 12px; border-radius: 999px; }
  .mob-nav a.on { background: var(--ink); color: #fff; }
  .main { padding: 24px 16px 60px; }
  .main-head h1 { font-size: 34px; }
  .grid-2e, .form2 .two { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .pic { min-height: 220px; }
  .auth .pane { padding: 32px 20px; }
  .tblwrap { overflow-x: auto; }
  .quick { flex-direction: column; }
  .steps-line { grid-template-columns: 1fr 1fr; }
  .kpi2 .val { font-size: 32px; }
  .prev { grid-template-columns: 90px 1fr; }
  .prev img { width: 90px; }
}
.app > div { min-width: 0; }
@media (max-width: 860px) { .quick input { flex: none; width: 100%; height: 50px; } }

/* dashboard v2 */
.rangebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.range-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.range-pills a { font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.range-pills a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.range-custom { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 14px; }
.range-custom.on { border-color: var(--ink); }
.range-custom input { border: 0; font: 13px var(--sans); color: var(--ink); background: transparent; }
.range-custom button { border: 0; background: var(--ink); color: #fff; font: 600 12px var(--sans); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.kpi-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi3 { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; cursor: default; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi3[data-metric] { cursor: pointer; }
.kpi3[data-metric]:hover { border-color: #BDBDBD; }
.kpi3.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kpi3 .lab { font-size: 12px; color: var(--muted); }
.kpi3 .val { font-family: var(--serif); font-size: 30px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi3 .chg { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.kpi3 .chg.up { color: #2F7A45; } .kpi3 .chg.down { color: #B04040; }
.chart-wrap { position: relative; margin-top: 16px; }
.chart-wrap svg { width: 100%; height: 220px; display: block; cursor: crosshair; }
.tip { position: absolute; top: 0; transform: translate(-50%, -110%); background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; display: none; pointer-events: none; white-space: nowrap; text-align: center; }
.tip b { display: block; font-size: 14px; }
.tip span { opacity: .75; }
.bar { display: grid; grid-template-columns: 140px 1fr 44px; gap: 10px; align-items: center; font-size: 13.5px; margin-bottom: 10px; }
.bar div { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.bar b { text-align: right; font-weight: 600; }
.tips { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.tips li { padding: 12px 14px; background: var(--soft); border-radius: 10px; font-size: 14px; line-height: 1.5; }
@media (max-width: 1300px) { .kpi-row { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 860px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .range-pills { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .range-custom { width: 100%; justify-content: space-between; border-radius: 12px; flex-wrap: wrap; }
  .bar { grid-template-columns: 110px 1fr 40px; }
}
