:root {
  /* Professional Color Palette */
  --primary: #2563eb;
  /* Royal Blue */
  --primary-hover: #1d4ed8;
  --bg-body: #f8fafc;
  /* Slate 50 */
  --surface: #ffffff;
  --text-main: #0f172a;
  /* Slate 900 */
  --text-secondary: #64748b;
  /* Slate 500 */
  --border: #e2e8f0;
  /* Slate 200 */
  --success: #10b981;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --radius: 8px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.page-container {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  margin-top: 64px;
  width: 100%;
  box-sizing: border-box;
}

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

.main-content {
  flex: 1;
  width: 100%;
}

/* Components */

/* Cards replace "glass-card" */
.glass-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  transition: transform 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.glass-card {
  max-width: 480px;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Navbar */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.nav-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active-link {
  color: var(--primary);
}

/* Typography */
.page-title {
  color: var(--text-main);
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
  text-align: center;
}

.page-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* Forms */
.form-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.input-label {
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
}

.styled-input,
.form-input,
.styled-textarea {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s;
  font-family: inherit;
}

.styled-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Map Container */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.map-container .leaflet-container {
  height: 100%;
  width: 100%;
  z-index: 1;
}

.location-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.styled-input:focus,
.form-input:focus,
.styled-textarea:focus,
select.styled-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.styled-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Buttons */
.primary-btn,
.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1rem;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  min-height: 48px;
  touch-action: manipulation;
  box-sizing: border-box;
}

.primary-btn:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.primary-btn:active,
.btn-primary:active {
  transform: translateY(0);
}

.primary-btn:disabled,
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

.data-table thead {
  background: #f8fafc;
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

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

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.btn-link {
  color: var(--primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-block;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-link:hover {
  background: var(--primary);
  color: white;
}

.auth-page-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
  position: relative;
  overflow: hidden;
}

.auth-page-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(37, 99, 235, 0.08) 0%, transparent 50%);
  opacity: 0.6;
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.5s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.auth-logo-icon {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.auth-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.auth-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-left: 0.25rem;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .auth-page-container {
    padding: 1.5rem 1rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 12px;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .auth-logo-text {
    font-size: 1.25rem;
  }

  .auth-logo-icon {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .auth-page-container {
    padding: 1rem 0.75rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
  }

  .auth-title {
    font-size: 1.25rem;
  }
}

/* Mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  z-index: 1001;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  align-items: center;
}

.nav-toggle .bar {
  width: 24px;
  height: 3px;
  background-color: var(--text-main);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-toggle.open .bar:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.nav-toggle.open .bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .bar:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
  .page-container {
    padding: 1.5rem 1rem;
    margin-top: 64px;
  }

  .nav-container {
    padding: 0 1rem;
  }

  .nav-logo {
    height: 32px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    height: 200px;
    background: #ffffff;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    padding: 1rem;
    padding-top: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1rem;
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    position: relative;
    z-index: 1002;
    background: transparent;
    min-height: auto;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .glass-card,
  .card {
    padding: 1.5rem;
    max-width: 100%;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .data-table {
    font-size: 0.875rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem 0.5rem;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody,
  .data-table tr {
    display: block;
    width: 100%;
  }

  .data-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .data-table td {
    display: block;
    border: none;
    padding: 0.75rem 0;
    text-align: left !important;
    position: relative;
    padding-left: 40%;
    border-bottom: 1px solid var(--border);
  }

  .data-table td:last-child {
    border-bottom: none;
  }

  .data-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 35%;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
}

@media (max-width: 480px) {
  .page-container {
    padding: 1rem 0.75rem;
  }

  .glass-card,
  .card {
    padding: 1.25rem;
    border-radius: 8px;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .primary-btn,
  .btn-primary {
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
  }
}