/* Essential Fire Services Client Portal Styles */

:root {
  --primary-color: #186043;
  --primary-dark: #0f4030;
  --primary-light: #247556;
  --secondary-color: #f8f9fa;
  --text-dark: #212529;
  --text-light: #6c757d;
  --border-color: #dee2e6;
  --success-color: #28a745;
  --error-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-dark);
  background-color: var(--secondary-color);
}

/* Flash Messages */
.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.flash-message {
  padding: 15px 45px 15px 20px;
  margin-bottom: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.flash-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid var(--success-color);
}

.flash-error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid var(--error-color);
}

.flash-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid var(--info-color);
}

.flash-warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 4px solid var(--warning-color);
}

.close-flash {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  color: inherit;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.close-flash:hover {
  opacity: 1;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
}

.login-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 440px;
  padding: 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.logo-circle {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(24, 96, 67, 0.3);
}

.fire-icon {
  width: 45px;
  height: 45px;
  color: white;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.login-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-top: 5px;
}

.login-form {
  margin-bottom: 25px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.3s;
  background-color: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(24, 96, 67, 0.1);
}

.checkbox-group {
  margin-bottom: 25px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.checkbox-label span {
  font-size: 14px;
  color: var(--text-dark);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 96, 67, 0.3);
}

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

.login-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.login-footer p {
  font-size: 14px;
  color: var(--text-light);
}

.btn-portal {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: white !important;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-portal:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1a5c3e 0%, #186043 50%, #145538 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  transition: width 0.3s ease;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  max-width: 100%;
  height: auto;
  transition: opacity 0.3s;
}

.logo-full {
  display: block;
  text-align: center;
}

.logo-mini {
  display: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.sidebar.collapsed .logo-full {
  display: none;
}

.sidebar.collapsed .logo-mini {
  display: flex;
  justify-content: center;
}

.user-role {
  font-size: 12px;
  opacity: 0.7;
  margin: 10px 0 0 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.sidebar.collapsed .user-role {
  display: none;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: absolute;
  top: 20px;
  right: -12px;
  width: 24px;
  height: 24px;
  background: #186043;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1001;
  padding: 0;
}

.sidebar-toggle:hover {
  background: #145538;
  transform: scale(1.1);
}

.toggle-icon {
  width: 14px;
  height: 14px;
  color: white;
  transition: transform 0.3s;
}

.sidebar.collapsed .toggle-icon {
  transform: rotate(180deg);
}

/* Navigation Menu */
.nav-menu {
  list-style: none;
  padding: 15px 0;
  flex: 1;
  margin: 0;
}

.nav-item {
  margin: 4px 12px;
}

.nav-item a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.2s;
  border-radius: 8px;
  gap: 12px;
}

.nav-item a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active a {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-text {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-item {
  margin: 4px 8px;
}

.sidebar.collapsed .nav-item a {
  justify-content: center;
  padding: 12px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-details {
  overflow: hidden;
  transition:
    opacity 0.2s,
    width 0.3s;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  opacity: 0.7;
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .user-details {
  opacity: 0;
  width: 0;
}

.sidebar.collapsed .user-info {
  justify-content: center;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

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

.btn-logout .nav-icon {
  width: 18px;
  height: 18px;
}

.sidebar.collapsed .btn-logout .nav-text {
  display: none;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  background: var(--secondary-color);
  transition: margin-left 0.3s ease;
}

.main-content.expanded {
  margin-left: 70px;
}

.content-header {
  background: white;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.content-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

.content-body {
  padding: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-card {
  background: white;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary-color);
}

.dashboard-card h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.card-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }

  .main-content {
    margin-left: 200px;
  }

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

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: linear-gradient(135deg, #1a5c3e 0%, #186043 100%);
  z-index: 999;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-menu-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  color: white;
}

.mobile-title {
  flex: 1;
  text-align: center;
  color: white;
  font-size: 16px;
  font-weight: 600;
}

.mobile-logout {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: background 0.2s;
}

.mobile-logout:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-logo {
  flex: 1;
  display: flex;
  justify-content: center;
  padding-right: 40px; /* Balance the menu button */
}

.mobile-logo img {
  height: 32px;
  width: auto;
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile Close Button */
.mobile-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

.mobile-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-close-btn svg {
  width: 20px;
  height: 20px;
  color: white;
}

@media (max-width: 576px) {
  .login-box {
    padding: 30px 20px;
  }
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .sidebar-toggle {
    display: none;
  }

  .mobile-close-btn {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding-top: 56px; /* Account for mobile header */
  }

  .main-content.expanded {
    margin-left: 0;
  }

  .content-header {
    padding: 12px 16px;
  }

  .content-body {
    padding: 12px;
  }
}

/* User Management Styles */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-primary {
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 96, 67, 0.3);
}

.btn-secondary {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: #5a6268;
}

.table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--secondary-color);
}

.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

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

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

.badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.badge-admin {
  background: #ffc107;
  color: #856404;
}

.badge-client {
  background: #d1ecf1;
  color: #0c5460;
}

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

.badge-inactive {
  background: #f8d7da;
  color: #721c24;
}

.text-muted {
  color: var(--text-light);
  font-style: italic;
}

.actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

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

.btn-edit:hover {
  background: var(--primary-dark);
}

.btn-delete {
  background: var(--error-color);
  color: white;
}

.btn-delete:hover {
  background: #c82333;
}

/* Form Styles */
.form-container {
  max-width: 800px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 20px;
}

.user-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-help {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-light);
}

.form-actions {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

@media (max-width: 768px) {
  .user-form .form-row {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 14px;
  }

  .data-table th,
  .data-table td {
    padding: 10px;
  }

  .actions {
    flex-direction: column;
  }
}

/* Company Assignment Styles */
.company-search-box {
  margin-bottom: 15px;
}

.company-search-box input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s;
}

.company-search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(24, 96, 67, 0.1);
}

.search-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 5px;
  display: block;
}

.company-selection-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.selection-count {
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 600;
}

.selection-actions {
  display: flex;
  gap: 10px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.2s;
}

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

.company-checkbox-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  background: white;
}

.company-checkbox-label {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  user-select: none;
}

.company-checkbox-label:hover {
  background: var(--secondary-color);
}

.company-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.company-checkbox-label span {
  font-size: 14px;
  color: var(--text-dark);
}

.company-checkbox-label.hidden {
  display: none;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.company-list-small {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

@media (max-width: 768px) {
  .company-selection-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .company-list-small {
    max-width: 200px;
  }
}

/* Map Container Styles */
.map-container {
  background: white;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-top: 12px;
}

.map-container h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 15px;
}

.site-map {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

@media (max-width: 768px) {
  .map-container {
    padding: 12px;
  }
}

/* Jobs Table Styles */
.table-container {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-top: 12px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
}

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

.data-table .description-cell {
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .no-data {
  text-align: center;
  color: #888;
  padding: 40px;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.status-quote {
  background: #fff3cd;
  color: #856404;
}

.status-work-order,
.status-in-progress,
.status-scheduled {
  background: #cce5ff;
  color: #004085;
}

.status-completed {
  background: #d4edda;
  color: #155724;
}

.status-unknown {
  background: #e9ecef;
  color: #6c757d;
}

/* Content header with filter button */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #5a6268;
}

@media (max-width: 768px) {
  .table-container {
    padding: 10px;
  }

  .data-table th,
  .data-table td {
    padding: 10px;
    font-size: 13px;
  }

  .data-table .description-cell {
    max-width: 150px;
  }
}

/* Filter Controls */
.filters-container {
  background: white;
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-top: 12px;
}

.filters-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.search-box {
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.filter-group {
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 5px;
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.filter-actions {
  display: flex;
  gap: 10px;
  padding-top: 5px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #c0392b;
}

/* Table Header */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.results-count {
  font-size: 14px;
  color: #666;
}

/* Job Number Column */
.job-number {
  font-weight: 600;
  color: var(--primary-color);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .filters-container {
    padding: 10px;
  }

  .filter-row {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }

  .filter-actions {
    flex-direction: column;
  }

  .filter-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* Job Detail Page */
.header-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.back-link {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--primary-color);
}

.detail-card {
  background: white;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 12px;
}

.detail-card h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-item label,
.detail-section label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
}

.detail-item span {
  font-size: 15px;
  color: var(--text-dark);
}

.detail-section {
  margin-top: 20px;
}

.description-text {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-top: 8px;
}

.dates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.date-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.date-item label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
}

.date-item span {
  font-size: 14px;
  color: var(--text-dark);
}

/* Job Details Row (with map) */
.job-details-row {
  display: flex;
  gap: 25px;
  margin-bottom: 25px;
}

.job-left-column {
  flex: 0 0 350px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.job-right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.job-left-column .detail-card,
.job-right-column .detail-card {
  margin-bottom: 0;
}

.job-map-card {
  margin-bottom: 0;
}

.job-map-container {
  border-radius: 8px;
  overflow: hidden;
}

.job-map-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

@media (max-width: 1024px) {
  .job-details-row {
    flex-direction: column;
  }

  .job-left-column,
  .job-right-column {
    flex: 1;
  }
}

/* Timeline Styles */
.timeline-section {
  margin-bottom: 20px;
}

.timeline-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.timeline-separator {
  display: flex;
  align-items: center;
  margin: 25px 0;
}

.timeline-separator::before,
.timeline-separator::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--primary-color);
}

.timeline-separator span {
  padding: 5px 15px;
  background: var(--primary-color);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 15px;
  text-transform: uppercase;
}

.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ddd;
}

.timeline-item {
  position: relative;
  padding-bottom: 25px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -26px;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  border: 3px solid #ddd;
}

.timeline-visit .timeline-marker {
  border-color: #3498db;
}

.timeline-form .timeline-marker {
  border-color: #9b59b6;
}

.timeline-attachment .timeline-marker {
  border-color: #27ae60;
}

.timeline-milestone .timeline-marker {
  border-color: #f39c12;
  background: #f39c12;
}

.timeline-content {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timeline-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e9ecef;
  color: #666;
}

.timeline-visit .timeline-type {
  background: #e3f2fd;
  color: #1976d2;
}

.timeline-form .timeline-type {
  background: #f3e5f5;
  color: #7b1fa2;
}

.timeline-attachment .timeline-type {
  background: #e8f5e9;
  color: #388e3c;
}

.timeline-milestone .timeline-type,
.timeline-type-milestone {
  background: #fff3e0;
  color: #e65100;
}

.timeline-date {
  font-size: 12px;
  color: #888;
}

.timeline-title {
  font-size: 14px;
  color: var(--text-dark);
  margin: 0;
}

.timeline-count-badge {
  display: inline-block;
  background: #9b59b6;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.timeline-attachment-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 13px;
}

.timeline-attachment-link:hover {
  text-decoration: underline;
}

.timeline-thumbnail {
  max-width: 120px;
  max-height: 120px;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  object-fit: cover;
  border: 1px solid #e0e0e0;
}

.timeline-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.timeline-image-link {
  display: inline-block;
}

.timeline-pdf-link,
.timeline-file-link {
  display: inline-block;
  margin-top: 10px;
}

.pdf-icon,
.file-icon {
  width: 50px;
  height: 60px;
  transition: transform 0.2s;
}

.pdf-icon svg,
.file-icon svg {
  width: 100%;
  height: 100%;
}

.pdf-icon:hover,
.file-icon:hover {
  transform: scale(1.1);
}

.no-timeline {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Clickable table rows */
.data-table tbody tr.clickable-row {
  cursor: pointer;
  transition: background 0.2s;
}

.data-table tbody tr.clickable-row:hover {
  background: #f0f0f0;
}

@media (max-width: 768px) {
  .detail-card {
    padding: 12px;
  }

  .detail-grid,
  .dates-grid {
    grid-template-columns: 1fr 1fr;
  }

  .timeline {
    padding-left: 25px;
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .timeline-thumbnail {
    max-width: 100%;
  }
}
