:root{
  --bg:#050505;
  --card:#0d0d0d;
  --card-2:#111111;
  --border:#222;
  --text:#f6f6f6;
  --muted:#9a9a9a;
  --yellow:#facc15;
  --green:#22c55e;
  --red:#ef4444;
}
*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  font-family:Inter,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}
button,input,select,textarea{font:inherit}
.hidden{display:none!important}

.app-shell{
  display:grid;
  grid-template-columns:260px 1fr;
  min-height:100vh;
}
.sidebar{
  border-right:1px solid var(--border);
  background:#090909;
  padding:24px 16px;
  position:sticky;
  top:0;
  height:100vh;
}
.logo{
  font-size:38px;
  font-weight:900;
  color:var(--yellow);
  margin-bottom:22px;
  letter-spacing:.02em;
}
.logo span{color:#555}

.nav-group{display:flex;flex-direction:column;gap:8px}
.nav-title{
  color:#666;
  text-transform:uppercase;
  letter-spacing:.15em;
  font-size:11px;
  margin:18px 10px 8px;
}
.nav-btn{
  border:1px solid transparent;
  background:transparent;
  color:#ddd;
  padding:12px 14px;
  border-radius:14px;
  text-align:left;
  cursor:pointer;
  transition:.18s ease;
}
.nav-btn:hover{background:#111;border-color:#171717}
.nav-btn.active{
  background:var(--yellow);
  color:#000;
  font-weight:700;
}

.main{
  padding:24px;
  min-width:0;
}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:22px;
  gap:16px;
  flex-wrap:wrap;
}
.title{
  font-size:38px;
  font-weight:900;
  line-height:1.02;
  letter-spacing:-.02em;
}
.subtitle{
  color:var(--muted);
  margin-top:8px;
  line-height:1.4;
}

.card{
  background:linear-gradient(180deg,var(--card),var(--card-2));
  border:1px solid var(--border);
  border-radius:22px;
  padding:20px;
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  min-width:0;
}
.grid{display:grid;gap:16px}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}

.metric-value{
  font-size:32px;
  font-weight:900;
  margin-top:8px;
  line-height:1.1;
  word-break:break-word;
}
.metric-label{
  color:#bbb;
  font-size:13px;
  letter-spacing:.02em;
}

.yellow{color:var(--yellow)}
.green{color:var(--green)}
.red{color:var(--red)}
.muted{color:var(--muted)}

.toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.flex{display:flex}
.between{justify-content:space-between}
.center{align-items:center}

.btn{
  border:none;
  border-radius:14px;
  padding:11px 15px;
  cursor:pointer;
  background:#111;
  color:#fff;
  transition:.18s ease;
  white-space:nowrap;
}
.btn:hover{transform:translateY(-1px)}
.btn.primary{
  background:var(--yellow);
  color:#000;
  font-weight:700;
}
.btn.secondary{
  border:1px solid var(--border);
  background:#090909;
}
.btn.danger{
  background:#2a0d0d;
  color:#fff;
  border:1px solid #4b1616;
}

