/* ── Portal styles (portal.v1.css — new filename avoids Cloudflare cache) ── */

/* Dark portal shell */
.portal-layout {
  display: flex;
  min-height: 100vh;
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Sidebar */
.portal-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1e293b;
  border-right: 1px solid #334155;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid #334155;
  margin-bottom: 16px;
}
.sidebar-brand h2 {
  font-size: 18px;
  font-weight: 800;
  color: #93c5fd;
  margin-bottom: 2px;
}
.sidebar-brand p {
  font-size: 12px;
  color: #64748b;
}
.sidebar-nav {
  flex: 1;
  padding: 0 12px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #0f172a;
  color: #e2e8f0;
}
.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid #334155;
}
.sidebar-user-email {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
  word-break: break-all;
}
.btn-logout {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.btn-logout:hover {
  border-color: #dc2626;
  color: #dc2626;
}

/* Main content */
.portal-main {
  flex: 1;
  overflow-x: hidden;
  padding: 32px 36px;
}
.portal-header {
  margin-bottom: 28px;
}
.portal-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 4px;
}
.portal-header p {
  font-size: 14px;
  color: #64748b;
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 18px 20px;
}
.stat-card .label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.stat-card .value {
  font-size: 26px;
  font-weight: 800;
  color: #93c5fd;
  line-height: 1;
}
.stat-card .sub {
  font-size: 12px;
  color: #475569;
  margin-top: 4px;
}

/* Section panels */
.panel {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}
.panel-body {
  padding: 20px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.filter-input, .filter-select {
  padding: 8px 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
  min-width: 130px;
}
.filter-input:focus, .filter-select:focus {
  border-color: #1a56db;
}
.filter-select option { background: #1e293b; }

.btn-search {
  padding: 8px 18px;
  background: #1a56db;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
  white-space: nowrap;
}
.btn-search:hover { background: #1342b8; }

.btn-export {
  padding: 8px 16px;
  background: transparent;
  color: #93c5fd;
  border: 1px solid #1a56db;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-export:hover { background: #1a56db22; }

.btn-download-full {
  padding: 10px 20px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-download-full:hover { background: #15803d; }

/* Results info bar */
.results-info {
  font-size: 13px;
  color: #64748b;
  padding: 10px 20px;
  border-bottom: 1px solid #334155;
}
.results-info strong { color: #93c5fd; }

/* Data table */
.data-table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
  background: #0f172a;
}
.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #0f172a44; }
.data-table .pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: #1e3a8a22;
  color: #93c5fd;
  border: 1px solid #1e3a8a;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  border-top: 1px solid #334155;
  flex-wrap: wrap;
}
.pagination button {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.pagination button:hover:not(:disabled) { border-color: #1a56db; color: #93c5fd; }
.pagination button:disabled { opacity: .35; cursor: default; }
.pagination .page-info { font-size: 13px; color: #64748b; margin: 0 8px; }
.pagination button.active { background: #1a56db; border-color: #1a56db; color: #fff; }

/* Loading overlay inside table */
.table-loading {
  text-align: center;
  padding: 40px;
  color: #64748b;
  font-size: 14px;
}

/* License info */
.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.license-item label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 4px;
}
.license-item .val {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}
.badge-lifetime {
  display: inline-block;
  padding: 3px 10px;
  background: #16a34a22;
  color: #4ade80;
  border: 1px solid #16a34a;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

/* Downloads section */
.download-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.download-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 20px;
}
.download-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
}
.download-card p {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 768px) {
  .portal-layout { flex-direction: column; }
  .portal-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #334155; padding: 16px 0; }
  .portal-main { padding: 20px 16px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

/* Login page */
.login-page {
  min-height: 100vh;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
}
.login-card h1 {
  font-size: 22px;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 6px;
}
.login-card .sub {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 28px;
}
.form-field {
  margin-bottom: 16px;
}
.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  display: block;
  margin-bottom: 6px;
}
.form-field input {
  width: 100%;
  padding: 10px 14px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
}
.form-field input:focus { border-color: #1a56db; }
.btn-login {
  width: 100%;
  padding: 12px;
  background: #1a56db;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
  margin-top: 8px;
}
.btn-login:hover { background: #1342b8; }
.login-error {
  color: #f87171;
  font-size: 14px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #dc262620;
  border-radius: 6px;
  border: 1px solid #dc262640;
  display: none;
}
.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}
.login-footer a { color: #93c5fd; }
