/* storage-mgmt.css — HUB Settings → Storage Mgmt dashboard (.sm-*) */
#storageMgmtRoot { --sm-green:#1E6332; --sm-green2:#2F8542; --sm-line:#e8e3da; --sm-panel:#ffffff; --sm-bg:#f7f5f1; --sm-txt:#1f2a26; --sm-mut:#6b7d75; }
#storageMgmtRoot { color:var(--sm-txt); }
.sm-loading, .sm-err { padding:40px; text-align:center; color:var(--sm-mut); font-size:15px; }
.sm-err { color:#b00000; }

.sm-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:18px; flex-wrap:wrap; }
.sm-title { font-size:20px; margin:0 0 3px; display:flex; align-items:center; gap:10px; }
.sm-title i { color:var(--sm-green); }
.sm-sub { color:var(--sm-mut); font-size:13px; margin:0; }
.sm-as-of { color:var(--sm-green2); font-weight:600; margin-left:6px; }
.sm-refresh { background:linear-gradient(135deg,var(--sm-green),var(--sm-green2)); color:#fff; border:none; border-radius:9px; padding:9px 16px; font-weight:600; font-size:13px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; transition:transform .12s, box-shadow .12s; }
.sm-refresh:hover { transform:translateY(-1px); box-shadow:0 6px 16px rgba(30,99,50,.25); }

.sm-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:16px; }
.sm-kpi { background:var(--sm-panel); border:1px solid var(--sm-line); border-radius:14px; padding:16px 18px; position:relative; }
.sm-kpi-ic { width:38px; height:38px; border-radius:10px; background:#eef5f0; color:var(--sm-green); display:flex; align-items:center; justify-content:center; font-size:16px; margin-bottom:10px; }
.sm-kpi.g .sm-kpi-ic { background:#e7f0ea; color:var(--sm-green); }
.sm-kpi.a .sm-kpi-ic { background:#fdf3e0; color:#b7791f; }
.sm-kpi-k { font-size:12px; color:var(--sm-mut); text-transform:uppercase; letter-spacing:.4px; }
.sm-kpi-v { font-size:26px; font-weight:800; margin:3px 0 1px; letter-spacing:-.5px; }
.sm-kpi.g .sm-kpi-v { color:var(--sm-green); } .sm-kpi.a .sm-kpi-v { color:#b7791f; }
.sm-kpi-s { font-size:12px; color:var(--sm-mut); }

.sm-two { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.sm-card { background:var(--sm-panel); border:1px solid var(--sm-line); border-radius:14px; padding:16px 18px; }
.sm-card h3 { font-size:14px; margin:0 0 14px; display:flex; align-items:center; gap:8px; }
.sm-tag { font-size:10px; background:#fdf3e0; color:#b7791f; border-radius:6px; padding:2px 7px; font-weight:700; text-transform:uppercase; }
.sm-tag2 { font-size:10px; background:#eef2f0; color:var(--sm-mut); border-radius:6px; padding:2px 7px; font-weight:600; margin-left:auto; }
.sm-note { font-size:12px; color:var(--sm-mut); margin-top:12px; line-height:1.6; }

.sm-rows { display:flex; flex-direction:column; gap:11px; }
.sm-rows.sm-scroll { max-height:300px; overflow-y:auto; padding-right:4px; }
.sm-row-top { display:flex; justify-content:space-between; font-size:12.5px; margin-bottom:5px; gap:8px; }
.sm-row-label { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sm-row-label em { color:var(--sm-mut); font-weight:400; font-style:normal; }
.sm-row-val { color:var(--sm-mut); white-space:nowrap; }
.sm-bar { height:9px; background:#eef2f0; border-radius:5px; overflow:hidden; }
.sm-bar-fill { height:100%; border-radius:5px; transition:width .5s; }

.sm-gauge { margin-bottom:14px; }
.sm-gauge-top { display:flex; justify-content:space-between; font-size:13px; margin-bottom:6px; }
.sm-gauge-top b { color:var(--sm-green2); } .sm-gauge-top b.sm-over { color:#ef4444; }
.sm-gauge-track { height:14px; background:#eef2f0; border-radius:7px; overflow:hidden; }
.sm-gauge-fill { height:100%; border-radius:7px; transition:width .6s; }

.sm-cost-line { display:flex; justify-content:space-between; font-size:13px; padding:7px 0; border-bottom:1px dashed var(--sm-line); }
.sm-cost-line b { font-variant-numeric:tabular-nums; }
.sm-cost-total { display:flex; justify-content:space-between; align-items:center; margin-top:10px; padding-top:10px; border-top:2px solid var(--sm-green); font-size:15px; }
.sm-cost-total b { font-size:22px; color:var(--sm-green); }

.sm-donut-wrap { position:relative; height:210px; }

.sm-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.sm-table th { text-align:left; color:var(--sm-mut); font-weight:600; text-transform:uppercase; font-size:10.5px; letter-spacing:.4px; padding:6px 8px; border-bottom:1px solid var(--sm-line); }
.sm-table td { padding:7px 8px; border-bottom:1px solid #f1efe9; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:220px; }
.sm-table td em { color:var(--sm-mut); font-style:normal; }
.sm-table tr:last-child td { border-bottom:none; }
.sm-table td:nth-child(2), .sm-table th:nth-child(2), .sm-table td:last-child, .sm-table th:last-child { text-align:right; font-variant-numeric:tabular-nums; }

.sm-legacy { background:linear-gradient(135deg,#f4f0e9,#faf8f4); border-color:#e8dfd0; margin-bottom:16px; }
.sm-legacy h3 i { color:var(--sm-green); }
.sm-legacy p { font-size:13.5px; line-height:1.7; margin:0; color:var(--sm-txt); }

.sm-limit-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.sm-limit { background:#f7f5f1; border:1px solid var(--sm-line); border-radius:10px; padding:11px 13px; }
.sm-limit-k { font-size:11px; color:var(--sm-mut); text-transform:uppercase; letter-spacing:.3px; }
.sm-limit-v { font-size:16px; font-weight:700; margin:2px 0; }
.sm-limit-s { font-size:11.5px; color:var(--sm-mut); }

@media (max-width:900px){ .sm-kpis{grid-template-columns:repeat(2,1fr);} .sm-two{grid-template-columns:1fr;} .sm-limit-grid{grid-template-columns:1fr 1fr;} }

/* dark theme */
body.dark-theme #storageMgmtRoot, [data-theme="dark"] #storageMgmtRoot {
  --sm-line:#26413a; --sm-panel:#152420; --sm-bg:#0e1512; --sm-txt:#e8f5ee; --sm-mut:#8fb3a6;
}
body.dark-theme #storageMgmtRoot .sm-kpi-ic { background:#1b2e28; }
body.dark-theme #storageMgmtRoot .sm-bar, body.dark-theme #storageMgmtRoot .sm-gauge-track { background:#0c1613; }
body.dark-theme #storageMgmtRoot .sm-limit { background:#0f1c18; }
body.dark-theme #storageMgmtRoot .sm-legacy { background:#14231e; border-color:#26413a; }
body.dark-theme #storageMgmtRoot .sm-table td { border-color:#1e332d; }

/* stale-cache banner */
.sm-stale { background:#fdf6e6; border:1px solid #f0d9a8; color:#8a6d1f; border-radius:10px; padding:10px 14px; font-size:13px; margin-bottom:16px; display:flex; align-items:center; gap:9px; }
.sm-stale i { color:#c99a2e; }
.sm-stale b { color:#6b5518; }

/* gauge overage line */
.sm-gauge-over { font-size:12px; color:#b7791f; margin-top:6px; font-weight:600; background:#fdf6e6; border-radius:6px; padding:5px 9px; }

/* billing info card */
.sm-info { background:linear-gradient(135deg,#f3f8f4,#fbfcfb); border-color:#dce8e0; margin-bottom:16px; }
.sm-info h3 i { color:var(--sm-green); }
.sm-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.sm-info-item { display:flex; gap:12px; align-items:flex-start; }
.sm-info-ic { flex:0 0 34px; width:34px; height:34px; border-radius:9px; background:#e7f0ea; color:var(--sm-green); display:flex; align-items:center; justify-content:center; font-size:14px; }
.sm-info-txt { min-width:0; }
.sm-info-t { font-weight:700; font-size:13.5px; margin-bottom:3px; }
.sm-info-b { font-size:12.5px; line-height:1.65; color:var(--sm-mut); }
.sm-info-b b { color:var(--sm-txt); }
@media (max-width:900px){ .sm-info-grid{grid-template-columns:1fr;} }

/* dark theme for the new bits */
body.dark-theme #storageMgmtRoot .sm-stale { background:#2a2410; border-color:#5a4a1a; color:#e6cf8a; }
body.dark-theme #storageMgmtRoot .sm-gauge-over { background:#2a2410; color:#e6cf8a; }
body.dark-theme #storageMgmtRoot .sm-info { background:#14231e; border-color:#26413a; }
body.dark-theme #storageMgmtRoot .sm-info-ic { background:#1b2e28; }

/* ---- visual polish pass ---- */
.sm-card h3 i { color:var(--sm-green); font-size:13px; }
.sm-table tbody tr:nth-child(even){ background:#faf9f6; }
.sm-table tbody tr:hover{ background:#eef5f0; }
.sm-row-val b { color:var(--sm-txt); font-variant-numeric:tabular-nums; }
.sm-row-val em { color:var(--sm-mut); font-style:normal; font-weight:600; }
.sm-bar { height:10px; }
/* legacy footprint hero */
.sm-legacy-flex { display:flex; align-items:center; gap:18px; }
.sm-legacy-ic { flex:0 0 56px; width:56px; height:56px; border-radius:14px; background:linear-gradient(135deg,#1E6332,#2F8542); color:#fff; display:flex; align-items:center; justify-content:center; font-size:24px; box-shadow:0 6px 16px rgba(30,99,50,.22); }
.sm-legacy-main { min-width:0; }
.sm-legacy-big { font-size:26px; font-weight:800; color:var(--sm-green); letter-spacing:-.5px; }
.sm-legacy-big span { font-size:13.5px; color:var(--sm-mut); font-weight:600; letter-spacing:0; }
.sm-legacy-lbl { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--sm-mut); margin-top:3px; }
.sm-legacy-sub { font-size:12.5px; color:var(--sm-mut); margin-top:5px; line-height:1.6; }
/* dark */
body.dark-theme #storageMgmtRoot .sm-table tbody tr:nth-child(even){ background:#12201b; }
body.dark-theme #storageMgmtRoot .sm-table tbody tr:hover{ background:#182b24; }

/* ---- depth & premium polish pass ---- */
.sm-kpi, .sm-card { box-shadow: 0 1px 2px rgba(16,40,30,0.05), 0 2px 6px rgba(16,40,30,0.03); }
.sm-kpi { transition: transform .15s ease, box-shadow .15s ease; }
.sm-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,40,30,0.10); }
.sm-kpi-v { line-height: 1.08; }
.sm-card h3 { padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.sm-legacy h3, .sm-info h3 { border-bottom: none; padding-bottom: 0; }
.sm-bar { box-shadow: inset 0 1px 2px rgba(0,0,0,0.06); }
.sm-bar-fill { position: relative; box-shadow: 0 1px 3px rgba(30,99,50,0.22); }
.sm-bar-fill::after { content: ''; position: absolute; inset: 0; border-radius: 5px; background: linear-gradient(180deg, rgba(255,255,255,0.28), transparent 55%); }
.sm-row { padding: 3px 5px; margin: 0 -5px; border-radius: 7px; transition: background .12s; }
.sm-row:hover { background: rgba(30,99,50,0.04); }
.sm-donut-wrap { padding: 6px 0; }
/* dark */
body.dark-theme #storageMgmtRoot .sm-kpi, body.dark-theme #storageMgmtRoot .sm-card { box-shadow: 0 1px 2px rgba(0,0,0,0.30), 0 2px 8px rgba(0,0,0,0.20); }
body.dark-theme #storageMgmtRoot .sm-kpi:hover { box-shadow: 0 10px 24px rgba(0,0,0,0.35); }
body.dark-theme #storageMgmtRoot .sm-card h3 { border-color: rgba(255,255,255,0.06); }
body.dark-theme #storageMgmtRoot .sm-row:hover { background: rgba(46,194,110,0.06); }

/* ── By document category: full-width card, big donut + colored legend ── */
#storageMgmtRoot .sm-cat-card { margin-bottom:16px; }
#storageMgmtRoot .sm-cat-flex { display:flex; gap:26px; align-items:center; }
#storageMgmtRoot .sm-cat-chart { flex:0 0 300px; max-width:300px; }
#storageMgmtRoot .sm-cat-chart .sm-donut-wrap { height:256px; padding:0; }
#storageMgmtRoot .sm-cat-legend { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:12px; }
#storageMgmtRoot .sm-growth-wrap { position:relative; height:232px; padding:2px 0; }
@media (max-width:900px){
  #storageMgmtRoot .sm-cat-flex { flex-direction:column; gap:18px; }
  #storageMgmtRoot .sm-cat-chart { flex:none; width:100%; max-width:100%; }
  #storageMgmtRoot .sm-cat-chart .sm-donut-wrap { height:220px; }
}
