html,
body {
  height: 100%;
  overflow: hidden;
  background: #141820;
}

.taksimo-app {
  height: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  --tk-card: #1e2430;
  --tk-border: rgba(234, 179, 8, 0.35);
  --tk-gold: #d4b06a;
  --tk-blue: #5b9cf5;
  --tk-cell: #252b38;
  --tk-cell-busy: rgba(91, 156, 245, 0.22);
}

.taksimo-app .topbar {
  background: rgba(20, 24, 32, 0.96);
  border-bottom-color: var(--tk-border);
}

.tk-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 20px;
}

.tk-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.tk-tab {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--tk-border);
  background: rgba(255, 255, 255, 0.04);
  color: #a1a1aa;
  cursor: pointer;
}

.tk-tab--active {
  background: rgba(234, 179, 8, 0.12);
  color: var(--tk-gold);
  border-color: rgba(234, 179, 8, 0.55);
}

.tk-panel[hidden] {
  display: none !important;
}

.tk-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin: 10px 0 6px;
}

.tk-input,
.tk-select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.92rem;
  color: #f4f4f5;
  background: var(--tk-card);
  border: 1.5px solid var(--tk-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.tk-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tk-vehicles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tk-vehicle {
  text-align: left;
  font: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--tk-border);
  background: var(--tk-card);
  color: #e4e4e7;
  cursor: pointer;
}

.tk-vehicle--active {
  border-color: var(--tk-blue);
  box-shadow: 0 0 0 1px rgba(91, 156, 245, 0.25);
}

.tk-vehicle-plate {
  font-weight: 700;
  font-size: 0.95rem;
}

.tk-vehicle-driver {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 2px;
}

.tk-slab-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tk-slab-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px 44px 52px;
  gap: 6px;
  margin-bottom: 4px;
  padding: 0 2px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  text-align: center;
}

.tk-slab-head span:nth-child(2) {
  text-align: left;
}

.tk-slab-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px 44px 52px;
  gap: 6px;
  align-items: center;
}

.tk-slab-letter {
  font-weight: 800;
  font-size: 1rem;
  color: var(--tk-gold);
  text-align: center;
}

.tk-slab-row .tk-input,
.tk-slab-row .tk-select {
  padding: 8px 6px;
  font-size: 0.85rem;
}

.tk-slab-row [data-field="letter"] {
  width: 100%;
  min-width: 0;
  padding: 8px 2px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--tk-gold);
  text-align: center;
  text-align-last: center;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%23d4af37' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 8px 5px;
}

.tk-submit {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #b45309, #d97706);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.35);
}

.tk-submit:disabled {
  opacity: 0.5;
}

.tk-yard-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
}

.tk-yard {
  display: inline-grid;
  gap: 4px;
  min-width: min-content;
}

.tk-yard-slab {
  font-size: 0.56rem;
  font-weight: 800;
  color: #bfdbfe;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-yard-place {
  font-size: 0.5rem;
  font-weight: 600;
  color: #9ca3af;
  margin-top: 1px;
}

.tk-yard-cell {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: var(--tk-cell);
  font-size: 0.62rem;
  font-weight: 700;
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  padding: 2px;
  cursor: pointer;
}

.tk-yard-cell--busy {
  background: var(--tk-cell-busy);
  border-color: rgba(91, 156, 245, 0.45);
  color: #bfdbfe;
}

.tk-yard-cell--pick {
  outline: 2px solid var(--tk-gold);
}

.tk-yard-axis {
  font-size: 0.7rem;
  color: #6b7280;
  text-align: center;
}

.tk-yard-legend {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 10px;
}

.tk-detail {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--tk-card);
  border: 1px solid var(--tk-border);
  font-size: 0.88rem;
  color: #d4d4d8;
}

.tk-detail h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--tk-gold);
}

.tk-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tk-card {
  padding: 12px;
  border-radius: 12px;
  background: var(--tk-card);
  border: 1.5px solid var(--tk-border);
}

