/* Contractor ERP - Modern BYCO Theme with Google-like Colors */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;
  --accent: #1a1a1a;
  --accent-yellow: #FFD000;
  --accent-yellow-hover: #E6BB00;
  --sidebar-bg: #1a1a1a;
  --sidebar-text: #f0f0f0;
  --sidebar-text-muted: #a1a1aa;
  /* Google-like Bright Colors */
  --google-blue: #4285F4;
  --google-red: #EA4335;
  --google-yellow: #FBBC05;
  --google-green: #34A853;
  --orange: #FF5722;
  --purple: #673AB7;
  --pink: #E91E63;
  --cyan: #00BCD4;
  --teal: #009688;
  --success: #34A853;
  --warning: #FBBC05;
  --danger: #EA4335;
  --info: #4285F4;
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  /* Border Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Sidebar - flat dark */
.sidebar {
  width: 260px;
  background: hsl(var(--sh-sidebar));
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  transition: width 0.25s ease;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed .sidebar-header {
  padding: 1rem 0.5rem;
  justify-content: center;
}

.sidebar.collapsed .sidebar-logo {
  width: 32px;
  height: auto;
}


.sidebar.collapsed .nav-section-title {
  display: none;
}

.sidebar.collapsed .nav-link {
  padding: 0.75rem;
  justify-content: center;
  position: relative;
}

.sidebar.collapsed .nav-link::before {
  font-size: 1.1rem;
}

.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.55rem;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
}

.sidebar.collapsed .sidebar-footer {
  padding: 1rem 0.5rem;
}

.sidebar.collapsed .sidebar-footer a {
  font-size: 0;
  padding: 0.75rem;
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .sidebar-footer a::before {
  content: '↪';
  font-size: 1.2rem;
}

/* Main content when sidebar collapsed */
.app-container.sidebar-collapsed .main-content {
  margin-left: 60px;
}

/* Sidebar resize handle */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  cursor: pointer;
  background: transparent;
  z-index: 100;
}

/* Visual indicator */
.sidebar-resize-handle::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background 0.2s;
}

.sidebar-resize-handle:hover::before,
.sidebar-resize-handle.dragging::before {
  background: #FFD000;
}

/* Arrow - left when expanded (collapse) */
.sidebar-resize-handle::after {
  content: '◀';
  position: absolute;
  top: 50%;
  right: -2px;
  transform: translateY(-50%);
  background: #FFD000;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: bold;
  padding: 12px 7px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle.dragging::after {
  opacity: 1;
  transform: translateY(-50%) scale(1.05);
}

/* Arrow - right when collapsed (expand) */
.sidebar.collapsed .sidebar-resize-handle::after {
  content: '▶';
}

body.sidebar-resizing {
  cursor: ew-resize !important;
  user-select: none;
}

body.sidebar-resizing * {
  cursor: ew-resize !important;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.sidebar-header {
  padding: 20px 12px 20px 20px;
  border-bottom: 1px solid hsl(240 10% 12%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: hsl(240 10% 4.5%);
  gap: 0.5rem;
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--sidebar-bg);
}

.sidebar-logo {
  max-width: 160px;
  max-height: 50px;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  padding: 12px 24px 8px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  letter-spacing: 1.2px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 11px 24px;
  color: var(--sidebar-text);
  transition: all 0.2s ease;
  font-size: 13.5px;
  border-left: 3px solid transparent;
  margin: 2px 0;
}

.nav-link:hover {
  background: hsl(240 10% 10%);
  color: hsl(0 0% 94%);
  text-decoration: none;
  border-left-color: hsl(0 0% 40%);
}

.nav-link.active {
  background: hsl(240 10% 12%);
  color: hsl(0 0% 98%);
  font-weight: 600;
  border-left-color: hsl(0 0% 80%);
}

.nav-badge {
  background-color: hsl(0 0% 22%);
  color: hsl(0 0% 88%);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
}

.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid #333;
  font-size: 12px;
  color: var(--sidebar-text-muted);
}

.sidebar-footer a {
  color: var(--sidebar-text-muted);
}

.sidebar-footer a:hover {
  color: var(--accent-yellow);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-secondary);
  transition: margin-left 0.25s ease;
}

.top-bar {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 30px;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 100;
}

.page-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info {
  text-align: right;
}

.user-name {
  font-weight: 500;
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.content-area {
  padding: 28px 32px;
  flex: 1;
  overflow-y: auto;
  background: var(--bg-secondary);
}

/* Cards - Modern Design */
.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 15px;
}

