@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600&display=swap');
@font-face {
  font-family: 'Mona Sans';
  src: url('https://cdn.jsdelivr.net/gh/github/mona-sans@main/fonts/webfonts/MonaSans[wght].woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

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

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

body {
  font-family: 'Mona Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f2;
  color: #080808;
  font-size: 0.8125rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: #080808;
  color: white;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo {
  height: 18px;
  width: auto;
}

.header-app-name {
  font-size: 0.8125rem;
  font-weight: 400;
  opacity: 0.6;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  position: relative;
  top: -1px;
}

.header-logo {
  display: block;
}

header h1 {
  font-size: 1rem;
  font-weight: 500;
}

.header-divider {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.3);
}

header p {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Header Tabs */
.header-tabs {
  display: flex;
  gap: 0.25rem;
  height: 100%;
  align-items: center;
}

.header-tabs > .tab {
  padding: 0.375rem 0.875rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  border-radius: 4px;
  transition: all 0.15s ease;
  position: relative;
}

.header-tabs > .tab:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.header-tabs > .tab.active {
  background: rgba(255,255,255,0.2);
  color: white;
  box-shadow: inset 0 -2px 0 #E0D3CC;
}

/* Nav Groups (Dropdowns) */
.nav-group {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-group-btn {
  padding: 0.375rem 0.875rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.nav-group-btn::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 5px;
  vertical-align: middle;
}

.nav-group-btn:hover,
.nav-group.open .nav-group-btn {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-group-btn.active {
  background: rgba(255,255,255,0.2);
  color: white;
  box-shadow: inset 0 -2px 0 #E0D3CC;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 180px;
  z-index: 200;
  padding: 4px 0;
  margin-top: 2px;
}

.nav-dropdown.nav-dropdown-right {
  left: auto;
  right: 0;
}

.nav-group.open .nav-dropdown {
  display: block;
}

.nav-dropdown .tab {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #333;
  transition: background 0.1s;
}

.nav-dropdown .tab:hover {
  background: #f0f5ff;
}

.nav-dropdown .tab.active {
  background: #e8f0fe;
  color: #0c3368;
  font-weight: 600;
}

/* Sidebar hidden state for non-sidebar tabs */
.sidebar.sidebar-hidden {
  display: none !important;
}

.sidebar.sidebar-hidden + .main-content {
  margin-left: 0;
}

/* Hamburger button - hidden on desktop */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 4px;
  line-height: 0;
}

.hamburger-btn:hover {
  background: rgba(255,255,255,0.15);
}

/* Mobile nav overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
}

.mobile-nav {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: #fff;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #080808;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.mobile-nav-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.mobile-nav-section {
  padding: 12px 20px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
}

.mobile-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  color: #333;
  cursor: pointer;
  transition: background 0.1s;
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
  background: #f0f5ff;
}

.mobile-nav-item.active {
  background: #E0D3CC;
  color: #080808;
  font-weight: 600;
}

.mobile-nav-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 4px 16px;
}

/* Barcode scanner */
.asset-search-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.asset-search-wrapper .table-container {
  flex: 1;
  overflow-y: auto;
}

#barcode-scanner-container {
  padding: 12px;
  background: #1a1a1a;
  border-radius: 8px;
  margin: 8px 12px;
}

#barcode-scanner-reader {
  border-radius: 6px;
  overflow: hidden;
}

#barcode-scanner-reader video {
  border-radius: 6px;
}

#scan-barcode-btn {
  padding: 0.375rem 0.5rem;
  display: inline-flex;
  align-items: center;
}

/* Header User */
.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-user span {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
}

.logout-btn {
  padding: 0.25rem 0.625rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: white;
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* Users Layout */
.users-layout {
  padding: 1rem;
  height: 100%;
  overflow: auto;
}

.users-panel {
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1rem;
}

.users-panel .content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0;
}

.users-panel .section-title {
  font-size: 1rem;
  font-weight: 500;
  color: #495057;
  margin: 0;
}

/* App Container */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: white;
  border-right: 1px solid #e5e9f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid #e5e9f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-title {
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
}

.sidebar-toggle {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #6c757d;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: #f5f7fb;
  color: #495057;
}

/* Sidebar expand button (shown when sidebar collapsed) */
.sidebar-expand {
  display: none;
  background: none;
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  color: #6c757d;
  border-radius: 4px;
  align-items: center;
  justify-content: center;
}

.sidebar-expand:hover {
  background: #f5f7fb;
  color: #495057;
}

.sidebar.collapsed ~ .main-content .sidebar-expand {
  display: flex;
}

/* Category List */
.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.375rem;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0.625rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
  margin-bottom: 1px;
}

