:root {
  --bg: #14161A;
  --surface: #1E2127;
  --text: #E8EAED;
  --muted: #A0A5AE;
  --accent: #E8A33D;
  --accent-dark: #C7711F;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

.app-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
  min-height: 100vh;
}

header {
  padding-top: 12px;
  margin-bottom: 12px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 12px;
  text-align: center;
}

.tabs {
  display: flex;
  background: #2A2E36;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 13px 8px;
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}

.tab-btn.active {
  font-weight: 600;
  background: #343A42;
  position: relative;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--accent);
}

main {
  padding-bottom: 40px;
}

.section-title {
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
}

.input-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}

.large-select {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  border: 2px solid #3B414D;
  border-radius: 10px;
  background: #2A2E36;
  color: var(--text);
  appearance: none;
  cursor: pointer;
  font-weight: 500;
}

.inputs {
  margin-bottom: 4px;
}

.status {
  padding: 14px 16px;
  border-radius: 10px;
  background: #2A2E36;
  margin-bottom: 16px;
  text-align: center;
}

#status-text {
  font-weight: 600;
  font-size: 15px;
}

#elapsed-time {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

.big-btn {
  width: 100%;
  min-height: 92px;
  font-size: 27px;
  font-weight: 700;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .05s, box-shadow .1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.big-btn.out-mode {
  background: #E85A33;
  color: #fff;
}

.big-btn:not(:disabled):active {
  transform: scale(0.985);
}

.help {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

.hidden {
  display: none !important;
}

.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.small-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.totals ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.totals li {
  padding: 9px 12px;
  background: #2A2E36;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 14px;
  background: #2A2E36;
  border-radius: 8px;
}

#entries-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 11px 10px;
  background: #2A2E36;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 14px;
  gap: 8px;
}

.entry-row .crew {
  font-weight: 600;
  font-size: 15px;
}

.entry-row .job {
  color: var(--accent);
  font-weight: 500;
}

.entry-row .times {
  width: 100%;
  font-size: 13px;
  color: var(--muted);
  margin: 3px 0;
}

.entry-row .hours {
  font-weight: 600;
  font-size: 13px;
  padding: 3px 10px;
  background: #3D424C;
  border-radius: 999px;
}

.entry-row .actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.entry-row button {
  padding: 5px 8px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #3D424C;
  color: var(--text);
}

.entry-row button:hover {
  background: #4A515E;
}

.manage-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.add-form input {
  flex: 1;
  padding: 10px 12px;
  font-size: 15px;
  border: 2px solid #3B414D;
  border-radius: 8px;
  background: #2A2E36;
  color: var(--text);
}

.add-form button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.list-container .item {
  padding: 9px 12px;
  margin-bottom: 4px;
  background: #2A2E36;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-container .item button {
  background: transparent;
  color: #E88760;
  font-size: 13px;
  padding: 3px 8px;
  border: none;
  cursor: pointer;
}

.edit-info {
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 500;
}

.edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.edit-actions button {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.edit-actions button:not(.secondary) {
  background: var(--accent);
  color: var(--bg);
}

.edit-actions .secondary {
  background: #3D424C;
  color: var(--text);
  flex: 0.65;
}

.edit-actions #cancel-edit-btn {
  background: #3D424C;
  color: var(--text);
  flex: 0.45;
}

#error-msg {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #3D424C;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  z-index: 100;
  max-width: 80%;
}

@media (max-width: 600px) {
  .app-container {
    padding: 8px;
  }
  .big-btn {
    min-height: 76px;
    font-size: 22px;
  }
  .large-select {
    font-size: 17px;
    padding: 12px;
  }
  .totals {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 22px;
  }
}