.card-header.d-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header .btn {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.card-header .btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-dark);
  transform: none;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Stats Grid - Modern Design */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.stat-card {
  background-color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: -1px;
  color: var(--text-primary);
}

.stat-change {
  font-size: 13px;
  margin-top: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
}

.stat-change.positive {
  color: var(--success);
  background: rgba(52, 168, 83, 0.1);
}
.stat-change.negative {
  color: var(--danger);
  background: rgba(234, 67, 53, 0.1);
}

/* Tables - Modern Design */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 500;
  background: hsl(var(--sh-muted));
  color: hsl(var(--sh-muted-foreground));
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Dark table header style */
.dark-header th,
table.dark-header th {
  background: hsl(var(--sh-primary));
  color: hsl(var(--sh-primary-foreground));
}

/* Light table header style - use on tables INSIDE cards (avoids clashing with card-header) */
.light-header th,
table.light-header th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-dark);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 0 !important;
}

th:first-child {
  border-radius: var(--radius) 0 0 0;
}

th:last-child {
  border-radius: 0 var(--radius) 0 0;
}

tr {
  transition: background-color 0.15s ease;
}

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

tr:last-child td:first-child {
  border-radius: 0 0 0 var(--radius);
}

tr:last-child td:last-child {
  border-radius: 0 0 var(--radius) 0;
}

.subtask-row {
  background-color: var(--bg-tertiary);
}

.subtask-row:hover {
  background-color: var(--bg-secondary);
}

.alert {
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

/* Forms - Modern Design */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--bg-primary);
}

.form-select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-dark);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: hsl(var(--sh-ring));
  box-shadow: 0 0 0 3px hsl(var(--sh-ring) / 0.12);
}

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

.form-checkbox {
  margin-right: 8px;
}

.form-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

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

/* Buttons - shadcn style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  opacity: 0.9;
}

.btn-primary {
  background: hsl(var(--sh-primary));
  color: hsl(var(--sh-primary-foreground));
  border-color: transparent;
}

.btn-primary:hover {
  background: hsl(240 10% 12%);
}

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

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

.btn-danger {
  background: hsl(var(--sh-destructive));
  color: hsl(var(--sh-destructive-foreground));
  border-color: transparent;
}

.btn-danger:hover {
  background: hsl(0 84% 54%);
}

.btn-success {
  background: hsl(var(--sh-success));
  color: white;
  border-color: transparent;
}

.btn-success:hover {
  background: hsl(142 71% 38%);
}

.btn-info {
  background: hsl(var(--sh-info));
  color: white;
  border-color: transparent;
}

.btn-info:hover {
  background: hsl(217 91% 53%);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: var(--radius);
}

.btn-group {
  display: flex;
  gap: 12px;
}

/* Badges - shadcn style (soft tinted, rounded-full) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 9999px;
  letter-spacing: 0.2px;
}

.badge-success  { background-color: hsl(142 71% 45% / 0.12); color: hsl(142 71% 32%); }
.badge-warning  { background-color: hsl(38 92% 50% / 0.14);  color: hsl(38 75% 34%); }
.badge-danger   { background-color: hsl(0 84% 60% / 0.12);   color: hsl(0 72% 42%); }
.badge-info     { background-color: hsl(217 91% 60% / 0.12); color: hsl(217 72% 38%); }
.badge-secondary{ background-color: hsl(var(--sh-muted));    color: hsl(var(--sh-muted-foreground)); }
.badge-primary  { background-color: hsl(240 10% 3.9% / 0.08); color: hsl(var(--sh-foreground)); }
.badge-purple   { background-color: hsl(262 83% 58% / 0.12); color: hsl(262 60% 42%); }
.badge-pink     { background-color: hsl(330 81% 60% / 0.12); color: hsl(330 60% 40%); }
.badge-orange   { background-color: hsl(24 95% 53% / 0.12);  color: hsl(24 78% 36%); }
.badge-teal     { background-color: hsl(174 72% 40% / 0.12); color: hsl(174 58% 28%); }

/* Alerts - Modern Design */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}

.alert-success {
  background-color: rgba(52, 168, 83, 0.1);
  border-left: 4px solid var(--success);
  color: #1e7e34;
}
.alert-warning {
  background-color: rgba(251, 188, 5, 0.12);
  border-left: 4px solid var(--warning);
  color: #856404;
}
.alert-danger {
  background-color: rgba(234, 67, 53, 0.1);
  border-left: 4px solid var(--danger);
  color: #c82333;
}
.alert-info {
  background-color: rgba(66, 133, 244, 0.1);
  border-left: 4px solid var(--info);
  color: #0c5d9d;
}

