@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

:root {
  --bg-page: #f2f6f4;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8faf9;
  --text-main: #13221c;
  --text-muted: #5a6e65;
  --text-dim: #889c93;
  --border-light: #dde6e1;
  --border-hover: #b5c7bd;
  
  --primary: #0f6b4f;
  --primary-hover: #0b543d;
  --primary-light: #e8f5ef;
  --primary-glow: rgba(15, 107, 79, 0.15);

  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-blue: #2563eb;
  --accent-blue-light: #eff6ff;
  --accent-red: #dc2626;
  --accent-red-light: #fee2e2;
  --accent-green: #10b981;
  --accent-green-light: #ecfdf5;

  --shadow-sm: 0 1px 2px 0 rgba(19, 34, 28, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(19, 34, 28, 0.06), 0 2px 6px -1px rgba(19, 34, 28, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(19, 34, 28, 0.1), 0 4px 12px -2px rgba(19, 34, 28, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header & Navigation */
header.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #15805d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.brand-title-wrap h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

nav.main-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-card-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

nav.main-nav a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
}

nav.main-nav a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

nav.main-nav a.active {
  color: var(--primary);
  background: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-main);
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.user-role-tag {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--border-light);
  color: var(--text-muted);
}

.role-admin { background: #fef3c7; color: #b45309; }
.role-manager { background: #e0e7ff; color: #4338ca; }
.role-engineer { background: #e8f5ef; color: #0f6b4f; }

/* Main Container */
main.main-content {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.section-header p.subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Metric KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.kpi-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.kpi-card.urgent {
  border-left: 4px solid var(--accent-red);
}
.kpi-card.active-state {
  border-left: 4px solid var(--primary);
}
.kpi-card.warning {
  border-left: 4px solid var(--accent-amber);
}

/* Tables & Wrappers */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-header-bar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-header-bar h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

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

table.data-table th {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

table.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

table.data-table tbody tr {
  transition: var(--transition);
}

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

table.data-table tbody tr:hover td {
  background-color: #fafcfb;
}

table.data-table tbody tr.clickable-row {
  cursor: pointer;
}

table.data-table tbody tr.clickable-row:hover td {
  background-color: #f1f7f4;
}

table.data-table tbody tr.row-overdue td {
  background-color: rgba(220, 38, 38, 0.04);
}

/* Status & Priority Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-planning { background: #eff6ff; color: #2563eb; }
.status-active { background: #ecfdf5; color: #059669; }
.status-on-hold { background: #fef3c7; color: #d97706; }
.status-done { background: #f1f5f9; color: #475569; }

.status-todo { background: #f1f5f9; color: #64748b; }
.status-in-progress { background: #eff6ff; color: #2563eb; }
.status-blocked { background: #fee2e2; color: #dc2626; }

.priority-low { background: #f1f5f9; color: #64748b; }
.priority-medium { background: #fef3c7; color: #b45309; }
.priority-high { background: #ffedd5; color: #c2410c; }
.priority-critical { background: #fee2e2; color: #b91c1c; font-weight: 700; }

/* Progress Bar */
.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 44px;
}

/* Forms, Inputs & Selects */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  transition: var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select {
  cursor: pointer;
  padding-right: 28px;
}

/* Inline Table Edit Selects */
table select {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
}

table select:hover {
  background: #ffffff;
  border-color: var(--border-light);
}

table select:focus {
  background: #ffffff;
  border-color: var(--primary);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-card-subtle);
  border-color: var(--border-hover);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

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

/* Modal Window */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 34, 28, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast Notifications */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(40px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
  pointer-events: none;
}

#toast.visible {
  transform: translateY(0);
  opacity: 1;
}

#toast.toast-error {
  background: var(--accent-red);
}

/* Card Grids */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 860px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Standup Log Box */
.standup-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.standup-form-grid {
  display: grid;
  grid-template-columns: 200px 1fr 100px auto;
  gap: 10px;
  align-items: center;
}

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

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

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-state h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
  max-width: 380px;
  margin: 0 auto;
}

/* Project Detail Header */
.project-detail-hero {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-top h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-tag {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.hero-meta-item strong {
  color: var(--text-main);
}

/* Engineer Member Chips */
.member-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.member-chip:hover {
  border-color: var(--border-hover);
}

.member-chip.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.member-chip input[type="checkbox"] {
  display: none;
}

/* Authentication Banner if not signed in */
.auth-notice-card {
  max-width: 600px;
  margin: 60px auto;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  text-align: center;
}

.auth-notice-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 26px;
}

.auth-notice-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  margin-bottom: 8px;
}

.auth-notice-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.auth-steps {
  text-align: left;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.auth-steps ol {
  padding-left: 20px;
}

/* Marketing Module Sub-Navigation & Styles */
.sub-nav {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sub-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.sub-nav a:hover {
  color: var(--text-main);
  background: var(--bg-card-subtle);
}

.sub-nav a.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.today-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 6px solid #b3622b;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.today-banner-tag {
  font-size: 12px;
  font-weight: 600;
  color: #b3622b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.today-banner-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.today-banner-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-del {
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-del:hover {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border-color: #fca5a5;
}

table input.in-table,
table select.in-table,
table textarea.in-table {
  width: 100%;
  font-size: 12px;
  padding: 5px 7px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: #ffffff;
}

table textarea.in-table {
  resize: vertical;
  min-height: 48px;
}

table input.in-table:focus,
table select.in-table:focus,
table textarea.in-table:focus {
  border-color: var(--primary);
}

