:root {
  --font: "Inter", -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --bg: #f6f5f4;
  --surface: #ffffff;
  --border: #e6e6e6;
  --text: #0d0d0d;
  --text-muted: #615d59;
  --primary: #0075de;
  --primary-hover: #005bab;
  --focus: rgba(0, 117, 222, 0.2);
  --success-bg: rgba(26, 174, 57, 0.12);
  --success-text: #1c8a2f;
  --warning-bg: rgba(221, 91, 0, 0.12);
  --warning-text: #a34500;
  --error-bg: #fdecea;
  --error-text: #c62828;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

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

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 0 10px;
}

.sidebar-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.sidebar-link:hover {
  background: var(--bg);
}

.sidebar-link.active {
  background: rgba(0, 117, 222, 0.1);
  color: var(--primary);
}

.content {
  flex: 1;
  min-width: 0;
}

.page {
  width: 100%;
  margin: 0;
  padding: 32px 40px 64px;
}

.page-header {
  text-align: center;
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text);
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-1);
}

.form-section {
  margin-bottom: 28px;
}

.form-section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.grid.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.grid.four-col {
  grid-template-columns: 1fr 1fr 2.5fr 1fr;
}

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

.grid .field {
  margin-bottom: 0;
}

.field.optional label::after {
  content: " (optional)";
  font-weight: 400;
  color: var(--text-muted);
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.section-hint {
  margin: -4px 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.swa-entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg);
}

.swa-remove-btn {
  margin-top: 12px;
  padding: 8px 14px;
  font-size: 13px;
}

.swa-remove-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="email"],
input[type="password"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

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

.with-button input {
  flex: 1;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary,
.btn-secondary {
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 11px 24px;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 16px;
}

a.btn-primary,
a.btn-secondary {
  display: inline-block;
  text-decoration: none;
  line-height: 1.4;
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.with-button .btn-secondary {
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.message {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.message.success {
  display: block;
  background: var(--success-bg);
  color: var(--success-text);
}

.message.error {
  display: block;
  background: var(--error-bg);
  color: var(--error-text);
}

/* Project Management board */

.pm-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.pm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pm-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pm-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 280px;
  flex-shrink: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pm-board--fit .pm-column {
  flex: 1 1 0;
  width: auto;
}

.pm-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 4px 6px;
  cursor: grab;
}

.pm-column.dragging-column {
  opacity: 0.4;
}

.pm-column-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pm-column-count {
  background: var(--success-bg);
  color: var(--success-text);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
}

.pm-column-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.pm-column-delete:hover {
  color: var(--error-text);
}

.pm-column-title {
  cursor: text;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.pm-column-title:hover {
  background: var(--bg);
}

.pm-column-title-input {
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 1px 3px;
  width: 140px;
  outline: none;
  background: #fff;
}

.pm-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  padding: 2px;
  transition: background 0.1s;
}

.pm-task-list.drag-over {
  background: var(--focus);
}

.pm-task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  cursor: grab;
  box-shadow: var(--shadow-1);
}

.pm-task-card:hover {
  border-color: var(--primary);
}

.pm-task-card.dragging {
  opacity: 0.4;
}

.pm-task-title {
  font-weight: 600;
  word-break: break-word;
}

.pm-add-in-column {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
}

.pm-add-in-column:hover {
  background: var(--bg);
  color: var(--primary);
}

.pm-add-column-input-inline {
  padding: 9px 14px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  width: 180px;
}

.pm-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.pm-modal-overlay.open {
  display: flex;
}

.pm-modal {
  background: var(--surface);
  border-radius: 12px;
  width: 760px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  box-shadow: var(--shadow-2);
}

.pm-payment-modal-overlay {
  z-index: 200;
}

.pm-payment-modal {
  width: 1180px;
}

.pm-payment-modal-title {
  font-size: 18px;
  font-weight: 700;
}

.pm-payment-table-wrap {
  overflow-x: auto;
  margin-bottom: 14px;
}

.pm-payment-table {
  width: 100%;
  border-collapse: collapse;
}

.pm-payment-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 0 8px 8px;
  white-space: nowrap;
}

.pm-payment-table td {
  padding: 4px;
  vertical-align: middle;
}

.pm-payment-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.pm-payment-table input {
  width: 100%;
  min-width: 100px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.pm-payment-table input[type="date"] {
  min-width: 130px;
}

.pm-payment-table input[type="number"] {
  min-width: 90px;
}

.pm-payment-amount-input {
  -moz-appearance: textfield;
}

.pm-payment-amount-input::-webkit-outer-spin-button,
.pm-payment-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pm-payment-total-label {
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 8px;
}

.pm-payment-total-value {
  font-weight: 700;
  padding: 12px 8px;
}

.pm-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.pm-detail-title-input {
  flex: 1;
  border: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  outline: none;
}

.pm-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.pm-modal-body {
  padding: 20px;
}

.pm-modal-body select,
.pm-modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}

.pm-modal-body textarea {
  resize: vertical;
}

.pm-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}

.pm-field {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--bg);
}

