/* General resets and typography */
* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  margin: 0;
  background: #ffffff;
  color: #333333;
  padding: 0;
  min-height: 100vh;
}

/* Layout Structure */
.app-container {
  display: grid;
  grid-template-columns: 60px 1fr;
  min-height: 100vh;
  background: #ffffff;
}

/* Global Header */
.global-header {
  grid-column: 1 / -1;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #333333;
  z-index: 100;
}

/* Left Navigation Sidebar (Narrow) - Icons Only */
.left-nav {
  background: #f8f9fa;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.nav-logo img {
  height: 28px;
  width: auto;
}

.nav-icons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.nav-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  user-select: none;
}

.nav-icon:hover {
  background: #e5e7eb;
  color: #374151;
}

.nav-icon.active {
  background: #667eea;
  color: #fff;
}

/* Top Global Header */
.global-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #333333;
}

.global-search {
  flex: 1;
  max-width: 400px;
  margin: 0 2rem;
}

.global-search input {
  width: 100%;
  padding: 0.5rem 1rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #374151;
  font-size: 0.9rem;
}

.global-search input::placeholder {
  color: #9ca3af;
}

.global-header .user-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #667eea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

/* Main Content Area */
.main-content {
  background: #fff;
  color: #374151;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px); /* Subtract global header height */
}

/* Right Sidebar */
.right-sidebar {
  background: #f8f9fa;
  border-left: 1px solid #e5e7eb;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

/* Main Content Area */
.main-content {
  background: #fff;
  color: #374151;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Top Header Bar */
.top-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: #667eea;
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-controls select,
.header-controls input {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
}

.header-controls button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: #667eea;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 2rem;
  background: #fff;
}

/* Global Header */
.global-header {
  background: #ffffff;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  color: #333333;
}

.global-header .user-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #667eea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

/* Content Cards */
.content-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

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

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.card-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0.25rem 0 0 0;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.action-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.action-btn.secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  color: #374151;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-open {
  background: #dbeafe;
  color: #1e40af;
}

.status-assigned {
  background: #fef3c7;
  color: #d97706;
}

.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .app-container {
    grid-template-columns: 60px 1fr;
  }
  
  .right-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  
  .left-nav,
  .left-sidebar {
    display: none;
  }
  
  .main-content {
    padding: 1rem;
  }
}

/* Header styling */
.app-header {
  background: #ffffff;
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 2rem;
  border-radius: 8px;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: #1f2d3d;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.nav-links a:hover {
  background: #f0f0f0;
}

.nav-links a.active {
  background-color: #e0f2ff;
}

.nav-links button {
  background: #e63946;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

/* Form styling */
form {
  margin: 0 auto;
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

fieldset {
  border: none;
  margin-bottom: 2rem;
}

legend {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

label {
  display: block;
  margin: 1rem 0 0.25rem;
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.button {
  background: #1f2d3d;
  color: white;
  padding: 0.75rem;
  border: none;
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1rem;
}

/* Map styling */
#map {
  width: 100%;
  height: 300px;
  border-radius: 8px;
  margin-bottom: 1rem;
}

#addressDisplay {
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  font-style: italic;
  color: #555;
}

/* Login styles moved to dedicated /assets/login.css file */

.page-container {
  margin: 0 auto;
  padding: 2rem;
}

/* Compact grid table */
.site-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  /* Smaller font for compactness */
}

.site-table th,
.site-table td {
  padding: 0.4rem 0.6rem;
  /* Tighter padding */
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.site-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 13px;
}

.site-table tr:hover {
  background: #f2f2f2;
  cursor: pointer;
}

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


/* Site Visit Details Page Styles */
body.site-visit-details {
  margin: 0;
  background: #f4f5f7;
  padding: 1.5rem;
  font-family: 'Inter', sans-serif;
}

.main-container {
  margin: 0 auto;
  display: flex;
  gap: 1rem;
}

.card {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  flex: 1;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.field {
  margin-bottom: 0.75rem;
}

.field-label {
  font-weight: 500;
  color: #6b7280;
}

.field-value {
  margin-top: 0.25rem;
  color: #374151;
}

#map {
  width: 100%;
  height: 250px;
  border-radius: 8px;
  margin-top: 1rem;
}

.assessment-block {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.subsection {
  margin-top: 1rem;
}

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.image-gallery img {
  border-radius: 4px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}

#pagination {
  margin: 1.5rem 0;
  text-align: center;
}

#pagination button {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #333;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#pagination button:hover:not(:disabled) {
  background-color: #f0f0f0;
}

#pagination button:disabled {
  color: #aaa;
  border-color: #eee;
  background-color: #fafafa;
  cursor: not-allowed;
}

.ticket-search-form {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
  padding: 0;
}

.ticket-search-form input {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: #fff;
  color: #374151;
  transition: border-color 0.3s;
  margin-bottom: 0;
  width: 700px;
}

.ticket-search-form input:focus {
  border-color: #0077ff;
  outline: none;
}

.ticket-search-form button {
  padding: 6px 12px;
  font-size: 14px;
  background-color: #0077ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s;
}

.ticket-search-form button:hover {
  background-color: #005fcc;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-dropdown {
  width: 100%;
  position: absolute;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s;
  color: #374151;
  line-height: 1.4;
  z-index: 1000;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-dropdown li {
  padding: 8px;
  cursor: pointer;
  font-size: 14px;
}

.search-dropdown li:last-child {
  border-bottom: none;
}

.search-dropdown li:hover {
  background: #e0f2ff;
  color: #0077ff;
}

.zoomable-img {
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
}

.zoomable-img:hover {
  opacity: 0.7;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
}

#caption {
  margin: auto;
  display: block;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  max-width: 700px;
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.close:hover {
  color: #bbb;
}

@media only screen and (max-width: 700px) {
  .modal-content {
    width: 100%;
  }
}

.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: #f1f1f1;
  font-weight: bold;
  font-size: 30px;
  user-select: none;
  transition: 0.3s;
  z-index: 1001;
}

.prev {
  left: 10px;
}

.next {
  right: 10px;
}

.prev:hover, .next:hover {
  color: #bbb;
}

/* User Section Styles */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-name {
  font-weight: 500;
  color: #374151;
  font-size: 0.9rem;
}

.logout-btn {
  padding: 0.5rem 1rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.logout-btn:hover {
  background: #dc2626;
}

/* Login page responsive styles moved to dedicated /assets/login.css file */
