/* Dead Seat Finder - Styles
   TheEngineersDesk Visual Tokens */

:root {
  --navy: #1B3A4B;
  --gold: #C4A35A;
  --aluminum: #F5F5F5;
  --text: #1A1A1A;
  --text-light: #666;
  --border: #DDD;
  --success: #28A745;
  --warning: #FFC107;
  --danger: #DC3545;
  --info: #17A2B8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  background: var(--aluminum);
  line-height: 1.6;
}

/* ==================== AUTH SCREEN ==================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #2A4A5C 100%);
}

.auth-container {
  background: white;
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  color: var(--navy);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.auth-header .subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.auth-header .brand {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-form {
  margin-bottom: 1rem;
}

.demo-hint {
  background: var(--aluminum);
  padding: 1rem;
  border-radius: 4px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ==================== MAIN APP ==================== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  background: var(--navy);
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.tenant-name {
  font-size: 0.85rem;
  color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-email {
  font-size: 0.9rem;
}

/* ==================== NAVIGATION ==================== */
.nav {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.nav-item {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--navy);
  background: var(--aluminum);
}

.nav-item.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

/* ==================== MAIN CONTENT ==================== */
.main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view h2 {
  color: var(--navy);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.view h3 {
  color: var(--navy);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.view-header h2 {
  margin: 0;
}

/* ==================== CARDS ==================== */
.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-card-highlight {
  background: linear-gradient(135deg, var(--navy) 0%, #2A4A5C 100%);
  color: white;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--navy);
}

.stat-card-highlight .stat-value {
  color: var(--gold);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card-highlight .stat-label {
  color: rgba(255, 255, 255, 0.8);
}

/* ==================== TOOL BREAKDOWN ==================== */
.tool-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--aluminum);
  border-radius: 6px;
}

.tool-breakdown-name {
  font-weight: 600;
  color: var(--navy);
}

.tool-breakdown-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tool-breakdown-waste {
  font-weight: 700;
  color: var(--danger);
}

/* ==================== TABLES ==================== */
.data-table {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

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

.table thead {
  background: var(--navy);
  color: white;
}

.table th {
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.table tbody tr:hover {
  background: var(--aluminum);
}

.table .row-warning {
  background: #FFF9E6;
}

.table .row-warning:hover {
  background: #FFF3CC;
}

/* ==================== FILTERS ==================== */
.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-select {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  min-width: 200px;
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27, 58, 75, 0.1);
}

/* ==================== BUTTONS ==================== */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--navy);
  color: white;
}

.btn-primary:hover {
  background: #2A4A5C;
}

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: #CCC;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.btn-icon:hover {
  transform: scale(1.2);
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-default {
  background: var(--aluminum);
  color: var(--text-light);
}

.badge-success {
  background: var(--success);
  color: white;
}

.badge-warning {
  background: var(--warning);
  color: var(--text);
}

.badge-danger {
  background: var(--danger);
  color: white;
}

.badge-info {
  background: var(--info);
  color: white;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light);
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* ==================== CSV IMPORT ==================== */
.csv-textarea {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.example-csv {
  background: var(--aluminum);
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.example-csv pre {
  font-size: 0.85rem;
  overflow-x: auto;
}

.import-summary {
  background: var(--aluminum);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.import-summary p {
  margin-bottom: 0.5rem;
}

.import-summary .error {
  color: var(--danger);
  font-weight: 600;
}

/* ==================== UTILITIES ==================== */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

/* ==================== TOASTS ==================== */
#toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--navy);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 250px;
  animation: slideIn 0.3s ease;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }

  .filters {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }
}
