/* Modern, clean styling for UGX PNL'S */

:root {
  --primary-color: #0066ff;
  --primary-dark: #0052cc;
  --primary-light: #e6f0ff;
  --success-color: #00875a;
  --danger-color: #de350b;
  --warning-color: #ff991f;
  --info-color: #0065ff;
  --text-primary: #172b4d;
  --text-secondary: #6b778c;
  --text-light: #8993a4;
  --bg-primary: #ffffff;
  --bg-secondary: #f4f5f7;
  --bg-tertiary: #fafbfc;
  --border-color: #dfe1e6;
  --border-light: #ebecf0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-tertiary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Modern Header */
.modern-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background-color: rgba(255,255,255,0.95);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

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

.nav-btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Hide old navbar */
.navbar {
  display: none;
}

/* Modern Container */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

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

/* Modern Cards */
.modern-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s;
}

.modern-card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-tertiary);
}

.card-body {
  padding: 24px;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* Modern Tables */
.modern-table {
  width: 100%;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.modern-table thead {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.modern-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.modern-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 14px;
}

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

.modern-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Modern Buttons */
.modern-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.modern-btn:hover {
  transform: translateY(-1px);
}

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

.modern-btn.primary {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

.modern-btn.primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.modern-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.modern-btn.secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

.modern-btn.success {
  background: var(--success-color);
  color: white;
}

.modern-btn.danger {
  background: var(--danger-color);
  color: white;
}

.modern-btn.ghost {
  background: transparent;
  color: var(--text-secondary);
}

.modern-btn.ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modern-btn.icon-only {
  padding: 8px;
  width: 32px;
  height: 32px;
}

/* Button Group */
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Keep compatibility with Bootstrap buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  border: none;
}

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

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

/* Modern Form Controls */
.form-group {
  margin-bottom: 20px;
}

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

.form-control, .form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all 0.2s;
  outline: none;
}

.form-control:hover, .form-select:hover {
  border-color: var(--text-secondary);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.form-control[readonly] {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Form Grid */
.form-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

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

/* Section Headers */
.section-header {
  margin: 32px 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.success {
  background: #e3fcef;
  color: #006644;
}

.status-badge.info {
  background: #deebff;
  color: #0052cc;
}

.status-badge.warning {
  background: #fffae6;
  color: #974f0c;
}

.status-badge.secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* Keep Bootstrap badge compatibility */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  margin-bottom: 24px;
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: var(--radius-md);
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.alert-info {
  background: #deebff;
  color: #0052cc;
}

.alert-success {
  background: #e3fcef;
  color: #006644;
}

.alert-warning {
  background: #fffae6;
  color: #974f0c;
}

.alert-danger {
  background: #ffebe6;
  color: #de350b;
}

/* Modals */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-tertiary);
}

/* List group styling */
.list-group-item {
  border: none;
  border-bottom: 1px solid #f3f4f6;
  padding: 0.875rem 0;
}

.list-group-item:last-child {
  border-bottom: none;
}

/* Input group styling */
.input-group-text {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem 0 0 0.5rem;
}

/* File input */
input[type="file"] {
  font-size: 0.875rem;
}

/* Logo preview */
#logoPreview {
  border-radius: 0.375rem;
  box-shadow: var(--card-shadow);
}

/* Summary section */
#jobForm .row.g-3 input[readonly] {
  font-weight: 600;
  color: #111827;
  background-color: #f9fafb;
}

/* KPI badges */
.badge.bg-success, .badge.bg-info, .badge.bg-secondary {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

/* Logout button styling */
#logoutBtn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#logoutBtn:hover {
  background: rgba(255, 67, 54, 0.9);
  border-color: rgba(255, 67, 54, 0.9);
}

/* Mobile Responsive - Tablet */
@media (max-width: 1024px) {
  .header-container {
    padding: 0 20px;
  }
  
  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .modern-table th,
  .modern-table td {
    padding: 14px;
    font-size: 13px;
  }
}

