:root {
  --tf-primary: #2a9d8f;
  --tf-primary-dark: #21807a;
  --tf-secondary: #4fc3d9;
  --tf-bg: #eef7f7;
  --tf-surface: #f7fbfb;
  --tf-border: #d3e9e8;
  --tf-text: #1f3d3b;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--tf-secondary);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  background-color: var(--tf-bg);
  color: var(--tf-text);
}

header .navbar {
  background-color: var(--tf-surface) !important;
  border-bottom: 1px solid var(--tf-border) !important;
}

.navbar-brand {
  color: var(--tf-primary-dark) !important;
  font-weight: 600;
}

.navbar-nav .nav-link {
  color: var(--tf-text) !important;
}

.navbar-nav .nav-link:hover {
  color: var(--tf-primary-dark) !important;
}

.tf-user-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--tf-secondary);
  border-radius: 999px;
  background-color: var(--tf-surface);
  color: #0d6efd !important;
  font-weight: 600;
}

.tf-nav-icon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.35rem;
  vertical-align: -0.15em;
}

.btn-primary {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--tf-primary-dark);
  border-color: var(--tf-primary-dark);
}

.btn-outline-primary {
  color: var(--tf-primary-dark);
  border-color: var(--tf-primary);
}

.btn-outline-primary:hover {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
}

.table {
  background-color: var(--tf-surface);
}

.card, .table, .form-control, .form-select {
  border-color: var(--tf-border);
}

footer.footer {
  background-color: var(--tf-surface);
  border-top: 1px solid var(--tf-border);
}

.btn-ms-signin {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background-color: #5e5e5e;
  color: #ffffff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0 0.9rem;
  height: 41px;
  border: 1px solid #8c8c8c;
  border-radius: 2px;
  line-height: 1;
}

.btn-ms-signin:hover {
  background-color: #4b4b4b;
  color: #ffffff;
}

.ms-logo {
  display: inline-grid;
  grid-template-columns: repeat(2, 9px);
  grid-template-rows: repeat(2, 9px);
  gap: 1px;
  width: 19px;
  height: 19px;
}

.ms-logo span:nth-child(1) { background-color: #f25022; }
.ms-logo span:nth-child(2) { background-color: #7fba00; }
.ms-logo span:nth-child(3) { background-color: #00a4ef; }
.ms-logo span:nth-child(4) { background-color: #ffb900; }

.hero {
  width: 98vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  min-height: calc(100vh - 130px);
  background-image: url("/images/timeflow-landing-hero.webp");
  background-size: cover;
  background-position: center;
  border-radius: 0.5rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Timesheet grid */
.tf-full-page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tf-full-page > header {
  flex: 0 0 auto;
}

.tf-page-content,
.tf-page-main,
.tf-timesheet-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
}

.tf-page-content {
  padding: 0 1rem 0.5rem;
}

.tf-timesheet-wrapper {
  width: 100%;
}

.tf-timesheet-wrapper > :not(#timesheet-grid) {
  flex: 0 0 auto;
}

.tf-timesheet-wrapper > p {
  margin-bottom: 0;
}

.tf-selettore-mese {
  font-size: 1.3rem;
  max-width: 260px;
  text-transform: capitalize;
  cursor: pointer;
  user-select: none;
}

#timesheet-grid {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--tf-border);
  background: var(--tf-surface);
}

.tf-grid {
  width: 100%;
  table-layout: fixed;
  font-size: 0.8rem;
  margin-bottom: 0;
}

.tf-grid thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 36px;
  white-space: normal;
  line-height: 1.1;
  background: #dcefed;
}

.tf-grid th.tf-day {
  padding: 0;
}

.tf-grid th.tf-day .tf-day-nome {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
}

.tf-grid th.tf-day .tf-day-numero {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
}

.tf-grid tbody tr {
  height: 32px;
}

.tf-grid th,
.tf-grid td {
  vertical-align: middle;
  padding: 2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.tf-grid thead th:nth-child(1),
.tf-grid thead th:nth-child(2) {
  width: 182px;
  text-align: left;
  background-color: #52697a;
  color: #f8f9fa;
  font-size: 0.95rem;
  font-weight: 700;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.tf-grid thead th:nth-child(3) {
  width: 260px;
  text-align: left;
  background-color: #52697a;
  color: #f8f9fa;
  font-size: 0.95rem;
  font-weight: 700;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.tf-grid tbody td:nth-child(1),
.tf-grid tbody td:nth-child(2) {
  width: 182px;
  text-align: left;
}

.tf-grid tbody td:nth-child(3) {
  width: 260px;
  text-align: left;
}

.tf-grid td:nth-child(1) input,
.tf-grid td:nth-child(2) input {
  font-weight: 700;
}

.tf-grid th.tf-totale-col,
.tf-grid td.tf-totale {
  width: 55px;
  font-weight: 700;
  text-align: center;
}

.tf-grid .tf-ore {
  text-align: center;
  padding: 0.1rem 0;
}

.tf-grid th.tf-weekend,
.tf-grid td.tf-weekend {
  background-color: #d6e9fb;
  border: 1px solid #a9c6dd;
}

.tf-grid tfoot .tf-footer-riga {
  height: 40px;
}

.tf-grid tfoot td {
  font-weight: 700;
}

.tf-grid tfoot .tf-footer-comandi {
  text-align: left;
  white-space: normal;
  background-color: var(--tf-surface);
}

.tf-grid tfoot .tf-footer-etichetta {
  background-color: #dcefed;
  color: var(--tf-text);
}

.tf-footer-giorni {
  display: inline-block;
  margin-right: 1.25rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--tf-border);
  border-radius: 0.35rem;
  background-color: #ffffff;
  font-weight: 600;
}

.tf-grid td.tf-totale,
.tf-grid tfoot .tf-totale-colonna,
.tf-grid tfoot .tf-totale-generale {
  background-color: #52697a;
  color: #f8f9fa;
  font-weight: 700;
  text-align: center;
  border: 1px solid #7d95a6;
}

.tf-grid tfoot .tf-footer-comandi .btn {
  white-space: nowrap;
}

.tf-grid th.tf-festivo,
.tf-grid td.tf-festivo {
  background-color: #fde2e2 !important;
}

.tf-grid input.form-control-sm {
  font-size: 0.8rem;
  padding: 0.15rem 0.35rem;
  width: 100%;
  min-width: 0;
  height: 27px;
  min-height: 0;
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.tf-grid input.form-control-sm:focus {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
  box-shadow: none;
}
