/* Sidebar navigation for pneu subpages */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 200px;
  background: rgba(255,255,255,0.95);
  box-shadow: 2px 0 16px 0 rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 48px;
  z-index: 100;
}
.sidebar-nav .nav-btn {
  width: 160px;
  margin: 12px 0;
  padding: 14px 0;
  border: none;
  border-radius: 1rem;
  background: #f3f4f6;
  color: #1f2937;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.sidebar-nav .nav-btn.active,
.sidebar-nav .nav-btn:hover {
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 100%);
  color: #fff;
}
.sidebar-nav .nav-btn svg {
  width: 22px;
  height: 22px;
}
.sidebar-nav-spacer {
  flex: 1;
}
@media (max-width: 900px) {
  .app-container,
  .panel-page {
    margin-left: 0 !important;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .bottom-nav {
    margin-left: 0 !important;
    width: 100vw;
    left: 0;
    right: 0;
    border-radius: 1.5rem 1.5rem 0 0;
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 50%, #e0e7ff 100%);
  min-height: 100vh;
  color: #1f2937;
}

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 2rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 400px;
}

.logo-container {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.login-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #10b981, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.login-card p {
  color: #6b7280;
  font-size: 0.875rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #cacaca;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #ffffff;
  border-radius: 1rem;
  font-size: 1rem;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.5);
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  color: #6b7280;
  font-size: 0.75rem;
}

/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Desktop: full width layout */
@media (min-width: 901px) {
  .app-container {
    margin-left: 0;
    width: 100%;
  }
}

.main-content {
  flex: 1;
  padding-bottom: 5rem;
}

.page-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem;
}

@media (min-width: 1024px) {
  .page-container {
    max-width: none;
  }
}

/* Page Headers */
.page-header {
  position: relative;
  margin-bottom: 2rem;
  padding-top: 2rem;
}

.header-background {
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  opacity: 0.1;
}

