/* Taxi Xanh - Theme overrides & new components */

:root {
  --tx-primary: #3b82f6;
  --tx-primary-dark: #2563eb;
  --tx-success: #22c55e;
  --tx-warning: #f59e0b;
  --tx-danger: #ef4444;
  --tx-card: rgba(30, 41, 59, 0.85);
  --tx-border: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"], .dark {
  --tx-card: rgba(15, 23, 42, 0.9);
}

/* Fleet grid */
.fleet-grid, .garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px 8px 100px;
}

.fleet-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
}

.event-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--tx-card);
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid var(--tx-border);
}

.fleet-actions {
  display: flex;
  gap: 8px;
}

/* Plot / vehicle card */
.plot {
  background: var(--tx-card);
  border: 1px solid var(--tx-border);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.plot:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.plot.empty {
  border-style: dashed;
  opacity: 0.85;
}

.plot.ready {
  border-color: var(--tx-success);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.plot.growing {
  border-color: var(--tx-primary);
}

.plot-icon {
  font-size: 2.2rem;
  line-height: 1.2;
}

.plot-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 4px;
}

.plot-status {
  font-size: 0.75rem;
  opacity: 0.9;
}

.plot-timer {
  font-size: 0.7rem;
  opacity: 0.75;
}

.plot-bars {
  width: 100%;
  margin-top: 6px;
}

.plot-bars .bar {
  height: 5px;
  background: rgba(0,0,0,0.25);
  border-radius: 3px;
  margin-top: 3px;
  overflow: hidden;
}

.plot-bars .bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.plot-driver {
  font-size: 0.72rem;
  margin-top: 4px;
  opacity: 0.9;
}

/* Shop */
.shop-tabs, .inventory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
}

.shop-tab, .tab-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--tx-border);
  background: transparent;
  color: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.shop-tab.active, .tab-btn.active {
  background: var(--tx-primary);
  border-color: var(--tx-primary);
  color: #fff;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 12px 12px 100px;
}

.shop-card {
  background: var(--tx-card);
  border: 1px solid var(--tx-border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-card .item-icon {
  font-size: 2rem;
}

.shop-card .item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.shop-card .item-desc {
  font-size: 0.75rem;
  opacity: 0.75;
  flex: 1;
}

.shop-card .item-price {
  font-weight: 700;
  color: var(--tx-warning);
  margin: 6px 0;
}

/* Inventory */
.inventory-content {
  padding: 12px 12px 100px;
}

.inv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--tx-card);
  border-radius: 12px;
  border: 1px solid var(--tx-border);
  margin-bottom: 8px;
}

.inv-item .item-icon {
  font-size: 1.8rem;
}

.inv-item .item-info {
  flex: 1;
}

.inv-item .item-qty {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Company panel */
.company-panel, .profile-panel {
  padding: 12px 16px 100px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--tx-card);
  border: 1px solid var(--tx-border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 4px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 100px;
}

/* Modal */
.tx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.tx-modal {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

[data-theme="light"] .tx-modal {
  background: #fff;
  color: #0f172a;
}

.tx-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 26px;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  line-height: 1;
}

.tx-modal-body {
  padding: 22px;
}

.tx-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-right: 24px;
}

.tx-modal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tx-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
}

.tx-modal-item .item-icon {
  font-size: 1.7rem;
}

.tx-modal-item .item-info {
  flex: 1;
  min-width: 0;
}

.tx-modal-item .item-info strong {
  display: block;
}

.tx-modal-item .item-info small {
  display: block;
  opacity: 0.75;
  font-size: 0.8rem;
}

.tx-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.vehicle-stats {
  line-height: 1.75;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.info-box {
  padding: 12px;
  background: rgba(59,130,246,0.15);
  border-radius: 10px;
  text-align: center;
  margin-bottom: 8px;
}

.page-sub {
  font-size: 0.85rem;
  opacity: 0.75;
  margin: 2px 0 0;
}

/* Bottom nav spacing */
.main-content {
  padding-bottom: 90px;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--tx-danger);
  border-color: var(--tx-danger);
  color: #fff;
}
