/* ============================================================
   FIELDWORK TRACKER — Modern Minimalist Theme
   Colors preserved: #012c56 (dark navy), #3498db (blue), 
   #1b6ec2 / #1861ac (primary blue), #0077cc (link blue)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* -- Reset & Base -- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
  html {
    font-size: 14px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 72px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  color: #1a2535;
  background-color: #f5f7fa;
  letter-spacing: -0.01em;
}

/* -- Typography -- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #0d1f35;
}

a {
  color: #0077cc;
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: #005fa3;
  opacity: 0.85;
}

/* -- Navbar -- */
.navbar {
  padding: 0 1.25rem;
  height: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 1px 12px rgba(1, 44, 86, 0.18) !important;
}

.navbar-brand {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: #fff !important;
  opacity: 1;
  white-space: normal;
  word-break: break-all;
  text-align: center;
  padding: 0;
}

.navbar-brand::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #3498db;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  margin-bottom: 2px;
}

.nav-link {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 0.45rem 0.85rem !important;
  border-radius: 6px;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.nav-link:hover {
  background: rgba(255,255,255,0.1);
  opacity: 1;
}

.navbar-toggler {
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.4);
}

/* -- Main container -- */
.container[style*="max-width:100%"],
.container[style*="max-width: 100%"] {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

main[role="main"] {
  padding-top: 0.5rem;
}

/* -- Footer -- */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
  font-size: 0.8rem;
  color: #6c7a8d;
  border-top: 1px solid #e8ecf0 !important;
  background: #f5f7fa;
}

/* -- Borders -- */
.border-top {
  border-top: 1px solid #e8ecf0 !important;
}

.border-bottom {
  border-bottom: 1px solid #e8ecf0 !important;
}

.box-shadow {
  box-shadow: 0 1px 12px rgba(1, 44, 86, 0.1);
}

/* -- Horizontal Rules -- */
hr {
  border: none;
  border-top: 1px solid #e8ecf0;
  margin: 1rem 0;
  opacity: 1;
}

/* -- Buttons -- */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;       /* up from 0.8125rem */
  letter-spacing: -0.01em;
  border-radius: 7px;
  padding: 0.3rem 0.8rem;  /* reduced from 0.45rem 1rem to keep overall size the same */
  transition: all 0.15s ease;
  border-width: 1px;
  line-height: 1.5;
}

.btn-primary {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
  box-shadow: 0 1px 3px rgba(27, 110, 194, 0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-primary:hover {
  background-color: #1560ad;
  border-color: #1357a0;
  box-shadow: 0 2px 6px rgba(27, 110, 194, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-secondary {
  color: #3d5168;
  background-color: #edf0f5;
  border-color: #dde2ea;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.btn-secondary:hover {
  background-color: #e2e7ef;
  border-color: #d0d7e2;
  color: #2b3a4d;
  transform: translateY(-1px);
}

.btn-danger {
  border-radius: 7px;
  font-weight: 500;
  font-size: 0.8125rem;
}

.btn-group-sm .btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 5px;
}

/* Focus states */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.22);
  outline: none;
}

/* -- Form Controls -- */
.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #4a5568;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.form-control,
.form-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: #1a2535;
  background-color: #fff;
  border: 1px solid #dde2ea;
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  height: auto;
}

.form-control:focus,
.form-select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-control[readonly] {
  background-color: #f7f9fc;
  color: #5a6a7e;
  border-color: #e8ecf0;
  cursor: default;
  font-size: 0.975rem;  /* larger than default 0.875rem for fields above the grid */
}

.form-control:disabled,
.form-select:disabled {
  background-color: #e9ecef !important;
  color: #4b5b70 !important;
  border-color: #cfd8e3 !important;
  cursor: not-allowed !important;
  font-size: 0.975rem;
  opacity: 1 !important;
  -webkit-text-fill-color: #4b5b70 !important;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.input-group-text {
  background-color: #f0f4f8;
  border: 1px solid #dde2ea;
  border-radius: 0 7px 7px 0;
  color: #5a6a7e;
  font-size: 0.875rem;
}

.input-group .form-control {
  border-radius: 7px 0 0 7px;
}

/* -- Checkboxes -- */
.form-check-input {
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  border: 1.5px solid #bcc5d3;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.form-check-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #2d3f54;
  cursor: pointer;
  padding-left: 0.25rem;
}

/* -- Validation -- */
.text-danger {
  font-size: 0.76rem;
  font-weight: 500;
  margin-top: 0.2rem;
  display: block;
}

[asp-validation-summary] .text-danger,
.validation-summary-errors {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 7px;
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* -- Tables (DataTables) -- */
table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0;
  width: 100% !important;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.825rem;
}

table.dataTable thead th {
  color: #fff;
  background-color: #012c56 !important;
  border-color: #012c56 !important;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 0.6rem;
  border-bottom: none !important;
  white-space: normal;
}

