:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --panel: rgba(26, 31, 42, .88);
  --panel-2: #202634;
  --line: rgba(255,255,255,.075);
  --text: #f7f8fb;
  --muted: #8c95a8;
  --orange: #ff8a2a;
  --orange-2: #ff5d35;
  --blue: #2d7dff;
  --blue-2: #6ba8ff;
  --green: #45d89b;
  --radius: 14px;
  --shadow: 0 14px 36px rgba(0,0,0,.24);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; font-family: Inter, "Noto Sans SC", system-ui, sans-serif; color: var(--text); background:
  radial-gradient(circle at 88% 4%, rgba(45,125,255,.12), transparent 28rem),
  radial-gradient(circle at 10% 92%, rgba(255,108,42,.08), transparent 28rem), var(--bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; padding: 24px 18px; border-right: 1px solid var(--line); background: rgba(10,13,19,.9); backdrop-filter: blur(24px); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 28px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--orange), var(--orange-2) 52%, var(--blue)); box-shadow: 0 12px 28px rgba(255,103,45,.22); }
.brand-mark svg { width: 22px; }
.brand strong, .brand small, .sync-state strong, .sync-state small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.2px; }
.brand small, .sync-state small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.side-nav { display: grid; gap: 7px; }
.nav-item, .mobile-nav button { border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 14px; border-radius: 13px; font-weight: 600; text-align: left; transition: .2s ease; }
.nav-item svg { width: 19px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-item.active { color: #fff; background: linear-gradient(100deg, rgba(255,134,42,.19), rgba(45,125,255,.1)); box-shadow: inset 0 0 0 1px rgba(255,143,55,.12); }
.side-bottom { margin-top: auto; display: grid; gap: 6px; }
.utility-link { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px; color: var(--muted); font-size: 13px; }
.utility-link:hover { background: rgba(255,255,255,.04); color: #fff; }
.utility-link svg { width: 17px; }
.sync-state { margin-top: 12px; padding: 14px 12px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; font-size: 12px; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(69,216,155,.09), 0 0 16px rgba(69,216,155,.7); }
.main-content { min-height: 100vh; margin-left: 244px; padding: 22px clamp(20px, 3vw, 44px) 54px; }
.topbar { max-width: 1440px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: -.02em; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn, .source-badge { height: 40px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--text); border-radius: 12px; }
.icon-btn { width: 40px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.07); }
.icon-btn svg { width: 17px; }
.source-badge { display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; color: #c6cede; font-size: 12px; }
.source-badge svg { width: 16px; color: var(--green); }
.welcome-line { margin: 0 0 7px; color: #ffbd72; font-size: 13px; font-weight: 700; }
.quick-filters { position: relative; max-width: 1440px; margin: 16px auto 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(18,22,31,.78); box-shadow: var(--shadow); }
.period-chips { display: flex; gap: 5px; padding-right: 7px; border-right: 1px solid var(--line); }
.period-chip, .filter-chip { min-height: 30px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 0 10px; color: #aeb8ca; background: rgba(255,255,255,.035); cursor: pointer; font-size: 11px; }
.period-chip:hover, .filter-chip:hover { color: #fff; border-color: rgba(255,255,255,.2); }
.period-chip.active { color: #111827; border-color: transparent; background: linear-gradient(135deg, #ffbd67, #ff8637); font-weight: 800; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; }
.filter-chip svg { width: 13px; }
.filter-popover, .custom-date-popover { position: absolute; z-index: 10; top: calc(100% + 8px); right: 12px; min-width: 170px; display: grid; gap: 5px; padding: 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: #1b2230; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.filter-popover button { border: 0; border-radius: 9px; padding: 10px; color: #dce4f1; text-align: left; background: transparent; cursor: pointer; }
.filter-popover button:hover { background: rgba(255,255,255,.08); }
.custom-date-popover { grid-template-columns: 1fr 1fr; min-width: 300px; right: 92px; }
.custom-date-popover label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.custom-date-popover input, .rule-form input { min-height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; color: #fff; background: #252d3a; }
.custom-date-popover button { grid-column: 1 / -1; min-height: 36px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); cursor: pointer; }
.owner-product-panel { margin-top: 16px; }
.rule-form { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); gap: 10px; padding: 0 22px 16px; }
.rule-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.rule-form .action-button { min-height: 36px; margin: 17px 0 0; border: 0; cursor: pointer; }
.rule-hint { display: block; padding: 0 22px 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.login-gate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 75% 10%, rgba(45,125,255,.2), transparent 30rem), #0b0e14; }
.login-card { width: min(420px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(29,35,47,.98), rgba(15,19,27,.98)); box-shadow: var(--shadow); }
.login-card .brand-mark { display: grid; margin-bottom: 24px; }
.login-card h1 { margin-bottom: 10px; font-size: 30px; }
.login-card > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-card label { display: grid; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.login-card input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: #fff; background: #222a37; outline: none; }
.login-card .action-button { width: 100%; margin: 20px 0 0; border: 0; cursor: pointer; }
.login-card small { display: block; min-height: 20px; margin-top: 10px; color: #ff9b68; font-size: 11px; }
.dashboard, .state-panel { max-width: 1440px; margin: auto; }
.hidden { display: none !important; }
.state-panel { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.state-panel strong { color: var(--text); }
.state-panel small { font-size: 12px; }
.state-panel.error svg { color: var(--orange); width: 38px; height: 38px; }
.state-panel button { margin-top: 8px; border: 0; border-radius: 10px; padding: 10px 15px; color: white; background: var(--blue); cursor: pointer; }
.loader { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(255,255,255,.08); border-top-color: var(--orange); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.data-note { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 10px; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.025); border: 1px solid var(--line); font-size: 11px; }
.data-note > span { min-width: 0; flex: 1; }
.data-note svg { width: 15px; color: var(--blue-2); }
.data-note strong { margin-left: auto; color: #cbd2df; white-space: nowrap; }
.view { display: none; animation: reveal .25s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
.hero-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(240px, .8fr); gap: 12px; }
.hero-card, .metric-card, .panel, .collab-banner, .quick-actions a { border: 1px solid var(--line); box-shadow: var(--shadow); }
.gradient-card { position: relative; overflow: hidden; min-height: 190px; padding: 20px; border-radius: var(--radius); background:
  radial-gradient(circle at 92% 88%, rgba(46,125,255,.9), transparent 34%),
  linear-gradient(125deg, #ff9b31 0%, #ff6d2e 54%, #cf5e56 76%, #2d7dff 120%); }
.gradient-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -110px; top: -150px; border-radius: 50%; background: rgba(255,255,255,.14); filter: blur(50px); }
.hero-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; opacity: .92; }
.hero-head svg { width: 19px; }
.hero-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 38px; }
.hero-metrics > div { padding: 0 16px; border-left: 1px solid rgba(255,255,255,.24); }
.hero-metrics > div:first-child { padding-left: 0; border-left: 0; }
.hero-metrics small { display: block; margin-bottom: 6px; font-size: 11px; color: rgba(255,255,255,.82); }
.hero-metrics strong { display: block; font-size: 24px; letter-spacing: -.04em; white-space: nowrap; }
.hero-metrics > div { min-width: 0; }
.metric-card { position: relative; overflow: hidden; min-height: 124px; padding: 16px; border-radius: var(--radius); background: linear-gradient(145deg, rgba(31,37,49,.96), rgba(22,27,37,.96)); }
.metric-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -65px; bottom: -70px; border-radius: 50%; background: rgba(45,125,255,.11); filter: blur(5px); }
.metric-card > small { display: block; margin: 15px 0 5px; color: var(--muted); font-size: 11px; }
.metric-card > strong { display: block; font-size: 26px; letter-spacing: -.04em; }
.metric-card > p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.metric-card.emphasis { background: linear-gradient(145deg, rgba(255,126,41,.13), rgba(26,31,42,.96) 45%, rgba(45,125,255,.1)); }
.month-card { min-height: 238px; }
.month-card > small { margin-top: 42px; }
.month-breakdown { display: grid; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.month-breakdown span { display: flex; justify-content: space-between; gap: 12px; }
.month-breakdown b { color: #dce4f1; font-weight: 700; }
.metric-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; }
.metric-icon svg { width: 19px; }
.metric-icon.orange { color: #ffc28b; background: rgba(255,130,42,.14); }
.metric-icon.blue { color: #9fc4ff; background: rgba(45,125,255,.14); }
.content-grid { display: grid; gap: 12px; margin-top: 12px; }
.content-grid.two-thirds { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.content-grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { border-radius: var(--radius); background: linear-gradient(145deg, rgba(28,33,44,.94), rgba(18,22,30,.96)); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }
.pill { padding: 6px 9px; border-radius: 999px; color: #b9c4d7; background: rgba(255,255,255,.045); border: 1px solid var(--line); font-size: 10px; white-space: nowrap; }
.table-wrap { overflow-x: auto; padding: 0 8px 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 10px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: #747e91; font-size: 10px; font-weight: 600; }
td { color: #dce1eb; font-size: 12px; }
td strong { color: #fff; }
td.money { color: #ffad63; font-weight: 700; }
.empty-row td { padding: 30px 12px; color: var(--muted); text-align: center; }
.reminder-panel { display: flex; flex-direction: column; }
.reminder-list { display: grid; gap: 10px; padding: 0 22px 20px; }
.reminder { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; color: #c9d0de; background: rgba(255,255,255,.035); font-size: 12px; line-height: 1.65; }
.reminder::before { content: ""; width: 7px; height: 7px; margin-top: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px rgba(255,138,42,.55); }
.action-button { margin: auto 22px 22px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 9px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 12px; background: linear-gradient(100deg, var(--orange), var(--orange-2) 45%, var(--blue)); box-shadow: 0 14px 30px rgba(25,70,166,.2); }
.action-button svg { width: 16px; }
.stats-grid { display: grid; gap: 10px; }
.stats-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.income-summary { margin: 0 16px 10px; padding: 14px; border-radius: 12px; background: linear-gradient(130deg, rgba(255,135,42,.14), rgba(45,125,255,.12)); }
.income-summary strong { display: block; font-size: 24px; margin: 5px 0; }
.income-summary .income-earned { color: #58dca5; }
.income-summary span, .income-summary small { color: var(--muted); font-size: 11px; }
.detail-list { display: grid; gap: 6px; padding: 0 16px 16px; }
.detail-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px; border-radius: 10px; background: rgba(255,255,255,.03); }
.detail-item strong { font-size: 12px; }
.detail-item b { color: #ffad63; font-size: 12px; }
.detail-item.reversal { border-left: 3px solid #f2c94c; background: rgba(242,201,76,.07); }
.detail-item.reversal b { color: #f5ce5d; }
.detail-item.loss_share { border-left: 3px solid #ff8a2a; background: rgba(255,138,42,.07); }
.detail-item.loss_share b { color: #ffad63; }
.detail-item.penalty { border-left: 3px solid #f05a66; background: rgba(240,90,102,.08); }
.detail-item.penalty b { color: #ff737d; }
.detail-item small { color: var(--muted); font-size: 10px; }
.streamer-adjustment-panel { margin-top: 12px; }
.adjustment-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 16px 12px; }
.adjustment-total { padding: 10px; border-radius: 10px; background: rgba(255,255,255,.035); }
.adjustment-total small { display: block; color: var(--muted); font-size: 10px; }
.adjustment-total strong { display: block; margin-top: 5px; font-size: 17px; }
.adjustment-total.earned strong, .adjustment-total.payable strong { color: #58dca5; }
.adjustment-total.reversal strong { color: #f5ce5d; }
.adjustment-total.loss-share strong { color: #ffad63; }
.adjustment-total.penalty strong { color: #ff737d; }
.adjustment-row.reversal td { background: rgba(242,201,76,.045); }
.adjustment-row.penalty td { background: rgba(240,90,102,.07); }
.adjustment-kind { display: inline-flex; padding: 3px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.adjustment-kind.reversal { color: #f6d66e; background: rgba(242,201,76,.13); }
.adjustment-kind.loss_share { color: #ffb66f; background: rgba(255,138,42,.14); }
.adjustment-kind.penalty { color: #ff8590; background: rgba(240,90,102,.14); }
.adjustment-money { font-weight: 700; }
.adjustment-table td:last-child { white-space: normal; min-width: 260px; }
.adjustment-table td:last-child strong, .adjustment-trace { display: block; }
.adjustment-trace { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.adjustment-row.reversal .adjustment-money { color: #f5ce5d; }
.adjustment-row.loss_share td { background: rgba(255,138,42,.06); }
.adjustment-row.loss_share .adjustment-money { color: #ffad63; }
.adjustment-row.penalty .adjustment-money { color: #ff737d; }
.adjustment-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; margin: 0; padding: 2px 16px 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.adjustment-legend .earned { color: #58dca5; }
.adjustment-legend .reversal { color: #f5ce5d; }
.adjustment-legend .loss-share { color: #ffad63; }
.adjustment-legend .penalty { color: #ff737d; }
.team-cards { padding: 0 22px 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.team-card { padding: 16px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.team-card span { color: var(--muted); font-size: 11px; }
.team-card strong { display: block; margin-top: 9px; font-size: 23px; }
.collab-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; border-radius: var(--radius); background: radial-gradient(circle at 100% 50%, rgba(45,125,255,.28), transparent 35%), linear-gradient(120deg, rgba(255,128,42,.15), rgba(27,33,45,.96) 43%); }
.collab-banner h2 { font-size: 30px; }
.collab-banner p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.collab-banner .action-button { flex: 0 0 auto; margin: 0; padding: 0 18px; }
.collab-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.quick-actions a { display: flex; align-items: center; gap: 13px; padding: 18px; border-radius: 16px; background: rgba(25,30,41,.9); }
.quick-actions a > svg { margin-left: auto; width: 18px; color: var(--muted); }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.role-ai-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.role-ai-tools article { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(25,30,41,.9); box-shadow: var(--shadow); }
.role-ai-tools small { color: var(--muted); font-size: 10px; }
.role-ai-tools h3 { margin: 4px 0 7px; font-size: 15px; }
.role-ai-tools p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.copy-prompt { grid-column: 1 / -1; min-height: 36px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; color: #e7edf8; background: rgba(255,255,255,.05); cursor: pointer; font-size: 11px; font-weight: 700; }
.copy-prompt:hover { background: rgba(255,255,255,.1); }
.mobile-nav { display: none; }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.management-list { display: grid; gap: 6px; padding: 0 16px 16px; }
.management-person { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 9px; border-radius: 10px; background: rgba(255,255,255,.035); }
.management-person strong, .management-person small { display: block; }
.management-person strong { font-size: 12px; }.management-person small, .empty-management { margin-top: 3px; color: var(--muted); font-size: 10px; }
.person-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #ffd09f; background: rgba(255,130,42,.15); font-size: 12px; font-weight: 800; }
.management-person b { padding: 3px 6px; border-radius: 99px; font-size: 10px; }.management-person b.enabled { color: #67e3af; background: rgba(69,216,155,.12); }.management-person b.disabled { color: #aab4c6; background: rgba(255,255,255,.07); }
.empty-management { padding: 14px 0; }.compact-form { display: grid; grid-template-columns: 1.1fr .65fr .55fr 1fr auto; gap: 7px; padding: 0 16px 16px; }.compact-form input, .compact-form select { min-width: 0; min-height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: #fff; background: #252d3a; font-size: 11px; }.compact-form .action-button { min-height: 36px; margin: 0; border: 0; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.toggle-detail { display: inline-flex; align-items: center; gap: 3px; min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: #cbd5e5; background: rgba(255,255,255,.04); cursor: pointer; font-size: 10px; font-weight: 700; }.toggle-detail svg { width: 14px; }.stream-product-detail.collapsed { display: none; }.collapsed-note { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 11px; }
.product-cell { display: flex; align-items: center; gap: 8px; }.product-cell img, .product-placeholder { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 6px; object-fit: cover; background: #293243; }.product-placeholder { display: grid; place-items: center; color: var(--muted); }.product-placeholder svg { width: 15px; }
.adjustment-total.reward { border: 1px solid rgba(69,216,155,.24); background: rgba(69,216,155,.08); }.adjustment-total.reward strong { color: #65e2ad; font-size: 22px; }.detail-item.reward { border-left: 3px solid #58dca5; background: rgba(69,216,155,.07); }.detail-item.reward b { color: #65e2ad; }
.ai-brief-panel { margin-top: 16px; }.ai-brief-actions { display: flex; gap: 6px; }.ai-brief-actions .copy-prompt { min-height: 30px; padding: 0 8px; }.ai-open { display: inline-flex; align-items: center; justify-content: center; }.ai-brief-panel textarea { box-sizing: border-box; width: calc(100% - 32px); min-height: 320px; margin: 0 16px 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; color: #dce4ef; background: #151b25; font: 11px/1.7 Inter, "Noto Sans SC", sans-serif; white-space: pre-wrap; }.quick-actions .quick-action-button { width: 100%; display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; color: inherit; text-align: left; background: rgba(25,30,41,.9); box-shadow: var(--shadow); cursor: pointer; }.quick-action-button > svg { margin-left: auto; width: 18px; color: var(--muted); }.quick-action-button strong, .quick-action-button small { display: block; }.quick-action-button small { margin-top: 5px; color: var(--muted); font-size: 10px; }

@media (max-width: 1100px) {
  .rule-form { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); gap: 24px 0; margin-top: 35px; }
  .hero-metrics > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats-grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .app-shell, .main-content, .topbar, .dashboard, .state-panel { width: 100%; max-width: 100%; min-width: 0; }
  body { background: radial-gradient(circle at 90% 0%, rgba(45,125,255,.13), transparent 24rem), var(--bg); }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 14px 12px calc(78px + env(safe-area-inset-bottom)); overflow: hidden; }
  .management-grid { grid-template-columns: 1fr; }.compact-form { grid-template-columns: 1fr 1fr; }.compact-form input:nth-of-type(2), .compact-form .action-button { grid-column: 1 / -1; }.ai-brief-actions { flex-wrap: wrap; justify-content: flex-end; }.ai-brief-panel textarea { min-height: 280px; }.adjustment-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; min-width: 0; }
  .topbar > div:first-child { min-width: 0; flex: 1 1 auto; }
  .header-actions { flex: 0 0 auto; }
  .source-badge { display: none; }
  .quick-filters { align-items: flex-start; padding: 9px; }
  .period-chips { width: 100%; overflow-x: auto; border-right: 0; padding-right: 0; padding-bottom: 2px; }
  .period-chip, .filter-chip { flex: 0 0 auto; font-size: 11px; }
  .custom-date-popover { left: 9px; right: 9px; min-width: 0; }
  .rule-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 17px 16px; }
  .rule-hint { padding: 0 17px 18px; }
  .data-note { align-items: flex-start; flex-wrap: wrap; line-height: 1.45; overflow-wrap: anywhere; }
  .data-note strong { width: 100%; margin-left: 24px; }
  .hero-grid, .content-grid.two-thirds, .content-grid.halves { grid-template-columns: 1fr; }
  .hero-card { min-height: 280px; padding: 22px; }
  .month-card { min-height: 165px; }
  .month-card > small { margin-top: 25px; }
  .collab-banner { align-items: flex-start; flex-direction: column; padding: 23px; }
  .collab-banner .action-button { width: 100%; }
  .quick-actions { grid-template-columns: 1fr; }
  .role-ai-tools { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); min-height: 54px; padding: 5px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(18,22,30,.9); backdrop-filter: blur(24px); box-shadow: 0 12px 32px rgba(0,0,0,.45); }
  .mobile-nav button { border-radius: 10px; display: grid; place-items: center; align-content: center; gap: 2px; font-size: 9px; }
  .mobile-nav button svg { width: 16px; }
  .mobile-nav button.active { color: #fff; background: linear-gradient(135deg, rgba(255,132,42,.22), rgba(45,125,255,.18)); }
}
@media (max-width: 560px) {
  h1 { font-size: 27px; }
  .quick-filters .filter-chip { flex: 1 1 calc(50% - 4px); min-width: 0; justify-content: center; overflow: hidden; white-space: nowrap; }
  .hero-metrics { margin-top: 33px; }
  .hero-metrics > div { padding: 0 13px; }
  .hero-metrics strong { font-size: 23px; }
  .stats-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 110px; padding: 12px; border-radius: 13px; }
  .metric-card > strong { font-size: 21px; }
  .metric-card > small { margin-top: 12px; }
  .team-cards { grid-template-columns: 1fr; }
  .panel-head { padding: 14px 13px 9px; }
  .table-wrap { padding: 0 5px 10px; }
  th, td { padding: 12px 9px; }
  .wide table { min-width: 690px; }
  .adjustment-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 13px 10px; gap: 6px; }
  .adjustment-total { padding: 8px; }
  .adjustment-total strong { font-size: 15px; }
  .adjustment-table { min-width: 640px; }
  .adjustment-legend { padding: 0 13px 12px; gap: 5px 10px; }
}
