.quota-admin-view{display:flex;flex:1;flex-direction:column;gap:12px;width:100%;height:100%;min-height:0;overflow:hidden}
.quota-admin-view:has(> .quota-usage-panel){gap:8px}
.quota-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:0 0 auto;min-height:66px;border:1px solid var(--admin-line);border-radius:12px;background:var(--admin-surface);overflow:hidden}
.quota-stat-grid article{display:grid;grid-template-columns:auto auto 1fr;align-items:baseline;gap:5px;min-width:0;padding:14px 18px;border-right:1px solid var(--admin-line)}
.quota-stat-grid article:last-child{border-right:0}
.quota-stat-grid small{grid-column:1/-1;color:var(--admin-muted);font-size:12px;font-weight:600}
.quota-stat-grid b{color:var(--admin-text);font-size:20px;line-height:1;letter-spacing:-.04em}
.quota-stat-grid span{color:var(--admin-muted);font-size:11px;white-space:nowrap}
.quota-admin-layout{display:grid;grid-template-columns:232px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:14px;flex:1;min-height:0;overflow:hidden}
.quota-department-sidebar{display:flex;flex-direction:column}
.quota-department-row{position:relative}
.quota-department-row .account-tree-node{padding-right:44px}
.quota-department-row .quota-department-settings{position:absolute;top:5px;right:4px;opacity:0}
.quota-department-row:hover .quota-department-settings,.quota-department-row:focus-within .quota-department-settings{opacity:1}
.quota-toolbar .ghost{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.quota-table{min-width:1020px}
.quota-table th,.quota-table td{height:55px;padding-right:9px;padding-left:9px}
.quota-table th:first-child,.quota-table td:first-child{width:36px;padding-right:4px;padding-left:12px}
.quota-table th:last-child,.quota-table td:last-child{width:40px;padding-right:9px;padding-left:4px}
.quota-status{display:inline-flex;align-items:center;gap:6px;color:var(--admin-success);font-size:12px;white-space:nowrap}
.quota-status i{width:6px;height:6px;border-radius:50%;background:currentColor}
.quota-status.low{color:#b9822e}
.quota-status.exhausted,.quota-status.paused,.quota-status.disabled{color:#a86c66}
.quota-usage{display:flex;align-items:center;gap:7px;min-width:92px}
.quota-usage>span{width:54px;height:4px;border-radius:99px;background:#eeeeeb;overflow:hidden}
.quota-usage>span>i{display:block;height:100%;border-radius:inherit;background:var(--admin-accent)}
.quota-usage small{min-width:28px;color:var(--admin-muted);font-size:11px}
.quota-row-exhausted .quota-usage>span>i,.quota-row-paused .quota-usage>span>i{background:#c98b84}
.quota-load-error{height:100%;border:1px solid var(--admin-line);border-radius:12px;background:#fff}
.quota-mode-tabs{display:flex;flex:none;gap:4px;align-self:flex-start;padding:3px;border:1px solid var(--admin-line);border-radius:10px;background:var(--admin-surface-soft)}
.quota-mode-tabs button{height:32px;padding:0 17px;border:0;border-radius:7px;background:transparent;color:var(--admin-muted);font-size:13px;font-weight:600;line-height:1;cursor:pointer}
.quota-mode-tabs button.active{background:var(--admin-surface);box-shadow:0 1px 5px rgba(46,36,29,.08);color:var(--admin-text)}
.quota-mode-tabs button:focus-visible,.quota-rank-toggle button:focus-visible,.quota-usage-details tr:focus-visible{outline:2px solid var(--admin-accent);outline-offset:2px}
.quota-usage-panel{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0;padding:0 2px 2px;overflow:hidden}
.quota-usage-panel [data-usage-content]{display:flex;flex:1;flex-direction:column;min-height:0}
.quota-usage-heading{flex:none;margin:0;padding:3px 2px 8px}
.quota-usage-heading h2,.quota-usage-heading p{margin:0}
.quota-usage-heading h2{color:var(--admin-text);font-size:20px}
.quota-usage-heading p{margin-top:4px;color:var(--admin-muted);font-size:12px}
.quota-usage-filterbar{display:flex;flex:none;flex-wrap:wrap;align-items:end;gap:8px;padding:8px 2px;border-bottom:1px solid var(--admin-line);background:var(--admin-surface-soft)}
.quota-usage-filterbar label{display:grid;gap:5px;min-width:110px;color:var(--admin-muted);font-size:11px;font-weight:600}
.quota-usage-filterbar label:nth-child(2){min-width:130px}
.quota-usage-filterbar input,.quota-usage-filterbar select{box-sizing:border-box;width:100%;height:36px;padding:0 10px;border:1px solid var(--admin-line);border-radius:8px;background:var(--admin-surface);color:var(--admin-text);font-size:12px;font-weight:500}
.quota-usage-filterbar input:focus-visible,.quota-usage-filterbar select:focus-visible{border-color:#d8d5d1;outline:0;box-shadow:0 0 0 2px rgba(60,55,50,.06)}
.quota-usage-export{display:inline-flex;align-items:center;justify-content:center;min-height:36px;margin-left:auto;white-space:nowrap;text-decoration:none}
.quota-usage-warning,.quota-usage-updating{margin:12px 0;padding:8px 12px;border:1px solid #f0dbc9;border-radius:8px;background:#fff7f1;color:#925d38;font-size:12px}
.quota-usage-updating{border-color:var(--admin-line);background:var(--admin-surface);color:var(--admin-muted)}
.quota-usage-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:none;gap:1px;margin:9px 0 10px;border:1px solid var(--admin-line);border-radius:12px;background:var(--admin-line);overflow:hidden}
.quota-usage-kpis article{display:grid;gap:5px;min-width:0;padding:11px 14px;background:var(--admin-surface)}
.quota-usage-kpis small{color:var(--admin-muted);font-size:12px}
.quota-usage-kpis b{color:var(--admin-text);font-size:26px;line-height:1;letter-spacing:-.04em}
.quota-usage-kpis em{color:var(--admin-muted);font-size:12px;font-style:normal;font-weight:500}
.quota-usage-visuals{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(260px,1fr);flex:none;gap:10px;height:clamp(230px,25vh,270px);transition:height .2s ease,opacity .2s ease}
.quota-usage-visuals:has(> :only-child){grid-template-columns:1fr}
.quota-usage-trend,.quota-usage-ranking,.quota-usage-details{min-width:0;border:1px solid var(--admin-line);border-radius:12px;background:var(--admin-surface)}
.quota-usage-trend>header,.quota-usage-ranking>header,.quota-usage-details>header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:10px;min-height:44px;margin:0;padding:0 14px;border-bottom:1px solid var(--admin-line)}
.quota-usage-trend h3,.quota-usage-ranking h3,.quota-usage-details h3{margin:0;color:var(--admin-text);font-size:14px}
.quota-usage-trend header small,.quota-usage-details header small{color:var(--admin-muted);font-size:11px}
.quota-usage-trend{display:flex;flex-direction:column;min-height:0}
.quota-usage-chart{position:relative;flex:1;min-height:0;padding:6px 10px}
.quota-usage-chart svg{display:block;width:100%;height:100%;overflow:visible}
.quota-chart-grid{fill:none;stroke:#eee8e1;stroke-width:1}
.quota-chart-line{fill:none;stroke:var(--admin-accent);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.quota-usage-chart circle{fill:#fff;stroke:var(--admin-accent);stroke-width:2;cursor:help}
.quota-usage-chart circle:hover,.quota-usage-chart circle:focus{r:7}
.quota-usage-chart text{fill:var(--admin-muted);font-size:11px}
.quota-usage-tooltip{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);max-width:calc(100% - 20px);padding:7px 10px;border:1px solid var(--admin-line);border-radius:8px;background:#fff;box-shadow:0 3px 12px rgba(46,36,29,.1);color:var(--admin-text);font-size:11px;white-space:nowrap;pointer-events:none}
.quota-usage-tooltip[hidden]{display:none}
.quota-rank-toggle{display:flex;gap:2px;padding:2px;border-radius:8px;background:var(--admin-surface-soft)}
.quota-rank-toggle button{height:27px;padding:0 10px;border:0;border-radius:6px;background:transparent;color:var(--admin-muted);font-size:11px;cursor:pointer}
.quota-rank-toggle button.active{background:#fff;color:var(--admin-text);box-shadow:0 1px 3px rgba(46,36,29,.08)}
.quota-usage-ranking ol{display:grid;gap:4px;margin:0;padding:8px 14px;list-style:none}
.quota-usage-ranking li{display:grid;grid-template-columns:minmax(80px,1fr) minmax(55px,1.5fr) auto;align-items:center;gap:10px;font-size:12px}
.quota-usage-ranking li span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.quota-usage-ranking li>div{height:6px;border-radius:99px;background:#f0ede9;overflow:hidden}
.quota-usage-ranking li i{display:block;height:100%;border-radius:inherit;background:#b5aaa0}
.quota-usage-ranking li:first-child i{background:var(--admin-accent)}
.quota-usage-ranking li b{min-width:48px;text-align:right;font-size:11px}
.quota-usage-empty{display:grid;place-items:center;min-height:190px;padding:20px;color:var(--admin-muted);font-size:12px;text-align:center}
.quota-usage-empty.is-error{color:var(--admin-danger)}
.quota-usage-details{display:flex;flex:1;flex-direction:column;min-height:0;margin-top:10px;overflow:hidden}
.quota-usage-details>header{justify-content:flex-start}
.quota-usage-details>header small{margin-left:auto}
.quota-usage-expand{display:grid;flex:none;place-items:center;width:32px;height:32px;padding:0;border:1px solid var(--admin-line);border-radius:8px;background:var(--admin-surface);color:var(--admin-muted);cursor:pointer;transition:background-color .18s ease,border-color .18s ease,color .18s ease}
.quota-usage-expand:hover{border-color:var(--admin-line-strong);background:var(--admin-hover);color:var(--admin-text)}
.quota-usage-expand:focus-visible{outline:2px solid rgba(60,55,50,.25);outline-offset:2px}
.quota-usage-expand span{display:grid;place-items:center}
.quota-usage-expand svg{display:block;width:16px;height:16px}
.quota-usage-expand .quota-collapse-icon{display:none}
.quota-usage-panel.is-table-expanded .quota-usage-visuals{height:46px;overflow:hidden;opacity:.72}
.quota-usage-panel.is-table-expanded .quota-usage-chart,.quota-usage-panel.is-table-expanded .quota-usage-ranking>ol,.quota-usage-panel.is-table-expanded .quota-usage-ranking>.quota-usage-empty{display:none}
.quota-usage-panel.is-table-expanded .quota-usage-details{border-color:#e6d2c3;box-shadow:0 3px 14px rgba(46,36,29,.05)}
.quota-usage-panel.is-table-expanded .quota-usage-expand .quota-expand-icon{display:none}
.quota-usage-panel.is-table-expanded .quota-usage-expand .quota-collapse-icon{display:grid}
.quota-usage-table-wrap{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:transparent transparent}
.quota-usage-table-wrap:hover{scrollbar-color:#d8d8d3 transparent}
.quota-usage-table-wrap table{width:100%;min-width:760px;border-collapse:collapse;font-size:12px}
.quota-usage-table-wrap th,.quota-usage-table-wrap td{padding:8px 12px;border-bottom:1px solid var(--admin-line);text-align:left;white-space:nowrap}
.quota-usage-table-wrap th{position:sticky;z-index:1;top:0;background:var(--admin-surface-soft);color:var(--admin-muted);font-weight:600}
.quota-usage-table-wrap td:first-child{display:flex;align-items:center;gap:8px}
.quota-usage-table-wrap td img{width:28px;height:28px;flex:none;border-radius:8px;object-fit:cover}
.quota-usage-table-wrap .quota-usage-no-data td{display:table-cell;height:92px;color:var(--admin-muted);text-align:center}
.quota-usage-details tr[data-usage-member]{cursor:pointer}
.quota-usage-details tr[data-usage-member]:hover{background:var(--admin-hover)}
.quota-usage-skeleton{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;padding:14px 0}
.quota-usage-skeleton i{height:85px;border-radius:10px;background:linear-gradient(100deg,#f0ede9 15%,#f9f8f6 45%,#f0ede9 75%);background-size:200% 100%;animation:quota-skeleton 1.5s linear infinite}
@keyframes quota-skeleton{to{background-position-x:-200%}}
@media(prefers-reduced-motion:reduce){.quota-usage-skeleton i{animation:none}}
@media(prefers-reduced-motion:reduce){.quota-usage-visuals,.quota-usage-expand{transition:none}}
@media(max-height:820px) and (min-width:821px){
  .quota-usage-visuals{height:190px}
  .quota-usage-ranking ol{gap:2px;padding:5px 12px}
  .quota-usage-ranking li{font-size:11px;line-height:14px}
}

.quota-drawer-identity{border-bottom:1px solid var(--admin-line)}
.quota-drawer-identity img{display:block;width:48px;height:48px;flex:0 0 48px;aspect-ratio:1;border-radius:13px;object-fit:cover;object-position:center}
.quota-drawer-identity>div{min-width:0}
.quota-drawer-balance{margin:16px 20px 0;padding:16px;border:1px solid var(--admin-line);border-radius:11px;background:var(--admin-surface-soft)}
.quota-drawer-balance>div{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.quota-drawer-balance small{color:var(--admin-muted);font-size:12px}
.quota-drawer-balance b{font-size:21px;letter-spacing:-.04em}
.quota-drawer-balance b em{color:var(--admin-faint);font-size:11px;font-style:normal;font-weight:600}
.quota-drawer-balance>span{display:block;height:5px;margin-top:11px;border-radius:99px;background:#eaeae7;overflow:hidden}
.quota-drawer-balance>span>i{display:block;height:100%;border-radius:inherit;background:var(--admin-accent)}
.quota-drawer-balance p{margin:8px 0 0;color:var(--admin-muted);font-size:11px}
.quota-drawer .account-drawer-tabs{margin-top:16px}
.quota-drawer-form{display:grid;gap:12px}
.quota-drawer-form>label:first-child{display:grid;gap:6px;color:var(--admin-muted);font-size:11px}
.quota-drawer-form>label:first-child small{color:var(--admin-faint);font-size:9px;line-height:1.55}
.quota-temp-actions{margin-top:22px;padding-top:18px;border-top:1px solid var(--admin-line)}
.quota-temp-actions h4,.quota-temp-actions p{margin:0}
.quota-temp-actions h4{font-size:12px}
.quota-temp-actions p{margin-top:4px;color:var(--admin-faint);font-size:9px}
.quota-temp-actions>div{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:10px}
.quota-temp-actions button{height:34px;border:1px solid var(--admin-line);border-radius:8px;background:#fff;color:#5d5d58;font-size:11px;cursor:pointer}
.quota-temp-actions button:hover{border-color:#edb58f;background:var(--admin-selected);color:#b45a27}
.quota-pause-button{width:100%;margin-top:18px;color:var(--admin-danger)!important}
.quota-transactions{display:grid}
.quota-transactions article{display:grid;grid-template-columns:8px minmax(0,1fr) auto;gap:10px;padding:12px 0;border-bottom:1px solid var(--admin-line)}
.quota-transactions article>i{width:7px;height:7px;margin-top:5px;border-radius:50%;background:var(--admin-faint)}
.quota-transactions article>i.plus{background:var(--admin-success)}
.quota-transactions article>i.minus{background:var(--admin-danger)}
.quota-transactions b,.quota-transactions p,.quota-transactions small,.quota-transactions article>span{display:block;margin:0}
.quota-transactions b{font-size:11px}
.quota-transactions p{margin-top:3px;color:var(--admin-muted);font-size:10px}
.quota-transactions small{margin-top:3px;color:var(--admin-faint);font-size:8px}
.quota-transactions article>span{color:var(--admin-muted);font-size:12px;font-weight:700;text-align:right}
.quota-transactions article>span.plus{color:var(--admin-success)}
.quota-transactions article>span.minus{color:var(--admin-danger)}
.quota-transactions article>span small{font-weight:500}
.account-drawer-loading{padding:36px 0;color:var(--admin-faint);font-size:11px;text-align:center}

.quota-rules-drawer{width:min(440px,100vw)}
.quota-rules-body{display:grid;gap:12px}
.quota-rule-section{padding:15px;border:1px solid var(--admin-line);border-radius:11px;background:#fff}
.quota-rule-section:first-child{display:flex;align-items:center;justify-content:space-between;gap:14px}
.quota-rule-section small,.quota-rule-section b,.quota-rule-section p{display:block;margin:0}
.quota-rule-section small{color:var(--admin-muted);font-size:10px}
.quota-rule-section>div>b{margin:4px 0;color:var(--admin-text);font-size:18px}
.quota-rule-section p{color:var(--admin-faint);font-size:9px;line-height:1.65}
.quota-rule-section h4{margin:0 0 10px;font-size:12px}
.quota-rule-section ol{display:grid;gap:0;margin:0;padding:0;list-style:none;counter-reset:rule}
.quota-rule-section li{display:grid;grid-template-columns:22px 90px 1fr;align-items:center;min-height:38px;border-top:1px solid var(--admin-line);counter-increment:rule}
.quota-rule-section li:before{content:counter(rule);display:grid;place-items:center;width:18px;height:18px;border-radius:6px;background:var(--admin-selected);color:#b55a27;font-size:9px;font-weight:800}
.quota-rule-section li b{font-size:10px}
.quota-rule-section li span{color:var(--admin-faint);font-size:9px}
.quota-cost-list{border-top:1px solid var(--admin-line)}
.quota-cost-list>div{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px;border-bottom:1px solid var(--admin-line)}
.quota-cost-list span{overflow:hidden;color:var(--admin-muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.quota-cost-list b{flex:none;font-size:10px}

@media(max-width:1120px){
  .quota-admin-layout{grid-template-columns:210px minmax(0,1fr)}
  .quota-stat-grid article{padding-right:12px;padding-left:12px}
  .quota-toolbar .account-search{max-width:280px}
}
@media(max-width:820px){
  .quota-admin-view{height:auto}
  .quota-usage-panel{display:block;overflow:visible}
  .quota-usage-panel [data-usage-content]{display:block}
  .quota-usage-visuals{grid-template-columns:1fr;height:auto}
  .quota-usage-panel.is-table-expanded .quota-usage-visuals{display:none}
  .quota-usage-chart{height:215px}
  .quota-usage-details{display:block}
  .quota-usage-table-wrap{overflow-x:auto;overflow-y:visible}
  .quota-usage-panel.is-table-expanded .quota-usage-table-wrap{height:min(62dvh,680px);overflow:auto}
  .quota-usage-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .quota-admin-layout{grid-template-columns:1fr;grid-template-rows:auto;overflow:visible}
  .quota-department-sidebar{height:auto;max-height:235px}
  .quota-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .quota-stat-grid article:nth-child(2){border-right:0}
  .quota-stat-grid article:nth-child(-n+2){border-bottom:1px solid var(--admin-line)}
  .quota-toolbar{flex-wrap:wrap}
  .quota-toolbar .account-search{flex:1 1 100%;max-width:none}
}
@media(max-width:560px){
  .quota-usage-filterbar label{flex:1 1 calc(50% - 9px);min-width:0}
  .quota-usage-filterbar label:nth-child(2){min-width:0}
  .quota-usage-export{width:100%;margin-left:0}
  .quota-usage-kpis article{padding:13px}
  .quota-usage-kpis b{font-size:21px}
  .quota-usage-skeleton{grid-template-columns:repeat(2,1fr)}
  .quota-stat-grid article{padding:11px}
  .quota-stat-grid b{font-size:18px}
  .quota-toolbar .ghost{margin-left:auto}
}
