
/*
 * Alario Tech Timesheets
 * Version 4.0
 * Compact Weekly Timesheet Review
 */

/* ========================================
   GENERAL LAYOUT
======================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #f4f7fa;
  color: #203244;
  font-family: -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

main {
  max-width: 1600px;
  margin: 26px auto;
  padding: 0 20px;
}

.narrow {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  font-size: 29px;
  font-weight: 700;
  margin: 0 0 7px;
  color: #163c56;
}

h2 {
  font-size: 19px;
  font-weight: 650;
  margin: 0 0 14px;
  color: #203244;
}

h3 {
  font-size: 16px;
  margin: 12px 0;
}

p {
  margin: 9px 0;
}

.muted {
  color: #697787;
  font-size: 13px;
}

.small {
  font-size: 12px;
  line-height: 1.4;
}

footer {
  color: #697787;
  font-size: 12px;
  margin: 35px 0 25px;
  text-align: center;
}


/* ========================================
   HEADER
======================================== */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

header .muted {
  margin: 0;
}


/* ========================================
   CARDS
======================================== */

.card {
  background: #ffffff;
  border: 1px solid #dce4ec;
  border-radius: 12px;
  padding: 21px;
  margin: 16px 0;
  box-shadow: 0 2px 5px rgba(30, 52, 72, 0.025);
}

.card > p:first-of-type {
  margin-top: 4px;
}


/* ========================================
   BUTTONS
======================================== */

button,
.button {
  display: inline-block;
  background: #163c56;
  color: #ffffff;
  border: 1px solid #163c56;
  border-radius: 7px;
  padding: 9px 15px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover,
.button:hover {
  background: #245978;
  border-color: #245978;
}

button:focus-visible,
.button:focus-visible {
  outline: 3px solid #9bc4e1;
  outline-offset: 2px;
}

button:disabled {
  background: #9baab6;
  border-color: #9baab6;
  cursor: not-allowed;
}

button.light,
.button.light {
  background: #e7edf3;
  color: #163c56;
  border-color: #d6e0e9;
}

button.light:hover,
.button.light:hover {
  background: #dbe5ee;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.actions form {
  margin: 0;
}


/* ========================================
   FORM ELEMENTS
======================================== */

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin: 10px 0;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 13px;
  color: #203244;
  background: #ffffff;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 8px;
  max-width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #39799f;
  outline: 2px solid rgba(57, 121, 159, 0.15);
  outline-offset: 0;
}

textarea {
  display: block;
  width: 100%;
  resize: vertical;
  line-height: 1.4;
}

input[type="password"] {
  display: block;
  width: 100%;
  margin: 8px 0 18px;
}

input[type="checkbox"] {
  accent-color: #163c56;
  cursor: pointer;
}

select {
  cursor: pointer;
}

.notice {
  background: #eef4fa;
  border-left: 4px solid #39799f;
  border-radius: 6px;
  padding: 11px 14px;
  margin: 12px 0;
  color: #203244;
}


/* ========================================
   WEEKLY TIMESHEET SETTINGS
======================================== */

.week-settings {
  display: grid;
  grid-template-columns:
    minmax(230px, 1.6fr)
    minmax(180px, 1fr)
    minmax(110px, 0.5fr);
  gap: 15px;
  align-items: end;
  max-width: 850px;
  margin: 8px 0 16px;
}

.week-settings label {
  margin: 0;
}

.week-settings select,
.week-settings input {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 37px;
}

.week-settings input[name="year"] {
  max-width: 125px;
}

textarea[name="notes"] {
  margin: 8px 0 13px;
  font-size: 13px;
}


/* ========================================
   COMPACT TIMESHEET TABLE
======================================== */

.table-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 12px;
}

.review-table {
  width: 100%;
  min-width: 1320px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.review-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eaf0f6;
  color: #334c61;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 7px;
  border-bottom: 2px solid #ccd8e3;
}

.review-table tbody td {
  padding: 7px;
  vertical-align: top;
  border-bottom: 1px solid #e4ebf1;
}

.review-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.review-table tbody tr:hover {
  background: #f0f6fb;
}

/* Column widths */

.review-table th:nth-child(1) {
  width: 132px;
}

.review-table th:nth-child(2) {
  width: 160px;
}

.review-table th:nth-child(3) {
  width: 225px;
}

.review-table th:nth-child(4) {
  width: 66px;
}

.review-table th:nth-child(5) {
  width: 175px;
}

.review-table th:nth-child(6) {
  width: auto;
}

.review-table th:nth-child(7) {
  width: 158px;
}

.review-table th:nth-child(8) {
  width: 140px;
}

/* Inputs inside rows */

.review-table input[type="date"] {
  width: 100%;
  padding: 6px 3px;
  font-size: 12px;
}

.review-table input[type="search"],
.review-table input[type="number"],
.review-table select {
  width: 100%;
  min-width: 0;
  padding: 6px;
  font-size: 12px;
}