/* Progress Bar - Modern Design */
.progress {
  height: 10px;
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-yellow), #e6bb00);
  transition: width 0.4s ease;
  border-radius: 10px;
}

.progress-bar.success { background: linear-gradient(90deg, var(--success), #2e7d32); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #f9a825); }
.progress-bar.danger { background: linear-gradient(90deg, var(--danger), #c62828); }
.progress-bar.info { background: linear-gradient(90deg, var(--info), #1565c0); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  margin-bottom: 10px;
  color: var(--text-secondary);
}

/* Page Header - Modern Design */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-header h1::after {
  display: none;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb-separator {
  color: var(--border-color);
}

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

.detail-item {
  margin-bottom: 15px;
}

.detail-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 15px;
  margin-top: 4px;
}

/* Cost Breakdown */
.cost-breakdown {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.cost-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
}

.cost-row:last-child {
  border-bottom: none;
}

.cost-row.header {
  background-color: var(--bg-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

.cost-row.total {
  background-color: var(--bg-tertiary);
  font-weight: 600;
}

.variance-positive { color: var(--success); }
.variance-negative { color: var(--danger); }

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--sh-secondary));
}

.login-box {
  width: 100%;
  max-width: 400px;
  background-color: hsl(var(--sh-background));
  border: 1px solid hsl(var(--sh-border));
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

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

.login-header h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--accent);
}

.login-header p {
  color: var(--text-muted);
}

.login-box .btn-primary {
  width: 100%;
  padding: 12px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }

.d-flex { display: flex; }
.justify-between, .justify-content-between { justify-content: space-between; }
.align-center, .align-items-center { align-items: center; }
.gap-2 { gap: 10px; }
.flex-wrap { flex-wrap: wrap; }

/* Formset styling */
.formset-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  align-items: end;
}

.formset-row:last-child {
  border-bottom: none;
}

.delete-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--danger);
}

/* Top Bar Right Section */
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Notification Bell */
.notification-wrapper {
  position: relative;
}

