* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #0f172a;
  background: #f8fafc;
}

h1, h2, h3 {
  margin: 0;
}

.app-header {
  background: linear-gradient(135deg, #000000 0%, #2a2a2a 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  min-height: 80px;
  pointer-events: auto;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.app-title {
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.app-title:hover {
  opacity: 0.9;
}

.app-subtitle {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions .btn {
  white-space: nowrap;
  min-width: 120px;
  height: 40px;
  padding: 8px 16px;
}

.header-actions .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  min-width: auto;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary {
  background: #000000;
  color: white;
}

.btn-primary:hover {
  background: #111111;
}

.btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-small {
  padding: 6px 10px;
  font-size: 12px;
  min-width: auto;
}

.container {
  display: flex;
  height: calc(100vh - 88px);
}

.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.sidebar-header h3 {
  font-size: 16px;
  color: #374151;
  font-weight: 600;
}

.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.category-item:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  transform: translateX(2px);
}

.category-item.active {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.category-color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #e2e8f0;
  flex-shrink: 0;
}

.category-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.category-count {
  background: #e5e7eb;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.category-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.category-item:hover .category-actions {
  opacity: 1;
}

.category-item .category-actions button {
  font-size: 11px;
  padding: 4px 8px;
  min-width: auto;
}

.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: #f8fafc;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-container {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9ca3af;
  pointer-events: none;
}

.search-container input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-container input:focus {
  outline: none;
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.15);
}

.location-pill {
  padding: 8px 16px;
  background: #e5e7eb;
  color: #1f2937;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

.content {
  width: 100%;
}

.table-wrapper {
  overflow: auto;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 16px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

th {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

tr:hover td {
  background: #f8fafc;
}

.icon-btn {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.2s;
}

.icon-btn:hover {
  color: #374151;
}

.modal[aria-hidden="false"] { 
  display: block !important; 
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 3000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  width: 96%;
  max-width: 560px;
  margin: 8vh auto;
  border-radius: 16px;
  overflow: visible;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.modal-header h2 {
  font-size: 18px;
  color: #1f2937;
  font-weight: 600;
}

.modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field label {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.field input, .field textarea, .field select {
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.15);
}

.modal-footer {
  display: flex !important;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  padding: 20px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  border-radius: 0 0 16px 16px;
}

.modal-footer .btn {
  min-width: 80px;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  height: 40px;
}

.modal-footer .btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.modal-footer .btn-secondary:hover {
  background: #cbd5e1;
}

.modal-footer .btn-primary {
  background: #10b981;
  color: white;
  border: 1px solid #059669;
}

.modal-footer .btn-primary:hover {
  background: #059669;
}

.sidebar-header .btn-icon {
  width: 32px;
  height: 32px;
  padding: 8px;
  border-radius: 8px;
  background: #3b82f6;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-header .btn-icon:hover {
  background: #2563eb;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-header .btn-icon:active {
  transform: scale(0.95);
}

.sidebar-header .btn-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* Responsive */
@media (max-width: 1200px) {
  .header-content {
    max-width: 100%;
    padding: 20px 20px;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .header-actions .btn {
    min-width: 110px;
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }
  
  .main-content {
    padding: 16px;
  }
  
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-container {
    min-width: auto;
  }
  
  .header-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 16px 20px;
  }
  
  .header-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .header-actions .btn {
    min-width: 100px;
    font-size: 12px;
    padding: 8px 12px;
  }

  .app-title {
    font-size: 24px;
  }

  .app-subtitle {
    font-size: 13px;
  }

  .modal-content {
    width: 95%;
    margin: 5vh auto;
    max-height: 95vh;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 16px;
    flex-direction: column;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 12px 16px;
  }
  
  .header-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .header-actions .btn {
    width: 100%;
    min-width: auto;
  }
  
  .app-title {
    font-size: 22px;
  }
  
  .app-subtitle {
    font-size: 12px;
  }
}

/* High DPI and zoom level fixes */
@media screen and (min-resolution: 120dpi) {
  .modal-content {
    max-height: 85vh;
  }
  
  .modal-footer {
    padding: 16px 20px;
  }
}

/* Ensure modal is always visible at any zoom level */
.modal[aria-hidden="false"] {
  display: block !important;
  visibility: visible !important;
}

.modal-content {
  min-height: 300px;
}

.modal-footer {
  min-height: 80px;
  display: flex !important;
  visibility: visible !important;
} 

/* Header specific improvements for monitors */
@media screen and (min-width: 1201px) {
  .header-content {
    max-width: 1600px;
    padding: 24px 32px;
  }
  
  .app-title {
    font-size: 32px;
  }
  
  .app-subtitle {
    font-size: 16px;
  }
  
  .header-actions .btn {
    min-width: 140px;
    height: 44px;
    font-size: 15px;
  }
}

@media screen and (min-width: 1601px) {
  .header-content {
    max-width: 1920px;
    padding: 28px 40px;
  }
  
  .app-title {
    font-size: 36px;
  }
  
  .app-subtitle {
    font-size: 18px;
  }
  
  .header-actions .btn {
    min-width: 150px;
    height: 48px;
    font-size: 16px;
  }
}

/* Ultra-wide monitor support */
@media screen and (min-width: 1921px) {
  .header-content {
    max-width: 2560px;
    padding: 32px 48px;
  }
  
  .app-title {
    font-size: 40px;
  }
  
  .app-subtitle {
    font-size: 20px;
  }
  
  .header-actions .btn {
    min-width: 160px;
    height: 52px;
    font-size: 17px;
  }
} 

/* Management Panel Styles */
.management-panel {
  position: fixed;
  inset: 0;
  background: #f8fafc;
  z-index: 2000;
  overflow-y: auto;
  padding: 20px;
}

.management-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.management-header h2 {
  font-size: 28px;
  color: #1e293b;
  margin: 0;
}

.management-content {
  max-width: 1200px;
  margin: 0 auto;
}

.management-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.management-section h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 18px;
  font-weight: 600;
}

.management-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.management-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.management-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.management-table th,
.management-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.management-table th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.management-table tbody tr:hover {
  background-color: #f9fafb;
}

.management-table .category-color-cell {
  width: 40px;
}

.management-table .category-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
}

.management-table .action-buttons {
  display: flex;
  gap: 6px;
}

.management-table .btn-small {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
}

.password-change-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  align-items: end;
}

.password-change-form .field {
  margin-bottom: 0;
}

.password-change-form .btn {
  height: 48px;
  font-size: 15px;
  font-weight: 500;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 500;
  opacity: 0.9;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  display: block;
}

/* Password Modal Specific */
#passwordModal .modal-content {
  max-width: 400px;
}

#passwordModal .field {
  margin-bottom: 20px;
}

#passwordModal input[type="password"] {
  font-size: 16px;
  letter-spacing: 2px;
}

/* Responsive Management Panel */
@media (max-width: 768px) {
  .management-panel {
    padding: 16px;
  }
  
  .management-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .management-header h2 {
    font-size: 24px;
  }
  
  .management-buttons {
    flex-direction: column;
  }
  
  .management-buttons .btn {
    width: 100%;
    min-width: auto;
  }
  
  .password-change-form {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-number {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .management-section {
    padding: 16px;
  }
} 

@media (max-width: 768px) {
  .management-buttons {
    flex-direction: column;
  }
  
  .management-table {
    font-size: 12px;
  }
  
  .management-table th,
  .management-table td {
    padding: 8px 6px;
  }
} 