/* Mobile Responsive - Phone */
@media (max-width: 768px) {
  body {
    font-size: 13px;
  }
  
  .header-container {
    padding: 0 12px;
    height: 56px;
  }
  
  .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  
  .logo-text {
    font-size: 16px;
  }
  
  .logo-text span {
    display: none;
  }
  
  .nav-section {
    gap: 4px;
  }
  
  .nav-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 36px;
  }
  
  .nav-btn span {
    display: none;
  }
  
  .nav-btn i {
    font-size: 16px;
  }
  
  .main-container {
    padding: 12px;
  }
  
  .page-header {
    margin-bottom: 20px;
  }
  
  .page-title {
    font-size: 20px;
    margin-bottom: 4px;
  }
  
  .page-subtitle {
    font-size: 12px;
  }
  
  .modern-card {
    border-radius: var(--radius-md);
  }
  
  .card-header {
    padding: 16px;
  }
  
  .card-body {
    padding: 16px;
  }
  
  .section-title {
    font-size: 14px;
  }
  
  .modern-table {
    font-size: 12px;
  }
  
  .modern-table thead {
    display: none;
  }
  
  .modern-table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
  }
  
  .modern-table td {
    display: block;
    padding: 8px 0;
    border: none;
    position: relative;
    padding-left: 40%;
  }
  
  .modern-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 35%;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
  }
  
  .modern-table tbody tr:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
  }
  
  .btn-group {
    width: 100%;
  }
  
  .modern-btn {
    flex: 1;
    justify-content: center;
    min-height: 40px;
    font-size: 13px;
    padding: 10px 14px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-label {
    font-size: 13px;
    margin-bottom: 4px;
  }
  
  .form-control, .form-select {
    font-size: 13px;
    padding: 10px;
    min-height: 40px;
  }
  
  .search-container {
    max-width: none;
  }
  
  .search-input {
    font-size: 13px;
    padding: 8px 12px 8px 36px;
  }
  
  .status-badge {
    font-size: 11px;
    padding: 3px 8px;
  }
  
  .empty-state {
    padding: 32px 16px;
  }
  
  .empty-state-icon {
    font-size: 36px;
  }
  
  .empty-state-title {
    font-size: 14px;
  }
  
  .empty-state-text {
    font-size: 12px;
  }
  
  .alert {
    padding: 12px;
    font-size: 13px;
  }
  
  .modal-header {
    padding: 16px;
  }
  
  .modal-title {
    font-size: 18px;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-footer {
    padding: 12px 16px;
  }
  
  .kpi-container {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .kpi-card {
    padding: 12px;
  }
  
  .kpi-label {
    font-size: 11px;
  }
  
  .kpi-value {
    font-size: 18px;
  }
  
  input[type="range"] {
    height: 8px;
  }
  
  input[type="range"]::-webkit-slider-thumb,
  input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
  
  .notification-container {
    top: 70px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .notification {
    padding: 12px;
    font-size: 13px;
  }
  
  .notification-icon {
    font-size: 18px;
  }
  
  .notification-message {
    font-size: 12px;
  }
  
  .auto-save-indicator {
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 11px;
  }
  
  /* Touch-friendly spacing */
  button, .btn, a.nav-btn, input, select, textarea {
    min-height: 40px;
  }
  
  /* Better spacing between form elements */
  .row.g-3 {
    --bs-gutter-y: 1rem;
    --bs-gutter-x: 0.75rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .header-container {
    padding: 0 8px;
  }
  
  .logo-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
  
  .logo-text {
    font-size: 14px;
  }
  
  .nav-btn {
    padding: 6px 8px;
  }
  
  .page-title {
    font-size: 18px;
  }
  
  .modern-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .template-card {
    min-width: 100%;
  }
  
  .kpi-container {
    grid-template-columns: 1fr;
  }
  
  /* Stack action buttons vertically on very small screens */
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons .modern-btn {
    width: 100%;
  }
}

/* Smooth transitions */
* {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Action buttons spacing */
.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
  }
  
  .action-buttons .modern-btn,
  .action-buttons .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  
  /* Job form action buttons */
  #jobForm .mt-4.d-flex {
    flex-direction: column;
    gap: 8px;
  }
  
  #jobForm .mt-4.d-flex .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  
  /* Fix range inputs on mobile */
  .d-flex.align-items-center.gap-2 {
    flex-wrap: wrap;
  }
  
  .d-flex.align-items-center.gap-2 .form-range {
    width: 100%;
    margin-bottom: 8px;
  }
  
  .d-flex.align-items-center.gap-2 input[type="number"] {
    width: 100% !important;
  }
}

/* Calculator Container */
#calculatorContainer {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin: 16px 0;
}

#calculatorContainer h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* KPI Cards */
.kpi-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-primary);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  text-align: center;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Chart container in modal */
#previewChart {
  max-height: 300px !important;
  margin-top: 20px;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-muted {
  color: var(--text-secondary) !important;
}