.login-wrap{
  min-height:100vh;
  display:grid;
  grid-template-columns:1.1fr .9fr;
}
.login-side{
  border-right:1px solid var(--border);
  padding:48px;
  background:
    radial-gradient(circle at top left, rgba(250,204,21,.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(250,204,21,.09), transparent 25%),
    #070707;
}
.login-panel{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:24px;
}
.login-card{
  width:100%;
  max-width:440px;
}

.form-grid{display:grid;gap:12px}
.input,.select,.textarea{
  width:100%;
  padding:13px 15px;
  border-radius:14px;
  background:#080808;
  color:#fff;
  border:1px solid var(--border);
  outline:none;
}
.input:focus,.select:focus,.textarea:focus{
  border-color:#3a3a3a;
  box-shadow:0 0 0 3px rgba(255,255,255,.03);
}
select[multiple]{min-height:130px}

.table-wrap{
  overflow:auto;
  border-radius:16px;
}
table{
  width:100%;
  border-collapse:collapse;
  min-width:820px;
}
th,td{
  text-align:left;
  padding:14px 12px;
  border-bottom:1px solid #181818;
  vertical-align:top;
}
th{
  color:#999;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  position:sticky;
  top:0;
  background:#0f0f0f;
  z-index:1;
}
tr:hover td{background:rgba(255,255,255,.015)}

.badge{
  display:inline-block;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:#111;
  border:1px solid var(--border);
}
.badge.active{background:#166534;color:#fff;border-color:#166534}
.badge.suspended{background:#7f1d1d;color:#fff;border-color:#7f1d1d}
.badge.yellow{background:var(--yellow);color:#000;border-color:var(--yellow)}

.spacer{height:16px}
.notice{
  padding:12px 14px;
  border-radius:14px;
  background:#111;
  border:1px solid var(--border);
  margin-bottom:12px;
  min-width:0;
}
.stat-card{box-shadow:0 0 0 1px rgba(255,255,255,0.03) inset}

.chart-svg{width:100%;height:auto;display:block}
.chart-grid{stroke:#262626;stroke-width:1}
.chart-axis{fill:#8a8a8a;font-size:10px}
.chart-line{fill:none;stroke:#facc15;stroke-width:3}
.chart-area{fill:rgba(250,204,21,0.10)}
.chart-dot{fill:#facc15}

.rank-row{margin-bottom:14px}
.rank-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:6px;
}
.rank-track{
  height:10px;
  border-radius:999px;
  background:#161616;
  overflow:hidden;
}
.rank-fill{
  height:10px;
  border-radius:999px;
  background:linear-gradient(90deg,#facc15,#fde68a);
}

.delta{margin-top:8px;font-size:13px}
.delta.positive{color:#22c55e}
.delta.negative{color:#f87171}

@media (max-width:1100px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .app-shell,.login-wrap,.grid-4,.grid-3,.grid-2{grid-template-columns:1fr}
  .sidebar{position:static;height:auto}
  .toolbar{flex-direction:column;align-items:stretch}
  .topbar{align-items:stretch}
  .title{font-size:30px}
  .main{padding:18px}
  .card{padding:16px}
  .btn{width:100%;text-align:center}
}


/* v17 mobile professional */
.mobile-menu-toggle{
  display:none;
  position:sticky;
  top:12px;
  left:12px;
  z-index:30;
  margin:12px 12px 0;
  width:calc(100% - 24px);
  border:none;
  border-radius:14px;
  padding:12px 14px;
  background:var(--yellow);
  color:#000;
  font-weight:800;
  box-shadow:0 8px 20px rgba(0,0,0,.25);
}
@media (max-width:900px){
  .mobile-menu-toggle{display:block}
  .app-shell{display:block}
  .sidebar{
    position:fixed!important;
    top:0;
    left:0;
    width:min(88vw,320px);
    height:100vh!important;
    z-index:40;
    transform:translateX(-105%);
    transition:transform .2s ease;
    box-shadow:18px 0 40px rgba(0,0,0,.45);
    overflow:auto;
  }
  .sidebar.open{transform:translateX(0)}
  .main{padding:14px}
  .card{border-radius:18px}
  .topbar .title{font-size:26px}
  .metric-value{font-size:26px}
  .toolbar .btn,.toolbar .input,.toolbar .select{width:100%}
  .btn{min-height:44px}
  .input,.select,.textarea{min-height:44px}
  .table-wrap{overflow:visible}
  table{min-width:0;border-collapse:separate;border-spacing:0 12px}
  table thead{display:none}
  table tbody,table tr,table td{display:block;width:100%}
  table tr{
    background:#101010;
    border:1px solid var(--border);
    border-radius:16px;
    padding:10px 12px;
    margin-bottom:10px;
  }
  table td{
    border:none;
    padding:8px 0 8px 44%;
    position:relative;
    min-height:24px;
    word-break:break-word;
  }
  table td::before{
    content:attr(data-label);
    position:absolute;
    left:0;
    top:8px;
    width:40%;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.04em;
  }
  .notice .flex.between{flex-direction:column;align-items:flex-start;gap:6px}
  .rank-head{align-items:flex-start;flex-direction:column}
}


.kpi-strip{display:grid;gap:16px}

/* ===== LEADS / CRM ===== */

.textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  font: inherit;
}

.textarea:focus {
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.subtitle {
  color: rgba(255,255,255,.65);
  margin-top: 6px;
}

.spacer {
  height: 16px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.72);
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}

tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
}

tbody tr:hover td {
  background: rgba(255,255,255,.02);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.08);
  color: #fff;
}

.badge.active {
  background: rgba(34,197,94,.15);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.24);
}

.badge.suspended {
  background: rgba(239,68,68,.14);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.22);
}

.badge.yellow {
  background: rgba(245,158,11,.14);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,.22);
}

.notice {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 14px;
}

.notice + .notice {
  margin-top: 10px;
}

.muted {
  color: rgba(255,255,255,.62);
  font-size: 13px;
}

.flex {
  display: flex;
}

.between {
  justify-content: space-between;
}

.center {
  align-items: center;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(10px);
}

.stat-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
}

.metric-label {
  font-size: 13px;
  color: rgba(255,255,255,.66);
  margin-bottom: 10px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.metric-value.green {
  color: #86efac;
}

.metric-value.red {
  color: #fca5a5;
}

.metric-value.yellow {
  color: #fcd34d;
}

.delta {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
}

.delta.positive {
  color: #86efac;
}

.delta.negative {
  color: #fca5a5;
}

.rank-row + .rank-row {
  margin-top: 14px;
}

.rank-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.rank-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f5c542, #d4af37);
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-grid {
  stroke: rgba(255,255,255,.08);
  stroke-width: 1;
}

.chart-axis {
  fill: rgba(255,255,255,.55);
  font-size: 11px;
}

.chart-line {
  fill: none;
  stroke: #f5c542;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: rgba(245,197,66,.12);
}

.chart-dot {
  fill: #f5c542;
}

@media (max-width: 980px) {
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    margin-bottom: 14px;
    overflow: hidden;
    background: rgba(255,255,255,.02);
  }

  tbody td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.05);
  }

  tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: rgba(255,255,255,.65);
  }
}