/*
@file: packages/control-pages/public/app.css
*/

:root{
  --bg:#0b0c10; --panel:#17191f; --muted:#aeb4c0; --text:#e8eef9; --brand:#6ea8fe;
  --ok:#28a745; --warn:#f59f00; --err:#d64045; --line:#262b33;
  --radius:10px;
}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,Segoe UI,Roboto,Arial,sans-serif}
.topbar{display:flex;align-items:center;gap:1rem;padding:.8rem 1rem;background:#11131a;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10}
.brand{font-weight:600;color:var(--brand)}
.sep{flex:1}
.controls{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.controls label{display:flex;align-items:center;gap:.45rem;color:var(--muted)}
.controls input{padding:.45rem .55rem;border-radius:8px;border:1px solid var(--line);background:#0f1116;color:var(--text);min-width:260px}
.btn{padding:.5rem .9rem;border-radius:8px;border:1px solid #2a2f3a;background:#1c212b;color:#fff;cursor:pointer}
.btn.warn{border-color:#5a4800;background:#3a2f12;color:#ffd36e}
.btn:disabled{opacity:.6;cursor:not-allowed}

.layout{display:grid;grid-template-columns:220px 1fr;min-height:calc(100vh - 52px)}
.sidebar{padding:12px;border-right:1px solid var(--line);background:#0e1015}
.nav-btn{display:block;width:100%;text-align:left;padding:.55rem .7rem;border-radius:8px;border:1px solid transparent;background:transparent;color:#cbd3e2;cursor:pointer}
.nav-btn.is-active,.nav-btn:hover{background:#171a21;border-color:#2a2f3a;color:#fff}

.content{padding:16px}
.view{display:none}
.view.is-active{display:block}

.card{padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);margin:0 0 14px}
.row{display:flex;gap:.6rem;align-items:center;margin:.5rem 0}
.row label{color:var(--muted);min-width:120px}
.row input,.row select{padding:.5rem;border-radius:8px;border:1px solid var(--line);background:#0f1116;color:#fff}
.mt{margin-top:.6rem}

table{width:100%;border-collapse:collapse;margin-top:.6rem}
th,td{border-bottom:1px solid var(--line);padding:.5rem;vertical-align:top}
th{color:#9fb3d9;text-align:left;background:#12151b}
tr:hover td{background:#121621}

.hint{color:#93a0b6;margin-top:.5rem}
.foot{padding:12px;color:#7e8897;border-top:1px solid var(--line);text-align:center;background:#11131a}

/* ----------------------- Tenants Manager specific --------------------- */

/* layout 2 cột: bảng bên trái, panel chi tiết bên phải */
.tm-layout{
  display:grid;
  grid-template-columns:minmax(0,2.1fr) minmax(0,1.4fr);
  gap:1rem;
  align-items:flex-start;
}
.tm-left,.tm-right{min-width:0}

@media (max-width: 1024px){
  .layout{grid-template-columns:1fr}
  .tm-layout{grid-template-columns:1fr}
}

/* Badge nhỏ cho Plan / Status */
.badge{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  padding:0.15rem .45rem;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.06);
  font-size:11px;
  line-height:1.2;
  background:#151825;
  color:#e5e7eb;
}
.badge-dot{
  width:6px;
  height:6px;
  border-radius:999px;
  background:currentColor;
}

/* Plan */
.badge-plan-base{background:#111827;color:#e5e7eb}
.badge-plan-pro{background:#1d4ed8;color:#bfdbfe}
.badge-plan-ultra{background:#6d28d9;color:#f5d0fe}
.badge-plan-enterprise{background:#047857;color:#a7f3d0}

/* Status */
.badge-status-active{background:#022c22;color:#6ee7b7}
.badge-status-trial{background:#1e3a8a;color:#bfdbfe}
.badge-status-suspended{background:#450a0a;color:#fecaca}
.badge-status-expired{background:#111827;color:#9ca3af}

/* Text helpers */
.text-sub{display:block;font-size:12px;color:var(--muted)}
.text-sm{font-size:12px}
.text-right{text-align:right}

/* Row highlight khi gần full quota */
.tm-row-heavy td{background:#221608}

/* Progress bar nhỏ cho quota */
.progress{
  height:6px;
  border-radius:999px;
  background:#111827;
  overflow:hidden;
  margin-top:4px;
}
.progress-bar{
  height:100%;
  background:var(--warn);
}

/* Panel chi tiết tenant */
.tm-detail h3{margin-top:0;margin-bottom:.5rem}
.tm-detail-section{margin-bottom:.75rem;font-size:13px}
.tm-detail-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.25rem 1.2rem;
}
.tm-detail-label{color:var(--muted);font-size:12px}
.tm-detail-value{font-weight:500}

/* Nút action nhỏ trong bảng */
.btn-xs{
  font-size:11px;
  padding:.25rem .5rem;
  border-radius:999px;
  border:1px solid #374151;
  background:#111827;
  color:#e5e7eb;
  cursor:pointer;
}
.btn-xs + .btn-xs{margin-left:4px}
