/* ProgencyAI control-plane admin styling. Imports shared tokens. */
@import url("tokens.css?v=1");

/* Shell layout: fixed sidebar + topbar + scrolling content */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 250px; flex: 0 0 250px; background: #0F1730; color: #C9D3E8;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px;
  font-weight: 800; font-size: 19px; color: #fff; letter-spacing: -.02em; }
.admin-brand .dot { width: 12px; height: 12px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 0 4px rgba(47,128,255,.25); }
.admin-nav { list-style: none; margin: 0; padding: 0; }
.admin-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 2px 0;
  border-radius: 10px; color: #C9D3E8; font-weight: 600; font-size: 14.5px;
  transition: background .12s ease, color .12s ease;
}
.admin-nav a i { font-size: 18px; opacity: .9; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: var(--blue); color: #fff; }
.admin-nav .nav-badge { margin-left: auto; background: var(--pink); color: #fff;
  border-radius: var(--r-pill); font-size: 11px; font-weight: 800; padding: 1px 8px; }
.admin-nav .nav-sep { margin: 12px 8px 6px; font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: #5D6B8C; font-weight: 700; }

.admin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 20;
}
.admin-topbar .page-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.admin-topbar .spacer { flex: 1; }
.admin-bell { position: relative; display: inline-flex; width: 42px; height: 42px;
  align-items: center; justify-content: center; border-radius: 12px; color: var(--ink);
  background: #F3F6FB; }
.admin-bell:hover { background: #E8EEF8; color: var(--ink); }
.admin-bell i { font-size: 20px; }
.admin-bell .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.admin-user .name { font-weight: 700; font-size: 14px; line-height: 1.1; }
.admin-user .role { font-size: 12px; color: var(--muted); }

.admin-content { padding: 28px; flex: 1; min-width: 0; max-width: 100%; }
.admin-main { max-width: 100%; overflow-x: hidden; }
.admin-content > h1 { font-size: 26px; margin-bottom: 4px; }
.admin-content .subtitle { color: var(--muted); margin: 0 0 22px; font-size: 15px; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.kpi { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .icon { width: 40px; height: 40px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 21px; }
.kpi .icon.blue { background: #EAF1FF; color: var(--blue); }
.kpi .icon.green { background: rgba(46,213,115,.14); color: #17914a; }
.kpi .icon.amber { background: rgba(255,176,32,.16); color: #a56c00; }
.kpi .icon.pink { background: rgba(255,91,160,.14); color: #c22a6f; }

/* Tables */
.table-wrap { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow);
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th { text-align: left; padding: 13px 16px; font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); background: #F7F9FC; font-weight: 700; }
table.data td { padding: 13px 16px; border-top: 1px solid var(--line); }
table.data tr:hover td { background: #FAFBFE; }

/* Section grid + panels */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel-title { font-size: 16px; font-weight: 800; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; }

/* Empty states */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty i { font-size: 38px; color: #C4CEDF; display: block; margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background:
    radial-gradient(1200px 600px at 15% -10%, rgba(47,128,255,.20), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(255,91,160,.14), transparent 55%), var(--canvas); }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 800;
  font-size: 22px; margin-bottom: 6px; letter-spacing: -.02em; }
.login-card .brand .dot { width: 13px; height: 13px; border-radius: 50%; background: var(--blue);
  box-shadow: 0 0 0 4px rgba(47,128,255,.22); }

/* Mobile: collapse sidebar to a top drawer */
.admin-menu-toggle { display: none; }
@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease; height: 100vh; }
  .admin-shell.nav-open .admin-sidebar { transform: translateX(0); }
  .admin-menu-toggle { display: inline-flex; width: 42px; height: 42px; align-items: center;
    justify-content: center; border-radius: 12px; background: #F3F6FB; border: 0; cursor: pointer; }
  .admin-menu-toggle i { font-size: 22px; }
  .admin-scrim { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 55; }
  .admin-shell.nav-open .admin-scrim { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .admin-content { padding: 18px; }
}
