/* Account and admin pages — extends landing.css */

.account-main {
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
  padding: 32px 24px;
}

.admin-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* Profile + Subscription side-by-side */
.account-profile-subscription-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .account-profile-subscription-row {
    grid-template-columns: 1fr;
  }

  .account-subscription-section {
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .account-main {
    padding: 24px 16px;
  }
}

.account-profile-section {
  margin-bottom: 0;
}

.account-profile-section p {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0 0 6px;
  padding: 6px 0;
  max-width: 100%;
  gap: 8px;
}

.account-profile-section p:last-child {
  margin-bottom: 0;
}

.account-subscription-section {
  margin-bottom: 0;
  padding-left: 24px;
}

.plan-label {
  font-size: 14px;
  color: var(--color-text, #1f2937);
}

.account-usage-section {
  margin-bottom: 32px;
  margin-top: -8px;
}

.account-section,
.admin-section {
  margin-bottom: 32px;
}

.admin-section {
  margin-bottom: 20px;
}

.account-section h2,
.admin-section h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

.admin-section h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

/* Auth form (login/signup) */
.auth-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  box-sizing: border-box;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-green, #22c55e);
}

.auth-form .hint {
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 4px;
}

.auth-form .btn-block {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
}

.auth-form .form-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted, #6b7280);
}

.auth-form .form-footer a {
  color: var(--color-green, #22c55e);
  font-weight: 500;
}

.auth-form .error-msg {
  color: #dc2626;
  font-size: 14px;
  margin-bottom: 12px;
}

/* Subscription / plan card — no bordered box */
.plan-card {
  padding: 0;
  margin-bottom: 20px;
  border: none;
  background: transparent;
}

.plan-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}


.plan-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

.plan-badge {
  text-transform: capitalize;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--color-green-light, #dcfce7);
  color: var(--color-green-dark, #16a34a);
}

.plan-badge.plan-free {
  background: #f3f4f6;
  color: #6b7280;
}

.plan-badge.plan-past-due {
  background: #fee2e2;
  color: #dc2626;
}

.subsection-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
  margin: 0 0 12px;
}