.storage-header .header-background {
  background: linear-gradient(135deg, #10b981, #059669, #0891b2);
}

.truck-header .header-background {
  background: linear-gradient(135deg, #facc15, #eab308, #fde047);
}

.trailer-header .header-background {
  background: linear-gradient(135deg, #3b82f6, #2563eb, #60a5fa);
}

.header-content {
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.header-icon-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.storage-icon {
  background: linear-gradient(135deg, #10b981, #059669);
}

.truck-icon {
  background: linear-gradient(135deg, #facc15, #eab308);
}

.trailer-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.history-icon {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

.header-text h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.storage-header h1 {
  background: linear-gradient(135deg, #10b981, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.truck-header h1 {
  background: linear-gradient(135deg, #facc15, #eab308);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.trailer-header h1 {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


.history-header .header-background {
  background: linear-gradient(135deg, #a855f7, #9333ea, #c084fc);
}

.history-header h1 {
  background: linear-gradient(135deg, #a855f7, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-text p {
  color: #6b7280;
  font-size: 0.875rem;
}

.header-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.stat-dot.good {
  background-color: #22c55e;
}

.stat-dot.warning {
  background-color: #f59e0b;
}

.stat-dot.danger {
  background-color: #ef4444;
}

.button {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.5);
}

.icon-button {
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.5);
}

.back-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #6b7280;
}

.back-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.status-badge.complete {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-badge.incomplete {
  background: #fed7aa;
  color: #9a3412;
  border: 1px solid #fdba74;
}

/* Sections */
.section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.section-header.collapsible {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.section-header.collapsible:hover {
  opacity: 0.8;
}

.dropdown-arrow {
  margin-left: auto;
  transition: transform 0.2s;
  color: #6b7280;
}

.collapsible-content {
  transition: all 0.3s ease;
  padding-top: 1rem;
}

.collapsible-content .tire-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.section-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2937;
}

.section-indicator {
  width: 0.25rem;
  height: 1.5rem;
  border-radius: 0.125rem;
}

.truck-indicator {
  background: linear-gradient(to bottom, #facc15, #eab308);
}

.trailer-indicator {
  background: linear-gradient(to bottom, #3b82f6, #2563eb);
}

/* Grids */
.tire-grid,
.vehicle-grid,
.tire-slots-grid {
  display: grid;
  gap: 1rem;
}

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

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

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

#rearTires.truck-axles {
  grid-template-columns: repeat(4, 1fr);
}


/* Cards */
.tire-card,
.vehicle-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
  cursor: pointer;
}

.tire-card:hover,
.vehicle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.tire-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.tire-info h3 {
  font-weight: 700;
  color: #1f2937;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.tire-info p {
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.tire-id {
  font-size: 0.75rem;
  color: #9ca3af;
  font-family: "Courier New", monospace;
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  display: inline-block;
}

.tire-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid;
  border-radius: 0.75rem;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.edit-btn {
  border-color: #bfdbfe;
  color: #3b82f6;
}

.edit-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.delete-btn {
  border-color: #fecaca;
  color: #ef4444;
}

.delete-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.move-btn {
  border-color: #e0e7ff;
  color: #4f46e5;
}

.move-btn:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.status-badge-small {
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-good {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-warning {
  background: #fed7aa;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.status-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Tire count with status colors */
.tire-count {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tire-count.status-available {
  background: linear-gradient(135deg, #10b981, #059669);
}

.tire-count.status-assigned {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.tire-count.status-forsale {
  background: linear-gradient(135deg, #ea580c, #c2410c);
}
.tire-count.status-disposed {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Vehicle Cards */
.vehicle-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vehicle-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.vehicle-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.vehicle-icon.good {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.vehicle-icon.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.vehicle-icon.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.vehicle-icon.unknown {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

.vehicle-details h3 {
  font-weight: 700;
  color: #1f2937;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.vehicle-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.vehicle-meta span {
  font-size: 0.875rem;
  color: #6b7280;
}

.vehicle-status {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.status-icon.complete {
  background: #dcfce7;
  color: #16a34a;
}

.status-icon.incomplete {
  background: #fed7aa;
  color: #f59e0b;
}

.status-icon.good {
  background: #dcfce7;
  color: #16a34a;
}

.status-icon.warning {
  background: #fed7aa;
  color: #f59e0b;
}

.status-icon.danger {
  background: #fee2e2;
  color: #ef4444;
}

.status-icon.unknown {
  background: #f3f4f6;
  color: #6b7280;
}

.progress-bar {
  width: 100%;
  margin-top: 1rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.progress-track {
  width: 100%;
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 0.25rem;
  transition: width 0.3s;
}

.progress-fill.complete {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.progress-fill.incomplete {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.progress-fill.good {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.progress-fill.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.progress-fill.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.progress-fill.unknown {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

/* Tire Slots */
.tire-slot-card {
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 15px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s;
}

.tire-slot-card.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.tire-slot-header {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.tire-slot-header h3 {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-align: center;
}

.tire-slot-content {
    flex-grow: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.assigned-tire-new {
    text-align: center;
}

.tire-brand-new {
    font-size: 1rem;
    font-weight: 500;
    color: #1f2937;
}

.tire-brand-new strong {
    font-weight: 800;
}

.tire-size-new {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.tire-details-grid-new {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tire-detail-item-new {
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.3rem 0.5rem;
}

.detail-label-new {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.detail-value-new {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1f2937;
    font-family: "Courier New", monospace;
}

.tire-km-new {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.tire-km-new.status-red {
    background: #fee2e2;
    border-color: #fecaca;
}

.tire-km-new.status-red .km-label {
    color: #b91c1c;
}

.tire-km-new.status-red .km-value {
    color: #991b1b;
}

.tire-km-new.status-orange {
    background: #ffedd5;
    border-color: #fed7aa;
}

.tire-km-new.status-orange .km-label {
    color: #9a3412;
}

.tire-km-new.status-orange .km-value {
    color: #7c2d12;
}

.tire-km-new.status-green {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.tire-km-new.status-green .km-label {
    color: #166534;
}

.tire-km-new.status-green .km-value {
    color: #15803d;
}

.km-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #166534;
}

.km-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #15803d;
}

.empty-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 2px dashed #d1d5db;
    border-radius: 1rem;
    background: #f9fafb;
    height: 100%;
    cursor: pointer;
    transition: all 0.2s;
}

.empty-slot:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.empty-slot-icon {
    color: #9ca3af;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.empty-slot:hover .empty-slot-icon {
    color: #3b82f6;
}

.empty-slot-text {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.empty-slot:hover .empty-slot-text {
    color: #3b82f6;
}

.tire-slot-footer {
    padding: 0.75rem;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.slot-btn-new {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.assign-btn-new {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 14px -4px rgba(59, 130, 246, 0.4);
}

.assign-btn-new:hover {
    background: #2563eb;
}

.remove-btn-new {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.remove-btn-new:hover {
    background: #fca5a5;
    color: #b91c1c;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(229, 231, 235, 0.5);
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 50;
}

.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 1rem;
  max-width: none;
  margin: 0;
}

@media (min-width: 1024px) {
  .bottom-nav {
    max-width: none;
  }
}

/* Make layout fill full width on desktop */
@media (min-width: 901px) {
  .bottom-nav {
    margin-left: 0;
    width: 100%;
  }
}

/* Mobile: bottom nav spans full width */
@media (max-width: 900px) {
  .bottom-nav {
    margin-left: 0 !important;
    width: 100vw;
    left: 0;
    right: 0;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  text-decoration: none;
  transition: all 0.3s;
  color: #6b7280;
}

.nav-item:hover {
  transform: scale(1.05);
}

.nav-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  transition: all 0.3s;
}

.nav-icon.truck-icon {
  background: #fef9c3;
  color: #eab308;
}

.nav-icon.storage-icon {
  background: #dcfce7;
  color: #10b981;
}

.nav-icon.trailer-icon {
  background: #dbeafe;
  color: #3b82f6;
}

.nav-icon.history-icon {
  background: #f3e8ff;
  color: #a855f7;
}

.nav-icon.active {
  transform: scale(1.1);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.nav-icon.truck-icon.active {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: white;
}

.nav-icon.storage-icon.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.nav-icon.trailer-icon.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.nav-icon.history-icon.active {
  background: linear-gradient(135deg, #a855f7, #9333ea);
  color: white;
}

.nav-item span {
  font-size: 0.75rem;
  font-weight: 600;
  transition: color 0.3s;
}

.nav-item.active span {
  color: #1f2937;
}

.nav-item.active .truck-icon span {
  color: #eab308;
}

.nav-item.active .storage-icon span {
  color: #10b981;
}

.nav-item.active .trailer-icon span {
  color: #3b82f6;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 1.5rem;
  padding: 0;
  max-width: 580px;
  min-width: 320px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.close-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal form {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.5);
}

/* Tire Selection */
.tire-selection {
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.tire-option {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tire-option:hover {
  border-color: #10b981;
  background: #f0fdf4;
}

.tire-option:last-child {
  margin-bottom: 0;
}

.tire-option-header {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.tire-option-details {
  font-size: 0.875rem;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Storage Options Modal */
.storage-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.storage-option-btn {
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
}

.storage-option-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
}

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

/* --- Skupina pneumatík detail modal --- */
.group-header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.group-header-icon {
  color: #10b981;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
}
.badge {
  display: inline-block;
  padding: 0.25em 0.75em;
  border-radius: 1em;
  font-size: 0.95em;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
  margin-right: 0.25em;
}
.badge-count {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 0.95em;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
  padding: 0.25em 0.75em;
  border-radius: 1em;
  margin-left: 0.5rem;
  display: inline-block;
  vertical-align: middle;
}
.badge-dot {
  background: #dcfce7;
  color: #166534;
  font-size: 0.95em;
}
.badge-status {
  font-size: 0.95em;
  padding: 0.25em 0.9em;
  border-radius: 1em;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}
.badge-status-available {
  background: #dcfce7;
  color: #16a34a;
}
.badge-status-assigned {
  background: #fef9c3;
  color: #ca8a04;
}
.badge-status-maintenance {
  background: #fef3c7;
  color: #f59e0b;
}
.badge-status-forsale {
  background: #fed7aa;
  color: #ea580c;
}
.badge-status-disposed {
  background: #fee2e2;
  color: #dc2626;
}
.group-table-box {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1.25rem 1rem 1rem 1rem;
}
.group-table-title {
  font-weight: 700;
  font-size: 1.1rem;
}
.group-table-scroll {
  /* overflow-x: auto; */
  overflow-x: visible;
}
.group-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}
.group-table th, .group-table td {
  padding: 0.4em 0.5em;
  text-align: left;
  font-size: 0.97em;
  white-space: nowrap;
}
.group-table th {
  background: #f3f4f6;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}
.group-table tr:not(:last-child) td {
  border-bottom: 1px solid #e5e7eb;
}
.group-table td {
  vertical-align: middle;
  font-size: 0.97em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-table tr:hover {
  background: #f0fdf4;
}
.action-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.3em 0.5em;
  border-radius: 0.5em;
  transition: background 0.2s;
  margin-right: 0.1em;
}
.edit-btn {
  color: #2563eb;
}
.edit-btn:hover {
  background: #dbeafe;
}
.delete-btn {
  color: #ef4444;
}
.delete-btn:hover {
  background: #fee2e2;
}

/* --- Mobilné zobrazenie skupiny pneumatík --- */
.group-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.group-mobile-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px -4px #0001;
  font-size: 1em;
}
.group-mobile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25em;
}
.group-mobile-row:last-child {
  margin-bottom: 0;
}
.group-mobile-label {
  font-weight: 600;
  color: #374151;
  margin-right: 0.5em;
}

/* --- Mobilné zobrazenie skupiny pneumatík - vylepšené karty --- */
.group-mobile-id {
  font-weight: 700;
  color: #222;
  letter-spacing: 0.5px;
}
.group-mobile-dot {
  background: #dcfce7;
  color: #16a34a;
  font-weight: 700;
  border-radius: 1em;
  padding: 0.2em 0.9em;
  font-size: 1em;
  display: inline-block;
}
.group-mobile-km {
  font-weight: 700;
  color: #222;
}
.group-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 0.7em;
}
.group-mobile-btn {
  flex: 1 1 auto;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.5em;
  padding: 0.45em 0.5em;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  transition: background 0.15s, color 0.15s, border 0.15s;
  text-align: center;
}
.group-mobile-btn.edit {
  color: #2563eb;
  border-color: #bfdbfe;
}
.group-mobile-btn.edit:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}
.group-mobile-btn.delete {
  color: #ef4444;
  border-color: #fecaca;
}
.group-mobile-btn.delete:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.group-mobile-add-btn {
  font-size: 1.1em;
  font-weight: 700;
  border-radius: 1.5em;
  padding: 0.7em 2.2em;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px -4px #05966922;
  border: none;
  transition: background 0.2s, box-shadow 0.2s;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.group-mobile-add-btn:hover {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 4px 16px -4px #05966933;
}

.group-size-main {
  font-weight: 700;
  font-size: 1.15em;
  letter-spacing: 0.5px;
  color: #222;
}
.group-size-r {
  font-weight: 700;
  font-size: 1em;
  color: #222;
  display: inline-block;
  margin-top: 0.1em;
}
.group-size-num {
  font-weight: 700;
  font-size: 1.15em;
  color: #1e293b;
  letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 640px) {
  .page-container {
    padding: 0.75rem;
  }

  .header-content {
    padding: 1rem;
  }

  .header-icon {
    width: 3rem;
    height: 3rem;
  }

  .header-text h1 {
    font-size: 1.25rem;
  }

  .tire-slots-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
}

@media (max-width: 500px) {
  .modal-content {
    max-width: 98vw;
    min-width: 0;
    padding: 0;
  }
  .group-header-box, .group-table-box {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .group-mobile-add-btn {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    font-size: 1.08em;
  }
}

/* Authentication Check */
.auth-required {
  display: none;
}

.auth-required.authenticated {
  display: block;
}

/* Back navigation utility */
.module-top-nav {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1rem;
}

.module-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.module-back-link svg {
  width: 18px;
  height: 18px;
}

.module-back-link:hover {
  background: #2563eb;
  color: #fff;
}