.category-item:hover {
  background: #f5f7fb;
}

.category-item.active {
  background: #e8eef8;
  color: #0c3368;
}

.category-item.active .category-name {
  font-weight: 500;
}

.category-name {
  font-size: 0.75rem;
  color: #495057;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-item.active .category-name {
  color: #0c3368;
}

.category-count {
  font-size: 0.65rem;
  color: #6c757d;
  background: #f0f2f5;
  padding: 0.0625rem 0.3125rem;
  border-radius: 8px;
  min-width: 18px;
  text-align: center;
}

.category-item.active .category-count {
  background: #0c3368;
  color: white;
}

/* Category hierarchy */
.category-item.level-1 { padding-left: 1.25rem; }
.category-item.level-2 { padding-left: 2rem; }
.category-item.level-3 { padding-left: 2.75rem; }

/* Main Content */
.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Tab Content */
.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  flex-direction: column;
}

.tab-content.active {
  display: flex;
}

/* Content Header */
.content-header {
  padding: 0.5rem 0.75rem;
  background: white;
  border-bottom: 1px solid #e5e9f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

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

.item-count {
  font-size: 0.75rem;
  color: #6c757d;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 320px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.625rem;
  color: #9ca3af;
  pointer-events: none;
}

.search-bar input {
  flex: 1;
  padding: 0.375rem 0.625rem 0.375rem 2rem;
  border: 1px solid #dde2eb;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #f8f9fc;
}

.search-bar input:focus {
  outline: none;
  border-color: #467fcf;
  box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.1);
  background: white;
}

/* Table Container */
.table-container {
  flex: 1;
  overflow: auto;
  background: white;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th {
  background: #f8f9fc;
  border-bottom: 1px solid #e5e9f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
  white-space: nowrap;
}

.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: #f8f9fc;
}

.data-table tbody tr.selected {
  background: #e8eef8;
}

.data-table tbody tr.selected td {
  border-bottom-color: #d0ddf0;
}

/* Column widths */
.col-title { min-width: 250px; }
.col-part { width: 120px; }
.col-category { width: 180px; }
.col-location { width: 120px; }
.col-stock { width: 70px; text-align: center; }

.data-table td.col-stock {
  text-align: center;
  font-weight: 500;
}

/* Stock title cell */
.stock-title {
  font-weight: 500;
  color: #1a1a2e;
}

.stock-alt-title {
  font-size: 0.7rem;
  color: #6c757d;
  margin-top: 2px;
}

/* Prefix badge */
.prefix-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  background: #0c3368;
  color: white;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: #333;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
}

/* Stock Browser Layout */
.stock-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
}

.stock-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stock-detail-panel {
  background: white;
  border-left: 1px solid #e5e9f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e9f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}

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

.detail-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-subtitle {
  font-size: 0.7rem;
  color: #6c757d;
  margin: 0.125rem 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
}

/* Location Bar */
.loc-bar {
  border-bottom: 1px solid #e5e9f0;
  flex-shrink: 0;
}

.loc-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
}

