/* ─────────────────────────────────────────────────
   Fleet Dashboard — Additional Styles
   Extends affiliate-styles.css dashboard base
   ───────────────────────────────────────────────── */

/* ─── Org Header ─── */
.fleet-org-name {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-heading);
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
}

.tag-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ─── Add Member ─── */
.fleet-add-member {
  display: flex;
  gap: 10px;
}

.fleet-add-member input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.fleet-add-member input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Members Table ─── */
.fleet-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fleet-table th {
  background: var(--bg-secondary);
}

.fleet-member-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.fleet-member-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.fleet-fc-bar {
  width: 80px;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.fleet-fc-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fleet-fc-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.fleet-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.dash-btn-remove {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.dash-btn-remove:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ─── Student Detail ─── */
.fleet-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fleet-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.fleet-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.fleet-detail-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.fleet-detail-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.fleet-detail-stats {
  display: flex;
  gap: 24px;
}

.fleet-detail-stat {
  text-align: center;
  flex: 1;
}

.fleet-detail-stat-value {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.fleet-detail-stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.accent-green { color: var(--green); }
.accent-amber { color: var(--amber); }

/* ─── Module Progress Bars ─── */
.fleet-module-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.fleet-module-name {
  width: 140px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.fleet-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.fleet-module-pct {
  width: 36px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Confirm Modal ─── */
.fleet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.fleet-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 90%;
}

.fleet-modal h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.fleet-modal p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.fleet-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-danger {
  background: var(--red);
  color: white;
  border: none;
  cursor: pointer;
}

.btn-danger:hover {
  background: #dc2626;
}

/* ─── CSV Upload ─── */
.fleet-modal-wide {
  max-width: 560px;
}

.fleet-add-or {
  font-size: 0.8rem;
  color: var(--text-muted);
  align-self: center;
}

.fleet-csv-preview {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.fleet-csv-table {
  font-size: 0.8rem;
}

.fleet-csv-table th:first-child,
.fleet-csv-table td:first-child {
  width: 40px;
  text-align: center;
  color: var(--text-muted);
}

.fleet-csv-row-invalid {
  opacity: 0.5;
}

.fleet-csv-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.fleet-csv-status-valid {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
}

.fleet-csv-status-invalid {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.fleet-csv-status-duplicate {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
}

.fleet-csv-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.fleet-csv-stat-valid { color: var(--green); font-weight: 600; }
.fleet-csv-stat-invalid { color: var(--red); font-weight: 600; }
.fleet-csv-stat-dupe { color: var(--amber); font-weight: 600; }

/* ─── Signup Page ─── */
.fleet-signup-container {
  max-width: 640px;
  margin: 120px auto 60px;
  padding: 0 24px;
}

.fleet-signup-container h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.fleet-signup-subtitle {
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.fleet-signup-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.fleet-signup-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.fleet-signup-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Plan Cards */
.fleet-plan-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.fleet-plan-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
  text-align: center;
}

.fleet-plan-card:hover {
  border-color: rgba(14, 165, 233, 0.3);
}

.fleet-plan-card input[type="radio"] {
  display: none;
}

.fleet-plan-selected {
  border-color: var(--accent);
  background: rgba(14, 165, 233, 0.05);
}

.fleet-plan-header {
  margin-bottom: 4px;
}

.fleet-plan-name {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.fleet-plan-price {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--accent);
}

.fleet-plan-price small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.fleet-plan-total {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Quantity selector for 100+ */
.fleet-quantity-section {
  margin-bottom: 20px;
}

.fleet-quantity-section label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.fleet-quantity-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fleet-quantity-row input {
  width: 120px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.fleet-quantity-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.fleet-quantity-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Billing toggle */
.fleet-billing-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.fleet-billing-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
}

.fleet-toggle-option {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.fleet-toggle-option input[type="radio"] {
  display: none;
}

.fleet-toggle-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(14, 165, 233, 0.05);
}

/* Price summary */
.fleet-price-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.fleet-price-summary-label {
  font-family: var(--font-heading);
  font-weight: 600;
}

.fleet-price-summary-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
}

.btn-lg {
  padding: 16px 24px;
  font-size: 1rem;
}

.fleet-signup-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ─── App Badge (table row) ─── */
.fleet-app-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.fleet-app-badge-oow {
  background: rgba(14, 165, 233, 0.12);
  color: var(--accent);
}

.fleet-app-badge-eoow {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
}

.fleet-app-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ─── Filter Tabs ─── */
.fleet-filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}

.fleet-filter-tab {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.fleet-filter-tab:hover {
  color: var(--text-secondary);
}

.fleet-filter-tab-active {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.fleet-filter-tab .fleet-filter-count {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
  font-size: 0.7rem;
}

/* ─── Per-App Seat Gauges ─── */
.fleet-seat-gauges {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
}

.fleet-seat-gauge {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.fleet-seat-gauge-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.fleet-seat-gauge-header img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.fleet-seat-gauge-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
}

.fleet-seat-gauge-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.fleet-seat-gauge-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.fleet-seat-gauge-fill-oow {
  background: var(--accent);
}

.fleet-seat-gauge-fill-eoow {
  background: var(--amber);
}

.fleet-seat-gauge-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.fleet-seat-gauge-label strong {
  color: var(--text-primary);
}

.fleet-seat-gauge-coming-soon {
  opacity: 0.5;
}

.fleet-seat-gauge-coming-soon .fleet-seat-gauge-name {
  color: var(--text-muted);
}

.coming-soon-badge-inline {
  position: static;
  transform: none;
  padding: 3px 10px;
  font-size: 0.6rem;
  letter-spacing: 1px;
}

/* ─── Add Member App Selector ─── */
.fleet-add-member-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.fleet-add-member-row input[type="email"] {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.fleet-add-member-row input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.fleet-app-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.fleet-app-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.fleet-app-check:hover {
  border-color: rgba(14, 165, 233, 0.3);
}

.fleet-app-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.fleet-app-check img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

.fleet-app-check-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.fleet-seat-remaining {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.fleet-seat-remaining span {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .fleet-detail-grid {
    grid-template-columns: 1fr;
  }

  .fleet-table th:nth-child(3),
  .fleet-table td:nth-child(3),
  .fleet-table th:nth-child(7),
  .fleet-table td:nth-child(7) {
    display: none;
  }

  .fleet-add-member {
    flex-direction: column;
  }

  .fleet-add-member-row {
    flex-direction: column;
  }

  .fleet-app-selector {
    flex-direction: column;
  }

  .fleet-seat-gauges {
    flex-direction: column;
  }

  .fleet-filter-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .fleet-plan-cards {
    grid-template-columns: 1fr;
  }

  .fleet-billing-toggle {
    flex-wrap: wrap;
  }

  .fleet-detail-stats {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .fleet-table th:nth-child(4),
  .fleet-table td:nth-child(4),
  .fleet-table th:nth-child(5),
  .fleet-table td:nth-child(5),
  .fleet-table th:nth-child(6),
  .fleet-table td:nth-child(6) {
    display: none;
  }

  .fleet-module-name {
    width: 100px;
  }
}
