:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #16a34a;
  --warning-color: #eab308;
  --danger-color: #dc2626;
  --info-color: #0891b2;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Mobile Design Tokens */
  --mobile-padding: 16px;
  --mobile-padding-sm: 12px;
  --mobile-gap: 12px;
  --mobile-gap-sm: 8px;
  --touch-target: 44px;
  
  /* Responsive Typography */
  --font-size-xs: clamp(0.7rem, 2vw, 0.75rem);
  --font-size-sm: clamp(0.8rem, 2.5vw, 0.875rem);
  --font-size-base: clamp(0.875rem, 3vw, 1rem);
  --font-size-lg: clamp(1rem, 3.5vw, 1.125rem);
  --font-size-xl: clamp(1.125rem, 4vw, 1.25rem);
  --font-size-2xl: clamp(1.25rem, 5vw, 1.5rem);
  
  --line-height-tight: 1.2;
  --line-height-normal: 1.4;
  --line-height-relaxed: 1.6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: var(--line-height-normal);
  font-size: var(--font-size-base);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
}

/* Single-line truncation utility */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar {
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
  padding: 0.35rem 0;
  margin-bottom: 1.5rem;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: -0.5px;
  white-space: nowrap;
  margin: 0;
  line-height: 1.1;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.15rem;
  align-items: center;
  flex: 1;
  justify-content: center;
  margin: 0;
}

.nav-menu a {
  padding: 0.35rem 0.55rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.1;
}

.nav-menu a:hover,
.nav-menu a.active {
  background-color: var(--bg-color);
  color: var(--primary-color);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.4rem;
  border-left: 1px solid var(--border-color);
  font-size: 0.75rem;
  min-width: fit-content;
}

.nav-user span {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.1;
}

.btn-logout {
  padding: 0.35rem 0.55rem;
  background-color: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.1;
}

.btn-logout:hover {
  background-color: var(--bg-color);
  color: var(--primary-color);
}

.main-content {
  min-height: calc(100vh - 200px);
  padding-bottom: 2rem;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-box {
  background-color: var(--card-bg);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
}

.login-box h1 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.demo-credentials {
  margin-top: 2rem;
  padding: 1rem;
  background-color: var(--bg-color);
  border-radius: 6px;
  font-size: 0.875rem;
}

.demo-credentials p {
  margin: 0.25rem 0;
}

.demo-credentials strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: var(--mobile-gap);
}

