/* =========================================================
   phase 3.4 enterprise ui addon
========================================================= */

:root{
  --cmg-bg:#f3f6fb;
  --cmg-surface:#ffffff;
  --cmg-surface-2:#f8fafc;
  --cmg-text:#0f172a;
  --cmg-muted:#64748b;
  --cmg-line:#e2e8f0;
  --cmg-primary:#c4141b;
  --cmg-primary-dark:#991b1b;
  --cmg-shadow:0 16px 40px rgba(15,23,42,.08);
  --cmg-radius:22px;
}

html,body{
  background:var(--cmg-bg);
  color:var(--cmg-text);
}

body{
  min-height:100vh;
}

.admin-shell{
  display:grid;
  grid-template-columns:290px minmax(0,1fr);
  gap:22px;
  align-items:start;
}

.sidebar{
  width:auto;
  min-width:0;
}

.sidebar-card{
  position:sticky;
  top:20px;
  background:linear-gradient(180deg,#0f172a 0%,#111827 100%);
  color:#fff;
  border:1px solid rgba(255,255,255,.07);
  box-shadow:0 22px 60px rgba(2,8,23,.24);
  padding:18px;
  border-radius:28px;
}

.sidebar-card .identity-card{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px;
  border-radius:20px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  margin-bottom:10px;
}

.sidebar-card .identity-card .meta .title{
  color:#fff;
  font-weight:800;
}

.sidebar-card .identity-card .meta .sub{
  color:rgba(255,255,255,.72);
  font-size:12px;
}

.sidebar-kpis{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:8px 0 10px;
}

.sidebar-kpi{
  padding:12px;
  border-radius:18px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
}

.sidebar-kpi .num{
  font-size:18px;
  font-weight:900;
  color:#fff;
}

.sidebar-kpi .lbl{
  font-size:11px;
  color:rgba(255,255,255,.72);
  margin-top:4px;
}

.nav-section-label{
  color:rgba(255,255,255,.58);
  font-size:11px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  margin:14px 4px 6px;
}

.nav-link{
  display:flex;
  align-items:center;
  gap:10px;
  border-radius:16px;
  color:rgba(255,255,255,.86);
  padding:12px 14px;
  transition:.18s ease;
  font-weight:700;
}

.nav-link:hover{
  background:rgba(255,255,255,.08);
  color:#fff;
}

.nav-link.active{
  background:#fff;
  color:#111827;
  box-shadow:0 10px 28px rgba(0,0,0,.18);
}

.content{
  min-width:0;
  gap:18px;
}

.enterprise-topbar{
  position:sticky;
  top:14px;
  z-index:30;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  background:rgba(255,255,255,.88);
  border:1px solid rgba(255,255,255,.85);
  backdrop-filter:blur(14px);
  padding:16px 18px;
  border-radius:24px;
  box-shadow:var(--cmg-shadow);
}

.enterprise-topbar-title{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.enterprise-eyebrow{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--cmg-muted);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.enterprise-topbar h1{
  margin:0;
  font-size:28px;
  line-height:1.1;
  font-weight:900;
  color:#0f172a;
}

.enterprise-topbar p{
  margin:0;
  color:var(--cmg-muted);
  font-size:14px;
}

.enterprise-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.enterprise-search{
  display:flex;
  align-items:center;
  gap:10px;
  background:#fff;
  border:1px solid var(--cmg-line);
  min-width:240px;
  padding:12px 14px;
  border-radius:16px;
}

.enterprise-search input{
  border:none;
  outline:none;
  width:100%;
  background:transparent;
  color:#0f172a;
  font-size:14px;
}

.enterprise-grid{
  display:grid;
  gap:18px;
}

.enterprise-grid-2{
  grid-template-columns:1.2fr .8fr;
}

.enterprise-grid-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.enterprise-card,
.card,
.panel,
.hero-card,
.table-wrap{
  border-radius:24px;
  box-shadow:var(--cmg-shadow);
}

.card,
.panel,
.hero-card,
.table-wrap{
  border:1px solid rgba(15,23,42,.05);
}

.hero-card{
  background:
    radial-gradient(circle at top right, rgba(196,20,27,.08), transparent 34%),
    linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);
}

.section-title{
  margin-bottom:12px;
}

.section-title .h3{
  font-size:18px;
  font-weight:800;
  color:#0f172a;
}

.chip{
  background:#eef2ff;
  color:#334155;
  border:1px solid #dbe4ff;
}

.btn{
  border-radius:14px;
}

.btn-primary{
  background:linear-gradient(180deg,var(--cmg-primary) 0%,var(--cmg-primary-dark) 100%);
}

.btn-light{
  background:#fff;
  border:1px solid var(--cmg-line);
}

.stats-row,
.report-kpi-grid,
.summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}

