﻿:root {
  --bg: #f6f3ee;
  --ink: #1f1c16;
  --accent: #2f5d50;
  --card: #ffffff;
  --border: #e4ddd3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-top: 64px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background: linear-gradient(120deg, #f6f3ee 0%, #efe7db 100%);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: #1f2b25;
  color: #f4f4f4;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.4px;
}

.nav a {
  color: #f4f4f4;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}

.container {
  max-width: 1900px;
  margin: 24px auto;
  padding: 0 20px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(31, 28, 22, 0.08);
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric {
  font-size: 32px;
  font-weight: 700;
}

.label {
  margin-top: 6px;
  color: #575046;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.btn {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: #5a534a;
  font-weight: 600;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .nav a {
    margin-left: 0;
    margin-right: 12px;
  }
}

.h2 { font-size: 22px; margin: 0; }
.h3 { font-size: 18px; margin: 0 0 12px; }
.muted { color: #6e6559; margin-top: 6px; }

.header-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.field input,
.field select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

.nav a.active {
  color: #ffffff;
  font-weight: 700;
  border-bottom: 2px solid #ffffff;
  padding-bottom: 4px;
}


.employees-card { width: 100%; max-width: none; }
.employees-table { table-layout: fixed; width: 100%; min-width: 1100px; }
.employees-table th:nth-child(1), .employees-table td:nth-child(1) { width: 50px; }
.employees-table th:nth-child(2), .employees-table td:nth-child(2) { width: 160px; }
.employees-table th:nth-child(3), .employees-table td:nth-child(3) { width: 140px; }
.employees-table th:nth-child(4), .employees-table td:nth-child(4) { width: 150px; }
.employees-table th:nth-child(5), .employees-table td:nth-child(5) { width: 140px; }
.employees-table th:nth-child(6), .employees-table td:nth-child(6) { width: 120px; }
.employees-table th:nth-child(7), .employees-table td:nth-child(7) { width: 110px; }
.employees-table th:nth-child(8), .employees-table td:nth-child(8) { width: 90px; }
.employees-table th:nth-child(9), .employees-table td:nth-child(9) { width: 190px; }
.employees-table .actions-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.employees-table .actions-cell .btn { width: 160px; }
.employees-table .actions-cell form { margin: 0; }

/* Calendar / timesheet styles */
.calendar.compact {
  display: inline-table;
  width: auto;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}
.calendar.compact th,
.calendar.compact td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: center;
}
.calendar.compact th {
  background: #ffffff;
  font-weight: 700;
}
.calendar.compact .date,
.calendar.compact .weekday {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: left;
}
.calendar.compact th.emp,
.calendar.compact td.cell {
  min-width: 120px;
}
.calendar.compact td.dayoff,
.calendar.compact .dayoff-pill {
  background: #f7d6d6;
}
.cell-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #1f1c16;
  white-space: nowrap;
}
.cell-pill.empty {
  background: transparent;
  border: 1px dashed #e2d6ca;
  min-width: 60px;
}
.legend.objects {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 12px;
  font-size: 13px;
}
.legend.objects .box {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 6px;
}
.cell-resp { font-size: 11px; color: #333; margin-top: 4px; white-space: nowrap; }

.map { height: 380px; border-radius: 12px; border: 1px solid var(--border); }
.map-tools { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }

/* Tasks progress UI */
.tasks-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.summary-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff7ef;
}
.summary-card.highlight {
  background: #f2fff7;
  border-color: #cfe9d8;
}
.summary-card.warning {
  background: #fff1f1;
  border-color: #f1c4c4;
}
.summary-label {
  font-size: 12px;
  color: #6e6559;
}
.summary-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
}
.tasks-controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 10px 0 6px;
}
.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #f0e6da;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: #e35d5b;
}
.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: #5a534a;
}
.row-problem { background: #fff1f1; }
.row-ok { background: #fff7ec; }
.row-good { background: #f2fff7; }
.row-no-total { background: #f6f3ee; }
.table.tasks-fixed { table-layout: fixed; }
.table.tasks-fixed th, .table.tasks-fixed td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table.tasks-fixed th:nth-child(1), .table.tasks-fixed td:nth-child(1) { width: 36%; }
.table.tasks-fixed th:nth-child(2), .table.tasks-fixed td:nth-child(2) { width: 10%; }
.table.tasks-fixed th:nth-child(3), .table.tasks-fixed td:nth-child(3) { width: 12%; }
.table.tasks-fixed th:nth-child(4), .table.tasks-fixed td:nth-child(4) { width: 14%; }
.table.tasks-fixed th:nth-child(5), .table.tasks-fixed td:nth-child(5) { width: 12%; }
.table.tasks-fixed th:nth-child(6), .table.tasks-fixed td:nth-child(6) { width: 12%; }


.edit-only { display: none; }
.view-only { display: inline; }
.edit-mode .view-only { display: none; }
.edit-mode .edit-only { display: block; }
.edit-mode th.edit-only,
.edit-mode td.edit-only { display: table-cell; }
.edit-mode .actions.edit-only { display: flex; }
.edit-mode .card.edit-only { display: block; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal.open { display: flex; }
.modal .modal-content {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  width: min(420px, 90vw);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.calendar.compact td.cell { cursor: pointer; }



.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 12px; }
.chart-card { background: #ffffff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 260px; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4f473d; }
.toggle input { transform: translateY(1px); }
.table-input { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }


.nav { display: flex; align-items: center; gap: 16px; }
.dropdown { position: relative; display: inline-flex; align-items: center; }
.dropbtn { color: #f4f4f4; font-size: 14px; cursor: pointer; padding-bottom: 4px; }
.dropdown-content { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: #1f2b25; border: 1px solid #2b3a33; border-radius: 10px; padding: 4px; min-width: 160px; width: max-content; box-shadow: 0 10px 24px rgba(0,0,0,0.2); z-index: 2000; }
.dropdown-content a { display: block; padding: 8px 10px; color: #f4f4f4; text-decoration: none; border-radius: 8px; }
.dropdown-content a:hover { background: rgba(255,255,255,0.08); }
.dropdown:hover .dropdown-content { display: block; }
.dropdown.active .dropbtn { font-weight: 700; border-bottom: 2px solid #ffffff; }


.calendar .date-col { min-width: 44px; text-align: center; }
.calendar .day-num { font-weight: 600; }
.calendar .day-week { font-size: 12px; color: #7b7266; }

.calendar.compact td.emp { min-width: 160px; text-align: left; font-weight: 600; }

/* Top nav alignment */
.nav { display: flex; align-items: center; gap: 16px; }
.nav a, .dropbtn { line-height: 1; display: inline-flex; align-items: center; height: 100%; }
.topbar { min-height: 56px; }

.dropdown-content { display: none; flex-direction: column; }

.dropdown:hover .dropdown-content { display: flex; }

.dropdown-content a { width: 100%; }

.dropdown-content { align-items: stretch; }

.dropdown-content a { padding: 8px 12px; border-radius: 8px; }
