@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

[x-cloak] { display: none !important; }

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Space Mono', monospace;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  background: #fff;
  color: #000;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 48px;
  background: #2d3436;
  border-bottom: 1px solid #1a1a1a;
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: #b2bec3;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-tab:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-tab.active {
  background: #0984e3;
  color: #fff;
}

.nav-search {
  display: flex;
  align-items: center;
}

.search-input {
  width: 220px;
  padding: 6px 12px;
  border: 1px solid #636e72;
  border-radius: 4px;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
}

.search-input::placeholder {
  color: #636e72;
}

.search-input:focus {
  outline: none;
  border-color: #0984e3;
}

.container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#map {
  flex: 1;
  height: 100%;
}

.sidebar {
  width: 280px;
  height: 100%;
  background: #f5f5f5;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 12px 16px;
  background: #333;
  color: white;
  font-weight: 600;
}

.stats-bar {
  display: flex;
  padding: 8px 12px;
  background: #444;
  color: #fff;
  font-size: 11px;
  gap: 16px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-label {
  color: #aaa;
}

.stat-value {
  font-weight: 600;
}

.sidebar-controls {
  padding: 10px;
  background: #e8e8e8;
  border-bottom: 1px solid #ddd;
}

.filter-group {
  margin-bottom: 10px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
  display: block;
}

.action-buttons {
  display: flex;
  gap: 4px;
}

.action-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  border: 1px solid #999;
  background: #fff;
  cursor: pointer;
  border-radius: 3px;
}

.action-btn:hover {
  background: #e0e0e0;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.zone-group {
  margin-bottom: 4px;
}

.zone-header {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}

.zone-header:hover {
  background: #e8e8e8;
}

.zone-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 8px;
  flex-shrink: 0;
}

.zone-name {
  flex: 1;
  font-size: 13px;
}

.zone-count {
  font-size: 11px;
  color: #666;
  margin-right: 8px;
}

.zone-toggle {
  font-size: 10px;
  color: #999;
  transition: transform 0.2s;
}

.zone-toggle.expanded {
  transform: rotate(90deg);
}

.zone-maps {
  padding-left: 20px;
}

.map-item {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}

.map-item:hover {
  background: #e0e0e0;
}

.map-item input {
  margin-right: 8px;
}

.map-item .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: auto;
}

.map-item .status-dot.available {
  background: #4caf50;
}

.map-item .status-dot.unavailable {
  background: #f44336;
}

.zone-checkbox {
  margin-right: 8px;
}

.leaflet-popup-content {
  font-size: 13px;
  line-height: 1.5;
}

.popup-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

.popup-row {
  display: flex;
  margin: 4px 0;
}

.popup-label {
  color: #666;
  width: 70px;
}

.popup-value {
  font-weight: 500;
}

.popup-available {
  color: #4caf50;
  font-style: italic;
}

.kingdom-hall-icon {
  background: #6c5ce7;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.context-menu {
  position: fixed;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 10000;
  min-width: 150px;
}

.context-menu-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
}

.context-menu-item:hover {
  background: #f0f0f0;
}

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #ff0;
  padding: 14px 24px;
  border: 4px solid #ff0;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 10001;
}

/* Assignment Panel */
.assignment-panel {
  width: 320px;
  height: 100%;
  background: #fff;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #2d3436;
  color: white;
}

.panel-title {
  font-weight: 600;
  font-size: 14px;
}

.panel-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.panel-close:hover {
  color: #ddd;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.panel-section {
  margin-bottom: 20px;
}

.panel-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.map-info {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
}

.map-info-row {
  display: flex;
  margin-bottom: 6px;
  font-size: 13px;
}

.map-info-row:last-child {
  margin-bottom: 0;
}

.map-info-label {
  color: #666;
  width: 60px;
  flex-shrink: 0;
}

.map-info-value {
  font-weight: 500;
}

.map-info-value a {
  color: #0984e3;
  text-decoration: none;
}

.map-info-value a:hover {
  text-decoration: underline;
}

.current-assignment {
  background: #fff3cd;
  border: 1px solid #ffc107;
  padding: 12px;
  border-radius: 6px;
}

.current-assignment.available {
  background: #d4edda;
  border-color: #28a745;
}

.assignment-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.assignment-date {
  font-size: 12px;
  color: #666;
}

