* {
  box-sizing: border-box;
}

:root {
  --brand-dark: #1f4f41;
  --brand: #2f7a62;
  --brand-accent: #3bbf8a;
  --brand-ink: #0f2a22;
  --brand-muted: #d7efe5;
  --surface: #f4fbf7;
  --text: #1f2a37;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--brand-dark);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  transition: width 0.2s ease;
}

body.sidebar-collapsed .sidebar {
  width: 80px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.sidebar-header button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #f8fafc;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  max-width: 170px;
  height: auto;
  display: block;
}

body.sidebar-collapsed .brand {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tab-button {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.tab-button.active,
.tab-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

body.sidebar-collapsed .tab-button {
  font-size: 0;
  padding: 10px;
}

body.sidebar-collapsed .tab-button::after {
  content: "•";
  font-size: 18px;
  color: #e2e8f0;
}

.sidebar-footer button {
  width: 100%;
  background: var(--brand-accent);
  color: var(--brand-ink);
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.top-bar {
  padding: 24px 32px 8px;
}

.top-bar h1 {
  margin: 0;
  font-size: 28px;
}

.top-bar p {
  margin: 6px 0 0;
  color: #64748b;
}

.panel {
  display: none;
  padding: 16px 32px 40px;
}

.panel.active {
  display: block;
}

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

.panel-actions {
  display: flex;
  justify-content: flex-end;
}

.bottom-actions {
  justify-content: center;
}

.bottom-actions button {
  min-width: 180px;
}

.person-form-card {
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.person-form-card h2 {
  font-size: 20px;
}

.person-form-card .button-row {
  justify-content: flex-end;
}

.equipment-form-card {
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.equipment-form-card h2 {
  font-size: 20px;
}

.equipment-form-card .button-row {
  justify-content: flex-end;
}

.is-hidden {
  display: none !important;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.span-2 {
  grid-column: span 2;
}

h2 {
  margin: 0;
  font-size: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  color: #475569;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

input,
select,
textarea {
  border: 1px solid #d1d9e6;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

button {
  border: none;
  background: var(--brand);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: #e2e8f0;
  color: #1f2a37;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.job-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.job-card.status-not_started {
  background: #fee2e2;
  border-color: #fecaca;
}

.job-card.status-in_process {
  background: #fef3c7;
  border-color: #fde68a;
}

.job-card.status-completed {
  background: #dcfce7;
  border-color: #bbf7d0;
}

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

.job-card h4 {
  margin: 0;
}

.subtle {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-pill.not_started {
  background: #e2e8f0;
  color: #475569;
}

.status-pill.in_process {
  background: #fde68a;
  color: #92400e;
}

.status-pill.completed {
  background: #bbf7d0;
  color: #15803d;
}

.job-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}

.job-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.job-actions button {
  flex: 1 1 110px;
  background: var(--brand);
}

.job-actions button:last-of-type {
  background: var(--brand-accent);
}

.job-actions select {
  flex: 1 1 120px;
}

.small-btn {
  font-size: 12px;
  padding: 8px 10px;
}

.job-assigned {
  background: white;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  color: #334155;
}

.assigned-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.assigned-group:last-child {
  margin-bottom: 0;
}

.assigned-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assigned-actions {
  display: flex;
  gap: 6px;
}

.tiny-btn {
  font-size: 11px;
  padding: 4px 8px;
  background: #0f172a;
}

.assigned-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f1f5f9;
}

.assigned-row-actions {
  display: flex;
  gap: 6px;
}


.job-quick-assign {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inline-controls {
  display: flex;
  gap: 8px;
}

.inline-controls select {
  flex: 1;
}

.inline-controls button {
  background: #1d4ed8;
  padding: 8px 12px;
}

.job-assigned strong {
  display: block;
  margin-bottom: 6px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-row {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-row-actions {
  display: flex;
  gap: 8px;
}

.list-row-actions button {
  padding: 6px 10px;
  font-size: 12px;
  background: #0f172a;
}

.list-row-actions button.delete {
  background: #ef4444;
}

.list-item span {
  font-size: 12px;
  color: #64748b;
}

.report {
  margin-top: 14px;
  background: var(--brand-dark);
  color: #f8fafc;
  border-radius: 16px;
  padding: 16px;
  min-height: 120px;
}

.report h3,
.report h4 {
  margin: 0 0 10px;
}

.report p {
  margin: 6px 0;
}

.report table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.report th,
.report td {
  border-bottom: 1px solid rgba(248, 250, 252, 0.2);
  padding: 6px 4px;
  text-align: left;
}

.report th {
  color: #bae6fd;
}

.report input[type="number"] {
  width: 100%;
  max-width: 110px;
  background: rgba(248, 250, 252, 0.1);
  border: 1px solid rgba(248, 250, 252, 0.3);
  color: #f8fafc;
  padding: 4px 6px;
  border-radius: 8px;
}

.report-job-block {
  border-bottom: 1px solid rgba(248, 250, 252, 0.2);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  body.sidebar-collapsed .sidebar {
    width: 100%;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  body.sidebar-collapsed .tab-button {
    font-size: 14px;
  }

  body.sidebar-collapsed .tab-button::after {
    content: "";
  }

  .panel {
    padding: 16px 20px 40px;
  }

  .span-2 {
    grid-column: auto;
  }
}