.text-small {
  font-size: 12px;
}

.mt-4 { margin-top: 32px; }
.mb-4 { margin-bottom: 32px; }
.p-4 { padding: 32px; }

/* Hide elements */
.d-none { display: none !important; }

/* Range Input Styling */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-light);
  outline: none;
  transition: background 0.15s;
}

input[type="range"]:hover {
  background: var(--border-color);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
  border: none;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.form-range {
  padding: 0;
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.notification {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

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

.notification.success {
  border-left: 4px solid var(--success-color);
}

.notification.error {
  border-left: 4px solid var(--danger-color);
}

.notification.warning {
  border-left: 4px solid var(--warning-color);
}

.notification.info {
  border-left: 4px solid var(--info-color);
}

.notification-icon {
  font-size: 20px;
}

.notification.success .notification-icon {
  color: var(--success-color);
}

.notification.error .notification-icon {
  color: var(--danger-color);
}

.notification.warning .notification-icon {
  color: var(--warning-color);
}

.notification.info .notification-icon {
  color: var(--info-color);
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.notification-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.notification-close {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.notification-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Auto-save indicator */
.auto-save-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 100;
}

.auto-save-indicator.visible {
  opacity: 1;
}

.auto-save-indicator.saving {
  color: var(--primary-color);
}

.auto-save-indicator.saved {
  color: var(--success-color);
}

.auto-save-indicator i {
  animation: spin 1s linear infinite;
}

.auto-save-indicator.saved i {
  animation: none;
}

/* Search input styling */
.search-container {
  position: relative;
  max-width: 400px;
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* Keyboard shortcut hint */
.kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: monospace;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.1);
  color: var(--text-primary);
}

/* Template selector */
.template-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.template-card {
  flex: 1;
  min-width: 200px;
  padding: 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.template-card:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.template-card.selected {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.template-icon {
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.template-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.template-description {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Mobile optimization for templates */
@media (max-width: 768px) {
  .template-selector {
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .template-card {
    min-width: 140px;
    padding: 10px;
  }
  
  .template-icon {
    font-size: 24px;
    margin-bottom: 6px;
  }
  
  .template-name {
    font-size: 13px;
    margin-bottom: 2px;
  }
  
  .template-description {
    font-size: 11px;
  }
  
  /* Job form specific mobile styles */
  #jobForm .row.g-3 {
    --bs-gutter-y: 0.75rem;
  }
  
  #jobForm input[type="number"],
  #jobForm input[type="text"],
  #jobForm input[type="date"],
  #jobForm select,
  #jobForm textarea {
    font-size: 13px;
  }
  
  #jobForm .table {
    font-size: 12px;
  }
  
  #jobForm .table input {
    font-size: 12px;
    padding: 6px;
  }
  
  #jobForm .btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  #yearlyBreakdownSection {
    padding: 16px;
    margin: 16px 0;
  }
  
  /* Logo icon for mobile */
  .logo-icon {
    font-weight: 800;
    letter-spacing: -1px;
  }
}

/* Yearly breakdown styling */
#yearlyBreakdownSection {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 20px 0;
}

.year-percentage {
  cursor: pointer;
}

.year-amount {
  font-weight: 600;
  color: var(--primary-color);
}

#yearlyBreakdownTotal {
  font-weight: 700;
  font-size: 16px;
}

#yearlyBreakdownStatus {
  font-weight: 500;
}