.pm-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pm-field-name {
  font-weight: 600;
  font-size: 13px;
  cursor: text;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.pm-field-name:hover {
  background: #fff;
}

.pm-field-name-input {
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 1px 3px;
  outline: none;
}

.pm-field-delete,
.pm-field-row-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.pm-field-delete:hover,
.pm-field-row-delete:hover {
  color: var(--error-text);
}

.pm-field-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.pm-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-field-row-name,
.pm-field-row-url,
.pm-field-row-note {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.pm-field-row-name {
  flex: 1;
  font-weight: 600;
}

.pm-field-row-url {
  flex: 1.5;
  color: var(--primary);
}

.pm-field-row-note {
  flex: 2;
}

.pm-field-add-row {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.pm-field-add-row:hover {
  color: var(--primary);
}

.pm-add-field-btn {
  padding: 8px 14px;
  font-size: 13px;
}

.pm-add-field-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

.pm-modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.pm-modal-footer-right {
  display: flex;
  gap: 12px;
}

/* Progress Tracker */

.pt-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.pt-page-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.pt-delete-project-btn {
  color: var(--error-text);
}

.pt-back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.pt-back-link:hover {
  color: var(--primary);
}

.pt-project-title {
  cursor: text;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px 6px;
  display: inline-block;
}

.pt-project-title:hover {
  background: var(--bg);
}

.pt-project-title-input {
  font: inherit;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 1px 5px;
  margin: -2px -4px 6px;
  outline: none;
  background: #fff;
}

/* Progress Tracker — project list */

.pt-projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.pt-project-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 18px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pt-project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-1);
}

.pt-project-card-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-project-card-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pt-project-card-value + .pt-card-meter {
  margin-bottom: 8px;
}

.pt-project-add-input {
  width: 220px;
}

.pt-overall {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 20px;
}

.pt-overall-good {
  border-left-color: var(--success-text);
}

.pt-overall-warning {
  border-left-color: var(--warning-text);
}

.pt-overall-critical {
  border-left-color: var(--error-text);
}

.pt-overall-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.pt-overall-value {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.pt-overall-meter {
  flex: 1;
  height: 10px;
  margin-bottom: 0;
}

.pt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.pt-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pt-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-1);
}

.pt-card-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-card-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.pt-card-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
  margin-bottom: 10px;
}

.pt-card-meter-fill {
  height: 100%;
  border-radius: 999px;
}

.pt-card-meter-fill-good {
  background: var(--success-text);
}

.pt-card-meter-fill-warning {
  background: var(--warning-text);
}

.pt-card-meter-fill-critical {
  background: var(--error-text);
}

.pt-card-meter-fill-none {
  background: var(--border);
}

.pt-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.pt-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.pt-card-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.pt-card-status-good {
  color: var(--success-text);
}

.pt-card-status-warning {
  color: var(--warning-text);
}

.pt-card-status-critical {
  color: var(--error-text);
}

.pt-card-status-none {
  color: var(--text-muted);
}

.pt-row-highlight {
  animation: pt-row-flash 1.5s ease;
}

@keyframes pt-row-flash {
  0% {
    background: #fff2cc;
  }
  100% {
    background: transparent;
  }
}

.pt-subcat-modal,
.pt-pdf-modal {
  width: 480px;
}

.pt-pdf-week {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
}

.pt-subcat-modal-title {
  font-size: 18px;
  font-weight: 700;
}

.pt-subcat-row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  cursor: pointer;
  font-family: inherit;
}

.pt-subcat-row:last-child {
  border-bottom: none;
}

.pt-subcat-row:hover .pt-subcat-name {
  color: var(--primary);
}

.pt-subcat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pt-subcat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pt-subcat-value {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.pt-subcat-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.pt-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.pt-table {
  width: 100%;
  border-collapse: collapse;
}

.pt-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 0 6px 10px;
  white-space: nowrap;
  vertical-align: bottom;
}