.loc-icon { color: #6c757d; flex-shrink: 0; }

.loc-value {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: 'Roboto Mono', monospace;
  color: #1a1a2e;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-value.empty { color: #9ca3af; font-family: inherit; font-weight: 400; }

.loc-edit-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #6c757d;
  border-radius: 3px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.loc-edit-btn:hover { background: #e5e9f0; color: #0c3368; }

.loc-editor {
  padding: 0.75rem 1rem;
  background: #f8f9fc;
  border-top: 1px solid #e5e9f0;
}

.loc-zone-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-bottom: 0.375rem;
}

.loc-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.625rem;
}

.loc-zone-btn {
  padding: 0.1875rem 0.5rem;
  border: 2px solid transparent;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: 'Roboto Mono', monospace;
  color: white;
  cursor: pointer;
  transition: border-color 0.1s, opacity 0.1s;
  line-height: 1.3;
}
.loc-zone-btn:hover { opacity: 0.85; }
.loc-zone-btn.active { border-color: #1a1a2e; box-shadow: 0 0 0 1px #1a1a2e; }

.loc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.loc-field label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: #6c757d;
  margin-bottom: 0.125rem;
}

.loc-field input {
  width: 100%;
  padding: 0.25rem 0.375rem;
  border: 1px solid #dde2eb;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'Roboto Mono', monospace;
  background: white;
}
.loc-field input:focus { outline: none; border-color: #467fcf; }
.loc-field input:disabled { background: #f0f2f5; opacity: 0.5; }

.loc-no-box {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}
.loc-no-box input[type="checkbox"] { accent-color: #0c3368; width: 12px; height: 12px; }
.loc-no-box label { font-size: 0.65rem; color: #6c757d; cursor: pointer; }

.loc-preview {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0c3368;
  padding: 0.375rem 0.5rem;
  background: white;
  border: 1px solid #dde2eb;
  border-radius: 4px;
  text-align: center;
  margin-bottom: 0.5rem;
  min-height: 1.75rem;
}
.loc-preview:empty { display: none; }

.loc-actions {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.loc-divider {
  text-align: center;
  position: relative;
  margin: 0.375rem 0;
}
.loc-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #dde2eb;
}
.loc-divider span {
  position: relative;
  background: #f8f9fc;
  padding: 0 0.5rem;
  font-size: 0.625rem;
  color: #9ca3af;
}

.loc-manual {
  display: flex;
  gap: 0.375rem;
}
.loc-manual input {
  flex: 1;
  padding: 0.25rem 0.5rem;
  border: 1px solid #dde2eb;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'Roboto Mono', monospace;
}
.loc-manual input:focus { outline: none; border-color: #467fcf; }

.loc-no-zones-hint {
  font-size: 0.6875rem;
  color: #9ca3af;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
}

/* Asset list in detail panel */
.asset-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.asset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.625rem;
  background: #f8f9fc;
  border: 1px solid #e5e9f0;
  border-radius: 4px;
  font-size: 0.8125rem;
}

.asset-barcode {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  color: #0c3368;
}

.asset-status {
  font-size: 0.65rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 500;
}

.asset-status.status-0 { background: #e8f5e9; color: #2e7d32; }
.asset-status.status-1 { background: #fff3e0; color: #ef6c00; }
.asset-status.status-2 { background: #ffebee; color: #c62828; }
.asset-status.status-3 { background: #e3f2fd; color: #1565c0; }
.asset-status.status-4 { background: #fce4ec; color: #ad1457; }
.asset-status.status-5 { background: #f5f5f5; color: #616161; }
.asset-status.status-erased { background: #e0e0e0; color: #9e9e9e; }

/* Erased asset styling */
.asset-item.asset-erased {
  opacity: 0.6;
  background: #f0f0f0;
  border-color: #d0d0d0;
}

.asset-item.asset-erased .asset-barcode {
  color: #9e9e9e;
  text-decoration: line-through;
}

/* Show erased toggle */
.show-erased-toggle {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  color: #6c757d;
  cursor: pointer;
  white-space: nowrap;
}

.show-erased-toggle input[type="checkbox"] {
  accent-color: #6c757d;
  width: 12px;
  height: 12px;
}

.no-assets {
  text-align: center;
  padding: 2rem 1rem;
  color: #6c757d;
  font-size: 0.8125rem;
}

.detail-actions {
  display: flex;
  gap: 0.375rem;
}

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

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #6c757d;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: #1a1a2e;
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e9f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Print labels list */
.print-labels-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e9f0;
  border-radius: 4px;
  padding: 0.5rem;
}

.print-label-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  border-radius: 3px;
}

.print-label-item:hover {
  background: #f8f9fc;
}

.print-label-item input[type="checkbox"] {
  accent-color: #0c3368;
}

.print-label-item .barcode {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
}

/* Label select actions */
.label-select-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.label-select-actions .divider {
  color: #ccc;
  font-size: 0.7rem;
}

.btn-link {
  background: none;
  border: none;
  color: #467fcf;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.btn-link:hover {
  text-decoration: underline;
  color: #316cbe;
}

/* Print status */
#print-status {
  margin-bottom: 1rem;
}

#print-status:empty {
  display: none;
}

#print-status.error {
  background: #ffebee;
  color: #c62828;
  padding: 0.625rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}

#print-status.success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.625rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}

#print-status.info {
  background: #e3f2fd;
  color: #1565c0;
  padding: 0.625rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}

/* Form select */
.form-select {
  width: 100%;
  padding: 0.375rem 0.625rem;
  border: 1px solid #dde2eb;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-family: inherit;
  background: white;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #467fcf;
  box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.1);
}

/* Print button on asset items */
.asset-item .print-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #6c757d;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-item .print-btn:hover {
  background: #e5e9f0;
  color: #0c3368;
}

/* Generator Layout */
.generator-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  overflow: hidden;
}

.generator-form {
  padding: 1rem;
  background: white;
  border-right: 1px solid #e5e9f0;
  overflow-y: auto;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 1rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.75rem;
  color: #495057;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  padding: 0.375rem 0.625rem;
  border: 1px solid #dde2eb;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: #467fcf;
  box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.1);
}

.form-group small {
  display: block;
  color: #6c757d;
  margin-top: 0.1875rem;
  font-size: 0.6875rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 0.75rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
  accent-color: #0c3368;
  width: 14px;
  height: 14px;
}

.button-group {
  display: flex;
  gap: 0.375rem;
  margin-top: 1rem;
}

/* Selected item display */
.selected-item {
  padding: 0.5rem 0.625rem;
  background: #f8f9fc;
  border: 1px solid #dde2eb;
  border-radius: 4px;
  font-size: 0.8125rem;
  min-height: 50px;
  display: flex;
  align-items: center;
}

.selected-item .placeholder {
  color: #9ca3af;
  font-size: 0.75rem;
}

.selected-item.has-item {
  border-color: #0c3368;
  background: #f0f4fc;
}

/* Preview Panel */
.preview-panel {
  padding: 1rem;
  overflow-y: auto;
  background: #f8f9fc;
}

.barcode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.barcode-item {
  padding: 0.375rem 0.625rem;
  background: white;
  border: 1px solid #dde2eb;
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8125rem;
  color: #495057;
}

.barcode-item.created {
  background: #e8f5e9;
  border-color: #c8e6c9;
  color: #2e7d32;
}

.barcode-item.generated {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #1565c0;
}

.barcode-item.error {
  background: #ffebee;
  border-color: #ffcdd2;
  color: #c62828;
}

.form-hint {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: #6c757d;
  line-height: 1.4;
}

.placeholder-text {
  color: #9ca3af;
  font-size: 0.8125rem;
  padding: 1rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.625rem 0.875rem;
  background: #1a1a2e;
  color: white;
  border-radius: 4px;
  font-size: 0.8125rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: #2e7d32; }
.toast.error { background: #c62828; }

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

/* Scrollbar styling */
.category-list::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.generator-form::-webkit-scrollbar,
.preview-panel::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.category-list::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.generator-form::-webkit-scrollbar-track,
.preview-panel::-webkit-scrollbar-track {
  background: transparent;
}

.category-list::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.generator-form::-webkit-scrollbar-thumb,
.preview-panel::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.category-list::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover,
.generator-form::-webkit-scrollbar-thumb:hover,
.preview-panel::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Responsive */
@media (max-width: 1024px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }
  .generator-form {
    border-right: none;
    border-bottom: 1px solid #e5e9f0;
  }
  .stock-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .stock-detail-panel {
    border-left: none;
    border-top: 1px solid #e5e9f0;
    min-height: 200px;
    max-height: 40vh;
  }
}

@media (max-width: 768px) {
  /* Base font bump for readability */
  body { font-size: 0.9375rem; }

  /* Header */
  header { padding: 0 0.5rem; height: 52px; }
  .header-content p, .header-divider { display: none; }
  .header-content h1 { font-size: 0.875rem; }
  /* Hide desktop nav, show hamburger */
  .hamburger-btn { display: block; }
  .header-tabs { display: none !important; }
  .logout-btn { padding: 0.375rem 0.5rem; font-size: 0.625rem; min-height: 36px; }

  /* Sidebar */
  .sidebar {
    position: absolute;
    left: 0;
    top: 52px;
    bottom: 0;
    z-index: 50;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  }
  .sidebar.collapsed { width: 0; overflow: hidden; }
  .sidebar.sidebar-hidden { display: none !important; }
  .sidebar-toggle, .sidebar-expand { padding: 0.5rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
  .category-item { padding: 0.5rem 0.75rem; font-size: 0.875rem; min-height: 44px; display: flex; align-items: center; }

  /* Buttons - 44px touch targets */
  .btn { padding: 0.5rem 0.875rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8125rem; }
  .btn-sm { padding: 0.375rem 0.75rem; min-height: 40px; font-size: 0.8125rem; }

  /* Tables */
  .col-category { display: none; }
  .col-part { display: none; }
  .col-title { min-width: 120px; }
  .col-location { width: 80px; }
  .col-stock { width: 50px; }
  .data-table th, .data-table td { padding: 0.5rem 0.375rem; font-size: 0.8125rem; }

  /* Stock detail panel */
  .stock-detail-panel { max-height: 45vh; min-height: 200px; }
  .detail-header h3 { font-size: 1rem; }

  /* Content header / search */
  .content-header { padding: 0.5rem; gap: 0.5rem; }
  .search-bar input { font-size: 0.9375rem; padding: 0.5rem 0.5rem 0.5rem 2rem; min-height: 44px; }

  /* Forms */
  .form-group input[type="text"],
  .form-group input[type="number"],
  .form-group input[type="password"],
  .form-group input[type="email"],
  .form-group select { min-height: 44px; font-size: 0.9375rem; padding: 0.5rem 0.625rem; }
  .form-group label { font-size: 0.875rem; margin-bottom: 0.25rem; }
  .form-row { grid-template-columns: 1fr; }

  /* Generator form */
  .generator-form { padding: 0.75rem; }

  /* Modals */
  .modal-content { width: 95%; max-width: 95%; max-height: 90vh; }
  .modal-header { padding: 0.75rem 1rem; }
  .modal-body { padding: 1rem; }
  .modal-footer { padding: 0.75rem 1rem; }

  /* Location editor */
  .loc-fields { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .loc-zone-btn { padding: 0.375rem 0.75rem; min-height: 40px; }
  .loc-field input { padding: 0.5rem 0.375rem; min-height: 40px; }

  /* Print button */
  .print-btn { padding: 0.375rem; width: 36px; height: 36px; }

  /* Toast at top on mobile */
  .toast { bottom: auto; top: 56px; left: 0.5rem; right: 0.5rem; }

  /* Help tab */
  .help-layout { padding: 0.75rem; }
  .help-content { padding: 1rem; }

  /* Users table */
  .users-layout { padding: 0.5rem; }
}

/* Generator Assets List */
.generator-assets {
  margin-top: 1rem;
  border-top: 1px solid #e5e9f0;
  padding-top: 1rem;
}

.generator-assets-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 300px;
  overflow-y: auto;
}

.generator-asset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0.5rem;
  background: #f8f9fc;
  border: 1px solid #e5e9f0;
  border-radius: 4px;
  font-size: 0.75rem;
}

.generator-asset-item .asset-barcode {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  color: #0c3368;
  font-size: 0.75rem;
}

.generator-asset-item .asset-status {
  font-size: 0.6rem;
  padding: 0.0625rem 0.25rem;
}

/* Help Tab */
.help-layout {
  padding: 1.5rem;
  height: 100%;
  overflow-y: auto;
  background: #f5f7fb;
}

.help-content {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 2rem;
}

.help-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0c3368;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e9f0;
}

.help-section {
  margin-bottom: 2rem;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 0.75rem 0;
}

.help-section p {
  font-size: 0.8125rem;
  color: #495057;
  line-height: 1.6;
  margin: 0 0 0.625rem 0;
}

.help-section ul {
  margin: 0 0 0.625rem 0;
  padding-left: 1.25rem;
}

.help-section li {
  font-size: 0.8125rem;
  color: #495057;
  line-height: 1.6;
  margin-bottom: 0.375rem;
}

.help-section code {
  background: #f0f2f5;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  color: #0c3368;
}

/* Help Steps */
.help-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.help-step {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8f9fc;
  border-radius: 6px;
  border-left: 3px solid #0c3368;
}

.step-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: #0c3368;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.step-content {
  flex: 1;
}

.step-content strong {
  display: block;
  font-size: 0.8125rem;
  color: #1a1a2e;
  margin-bottom: 0.25rem;
}

.step-content p {
  margin: 0;
  font-size: 0.75rem;
}

.step-content ul {
  margin: 0.375rem 0 0 0;
  font-size: 0.75rem;
}

.step-content li {
  font-size: 0.75rem;
}

/* Help Tables */
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

.help-table th,
.help-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border: 1px solid #e5e9f0;
}