.subsection-desc {
  font-size: 14px;
  color: var(--color-text-muted, #6b7280);
  margin: 0 0 12px;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .usage-grid {
    grid-template-columns: 1fr;
  }
}

.usage-item {
  padding: 16px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: var(--color-bg-light, #f8faf8);
  text-align: center;
}

.usage-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text, #1f2937);
}

.usage-label {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 4px;
}

.plan-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Jobs list (legacy, kept for compatibility) */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jobs-empty {
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted, #6b7280);
  background: var(--color-bg-light, #f8faf8);
  border-radius: var(--radius, 8px);
}

.job-card {
  padding: 16px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: var(--color-white, #fff);
}

.job-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.job-filename {
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

.job-meta {
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 6px;
}

.job-status {
  font-size: 13px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}

.job-status-completed {
  background: var(--color-green-light, #dcfce7);
  color: var(--color-green-dark, #16a34a);
}

.job-status-pending {
  background: #fef3c7;
  color: #b45309;
}

.job-status-failed {
  background: #fee2e2;
  color: #dc2626;
}

/* My Models section */
.models-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.models-section-header h2 {
  margin: 0;
}

.models-upload-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.models-upload-input {
  display: none;
}

.models-table-wrap {
  background: var(--color-bg-light, #f3f4f6);
  border-radius: var(--radius, 8px);
  padding: 0;
  overflow-x: auto;
}

/* Export history: no scroll bar (overflow: hidden for both axes) */
.exports-table-wrap {
  overflow: hidden;
}

/* Align Export history columns with My Models — same column widths */
.models-th.models-th-status,
.models-th-spacer {
  width: 120px;
}

.models-th.models-th-size { width: 120px; }
.models-th.models-th-parts { width: 120px; }
.models-th.models-th-date { width: 140px; }

.models-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

/* Fixed layout on both tables for consistent column alignment */
.models-table,
.models-table-exports {
  table-layout: fixed;
}

.models-table th,
.models-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  vertical-align: middle;
}

.models-table tbody tr:last-child td {
  border-bottom: none;
}

.models-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

.models-th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.models-th.models-th-filename { text-align: left; }
.models-th.models-th-status,
.models-th.models-th-size,
.models-th.models-th-parts { text-align: center; }

.models-th.models-th-date {
  text-align: left;
  padding-left: calc(16px + 1ch);
}

.models-sortable {
  cursor: pointer;
  user-select: none;
}

.models-sortable:hover {
  color: var(--color-text, #1f2937);
}

.models-sortable .models-sort-icon {
  margin-left: 4px;
  opacity: 0.5;
  font-size: 11px;
}

.models-sortable.models-sort-asc .models-sort-icon,
.models-sortable.models-sort-desc .models-sort-icon {
  opacity: 1;
}

/* File name cell: [3D] tag + icon + filename */
.models-cell-filename {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-open-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.model-open-link:hover .model-3d-tag,
.model-open-link:hover .model-filename {
  color: var(--color-green, #22c55e);
  text-decoration: underline;
}

.model-3d-tag {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  flex-shrink: 0;
}

.model-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #2563eb;
}

.model-icon svg {
  width: 100%;
  height: 100%;
  animation: model-icon-spin 3s linear infinite;
}

@keyframes model-icon-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.model-filename {
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

.models-cell-status,
.models-cell-size,
.models-cell-parts {
  text-align: center;
  color: var(--color-text, #1f2937);
}

.models-cell-date {
  text-align: left;
  color: var(--color-text, #1f2937);
  padding-left: calc(16px + 1ch);
}

/* Model status pills */
.model-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 9999px;
}

.model-status-ready {
  background: var(--color-green-light, #dcfce7);
  color: var(--color-green-dark, #16a34a);
}

.model-status-processing {
  background: #dbeafe;
  color: #1d4ed8;
}

.model-status-failed {
  background: #fee2e2;
  color: #dc2626;
}

.models-cell-date {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.model-date-icon {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted, #6b7280);
  flex-shrink: 0;
}

.models-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--color-text-muted, #6b7280);
  font-size: 14px;
}

@media (max-width: 768px) {
  .models-table-wrap {
    overflow-x: auto;
  }

  .models-table th,
  .models-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Admin page — compact layout (~10 rows visible) */
.admin-main {
  max-width: 1200px;
  padding: 16px 24px;
}

.admin-breadcrumb {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}

/* Admin header storage (center) */
.header-center {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}

/* Admin stats — compact 5 cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

.admin-stat-card {
  padding: 10px 12px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  text-align: center;
}

.admin-stat-icon {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
  opacity: 0.8;
}

.admin-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text, #1f2937);
  line-height: 1.2;
}

.admin-stat-label {
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 2px;
  line-height: 1.3;
}

/* Admin toolbar */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-search-input {
  flex: 1;
  min-width: 180px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--color-green, #22c55e);
}

.admin-filter-select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: var(--color-white, #fff);
}

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.admin-pagination-footer {
  margin-top: 12px;
  margin-left: 0;
}

.admin-pagination-info {
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}

/* Admin users table — compact (fit ~10 rows in viewport) */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.35;
}

.admin-table th,
.admin-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  vertical-align: middle;
}

.admin-table th {
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-table td {
  color: var(--color-text, #1f2937);
}

.admin-table tbody tr {
  min-height: 0;
}

/* Account column: avatar + email */
.admin-account-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-green-light, #dcfce7);
  color: var(--color-green-dark, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.admin-account-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-account-email {
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

.admin-account-name {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
}

/* Expandable detail row */
.admin-detail-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-bg-light, #f3f4f6);
  vertical-align: top;
}

.admin-detail-panel {
  padding: 12px 16px 16px;
}

.admin-detail-panel h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-models-empty {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  padding: 8px 0;
}

.admin-models-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-model-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
  font-size: 13px;
}

.admin-model-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: var(--color-green-light, #dcfce7);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.admin-model-filename {
  flex: 1;
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

.admin-model-meta {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  white-space: nowrap;
}

.admin-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-expand-btn:hover {
  color: var(--color-text, #1f2937);
}

.admin-expand-btn[aria-expanded="true"] .admin-expand-icon {
  transform: rotate(180deg);
}

.admin-models-link {
  color: var(--color-green, #22c55e);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
  padding: 0;
}

.admin-models-link:hover {
  text-decoration: underline;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}