.notification-bell {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bell:hover {
  background-color: var(--bg-secondary);
}

.notification-bell svg {
  color: var(--text-secondary);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Notification Dropdown */
.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
}

.notification-dropdown.show {
  display: block;
}

.notification-header {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.notification-header .text-link {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
}

.notification-header .text-link:hover {
  color: var(--text-primary);
}

.notification-list {
  max-height: 350px;
  overflow-y: auto;
}

.notification-item {
  display: block;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s;
  text-decoration: none;
}

.notification-item:hover {
  background-color: var(--bg-secondary);
  text-decoration: none;
}

.notification-item.unread {
  background-color: #fffcf0;
  border-left: 3px solid var(--accent-yellow);
}

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

.notification-title {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
}

.notification-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.notification-empty {
  padding: 30px 15px;
  text-align: center;
  color: var(--text-muted);
}

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

.notification-footer a {
  font-size: 13px;
  color: var(--text-secondary);
}

.notification-footer a:hover {
  color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-yellow);
  border-radius: 4px;
  padding: 15px 20px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-out;
}

.toast-high,
.toast-urgent {
  border-left-color: var(--danger);
  background-color: #fff8f8;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
}

.toast-fade {
  animation: fadeOut 0.3s ease-out forwards;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Progress Timeline */
.progress-timeline {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.timeline-entry {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-primary);
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.timeline-date-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--accent);
  color: var(--accent-yellow);
  padding: 8px 12px;
  border-radius: 6px;
  min-width: 50px;
}

.timeline-date-marker .date-day {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.timeline-date-marker .date-month {
  font-size: 11px;
  text-transform: uppercase;
}

.timeline-meta {
  flex: 1;
}

.timeline-meta h4 {
  margin: 0 0 5px 0;
  font-size: 15px;
}

.entry-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-actions {
  display: flex;
  gap: 5px;
}

.timeline-content {
  padding: 20px;
}

.timeline-content > div {
  margin-bottom: 15px;
}

.timeline-content > div:last-child {
  margin-bottom: 0;
}

.work-description, .materials-used, .issues-reported {
  padding: 10px 15px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.work-description strong, .materials-used strong, .issues-reported strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.work-description p, .materials-used p, .issues-reported p {
  margin: 0;
}

.entry-photos {
  margin-top: 15px;
}

.entry-photos strong {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.timeline-footer {
  padding: 10px 15px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* Photo Upload Row */
.photo-upload-row {
  padding: 15px;
  margin-bottom: 15px;
  border: 1px dashed var(--border-color);
  border-radius: 6px;
}

.current-photo {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-photo img {
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.photo-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-primary);
}

.photo-wrapper {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}

.photo-wrapper img:hover {
  transform: scale(1.05);
}

.photo-type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  color: white;
}

.badge-before { background-color: #6c757d; }
.badge-during { background-color: #17a2b8; }
.badge-after { background-color: #28a745; }
.badge-issue { background-color: #dc3545; }
.badge-inspection { background-color: #ffc107; color: #333; }
.badge-material { background-color: #6f42c1; }

.photo-info {
  padding: 12px;
}

.photo-caption {
  font-size: 13px;
  margin: 0 0 5px 0;
  color: var(--text-primary);
}

.photo-location {
  margin: 0 0 8px 0;
  color: var(--text-muted);
}

.photo-meta {
  margin-bottom: 8px;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.lightbox img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}

.lightbox-caption {
  color: white;
  text-align: center;
  padding: 15px;
  font-size: 16px;
}

/* Sales Pipeline Styles */

/* Status Banner */
.status-banner {
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-banner .status-label {
  font-weight: 600;
}

.status-banner .status-value {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9em;
}

.status-banner.status-info {
  background-color: #e7f3ff;
  border-left: 4px solid var(--info);
  color: #0c5d9d;
}

.status-banner.status-warning {
  background-color: #fff8e6;
  border-left: 4px solid var(--warning);
  color: #856404;
}

.status-banner.status-success {
  background-color: #e6f4ea;
  border-left: 4px solid var(--success);
  color: #1e7e34;
}

.status-banner.status-danger {
  background-color: #fce8e8;
  border-left: 4px solid var(--danger);
  color: #c82333;
}

.status-banner.status-secondary {
  background-color: #f0f0f0;
  border-left: 4px solid #6c757d;
  color: #495057;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Detail List */
.detail-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 15px;
}

.detail-list dt {
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-list dd {
  color: var(--text-primary);
}

/* List Simple */
.list-simple {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-simple li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.list-simple li:last-child {
  border-bottom: none;
}

.list-simple li a {
  display: block;
}

.list-item-danger {
  border-left: 3px solid var(--danger);
  padding-left: 10px;
  margin-left: -10px;
}

/* Section Title */
.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* Stat Card Variants */
.stat-card-success {
  border-left-color: var(--success);
}

.stat-card-success .stat-value {
  color: var(--success);
}

.stat-card-warning {
  border-left-color: var(--warning);
}

.stat-card-warning .stat-value {
  color: #856404;
}

.stat-card-danger {
  border-left-color: var(--danger);
}

.stat-card-danger .stat-value {
  color: var(--danger);
}

/* Lead Summary */
.lead-summary {
  background: #f8f9fa;
  padding: 12px 15px;
  border-radius: 4px;
  font-size: 14px;
}

/* Form Section */
.form-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
  border-bottom: none;
}

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

/* Form Help Text */
.form-help {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Alert (shadcn soft style) */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border-left: 4px solid transparent;
  font-size: 14px;
}

.alert-info {
  background-color: hsl(217 91% 60% / 0.08);
  border-left-color: hsl(var(--sh-info));
  color: hsl(217 72% 32%);
}

.alert-success {
  background-color: hsl(142 71% 45% / 0.08);
  border-left-color: hsl(var(--sh-success));
  color: hsl(142 60% 24%);
}

.alert-warning {
  background-color: hsl(38 92% 50% / 0.1);
  border-left-color: hsl(var(--sh-warning));
  color: hsl(38 75% 28%);
}

.alert-danger,
.alert-error {
  background-color: hsl(0 84% 60% / 0.08);
  border-left-color: hsl(var(--sh-destructive));
  color: hsl(0 72% 34%);
}

/* Text Utilities */
.text-danger {
  color: var(--danger) !important;
}

.text-link {
  color: var(--info);
  font-size: 13px;
}

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

/* Flex Utilities */
.d-flex {
  display: flex;
}

.d-inline {
  display: inline;
}

.gap-2 {
  gap: 10px;
}

.mb-3 {
  margin-bottom: 15px;
}

/* Form Error */
.form-error {
  color: var(--danger);
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }

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

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

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

  .content-area {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .cost-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

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

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

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

  .detail-list dt {
    margin-bottom: 0;
  }

  .detail-list dd {
    margin-bottom: 10px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header h1 {
    font-size: 22px;
  }
}