.kpi,
.report-kpi-card,
.summary-card{
  background:#fff;
  border:1px solid #edf2f7;
  box-shadow:var(--cmg-shadow);
  border-radius:22px;
}

.kpi{
  padding:18px;
}

.kpi .num,
.report-kpi-value{
  font-size:28px;
  font-weight:900;
  color:#0f172a;
  line-height:1.1;
}

.kpi .muted,
.report-kpi-card .muted{
  color:var(--cmg-muted);
}

.table-wrap{
  padding:0;
  overflow:auto;
  background:#fff;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

.table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f8fafc;
  color:#64748b;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  border-bottom:1px solid #e2e8f0;
}

.table th,
.table td{
  padding:14px 16px;
  white-space:nowrap;
}

.table tbody tr:nth-child(even){
  background:#fcfdff;
}

.table tbody tr:hover{
  background:#f8fafc;
}

.badge{
  border:1px solid #e2e8f0;
  background:#fff;
  color:#334155;
  font-weight:800;
}

.enterprise-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.enterprise-list-item{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:14px;
  align-items:start;
  padding:14px;
  border:1px solid #e2e8f0;
  border-radius:18px;
  background:#fff;
}

.enterprise-list-item .icon{
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
}

.enterprise-list-item .title{
  font-weight:800;
  color:#0f172a;
}

.enterprise-list-item .meta{
  color:#64748b;
  font-size:13px;
  margin-top:4px;
}

.enterprise-list-item .value{
  font-weight:800;
  color:#0f172a;
  text-align:right;
}

.quick-panel{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.quick-link{
  display:flex;
  align-items:center;
  gap:12px;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:20px;
  padding:16px;
  box-shadow:var(--cmg-shadow);
}

.quick-link .icon-only{
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:#fff5f5;
  color:var(--cmg-primary);
}

.report-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.report-tab{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid #e2e8f0;
  background:#fff;
  color:#334155;
  font-weight:800;
}

.report-tab.active{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}

.feed-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:18px;
}

.feed-card{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:24px;
  padding:18px;
  box-shadow:var(--cmg-shadow);
}

.feed-head{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.feed-title{
  font-weight:900;
  color:#0f172a;
}

.feed-text{
  color:#475569;
  line-height:1.6;
}

.feed-meta{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  color:#64748b;
  font-size:13px;
  margin-top:12px;
}

.feed-photo{
  margin-top:14px;
  overflow:hidden;
  border-radius:18px;
  border:1px solid #e2e8f0;
  background:#f8fafc;
}

.feed-photo img{
  display:block;
  width:100%;
  height:auto;
}

@media (max-width:1200px){
  .admin-shell{grid-template-columns:250px minmax(0,1fr)}
  .stats-row,.report-kpi-grid,.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .enterprise-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .feed-grid{grid-template-columns:1fr}
}

@media (max-width:860px){
  .admin-shell{grid-template-columns:1fr}
  .sidebar{order:2}
  .sidebar-card{position:static}
  .enterprise-topbar{grid-template-columns:1fr}
  .stats-row,.report-kpi-grid,.summary-grid,.quick-panel,.enterprise-grid-2,.enterprise-grid-3{
    grid-template-columns:1fr;
  }
}