table.dataTable thead {
  border-top-color: #012c56;
}

table.dataTable thead th:first-child {
  border-radius: 0;
}

table.dataTable thead th:last-child {
  border-radius: 0;
}

table.dataTable tbody tr {
  transition: background 0.1s ease;
}

table.dataTable tbody tr:hover {
  background-color: #f0f5fb !important;
}

table.dataTable tbody td {
  padding: 0.5rem 0.6rem;
  vertical-align: middle;
  border-color: #edf0f5 !important;
  color: #2d3f54;
  font-size: 0.8rem;
}

table.dataTable.table-striped tbody tr:nth-of-type(odd) {
  background-color: #fafbfd;
}

/* DataTables controls */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input,
.dt-length select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  border: 1px solid #dde2ea;
  border-radius: 6px;
  padding: 0.3rem 1.8rem 0.3rem 0.6rem;
  color: #2d3f54;
  min-width: 70px;
  width: auto;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 14px 10px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.12);
  outline: none;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  font-size: 0.8rem;
  color: #6c7a8d;
}

/* Hide pagination buttons and "X entries per page" selector —
   the Fieldworks grid averages 30 rows and doesn't need paging */
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_length {
  display: none !important;
}

/* Action column: hide the plain-text "|" separators rendered between icons.
   Icons are <a> or <button> elements; bare text nodes between them are
   targeted by making the cell overflow hidden and spacing icons via gap instead. */
#Fieldworks td:last-child,
#Fieldworks tbody td.dt-actions {
  white-space: nowrap;
}

/* Space out action icons cleanly without a separator character */
#Fieldworks td:last-child a,
#Fieldworks td:last-child button,
#Fieldworks tbody td.dt-actions a,
#Fieldworks tbody td.dt-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 3px;
  vertical-align: middle;
}

/* Hide bare "|" text separators — rendered as text nodes between icon links.
   We achieve this by making the cell a flex container so only element children
   are laid out; text nodes (the "|") become invisible. */
#Fieldworks td:last-child,
#Fieldworks tbody td.dt-actions {
  display: table-cell; /* keep as table cell */
}

/* Wrap icon anchors in a flex span via a CSS trick:
   color the cell text transparent so "|" chars disappear,
   then restore color on actual child elements */
#Fieldworks td:last-child,
#Fieldworks tbody td.dt-actions {
  color: transparent;     /* hides bare "|" text nodes */
  font-size: 0;           /* belt-and-suspenders: zero font collapses text nodes */
}

#Fieldworks td:last-child a,
#Fieldworks td:last-child button,
#Fieldworks td:last-child span,
#Fieldworks tbody td.dt-actions a,
#Fieldworks tbody td.dt-actions button,
#Fieldworks tbody td.dt-actions span {
  font-size: 0.875rem;    /* restore readable size for actual icon elements */
  color: revert;          /* restore color for icon elements */
}

/* -- Cards -- */
.card {
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(1, 44, 86, 0.06);
  transition: box-shadow 0.2s ease;
  background: #fff;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(1, 44, 86, 0.1);
}

.card-body {
  padding: 1.1rem 1.25rem;
}

/* -- Badges -- */
.badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3em 0.6em;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

/* -- Modals -- */
.modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(1, 44, 86, 0.18);
  overflow: hidden;
}

.modal-header {
  background: #f7f9fc;
  border-bottom: 1px solid #e8ecf0;
  padding: 1rem 1.4rem;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0d1f35;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 1.2rem 1.4rem;
  font-size: 0.875rem;
  color: #3d5168;
}

.modal-footer {
  padding: 0.85rem 1.4rem;
  border-top: 1px solid #e8ecf0;
  background: #f7f9fc;
  gap: 0.5rem;
}

.btn-close {
  opacity: 0.5;
  transition: opacity 0.15s;
}

.btn-close:hover {
  opacity: 0.85;
}

/* -- Dropdowns -- */
.dropdown-menu {
  border: 1px solid #e8ecf0;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(1, 44, 86, 0.12);
  padding: 0.35rem;
  font-size: 0.85rem;
}

.dropdown-item {
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  color: #2d3f54;
  font-weight: 500;
  transition: background 0.12s ease;
}

.dropdown-item:hover {
  background: #f0f5fb;
  color: #1b6ec2;
}

.dropdown-toggle.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* -- Nav pills -- */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

/* -- Page headings -- */
h5.fw-bold {
  font-size: 1rem;
  font-weight: 600;
  color: #0d1f35;
  letter-spacing: -0.03em;
}

/* -- Background utility -- */
.bg-darkblue {
  background-color: #012c56 !important;
}

/* -- Icon colors -- */
.edit-icon,
.view-icon {
  color: #1b6ec2;
  transition: opacity 0.15s;
}