.pt-table td {
  padding: 4px 8px;
  vertical-align: middle;
}

.pt-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.pt-table tbody tr:hover {
  background: var(--bg);
}

.pt-table tbody tr.pt-editing {
  cursor: default;
  background: #fff9e8;
}

.pt-row-category {
  background: var(--bg);
}

.pt-row-category:hover {
  background: var(--bg);
}

.pt-row-category td {
  font-weight: 700;
}

.pt-row-subcategory {
  background: #fafbfc;
}

.pt-row-subcategory:hover {
  background: #fafbfc;
}

.pt-row-subcategory td {
  font-weight: 600;
}

.pt-row-category td:first-child,
.pt-row-category td:nth-child(2) {
  padding-left: 8px;
}

.pt-row-subcategory td:first-child,
.pt-row-subcategory td:nth-child(2) {
  padding-left: 24px;
}

.pt-row-item td:first-child,
.pt-row-item td:nth-child(2) {
  padding-left: 40px;
}

.pt-table tfoot tr {
  border-top: 2px solid var(--border);
}

.pt-total-label {
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 8px;
}

.pt-total-value {
  font-weight: 700;
  padding: 12px 8px;
}

.pt-week-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-week-cell .pt-input {
  flex: 1;
  min-width: 46px;
}

.pt-week-raw {
  flex: 1;
  min-width: 30px;
}

.pt-computed-value {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.pt-input {
  width: 100%;
  min-width: 90px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.pt-input-code {
  min-width: 64px;
}

.pt-input-description {
  min-width: 220px;
}

.pt-input-unit {
  min-width: 70px;
}

.pt-input-number {
  min-width: 90px;
  text-align: right;
}

.pt-input-progress {
  min-width: 70px;
}

.pt-col-week {
  min-width: 150px;
}

.pt-col-week.pt-editing {
  background: #fff9e8;
}

.pt-week-title {
  font-weight: 700;
}

.pt-week-label-input {
  margin-top: 4px;
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 3px 5px;
  width: 100%;
  min-width: 110px;
  outline: none;
}

.pt-level-select {
  display: block;
  width: 100%;
  min-width: 108px;
  padding: 5px 6px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.pt-week-delete,
.pt-row-delete {
  background: none;
  border: none;
  color: var(--error-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
}

.pt-week-delete {
  margin-top: 4px;
  display: block;
}

.pt-week-delete:hover,
.pt-row-delete:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .grid.two-col,
  .grid.three-col,
  .grid.four-col {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: auto;
    flex-direction: row;
    overflow-x: auto;
  }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
}

.login-title {
  margin: 0 0 20px;
  font-size: 18px;
  text-align: center;
}

.login-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 13px;
}

.login-submit {
  width: 100%;
  margin-top: 8px;
}

/* Job Order */

.jo-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) 1026px;
  gap: 24px;
  align-items: start;
}

.jo-preview {
  position: sticky;
  top: 16px;
  min-width: 0;
}

.jo-preview-actions {
  margin: 0 0 12px;
}

.jo-preview .message {
  margin: 0 0 12px;
}

.jo-preview-frame {
  max-height: calc(100vh - 100px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-1);
}

@media (max-width: 1760px) {
  .jo-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .jo-preview {
    position: static;
  }
}

.jo-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.jo-rows:empty {
  margin-bottom: 0;
}

.jo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jo-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.jo-row input.jo-att-size {
  flex: 0 0 90px;
}

.jo-row select,
.jo-tb-select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

.jo-add,
.jo-file {
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.jo-remove {
  padding: 6px 12px;
  font-size: 18px;
  line-height: 1;
}

.field input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #fff;
  cursor: pointer;
}

.jo-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 500;
}

.jo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg);
}

.jo-tb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.jo-tb:hover {
  background: #e8e7e5;
}

.jo-tb.active {
  background: rgba(0, 117, 222, 0.12);
  color: var(--primary);
}

.jo-tb-select {
  height: 32px;
  padding: 0 6px;
}

.jo-tb-sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--border);
}

.jo-tb-color {
  display: inline-flex;
  align-items: center;
}

.jo-tb-swatch-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
  line-height: 1;
}

.jo-tb-swatch {
  display: block;
  width: 16px;
  height: 3px;
  margin-top: 2px;
  border-radius: 1px;
}

.jo-tb-color input[type="color"] {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.jo-tb-color input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.jo-tb-color input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border);
  border-radius: 3px;
}

.jo-editor {
  min-height: 320px;
  max-height: 70vh;
  overflow: auto;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #fff;
  outline: none;
}