.review-table textarea {
  width: 100%;
  min-height: 43px;
  margin: 0;
  padding: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.review-table .minutes {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.review-table td strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.review-table td {
  overflow-wrap: anywhere;
}


/* ========================================
   CUSTOMER SEARCH
======================================== */

.customer-picker {
  position: relative;
  width: 100%;
}

.customer-search {
  width: 100%;
}

.customer-results {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  width: max(100%, 265px);
  max-width: 380px;
  max-height: 240px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #bdcbd8;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(22, 60, 86, 0.18);
  z-index: 20;
}

.customer-results[hidden] {
  display: none;
}

.customer-choice {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  border-radius: 0;
  background: #ffffff;
  color: #203244;
  padding: 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}

.customer-choice:hover,
.customer-choice:focus {
  background: #eaf2f8;
  color: #163c56;
}

.customer-results p {
  font-size: 12px;
  margin: 0;
  padding: 10px;
}

.match-status {
  display: inline-block;
  color: #687c8c;
  font-size: 11px;
  margin-top: 5px;
  text-transform: capitalize;
}


/* ========================================
   CHECKBOXES AND ROW OPTIONS
======================================== */

.inline {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  margin: 6px 0;
  cursor: pointer;
}

.inline input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.review-table td:last-child {
  font-size: 11px;
}


/* ========================================
   DUPLICATE WARNINGS
======================================== */

.warning {
  display: inline-block;
  background: #fff4d9;
  color: #8a5700;
  border: 1px solid #f2d58c;
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.clear {
  display: inline-block;
  color: #28764c;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 0;
}

.review-table details {
  margin: 7px 0;
}

.review-table details summary {
  font-size: 11px;
}

.review-table details .small {
  background: #fff9e9;
  padding: 7px;
  margin: 5px 0;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.review-table select[name^="duplicate_action_"] {
  margin-top: 7px;
  width: 100%;
  background: #fffdf7;
}


/* ========================================
   EXPANDABLE SECTIONS
======================================== */

details {
  margin: 12px 0;
}

summary {
  cursor: pointer;
  color: #163c56;
  font-weight: 600;
  font-size: 13px;
}

summary:hover {
  text-decoration: underline;
}

details[open] > summary {
  margin-bottom: 10px;
}

details ul {
  padding-left: 23px;
}

details li {
  margin: 7px 0;
  line-height: 1.5;
}


/* ========================================
   SAVE DRAFT
======================================== */

.save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid #e1e9f0;
}


/* ========================================
   UPLOAD PREPARATION
======================================== */

.card form[action$="prepare-submission"] {
  margin-top: 15px;
}

.card form[action$="prepare-submission"] button {
  background: #163c56;
}


/* ========================================
   FINAL APPROVAL AND SUBMISSION
======================================== */

.card form[action$="authorize-submission"] {
  margin-top: 15px;
  padding: 15px;
  background: #f5f8fb;
  border: 1px solid #dce4ec;
  border-radius: 8px;
}

.card form[action$="authorize-submission"] label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 13px;
}

.card form[action$="authorize-submission"] input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

#send-approved {
  background: #176344;
  border-color: #176344;
  font-size: 14px;
  padding: 11px 17px;
}

#send-approved:hover {
  background: #217b55;
  border-color: #217b55;
}

#upload-progress {
  margin: 13px 0;
  padding: 12px;
  background: #edf5f0;
  border-left: 4px solid #34865b;
  border-radius: 6px;
  font-size: 13px;
}


/* ========================================
   UPLOAD HISTORY TABLE
======================================== */

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

.card details table th {
  background: #eef3f7;
  color: #344b5e;
  text-align: left;
  font-weight: 700;
  padding: 9px;
}

.card details table td {
  border-bottom: 1px solid #e5ebf1;
  padding: 9px;
  text-align: left;
}

.card details table tr:nth-child(even) {
  background: #f8fafc;
}


/* ========================================
   ACCESSIBILITY AND SAFETY
======================================== */

[hidden] {
  display: none !important;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f0f3f6;
  color: #8897a4;
  cursor: not-allowed;
}

::placeholder {
  color: #8c99a5;
  opacity: 1;
}


/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 900px) {

  main {
    padding: 0 14px;
  }

  .week-settings {
    grid-template-columns: 1fr 1fr;
  }

  .week-settings label:first-child {
    grid-column: 1 / -1;
  }

  .review-table {
    min-width: 1320px;
  }

}

@media (max-width: 600px) {

  main {
    padding: 0 10px;
    margin-top: 15px;
  }

  .card {
    padding: 14px;
    margin: 12px 0;
  }

  header {
    align-items: flex-start;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .week-settings {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .week-settings label:first-child {
    grid-column: auto;
  }

  .week-settings input[name="year"] {
    max-width: 150px;
  }

  .actions {
    gap: 7px;
  }

  .actions button {
    font-size: 12px;
  }

  .review-table {
    min-width: 1320px;
  }

  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .save-bar {
    align-items: flex-start;
    flex-direction: column;
  }

}