.edit-icon:hover,
.view-icon:hover {
  opacity: 0.7;
}

.delete-icon {
  color: #dc3545;
  transition: opacity 0.15s;
}

.delete-icon:hover {
  opacity: 0.7;
}

/* -- "Total cumulative hrs" label — same size as the h5 heading beside it -- */
.cumulative-hrs-label {
  font-size: 1rem;      /* matches h5.fw-bold */
  font-weight: 600;
  color: #0d1f35;
  letter-spacing: -0.03em;
}

/* -- Image & Signature containers -- */
.image-container {
  border: 1.5px solid #3498db;
  display: inline-block;
  background: #f8f9fa;
  border-radius: 8px;
}

.signature-container {
  border: 1.5px solid #3498db;
  display: inline-flex;
  background: #f8fbff;
  border-radius: 8px;
  width: 100%;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  padding: 4px;
  margin: 0 auto;
  transition: border-color 0.15s;
}

.signature-container:hover {
  border-color: #1b6ec2;
}

.signature-container.signature-box {
  min-height: 120px;
  max-width: 100%;
}

.signature-image {
  max-width: 100%;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.signature-container.signature-box .signature-image {
  max-height: 90px;
}

.signature-prompt {
  position: absolute;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(13, 110, 253, 0.1);
  border: 1px solid rgba(13, 110, 253, 0.3);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.signature-prompt:hover {
  background: rgba(13, 110, 253, 0.2);
  border-color: rgba(13, 110, 253, 0.5);
}

.signature-container {
  position: relative;
}

/* -- Filters section -- */
.container.ms-0.p-0 .form-label {
  font-size: 0.75rem;
}

/* -- Accept policy button -- */
button.accept-policy {
  font-size: 1rem;
  line-height: inherit;
}

/* -- Scrollbar (webkit) -- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c8d0db;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9aa6b5;
}

/* -- Table responsive wrapper -- */
.table-responsive {
  border-radius: 10px;
  overflow-x: auto;   /* never 'hidden' — that clips columns on wide tables */
  overflow-y: visible;
  border: 1px solid #e8ecf0;
  -webkit-overflow-scrolling: touch;
}

/* -- Fieldwork grid section — no extra padding around the table -- */
.mf-fieldwork-section {
  font-size: 11px;
}

/* DataTables inline editing inputs - fit within column width */
.mf-fieldwork-section .dt-input {
  max-width: 100%;
  width: 100%;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem 0.25rem 0.3rem;
}

.mf-fieldwork-section input[type="time"],
.mf-fieldwork-section input[type="date"] {
  font-size: 0.75rem;
  padding-right: 0.5rem;
}

.mf-fieldwork-section input[type="number"] {
  padding-right: 0.4rem;
}

.mf-fieldwork-section select.dt-input {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem 0.2rem 0.3rem;
}

.mf-fieldwork-section .dt-input:disabled,
.mf-fieldwork-section input.dt-input:disabled,
.mf-fieldwork-section select.dt-input:disabled {
  background-color: #e6ebf2 !important;
  color: #4b5b70 !important;
  border-color: #cfd8e3 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  -webkit-text-fill-color: #4b5b70 !important;
}

.mf-fieldwork-section .dt-checkbox-container {
  display: flex;
  justify-content: center;
}


.mf-fieldwork-section .dt-checkbox-container input {
  width: 14px;
  height: 14px;
}

.mf-fieldwork-section .table-responsive {
  margin: 0;
  padding: 0;
  border-radius: 8px;
}

.mf-fieldwork-section table.dataTable {
  table-layout: fixed;
  width: 100% !important;
}

@media (max-width: 991px) {
  .mf-fieldwork-section table.dataTable {
    table-layout: auto !important;
    width: auto !important;
    min-width: 1400px !important;
  }
}

.mf-fieldwork-section table.dataTable td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-fieldwork-section table.dataTable thead th {
  font-size: 0.66rem;
}

.mf-fieldwork-section table.dataTable td.editing {
  overflow: visible;
  white-space: normal;
}

/* -- Toastr overrides -- */
#toast-container > div {
  border-radius: 10px !important;
  box-shadow: 0 6px 24px rgba(1, 44, 86, 0.14) !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.85rem !important;
  padding: 12px 16px 12px 48px !important;
}

/* -- DataTables scrollbars -- */
.dt-scroll-body::-webkit-scrollbar,
.dataTables_scrollBody::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.dt-scroll-body::-webkit-scrollbar-track,
.dataTables_scrollBody::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

.dt-scroll-body::-webkit-scrollbar-thumb,
.dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 6px;
}

.dt-scroll-body::-webkit-scrollbar-thumb:hover,
.dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.dt-scroll-body,
.dataTables_scrollBody {
  scrollbar-width: auto;
  scrollbar-color: #888 #f1f1f1;
}

.month-year-picker {
    text-transform: capitalize;
}