.page-header h1 {
  font-size: var(--font-size-2xl);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.stat-card-link:hover .stat-card {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.stat-card {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.dashboard-sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-section {
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
  font-size: 1.25rem;
  color: var(--text-primary);
}

.project-details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.detail-card {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.detail-card h2 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-size: 1.5rem;
}

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

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item strong {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  font-weight: 600;
}

.detail-item span {
  color: var(--text-primary);
  font-size: 1rem;
}

.detail-notes {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.detail-notes p {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-section {
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

/* Hide mobile cards on desktop */
.mobile-cards {
  display: none;
}

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

thead {
  background-color: var(--bg-color);
}

th {
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 1rem;
}

tbody tr:hover {
  background-color: var(--bg-color);
}

.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

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

.form-card {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 800px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
  background-color: #475569;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
  margin-left: auto;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  min-height: 28px;
  font-weight: 500;
  line-height: 1.2;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

.badge-active {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-completed {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-on-hold {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-pending {
  background-color: #f3f4f6;
  color: #374151;
}

.badge-in-progress {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-blocked {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-pending-verification {
  background-color: #f59e0b;
  color: white;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.badge-high {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-medium {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-low {
  background-color: #e0e7ff;
  color: #3730a3;
}

.badge-admin {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-manager {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-employee {
  background-color: #f3f4f6;
  color: #374151;
}

.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

footer {
  background-color: var(--card-bg);
  padding: 2rem 0;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
}

/* Mobile Optimizations for iPhone and iPad */
@media (max-width: 834px) {
  /* Container and Spacing */
  .container {
    padding: 0 var(--mobile-padding);
  }
  
  /* Navigation - Streamlined and Clean */
  .navbar {
    padding: 0.25rem 0;
    margin-bottom: 1rem;
  }
  
  .navbar .container {
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
  }
  
  .nav-brand h1 {
    font-size: 1.125rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.125rem;
    width: 100%;
  }
  
  .nav-menu a {
    font-size: 0.6875rem;
    padding: 0.3rem 0.5rem;
    min-height: 32px;
    display: flex;
    align-items: center;
  }
  
  .nav-user {
    width: 100%;
    justify-content: center;
    padding: 0.375rem 0 0 0;
    border-top: 1px solid var(--border-color);
    border-left: none;
    font-size: 0.6875rem;
    gap: 0.375rem;
  }
  
  .btn-logout {
    font-size: 0.6875rem;
    padding: 0.3rem 0.5rem;
    min-height: 32px;
  }
  
  /* Page Headers - Single Line Titles */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--mobile-gap);
    margin-bottom: 1rem;
    padding: var(--mobile-padding-sm) 0;
  }
  
  .page-header h1 {
    font-size: var(--font-size-xl);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: var(--line-height-tight);
  }
  
  h1, h2, h3 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: var(--line-height-tight);
  }
  
  .page-header > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  
  .page-header .btn {
    width: 100%;
    text-align: center;
    min-height: var(--touch-target);
  }
  
  .page-header .btn-secondary {
    font-size: var(--font-size-sm);
    padding: 0.75rem 1rem;
  }
  
  /* Stats Grid - Compact */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--mobile-gap);
    margin-bottom: 1rem;
  }
  
  /* Make stat cards clickable on mobile */
  .stat-card-link {
    pointer-events: auto;
    cursor: pointer;
  }
  
  .stat-card-link:active .stat-card {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  
  .stat-card {
    padding: var(--mobile-padding-sm);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
  }
  
  .stat-card h3 {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-tight);
  }
  
  .stat-number {
    font-size: var(--font-size-2xl);
    line-height: var(--line-height-tight);
  }
  
  /* Dashboard Sections - Clean List View */
  .dashboard-section {
    margin-bottom: var(--mobile-gap);
  }
  
  .section-header {
    padding: var(--mobile-padding-sm);
    flex-direction: column;
    align-items: stretch;
    gap: var(--mobile-gap);
  }
  
  .section-header h2 {
    font-size: var(--font-size-lg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .section-header .btn {
    width: 100%;
    text-align: center;
    min-height: var(--touch-target);
  }
  
  /* Tables - Responsive List Without Horizontal Scroll */
  .table-responsive {
    overflow-x: visible;
  }
  
  .dashboard-section table {
    font-size: var(--font-size-sm);
  }
  
  .dashboard-section thead {
    display: none;
  }
  
  .dashboard-section tbody tr {
    display: block;
    border-bottom: 1px solid var(--border-color);
    padding: var(--mobile-padding-sm);
    background: var(--card-bg);
    margin-bottom: 2px;
  }
  
  .dashboard-section tbody tr:hover {
    background: var(--bg-color);
  }
  
  .dashboard-section td {
    display: block;
    text-align: left !important;
    padding: 0.2rem 0 !important;
    border: none;
    font-size: var(--font-size-sm);
  }
  
  /* First cell - Title (SINGLE LINE) */
  .dashboard-section td:first-child {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: var(--line-height-tight);
  }
  
  .dashboard-section td:not(:first-child) {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    padding-left: 0 !important;
    line-height: var(--line-height-normal);
  }
  
  .dashboard-section td:before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-block;
    width: 85px;
    margin-right: 0.5rem;
    font-size: var(--font-size-xs);
  }
  
  .dashboard-section td:first-child:before {
    display: none;
  }
  
  /* Project Section Tables - Same Mobile Treatment */
  .project-section table {
    font-size: var(--font-size-sm);
  }
  
  .project-section thead {
    display: none;
  }
  
  .project-section tbody tr {
    display: block;
    border-bottom: 1px solid var(--border-color);
    padding: var(--mobile-padding-sm);
    background: var(--card-bg);
    margin-bottom: 2px;
  }
  
  .project-section tbody tr:hover {
    background: var(--bg-color);
  }
  
  .project-section td {
    display: block;
    text-align: left !important;
    padding: 0.2rem 0 !important;
    border: none;
    font-size: var(--font-size-sm);
  }
  
  /* First cell - Title (SINGLE LINE) */
  .project-section td:first-child {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: var(--line-height-tight);
  }
  
  .project-section td:first-child a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
  }
  
  .project-section td:not(:first-child) {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    padding-left: 0 !important;
    line-height: var(--line-height-normal);
  }
  
  .project-section td:before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-block;
    width: 85px;
    margin-right: 0.5rem;
    font-size: var(--font-size-xs);
  }
  
  .project-section td:first-child:before {
    display: none;
  }
  
  /* Hide Edit button on mobile for task cards */
  .project-section td[data-label="Actions"] .btn-xs.btn-secondary {
    display: none !important;
  }
  
  /* Show mobile cards on mobile, hide table for dashboard properties only */
  .dashboard-properties-table table {
    display: none;
  }
  
  .dashboard-properties-table .mobile-cards {
    display: block;
  }
  
  /* Hide specific elements on mobile */
  .mobile-hide {
    display: none !important;
  }
  
  /* Properties Table - Mobile List View */
  .table-responsive table {
    font-size: var(--font-size-sm);
  }
  
  .table-responsive thead {
    display: none;
  }
  
  .table-responsive tbody tr {
    display: block;
    border-bottom: 1px solid var(--border-color);
    padding: var(--mobile-padding-sm);
    background: var(--card-bg);
    margin-bottom: 2px;
  }
  
  .table-responsive tbody tr:hover {
    background: var(--bg-color);
  }
  
  .table-responsive td {
    display: block;
    text-align: left !important;
    padding: 0.2rem 0 !important;
    border: none;
    font-size: var(--font-size-sm);
  }
  
  /* First cell - Name (SINGLE LINE, CLICKABLE) */
  .table-responsive td:first-child {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    margin-bottom: 0.3rem;
  }
  
  .table-responsive td:first-child a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: block;
    color: var(--primary-color);
    text-decoration: none;
  }
  
  .table-responsive td:not(:first-child) {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    padding-left: 0 !important;
    line-height: var(--line-height-normal);
  }
  
  .table-responsive td:before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-block;
    width: 85px;
    margin-right: 0.5rem;
    font-size: var(--font-size-xs);
  }
  
  .table-responsive td:first-child:before {
    display: none;
  }
  
  /* Mobile Task Cards - Special Layout */
  .table-responsive tbody tr {
    position: relative;
    padding-top: 2.5rem !important;
  }
  
  /* Hide Actions label and position Edit button absolutely */
  .table-responsive td:last-child:before {
    display: none;
  }
  
  .table-responsive td:last-child {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0 !important;
  }
  
  .table-responsive td:last-child .btn {
    padding: 6px 14px;
    font-size: 0.875rem;
    min-height: auto;
  }
  
  /* Consistent label width and alignment */
  .table-responsive td:before {
    width: 90px;
    text-align: left;
  }
  
  .table-responsive td {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  
  .table-responsive td:first-child,
  .table-responsive td:last-child {
    display: block;
  }
  
  /* Forms - Single Column */
  .form-row {
    grid-template-columns: 1fr;
    gap: var(--mobile-gap);
  }
  
  .form-actions {
    flex-direction: column;
    gap: var(--mobile-gap);
  }
  
  .form-actions .btn {
    min-height: var(--touch-target);
  }
  
  .btn-danger {
    margin-left: 0;
  }
  
  /* General Tables */
  table {
    font-size: var(--font-size-sm);
  }
  
  th, td {
    padding: 0.5rem;
  }
  
  /* Uploads */
  .upload-input-group {
    flex-direction: column;
    gap: var(--mobile-gap);
  }
  
  .upload-input-group button {
    width: 100%;
    min-height: var(--touch-target);
  }
  
  /* Documents */
  .document-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--mobile-gap);
    padding: var(--mobile-padding-sm);
  }
  
  .document-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .document-actions .btn {
    min-height: 36px;
  }
  
  /* Detail Cards */
  .detail-card {
    padding: var(--mobile-padding-sm);
  }
  
  .detail-card h2 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--mobile-gap);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
    gap: var(--mobile-gap);
    margin-bottom: var(--mobile-gap);
  }
  
  .detail-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.5rem;
    align-items: start;
  }
  
  .detail-item strong {
    font-size: var(--font-size-xs);
    text-transform: none;
  }
  
  .detail-item span {
    font-size: var(--font-size-sm);
    overflow-wrap: break-word;
  }
  
  .detail-notes {
    margin-top: var(--mobile-gap);
  }
  
  .detail-notes strong {
    font-size: var(--font-size-xs);
  }
  
  .detail-notes p {
    font-size: var(--font-size-sm);
    margin-top: 0.5rem;
    line-height: var(--line-height-normal);
  }
  
  .project-section {
    margin-top: var(--mobile-gap);
  }
  
  .section-header h2 {
    font-size: var(--font-size-lg);
  }
  
  /* Buttons - Touch Friendly */
  .btn {
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .btn-sm {
    min-height: 36px;
    font-size: var(--font-size-sm);
  }
}

/* Extra Small Devices (iPhone SE, etc) */
@media (max-width: 640px) {
  :root {
    --mobile-padding: 12px;
    --mobile-padding-sm: 10px;
    --mobile-gap: 10px;
  }
  
  .page-header h1 {
    font-size: var(--font-size-lg);
  }
  
  .section-header h2 {
    font-size: var(--font-size-base);
  }
  
  .dashboard-section td:first-child {
    font-size: var(--font-size-sm);
  }
}

.document-upload-section {
  background-color: var(--bg-color);
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-input-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.upload-input-group input[type="file"] {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--card-bg);
}

.upload-hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.document-count {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: normal;
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.no-documents {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
  font-style: italic;
}

.document-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: box-shadow 0.2s;
}

.document-item:hover {
  box-shadow: var(--shadow);
}

.document-icon {
  flex-shrink: 0;
}

.document-icon span {
  display: inline-block;
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.625rem;
  color: white;
}

.doc-pdf {
  background-color: #dc2626;
}

.doc-word {
  background-color: #2563eb;
}

.doc-excel {
  background-color: #16a34a;
}

.doc-image {
  background-color: #0891b2;
}

.doc-cad {
  background-color: #7c3aed;
}

.doc-generic {
  background-color: var(--secondary-color);
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-name {
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  display: block;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.document-name:hover {
  text-decoration: underline;
}

.document-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.document-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Mobile-First Compact Cards */
.compact-card {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.compact-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.compact-upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.compact-upload-form input[type="file"] {
  font-size: 0.875rem;
  padding: 0.5rem;
}

.compact-upload-form small {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.doc-item-info {
  flex: 1;
  min-width: 0;
}

.doc-item-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--primary-color);
  text-decoration: none;
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.doc-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.project-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.project-card-title {
  flex: 1;
  min-width: 0;
}

.project-card-title a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.project-card-title a:hover {
  text-decoration: underline;
}

.project-card-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.project-fact {
  font-size: 0.8125rem;
}

.project-fact-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  display: block;
  margin-bottom: 0.25rem;
}

.project-fact-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Property Info Card - Consolidated Layout */
.property-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem 1.5rem;
  margin-top: 1rem;
}

.property-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.property-info-item.property-info-full {
  grid-column: 1 / -1;
}

.property-info-label {
  color: #6b7280;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-info-value {
  color: #111827;
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 500;
}

.property-notes-text {
  white-space: pre-wrap;
  color: #374151;
  font-weight: 400;
  line-height: 1.6;
  margin-top: 0.125rem;
}

@media (max-width: 768px) {
  .property-info-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .property-info-item.property-info-full {
    grid-column: 1;
  }
}

/* Legacy info styles (keeping for backward compatibility) */
.info-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.25rem 0;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.info-value {
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Page Header Utilities */
.header-actions {
  display: flex;
  gap: 6px;
}

/* Card Section Headers */
.card-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-section-header h3 {
  margin-bottom: 0;
}

/* Notes Section */
.info-notes {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.info-notes-label {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.info-notes-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Empty State */
.empty-state {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
}

/* Document Grid */
.docs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Delete Form */
.inline-delete-form {
  margin: 0;
}

/* Project Card Actions */
.project-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Task Count Display */
.task-count {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.task-count-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Mobile Card Styles */
.mobile-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.mobile-card-title {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-card-title a {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  line-height: 1.3;
}

.mobile-card-title a:hover {
  text-decoration: underline;
}

.mobile-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-card-row {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  font-size: 0.875rem;
  line-height: 1.5;
}

.mobile-card-label {
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
  margin-right: 0.75rem;
}

/* Contractor List Cards */
.contractor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contractor-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
}

.contractor-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.contractor-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.contractor-card-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
}

.contractor-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.contractor-name:hover {
  color: #1e40af;
  text-decoration: underline;
}

.contractor-trade-badge {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contractor-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contractor-detail-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.detail-label {
  color: #6b7280;
  font-weight: 500;
  min-width: 60px;
  flex-shrink: 0;
}

.detail-value {
  color: #374151;
  word-break: break-word;
}

.detail-link {
  color: var(--primary-color);
  text-decoration: none;
}

.detail-link:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .contractor-card {
    padding: 0.875rem 1rem;
  }
  
  .contractor-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
  }
  
  .contractor-card-main {
    width: 100%;
  }
  
  .contractor-name {
    font-size: 1rem;
  }
  
  .contractor-trade-badge {
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
  }
  
  .contractor-detail-row {
    font-size: 0.875rem;
  }
  
  .detail-label {
    min-width: 55px;
  }
}

/* Dashboard Property Card Redesign */
.dashboard-property-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.dashboard-property-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.dashboard-property-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f3f4f6;
}

.dashboard-property-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  line-height: 1.3;
  flex: 1;
  transition: color 0.2s ease;
}

.dashboard-property-name:hover {
  color: #1e40af;
}

.dashboard-property-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.badge-count {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.badge-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.2;
}

.dashboard-property-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-property-detail {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: #374151;
}

.detail-icon {
  flex-shrink: 0;
  color: #6b7280;
  width: 16px;
  height: 16px;
}

.detail-text {
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 768px) {
  .dashboard-property-card {
    padding: 1rem;
  }
  
  .dashboard-property-header {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .dashboard-property-badge {
    align-self: flex-start;
  }
  
  .badge-count {
    font-size: 1rem;
  }
  
  .badge-label {
    font-size: 0.6875rem;
  }
  
  .dashboard-property-name {
    font-size: 1.125rem;
  }
  
  .dashboard-property-detail {
    font-size: 0.875rem;
  }
}