.tk-card-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.tk-card-meta {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 4px;
}

.tk-toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  padding: 12px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.92);
  color: #fff;
  font-weight: 600;
  text-align: center;
  z-index: 30;
  transform: translateY(120%);
  transition: transform 0.2s ease;
}

.tk-toast--show {
  transform: translateY(0);
}

.tk-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.78rem;
}

.tk-footer a {
  color: var(--tk-blue);
  text-decoration: none;
}

.tk-export-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.tk-export-btn {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #166534, #22c55e);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.tk-export-btn--inline {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 44px;
}

.tk-card--click {
  cursor: pointer;
}

.tk-yard-legend code {
  font-size: 0.75rem;
  color: var(--tk-gold);
}

.tk-edit-banner {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: var(--tk-gold);
  font-size: 0.88rem;
  font-weight: 600;
}

.tk-link-btn {
  font: inherit;
  font-size: 0.85rem;
  color: var(--tk-blue);
  background: none;
  border: none;
  margin-left: 8px;
  text-decoration: underline;
  cursor: pointer;
}

.tk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tk-btn {
  flex: 1;
  min-width: 120px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--tk-border);
  background: var(--tk-card);
  color: #e4e4e7;
  cursor: pointer;
}

.tk-btn--primary {
  background: linear-gradient(135deg, #b45309, #d97706);
  border: none;
  color: #fff;
}

.tk-btn--danger {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

.tk-btn--warn {
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.tk-slab-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tk-slab-item .tk-mini-btn {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--tk-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--tk-blue);
  cursor: pointer;
}

.tk-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.tk-sheet[hidden] {
  display: none !important;
}

.tk-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.tk-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: #1a2030;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--tk-border);
}

.tk-sheet-title {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--tk-gold);
}

.tk-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.tk-menu-link {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--tk-gold);
  background: rgba(212, 175, 55, 0.12);
  color: var(--tk-gold);
  text-decoration: none;
  white-space: nowrap;
}

.tk-menu-link:active {
  background: rgba(212, 175, 55, 0.25);
}

.tk-header-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.tk-dropdown {
  position: relative;
}

.tk-dropdown-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--tk-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--tk-gold);
  cursor: pointer;
  white-space: nowrap;
}

.tk-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  max-width: min(92vw, 300px);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 25;
  background: #1a2030;
  border: 1.5px solid var(--tk-border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.tk-dropdown--open .tk-dropdown-menu {
  display: block;
}

.tk-dropdown-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  padding: 11px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e4e4e7;
  text-decoration: none;
  cursor: pointer;
}

.tk-dropdown-item:hover,
.tk-dropdown-item:active {
  background: rgba(91, 156, 245, 0.15);
}

.tk-dropdown-item--link {
  color: var(--tk-blue);
}

.tk-dropdown-divider {
  height: 1px;
  margin: 4px 8px;
  background: var(--tk-border);
}

.tk-dropdown-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  padding: 8px 12px 4px;
}

.tk-quick-links {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.tk-quick-btn {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--tk-border);
  background: var(--tk-card);
  color: #d4d4d8;
  text-decoration: none;
  cursor: pointer;
}

.tk-quick-btn--active {
  border-color: var(--tk-blue);
  color: #93c5fd;
}

.tk-upload-box {
  padding: 8px 10px 10px;
}

.tk-upload-box .tk-select,
.tk-upload-box .tk-input {
  margin-bottom: 8px;
}

.tk-file-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}

.tk-file-list li {
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: 8px;
  color: #a1a1aa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tk-file-list strong {
  color: #e4e4e7;
  font-weight: 600;
}

.menu-hint {
  font-size: 0.85rem;
  color: #71717a;
  margin: 0 0 12px;
}

.menu-upload-btn {
  width: 100%;
  margin-top: 10px;
}

.menu-file-list {
  margin-top: 14px;
  border: 1px solid var(--tk-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}