.available-badge {
  color: #28a745;
  font-weight: 600;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.form-input:focus {
  outline: none;
  border-color: #0984e3;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: #0984e3;
  color: white;
}

.btn-primary:hover {
  background: #0773c7;
}

.btn-primary:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.btn-warning {
  background: #f39c12;
  color: white;
}

.btn-warning:hover {
  background: #d68910;
}

.btn-block {
  width: 100%;
}

.history-list {
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  gap: 12px;
}

.history-item:last-child {
  border-bottom: none;
}

.history-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-dates {
  color: #666;
  font-size: 11px;
  text-align: right;
  flex-shrink: 0;
}

.history-active {
  background: #fff3cd;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 4px;
}

.active-badge {
  display: inline-block;
  background: #f39c12;
  color: white;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 13px;
}

/* Table View */
.table-view, .priorities-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.table-filters {
  display: flex;
  gap: 8px;
}

.filter-select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: #0984e3;
}

.table-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #666;
}

.table-container {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table th {
  background: #2d3436;
  color: #fff;
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  padding: 12px 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  background: #3d4446;
}

.data-table td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.table-row {
  cursor: pointer;
  transition: background 0.15s;
}

.table-row:hover {
  background: #f0f7ff;
}

.row-available {
  background: #fff;
}

.row-assigned {
  background: #fffbf0;
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge-available {
  background: #d4edda;
  color: #155724;
}

.badge-assigned {
  background: #fff3cd;
  color: #856404;
}

/* Priorities View */
.priorities-header {
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  font-size: 13px;
  color: #666;
}

.priorities-zones {
  font-weight: 500;
  color: #333;
}

.priority-high {
  background: #e8f5e9;
}

.priority-high:hover {
  background: #c8e6c9;
}

.priority-normal {
  background: #fff;
}

.empty-cell {
  text-align: center;
  color: #999;
  padding: 40px !important;
}

/* Split View Layout */
.split-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.split-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: flex 0.3s ease;
}

.split-container.has-detail .split-top {
  flex: 0 0 55%;
}

.split-top .table-container {
  flex: 1;
  overflow: auto;
}

.split-bottom {
  flex: 0 0 45%;
  border-top: 2px solid #ddd;
  background: #fff;
}

.detail-panel {
  display: flex;
  height: 100%;
}

.detail-map {
  flex: 1;
  min-width: 0;
}

.detail-info {
  width: 280px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #ddd;
  background: #f8f9fa;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #2d3436;
  color: #fff;
}

.detail-title {
  font-weight: 600;
  font-size: 14px;
}

.detail-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.detail-close:hover {
  color: #ddd;
}

.detail-content {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.detail-status {
  background: #fff3cd;
  border: 1px solid #ffc107;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.detail-status.available {
  background: #d4edda;
  border-color: #28a745;
}

.detail-assignee {
  font-weight: 600;
  font-size: 14px;
}

.detail-date {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.detail-actions {
  margin-bottom: 12px;
}

.action-row {
  display: flex;
  gap: 8px;
}

.action-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-input.compact {
  padding: 6px 8px;
  font-size: 12px;
}

.detail-link {
  padding-top: 8px;
  border-top: 1px solid #ddd;
}

.detail-link a {
  color: #0984e3;
  text-decoration: none;
  font-size: 12px;
}

.detail-link a:hover {
  text-decoration: underline;
}

/* Selected Row */
.row-selected {
  background: repeating-linear-gradient(
    -45deg,
    #e3f2fd,
    #e3f2fd 10px,
    #bbdefb 10px,
    #bbdefb 20px
  ) !important;
  position: relative;
}

.row-selected td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #0984e3;
}

/* ========================================
   QUICK APP - BRUTALIST STYLE
   ======================================== */

.quick-app {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.confirm-screen {
  overflow: hidden;
}

/* Screen Header */
.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  height: 60px;
  background: #000;
  color: #fff;
  flex-shrink: 0;
  border-bottom: 4px solid #000;
}

.back-btn {
  padding: 8px 14px;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 3px 3px 0 #ff0;
  color: #000;
  font-size: 14px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.back-btn:active {
  background: #ff0;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #ff0;
}

.screen-title {
  flex: 1;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-spacer {
  flex: 1;
}

.external-link {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 900;
  font-family: inherit;
  text-decoration: none;
  border: 3px solid #fff;
  box-shadow: 3px 3px 0 #0f0;
  flex-shrink: 0;
}

.external-link:active {
  background: #0f0;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #0f0;
}

/* Home Screen */
.home-content {
  flex: 1;
  padding: 16px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.home-content > div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.home-header {
  margin-bottom: 24px;
  padding: 16px;
  background: #000;
  box-shadow: 8px 8px 0 #ff0;
  flex-shrink: 0;
}

.home-title {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.home-title::after {
  content: '_';
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.stat {
  flex: 1;
  background: #fff;
  border: 4px solid #000;
  padding: 20px 8px;
  text-align: center;
  box-shadow: 6px 6px 0 #000;
  position: relative;
}

.stat-num {
  display: block;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.stat-lbl {
  display: block;
  font-size: 9px;
  font-weight: 900;
  color: #000;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.stat.available {
  border-color: #00cc44;
  box-shadow: 6px 6px 0 #00cc44;
}
.stat.available .stat-num { color: #00cc44; }

.stat.assigned {
  border-color: #e63946;
  box-shadow: 6px 6px 0 #e63946;
}
.stat.assigned .stat-num { color: #e63946; }

.stat.resting {
  border-color: #8800ff;
  box-shadow: 6px 6px 0 #8800ff;
}
.stat.resting .stat-num { color: #8800ff; }

.action-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.action-card {
  flex: 1;
  background: #fff;
  border: 4px solid #000;
  padding: 28px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 8px 8px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.action-card:active {
  background: #ff0;
  transform: translate(4px, 4px);
  box-shadow: 4px 4px 0 #000;
}

.action-card-icon {
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Brutalist Icons */
.icon-arrow-out,
.icon-arrow-in {
  display: block;
  width: 40px;
  height: 40px;
  border: 4px solid #000;
  position: relative;
}

.icon-arrow-out::before,
.icon-arrow-out::after {
  content: '';
  position: absolute;
  background: #000;
}

.icon-arrow-out::before {
  width: 4px;
  height: 24px;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
}

.icon-arrow-out::after {
  width: 16px;
  height: 16px;
  border: 4px solid #000;
  border-left: none;
  border-bottom: none;
  background: transparent;
  top: 0;
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
}

.icon-arrow-in::before,
.icon-arrow-in::after {
  content: '';
  position: absolute;
  background: #000;
}

.icon-arrow-in::before {
  width: 4px;
  height: 24px;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
}

.icon-arrow-in::after {
  width: 16px;
  height: 16px;
  border: 4px solid #000;
  border-left: none;
  border-bottom: none;
  background: transparent;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(135deg);
}

/* Recent row icons */
.recent-icon {
  width: 24px;
  height: 24px;
  border: 3px solid #000;
  position: relative;
  flex-shrink: 0;
}

.recent-icon.icon-out::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid #000;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.recent-icon.icon-out::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 10px;
  background: #000;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.recent-icon.icon-in::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #000;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.recent-icon.icon-in::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 10px;
  background: #000;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.action-card-label {
  font-size: 15px;
  font-weight: 900;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.action-card.assign {
  border-color: #0066ff;
  box-shadow: 8px 8px 0 #0066ff;
}

.action-card.assign:active {
  box-shadow: 4px 4px 0 #0066ff;
}

.action-card.return {
  border-color: #ff9900;
  box-shadow: 8px 8px 0 #ff9900;
}

.action-card.return:active {
  box-shadow: 4px 4px 0 #ff9900;
}

/* Recent Section */
.recent-section {
  background: #fff;
  border: 4px solid #000;
  box-shadow: 6px 6px 0 #000;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.section-title {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 900;
  color: #000;
  background: #fff;
  border-bottom: 2px solid #000;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.recent-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
}

.recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 2px solid #eee;
  font-size: 13px;
}

.recent-row:last-child {
  border-bottom: none;
}

.recent-icon {
  font-size: 16px;
}

.recent-text {
  flex: 1;
  font-weight: 600;
}

.recent-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.recent-date {
  font-size: 11px;
  font-weight: 700;
  color: #666;
}

.recent-user {
  font-size: 10px;
  color: #999;
}

/* Picker Map (always visible) */
.picker-map-container {
  position: relative;
  flex-shrink: 0;
  border-bottom: 4px solid #000;
}

.picker-map {
  height: 45vh;
  min-height: 220px;
}

.map-legend {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: #fff;
  padding: 6px 10px;
  border: 3px solid #000;
  display: flex;
  gap: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 1000;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #000;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #000;
}

.legend-dot.available { background: #00cc44; }
.legend-dot.resting { background: #8800ff; }
.legend-dot.assigned { background: #e63946; }

/* Compact Form Row */
.picker-form-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-bottom: 4px solid #000;
  flex-shrink: 0;
}

.form-field {
  flex: 1;
  padding: 12px;
  border: 3px solid #000;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  min-width: 0;
  font-family: inherit;
}

.form-field:focus {
  outline: none;
  background: #ff0;
}

.zone-field {
  flex: 0 0 auto;
  width: 120px;
}

/* Picker Filter */
.picker-filter {
  padding: 8px;
  background: #f0f0f0;
  border-bottom: 2px solid #000;
}

.filter-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  border: 3px solid #000;
  background: #fff;
  box-shadow: 3px 3px 0 #000;
}

.filter-input:focus {
  outline: none;
  background: #ff0;
}

/* Picker List */
.picker-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  background: #f0f0f0;
}

.pick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.pick-card:active {
  background: #ff0;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.pick-card.selected {
  background: #ff0;
  border-width: 4px;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.pick-card.resting {
  background: #f3e8ff;
  border-color: #8800ff;
  box-shadow: 4px 4px 0 #8800ff;
}

.pick-card.resting:active {
  box-shadow: 2px 2px 0 #8800ff;
}

.pick-card.resting.selected {
  background: #ff0;
  border-color: #000;
  box-shadow: 2px 2px 0 #000;
}

.pick-card.unavailable {
  background: #ffe5e5;
  border-color: #e63946;
  box-shadow: 4px 4px 0 #e63946;
}

.pick-card.unavailable:active {
  background: #ffd0d0;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #e63946;
}

.pick-card.unavailable.selected {
  background: #ff0;
  border-color: #000;
  border-width: 4px;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.pick-status {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid #000;
}

.pick-status.available { background: #00cc44; }
.pick-status.resting { background: #8800ff; }
.pick-status.assigned { background: #e63946; }

.pick-info {
  flex: 1;
  min-width: 0;
}

.pick-title {
  font-weight: 900;
  font-size: 14px;
  color: #000;
  text-transform: uppercase;
}

.pick-sub {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  margin-top: 2px;
}

.pick-note {
  font-size: 10px;
  font-weight: 700;
  color: #000;
  background: #ff0;
  padding: 2px 6px;
  margin-top: 4px;
  display: inline-block;
  border: 2px solid #000;
  text-transform: uppercase;
}

.pick-badge {
  font-size: 12px;
  font-weight: 900;
  color: #000;
  background: #00cc44;
  padding: 4px 6px;
  border: 2px solid #000;
  letter-spacing: 0;
}

.pick-badge.warn {
  background: #8800ff;
  color: #fff;
}

.pick-days {
  font-size: 12px;
  font-weight: 900;
  color: #000;
  background: #ddd;
  padding: 4px 8px;
  border: 2px solid #000;
}

.pick-days.overdue {
  background: #e63946;
  color: #fff;
}

/* Overdue card styling */
.pick-card.overdue {
  background: #ffe5e5;
  border-color: #e63946;
  box-shadow: 4px 4px 0 #e63946;
}

.pick-card.overdue:active {
  box-shadow: 2px 2px 0 #e63946;
}

.pick-card.overdue.selected {
  background: #ff0;
  border-color: #000;
  box-shadow: 2px 2px 0 #000;
}

.pick-badge.overdue {
  background: #e63946;
  color: #fff;
}

.pick-share {
  font-size: 12px;
  font-weight: 900;
  font-family: inherit;
  color: #000;
  background: #0f0;
  padding: 6px 10px;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #000;
  text-decoration: none;
  margin-left: 8px;
}

.pick-share:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.empty-msg {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.load-more-btn {
  width: 100%;
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
  border: 3px solid #000;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
}

.load-more-btn:active {
  background: #ff0;
}

/* Picker Footer */
.picker-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #ff0;
  border-top: 4px solid #000;
  flex-shrink: 0;
}

.picker-footer-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.picker-footer-number {
  font-size: 24px;
  font-weight: 900;
}

.picker-footer-zone {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #333;
}

.picker-footer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: #000;
  color: #fff;
  border: 4px solid #000;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 4px 4px 0 #333;
}

.picker-footer-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #333;
}

.picker-footer-btn .arrow {
  font-size: 18px;
}

/* Confirm Footer */
.confirm-footer {
  padding: 10px;
  background: #fff;
  border-top: 4px solid #000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.confirm-summary {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: #000;
  line-height: 1.4;
}

.confirm-summary strong {
  font-weight: 900;
}

.confirm-btn {
  padding: 14px 24px;
  border: 4px solid #000;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  color: #000;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: inherit;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.confirm-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.confirm-btn.assign {
  background: #0066ff;
  color: #fff;
  box-shadow: 4px 4px 0 #003399;
}

.confirm-btn.assign:active {
  background: #ff0;
  color: #000;
  box-shadow: 2px 2px 0 #000;
}

.confirm-btn.return {
  background: #ff9900;
  color: #000;
  box-shadow: 4px 4px 0 #cc7700;
}

.confirm-btn.return:active {
  background: #ff0;
  box-shadow: 2px 2px 0 #000;
}

.confirm-btn:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  border-color: #999;
  box-shadow: none;
  transform: none;
}

/* Zone Selector Screen */
.zone-selector-actions {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-bottom: 4px solid #000;
  align-items: center;
}

.zone-action-btn {
  padding: 10px 16px;
  background: #fff;
  border: 3px solid #000;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
}

.zone-action-btn:active {
  background: #ff0;
}

.zone-count-label {
  margin-left: auto;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.zone-selector-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  background: #f0f0f0;
}

.zone-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin-bottom: 8px;
  background: #fff;
  border: 3px solid #000;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.zone-select-item:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.zone-select-item.selected {
  background: #ff0;
  border-width: 4px;
}

.zone-select-check {
  font-size: 14px;
  font-weight: 900;
  width: 30px;
  text-align: center;
}

.zone-select-color {
  width: 20px;
  height: 20px;
  border: 3px solid #000;
  flex-shrink: 0;
}

.zone-select-info {
  flex: 1;
}

.zone-select-name {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.zone-select-count {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  margin-top: 2px;
}

.zone-selector-footer {
  padding: 12px;
  background: #fff;
  border-top: 4px solid #000;
}

.continue-btn {
  width: 100%;
  padding: 16px;
  background: #000;
  color: #fff;
  border: 4px solid #000;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 4px 4px 0 #ff0;
}

.continue-btn:active {
  background: #ff0;
  color: #000;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #ff0;
}

.continue-btn:disabled {
  background: #ccc;
  color: #666;
  border-color: #999;
  box-shadow: none;
  cursor: not-allowed;
}

/* Zones button in picker header */
.zones-btn {
  padding: 8px 14px;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 3px 3px 0 #0af;
  color: #000;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
}

.zones-btn:active {
  background: #0af;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #0af;
}

/* Confirm Screen */
.confirm-map-container {
  flex-shrink: 0;
  border-bottom: 4px solid #000;
}

.confirm-map {
  height: 40vh;
  min-height: 200px;
}

.confirm-header {
  padding: 16px;
  background: #fff;
  border-bottom: 4px solid #000;
  text-align: center;
  flex-shrink: 0;
}

.confirm-territory {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
}

.confirm-number {
  font-size: 32px;
  font-weight: 900;
}

.confirm-zone {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
}

.confirm-assignee {
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
}

.confirm-since {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.confirm-history {
  flex: 1;
  min-height: 0;
  background: #f5f5f5;
  border-top: 4px solid #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-title {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  border-bottom: 2px solid #ddd;
  flex-shrink: 0;
}

.history-scroll {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 80px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 12px;
  border-bottom: 1px solid #ddd;
}

.history-row:last-child {
  border-bottom: none;
}

.history-name {
  font-weight: 700;
}

.history-dates {
  color: #666;
  font-size: 11px;
}

.confirm-form {
  padding: 16px;
  background: #f0f0f0;
}

.confirm-spacer {
  flex: 1;
  min-height: 80px;
  background: #f0f0f0;
}

.form-row {
  margin-bottom: 16px;
}

.form-lbl {
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.confirm-action {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 4px solid #000;
  z-index: 100;
}

.big-confirm-btn {
  width: 100%;
  padding: 18px;
  border: 4px solid #000;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 6px 6px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.big-confirm-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 #000;
}

.big-confirm-btn.assign {
  background: #0066ff;
  color: #fff;
  box-shadow: 6px 6px 0 #003399;
}

.big-confirm-btn.assign:active {
  background: #ff0;
  color: #000;
  box-shadow: 3px 3px 0 #000;
}

.big-confirm-btn.return {
  background: #ff9900;
  color: #000;
  box-shadow: 6px 6px 0 #cc7700;
}

.big-confirm-btn.return:active {
  background: #ff0;
  box-shadow: 3px 3px 0 #000;
}

.big-confirm-btn:disabled {
  background: #ccc;
  color: #666;
  border-color: #999;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Hide other views on mobile */
.container, .table-view, .priorities-view {
  display: none;
}

/* Login Modal */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-modal {
  background: #fff;
  border: 4px solid #000;
  box-shadow: 8px 8px 0 #000;
  width: 90%;
  max-width: 360px;
  padding: 0;
}

.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #000;
  color: #ff0;
}

.login-header h2 {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-close {
  background: none;
  border: none;
  color: #ff0;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.login-form {
  padding: 24px 20px;
  flex-shrink: 0;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form .form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.login-form .form-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  border: 3px solid #000;
  background: #fff;
  box-shadow: 3px 3px 0 #000;
}

.login-form .form-input:focus {
  outline: none;
  background: #ff0;
}

.login-error {
  background: #e63946;
  color: #fff;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  border: 2px solid #000;
}

/* Auth Bar */
.auth-bar {
  margin-top: 8px;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-name {
  font-size: 12px;
  color: #666;
  font-weight: 600;
}

.auth-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 3px solid #000;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.auth-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
}

.auth-btn.login {
  background: #ff0;
  color: #000;
}

.auth-btn.logout {
  background: #fff;
  color: #000;
}

.login-hint {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: 8px;
}

/* Home Login Form */
.home-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px;
}

.home-login .home-title {
  margin-bottom: 32px;
}

.home-login-form {
  width: 100%;
  max-width: 320px;
}

.home-login-form .form-group {
  margin-bottom: 16px;
}

.home-login-form .form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.home-login-form .form-input {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
  border: 3px solid #000;
  background: #fff;
  box-shadow: 4px 4px 0 #000;
}

.home-login-form .form-input:focus {
  outline: none;
  background: #ff0;
}

.home-login-form .btn-block {
  width: 100%;
  margin-top: 8px;
}

/* Home Footer */
.home-footer {
  padding: 16px 24px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 4px solid #000;
  background: #f5f5f5;
}

.home-footer .action-card {
  width: 100%;
}

/* Login/Logout action cards */
.action-card.login-card {
  width: 100%;
  background: #ff0;
  color: #000;
  box-shadow: 6px 6px 0 #000;
  margin-top: 16px;
}

.action-card.logout {
  background: #fff;
  color: #000;
  box-shadow: 4px 4px 0 #000;
}

.action-card.logout:active {
  background: #ff0;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

/* Login icon */
.icon-login::before {
  content: '→';
  font-size: 28px;
  font-weight: 900;
}

/* Logout icon */
.icon-logout::before {
  content: '←';
  font-size: 28px;
  font-weight: 900;
}

/* Update home-login for centered form */
.home-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 24px;
}

.home-login .home-title {
  margin-bottom: 32px;
}

/* Compact login/logout buttons */
.action-card.login-card,
.action-card.logout {
  flex-direction: row;
  padding: 12px 20px;
  gap: 12px;
}

.action-card.login-card .action-card-icon,
.action-card.logout .action-card-icon {
  width: auto;
  height: auto;
}

.action-card.login-card .action-card-label,
.action-card.logout .action-card-label {
  font-size: 14px;
}

.icon-login::before,
.icon-logout::before {
  font-size: 18px;
}

/* Fix login/logout button alignment */
.action-card.login-card,
.action-card.logout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  gap: 10px;
}

.action-card.login-card .action-card-icon,
.action-card.logout .action-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.action-card.login-card .action-card-label,
.action-card.logout .action-card-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

.icon-login::before,
.icon-logout::before {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  display: block;
}