.help-table th {
  background: #f8f9fc;
  font-weight: 600;
  font-size: 0.75rem;
  color: #495057;
}

.help-table td {
  color: #495057;
}

.help-table td.yes {
  color: #2e7d32;
  font-weight: 500;
}

.help-table td.no {
  color: #c62828;
  font-weight: 500;
}

.help-table.compact th,
.help-table.compact td {
  padding: 0.375rem 0.625rem;
}

/* Status badges in help */
.status-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-badge.status-0 { background: #e8f5e9; color: #2e7d32; }
.status-badge.status-1 { background: #fff3e0; color: #ef6c00; }
.status-badge.status-2 { background: #ffebee; color: #c62828; }
.status-badge.status-3 { background: #e3f2fd; color: #1565c0; }
.status-badge.status-4 { background: #fce4ec; color: #ad1457; }
.status-badge.status-5 { background: #f5f5f5; color: #616161; }
.status-badge.status-erased { background: #e0e0e0; color: #9e9e9e; }

/* Responsive help */
@media (max-width: 768px) {
  .help-layout {
    padding: 0.75rem;
  }
  .help-content {
    padding: 1rem;
  }
  .help-table {
    font-size: 0.75rem;
  }
  .help-table th,
  .help-table td {
    padding: 0.5rem;
  }
}
