*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  background: #f4f5f7;
  color: #222;
}

/* ── Navbar ── */
.navbar {
  background: #1a1a2e;
  color: #fff;
  padding: 0 1rem;
  height: 46px;
  display: flex;
  align-items: center;
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-brand { font-size: 16px; font-weight: 600; letter-spacing: 0.3px; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-link { color: #e0e0e0; font-size: 13px; text-decoration: none; }
.nav-link:hover { color: #fff; }
.nav-logout { color: #e0e0e0; font-size: 13px; text-decoration: none; }
.nav-logout:hover { color: #fff; }

/* ── Settings ── */
.settings-section {
  margin-bottom: 2rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}
.settings-section:last-child { border-bottom: none; }
.settings-section h3 { font-size: 14px; font-weight: 600; color: #444; margin-bottom: 12px; }
.settings-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; background: #f8f8f8; border-radius: 6px;
  border: 1px solid #eee; font-size: 13px;
}
.btn-remove {
  background: none; border: none; color: #999; cursor: pointer;
  font-size: 14px; padding: 2px 6px; border-radius: 4px;
}
.btn-remove:hover { background: #fde8e8; color: #b71c1c; }
.settings-add-form { display: flex; gap: 8px; }
.settings-add-form input[type=text],
.settings-add-form input[type=password] {
  flex: 1; padding: 7px 10px; border: 1px solid #ccc;
  border-radius: 6px; font-size: 13px;
}
.btn-add-item {
  padding: 7px 16px; background: #1a1a2e; color: #fff;
  border: none; border-radius: 6px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.btn-add-item:hover { background: #2d2d4e; }

/* ── Import ── */
.import-instructions {
  background: #f8f8f8; border: 1px solid #eee; border-radius: 8px;
  padding: 1rem 1.25rem; margin-bottom: 1.5rem; font-size: 13px; color: #444;
}
.col-list {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.col-list span {
  background: #e8e8e8; border-radius: 4px; padding: 2px 8px;
  font-size: 12px; color: #333;
}
.import-form { display: flex; flex-direction: column; }
.file-drop {
  border: 2px dashed #ccc; border-radius: 8px; padding: 2rem;
  text-align: center; cursor: pointer; transition: border-color 0.2s;
  position: relative;
}
.file-drop input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-drop:hover, .file-drop.drag-over { border-color: #1a1a2e; background: #f0f0f8; }
.drop-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.drop-text { display: block; font-size: 14px; font-weight: 500; color: #333; }
.drop-sub  { display: block; font-size: 12px; color: #888; margin-top: 4px; }
.import-results {
  background: #f0fff4; border: 1px solid #c8e6c9; border-radius: 8px;
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.import-results.has-errors { background: #fff8f0; border-color: #ffe0b2; }
.result-counts { display: flex; gap: 1.5rem; margin-bottom: 10px; }
.result-count { display: flex; flex-direction: column; align-items: center; }
.count-num { font-size: 28px; font-weight: 600; line-height: 1; }
.count-label { font-size: 12px; color: #666; margin-top: 2px; }
.result-count.success .count-num { color: #2e7d32; }
.result-count.warn .count-num { color: #e65100; }
.error-list { margin-top: 10px; }
.error-item {
  font-size: 12px; color: #b71c1c; padding: 4px 8px;
  background: #fde8e8; border-radius: 4px; margin-bottom: 4px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

/* ── Login ── */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: #f4f5f7;
}
.login-box {
  background: #fff; border-radius: 10px; padding: 2rem 2.5rem;
  width: 100%; max-width: 360px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.login-box h1 { font-size: 22px; margin-bottom: 4px; }
.login-sub { color: #666; font-size: 13px; margin-bottom: 1.5rem; }
.login-box input[type=password] {
  width: 100%; padding: 9px 12px; border: 1px solid #ddd;
  border-radius: 6px; font-size: 15px; margin-bottom: 12px;
}
.login-box button {
  width: 100%; padding: 10px; background: #1a1a2e; color: #fff;
  border: none; border-radius: 6px; font-size: 15px; cursor: pointer;
}
.login-box button:hover { background: #2d2d4e; }

/* ── Alerts ── */
.alert {
  padding: 8px 14px; border-radius: 6px; margin-bottom: 12px;
  font-size: 13px;
}
.alert-error { background: #fde8e8; color: #b71c1c; border: 1px solid #f5c6c6; }
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }

/* ── Board header ── */
.board-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.board-header h2 { font-size: 18px; font-weight: 600; }
.btn-add {
  background: #1a1a2e; color: #fff; text-decoration: none;
  padding: 7px 16px; border-radius: 6px; font-size: 13px;
}
.btn-add:hover { background: #2d2d4e; }

/* ── Filter bar ── */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 10px;
}
.filter-bar input[type=text],
.filter-bar select {
  padding: 6px 10px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 13px; background: #fff; height: 34px;
}
.filter-bar input[type=text] { width: 200px; }
.btn-filter {
  padding: 6px 14px; background: #444; color: #fff; border: none;
  border-radius: 6px; cursor: pointer; font-size: 13px; height: 34px;
}
.btn-filter:hover { background: #222; }
.btn-clear {
  padding: 6px 12px; color: #555; text-decoration: none; font-size: 13px;
  border: 1px solid #ccc; border-radius: 6px; background: #fff; height: 34px;
  display: inline-flex; align-items: center;
}
.btn-clear:hover { background: #f0f0f0; }

/* ── Legend ── */
.legend {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.leg {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 12px; text-transform: uppercase; letter-spacing: 0.4px;
}
.leg-notstarted { background: #c8e6c9; color: #1b5e20; }
.leg-inprogress { background: #fff9c4; color: #f57f17; }
.leg-complete   { background: #ffcdd2; color: #b71c1c; }
.leg-billed     { background: #b2ebf2; color: #006064; }
.leg-approved   { background: #dcedc8; color: #33691e; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: 8px; }

.wo-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: 8px;
  font-size: 13px;
}
.wo-table thead th {
  background: #2a2a3e; color: #ddd;
  padding: 9px 10px; text-align: left;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.wo-table thead th:first-child { border-radius: 8px 0 0 0; }
.wo-table thead th:last-child  { border-radius: 0 8px 0 0; }

.wo-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
}
.wo-desc { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Row colors */
.row-notstarted td { background: rgba(200,230,201,0.35); }
.row-inprogress td { background: rgba(255,249,196,0.55); }
.row-complete   td { background: rgba(255,205,210,0.35); }
.row-billed     td { background: rgba(178,235,242,0.40); }
.row-billapproved td { background: rgba(220,237,200,0.45); }

.wo-table tbody tr:hover td { filter: brightness(0.95); }

/* Inline status select */
.status-select {
  font-size: 12px; padding: 3px 6px; border: 1px solid #bbb;
  border-radius: 5px; background: rgba(255,255,255,0.7);
  cursor: pointer; width: 120px;
}

.btn-edit { font-size: 15px; text-decoration: none; }
.no-results { text-align: center; padding: 2rem; color: #888; }

.table-footer {
  font-size: 12px; color: #888; text-align: right;
  margin-top: 6px;
}

/* ── Form pages ── */
.form-page {
  max-width: 760px; margin: 0 auto;
  background: #fff; border-radius: 10px; padding: 1.5rem 2rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.form-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 1.5rem;
}
.form-header h2 { font-size: 18px; font-weight: 600; }
.back-link { font-size: 13px; color: #555; text-decoration: none; }
.back-link:hover { color: #000; }

.wo-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px; }
.form-group.wide { flex: 2; }
.form-group label { font-size: 12px; font-weight: 500; color: #555; }
.form-group input[type=text],
.form-group input[type=date],
.form-group select,
.form-group textarea {
  padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 13px; font-family: inherit; background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: #888; box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
}
.disabled-input { background: #f5f5f5 !important; color: #888; }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.btn-save {
  padding: 9px 20px; background: #1a1a2e; color: #fff; border: none;
  border-radius: 6px; font-size: 14px; cursor: pointer;
}
.btn-save:hover { background: #2d2d4e; }
.btn-cancel {
  padding: 9px 16px; color: #555; text-decoration: none;
  border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
  background: #fff;
}
.btn-cancel:hover { background: #f5f5f5; }
.btn-delete {
  padding: 9px 16px; background: #b71c1c; color: #fff; border: none;
  border-radius: 6px; font-size: 14px; cursor: pointer; margin-left: auto;
}
.btn-delete:hover { background: #8b0000; }

/* ── Notes section ── */
.notes-section {
  margin-top: 2rem; border-top: 1px solid #eee; padding-top: 1rem;
}
.notes-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: #444; }
.note-entry {
  display: flex; gap: 12px; padding: 7px 0;
  border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.note-ts { color: #888; white-space: nowrap; font-size: 12px; min-width: 130px; }
.note-text { color: #222; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .filter-bar input[type=text] { width: 100%; }
  .form-row { flex-direction: column; }
  .wo-table { font-size: 12px; }
  .wo-table td { max-width: 140px; }
}