.jo-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

/* Shared by the editor and the email body so both format text the same way. */
.ol-content {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15pt;
  line-height: 1.4;
  color: #000;
  overflow-wrap: break-word;
}

.ol-content p {
  margin: 0;
}

.ol-content ul,
.ol-content ol {
  margin: 0;
  padding-left: 56px;
}

.ol-content li {
  padding-left: 16px;
  line-height: 1.5;
}

/* The captured email: measured 1:1 against an Outlook reading-pane screenshot. */

.ol-email {
  width: 1024px;
  background: #fff;
  color: #fff;
  font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  text-align: left;
}

.ol-email [hidden] {
  display: none !important;
}

.ol-header {
  padding: 7px 31px 11px 28px;
  background: #666;
}

.ol-subject {
  font-size: 28px;
  line-height: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ol-top {
  display: flex;
  margin-top: 10px;
}

.ol-avatar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-top: 16px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 300;
}

.ol-presence {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border: 2px solid #626262;
  border-radius: 50%;
  background: #fff;
}

.ol-meta {
  flex: 1;
  min-width: 0;
  margin-left: 17px;
  padding-top: 22px;
}

.ol-from {
  margin-bottom: 2.5px;
  font-size: 22px;
  line-height: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ol-line {
  display: flex;
  font-size: 14pt;
  line-height: 25px;
}

.ol-cc-line {
  margin-top: 2px;
}

.ol-label {
  flex: none;
  width: 35px;
}

.ol-recips {
  flex: 1;
  min-width: 0;
}

.ol-recip {
  white-space: nowrap;
}

/* Trailing gap, so a wrapped line still starts flush left. */
.ol-recip:not(:last-child) {
  margin-right: 3px;
}

.ol-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  border-radius: 50%;
  background: #fff;
  vertical-align: -1px;
}

.ol-dot-available {
  background: #72b601 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.6 5.2l1.7 1.7 3.2-3.5' fill='none' stroke='%23fff' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.ol-dot-busy {
  background: #eb0218;
}

.ol-dot-away {
  background: #ffaa44;
}

.ol-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: 12px;
}

.ol-buttons {
  display: flex;
  gap: 12px;
}

.ol-group {
  display: flex;
  height: 48px;
  border: 1px solid #7e7e7e;
  border-radius: 5px;
  overflow: hidden;
  background: #d2d2d2;
}

.ol-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 47px;
  box-shadow: inset 0 0 0 1px #ababab;
}

/* Widths include the 1px separators: 47 + 48 + 47 inside the 144px group. */
.ol-btn + .ol-btn {
  border-left: 1px solid #7e7e7e;
}

.ol-btn:nth-child(2) {
  width: 48px;
}

.ol-more .ol-btn {
  width: 46px;
}

.ol-date {
  margin-top: 4.5px;
  font-size: 14pt;
  line-height: 25px;
}

.ol-replied {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6.5px;
  font-size: 16px;
  line-height: 24px;
}

.ol-replied svg {
  flex: none;
}

.ol-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 0 -1px;
}

.ol-attachments:empty {
  display: none;
}

.ol-att {
  display: flex;
  align-items: flex-start;
  width: 443px;
  height: 62px;
  padding: 6px;
  border: 1px solid #454545;
  border-radius: 5px;
  background: #d4d4d4;
  color: #242424;
}

.ol-att-icon {
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
}

.ol-att-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.ol-att-text {
  flex: 1;
  min-width: 0;
  margin-left: 14px;
}

.ol-att-name {
  font-size: 18px;
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ol-att-size {
  font-size: 18px;
  line-height: 24px;
  color: #616161;
}

.ol-att-chevron {
  flex: none;
  align-self: center;
  margin: 1px 6px 0 6px;
}

.ol-body-wrap {
  display: flex;
  min-height: 80px;
  background: #fff;
}

.ol-body {
  flex: 1;
  min-width: 0;
  padding: 1px 15px 24px;
}

.ol-scrollbar {
  position: relative;
  flex: none;
  width: 21px;
  background: #f5f5f5;
}

.ol-scroll-up,
.ol-scroll-down {
  position: absolute;
  left: 4px;
}

.ol-scroll-up {
  top: 7px;
}

.ol-scroll-down {
  bottom: 8px;
}

.ol-scroll-thumb {
  position: absolute;
  top: 28px;
  left: 5px;
  width: 12px;
  height: 31px;
  border-radius: 6px;
  background: #707070;
}