/* Date range inputs */
#projectDuration {
  font-weight: 600;
  color: var(--primary-color);
}

/* Additional mobile optimizations */
@media (max-width: 768px) {
  /* Improve touch targets for mobile */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
  }
  
  /* Better table handling on mobile */
  .table-responsive {
    margin: 0 -12px;
    padding: 0 12px;
  }
  
  /* Fix Bootstrap table on mobile */
  .table {
    margin-bottom: 0;
  }
  
  .table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary);
  }
  
  /* Improve button visibility */
  .btn i,
  .modern-btn i {
    margin-right: 4px;
  }
  
  /* Better modal display on mobile */
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .modal-xl {
    max-width: calc(100vw - 1rem);
  }
  
  /* Fix date inputs on iOS */
  input[type="date"] {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Improve file input */
  input[type="file"] {
    font-size: 14px;
    padding: 8px;
  }
  
  /* Better form control focus */
  .form-control:focus,
  .form-select:focus {
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2);
  }
  
  /* Sticky save button for mobile */
  .action-buttons {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    padding: 12px;
    margin: 16px -12px -12px;
    border-top: 1px solid var(--border-light);
    z-index: 50;
  }
  
  /* Fix number input spinners */
  input[type="number"] {
    -moz-appearance: textfield;
  }
  
  input[type="number"]::-webkit-outer-spin-button,
  input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  
  /* Improve dropdown menus */
  .dropdown-menu {
    font-size: 14px;
  }
  
  .dropdown-item {
    padding: 10px 16px;
  }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .header-container {
    height: 48px;
  }
  
  .main-container {
    padding-top: 16px;
  }
  
  .logo-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  /* Future dark mode styles can go here */
}

/* Calculator mobile optimizations */
@media (max-width: 768px) {
  #calculatorContainer {
    margin: 0 -12px;
    padding: 12px;
  }
  
  #calculatorContainer .row {
    margin-left: -8px;
    margin-right: -8px;
  }
  
  #calculatorContainer .col-md-6,
  #calculatorContainer .col-md-4,
  #calculatorContainer .col-md-3 {
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: 12px;
  }
  
  #calculatorContainer .card {
    margin-bottom: 12px;
  }
  
  #calculatorContainer .card-body {
    padding: 12px;
  }
  
  #calculatorContainer .card-title {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  #calculatorContainer input[type="number"] {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 8px;
  }
  
  #calculatorContainer .form-label {
    font-size: 12px;
    margin-bottom: 4px;
  }
  
  #calculatorContainer .btn {
    width: 100%;
    margin-top: 8px;
  }
  
  /* Pressure washing calculator specific */
  .pressure-washing-calculator .alert {
    font-size: 13px;
    padding: 10px;
  }
  
  .pressure-washing-calculator h6 {
    font-size: 14px;
    margin-top: 16px;
    margin-bottom: 8px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  #calculatorContainer .row {
    margin-left: -4px;
    margin-right: -4px;
  }
  
  #calculatorContainer .col-8,
  #calculatorContainer .col-4 {
    padding-left: 4px;
    padding-right: 4px;
  }
  
  #calculatorContainer .card-body {
    padding: 10px;
  }
  
  #calculatorContainer input[type="number"] {
    padding: 6px;
    font-size: 14px;
  }
}

/* Touch-friendly calculator controls */
@media (hover: none) and (pointer: coarse) {
  #calculatorContainer input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }
  
  #calculatorContainer .btn {
    min-height: 44px;
  }
}