:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --ink: #1b2430;
  --muted: #5c5c5c;
  --line: #d9d9d9;
  --panel: #ffffff;
  --surface: #f4f4f4;
  --accent: #f28c00;
  --accent-strong: #d97800;
  --warning: #f28c00;
  --danger: #b42318;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(242, 140, 0, 0.11), transparent 300px),
    var(--surface);
  color: var(--ink);
}

body.locked {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 22%, rgba(242, 140, 0, 0.18), transparent 230px),
    linear-gradient(180deg, #fff4e3 0%, #f7f7f7 58%, #ffffff 100%),
    var(--surface);
}

.login-panel {
  position: relative;
  display: grid;
  width: min(460px, 100%);
  gap: 15px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 64px rgba(17, 17, 17, 0.13);
  padding: 34px;
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--accent);
}

.login-brand {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: inset 0 -5px 0 var(--accent);
}

.login-panel h1 {
  margin-bottom: 0;
  max-width: 360px;
  font-size: clamp(2rem, 7vw, 2.55rem);
  line-height: 0.98;
}

.login-panel p {
  color: var(--muted);
}

.login-copy {
  margin-bottom: 8px;
}

.login-panel label {
  color: var(--ink);
  font-weight: 850;
}

.login-panel input,
.login-panel select {
  min-height: 48px;
  border-color: #c7c7c7;
  background: #fff;
}

.login-panel input:focus,
.login-panel select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(242, 140, 0, 0.16);
}

.login-panel .primary-button {
  min-height: 50px;
  margin-top: 2px;
  background: #111;
  color: #fff;
  box-shadow: inset 0 -4px 0 var(--accent);
}

.login-panel .primary-button:hover {
  background: #252525;
}

.login-error {
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.user-bar span {
  color: var(--muted);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.server-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 750;
}

h2 {
  font-size: 1.15rem;
}

.summary-strip {
  display: grid;
  overflow: hidden;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 0;
  text-align: left;
}

.followup-filter {
  cursor: pointer;
}

.followup-filter:hover {
  background: #fff4e5;
}

.summary-strip div {
  padding: 14px 18px;
}

.summary-strip div:last-child {
  border-right: 0;
}

.summary-strip span {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
}

.summary-strip small {
  color: var(--muted);
  font-weight: 700;
}

.response-block {
  border: 1px solid #f4bd68;
  border-radius: 8px;
  background: #fff8ed;
  padding: 12px;
}

.response-form {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 12px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.tab-button {
  min-height: 42px;
  border-radius: 8px;
  background: #eef2f6;
  color: #344054;
  padding: 0 16px;
  font-weight: 850;
}

.tab-button.active {
  background: var(--accent);
  color: #fff;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.workspace.admin-mode {
  display: block;
}

.workspace.admin-mode .report-form {
  max-width: 720px;
}

.workspace.admin-mode .report-list-panel,
.workspace.admin-mode .admin-panel,
.workspace.admin-mode .worktime-panel {
  width: 100%;
}

.report-form,
.admin-panel,
.worktime-panel,
.report-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-form {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.admin-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.admin-panel.hidden,
.worktime-panel.hidden {
  display: none;
}

.worktime-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.manual-worktime-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
}

.manual-worktime-form.expanded {
  background: #fff;
}

.manual-worktime-body {
  display: grid;
  gap: 14px;
}

.drilling-section {
  display: grid;
  gap: 10px;
}

.drilling-section h3 {
  margin: 0;
}

.drilling-point-list {
  display: grid;
  gap: 10px;
}

.drilling-point-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(90px, 0.75fr) minmax(100px, 0.8fr) minmax(130px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.employee-form {
  display: grid;
  gap: 14px;
}

.employee-list {
  display: grid;
  gap: 10px;
}

.employee-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.employee-item strong,
.employee-item span {
  display: block;
}

.employee-item span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.employee-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.form-header,
.report-toggle,
.card-actions,
.list-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.form-header-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.card-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.print-select {
  display: inline-grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  padding: 6px 10px;
  color: #344054;
  font-size: 0.82rem;
  font-weight: 850;
}

.print-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.form-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7d0dd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 140, 0, 0.18);
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.date-time-grid,
.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.time-grid label,
.date-time-grid label {
  min-width: 0;
}

.checkbox-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #c7d0dd;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.employee-checkbox {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--ink);
  font-weight: 750;
}

.employee-checkbox:hover {
  background: #f3f6f9;
}

.employee-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.employee-checkbox span {
  overflow-wrap: anywhere;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.checkbox-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: #fff3df;
  color: #111;
}

.ghost-button {
  background: #eef2f6;
  color: #344054;
}

.danger-button {
  background: #fff1f0;
  color: var(--danger);
}

.report-list-panel {
  min-height: 620px;
  padding: 18px;
}

.list-tools {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 18px;
}

.list-tools label {
  flex: 1;
}

.list-tools button {
  white-space: nowrap;
}

.card-actions {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  flex-wrap: wrap;
}

input[readonly] {
  background: #f3f6f9;
  color: var(--muted);
}

.report-list {
  display: grid;
  gap: 14px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.report-card h3 {
  margin-bottom: 5px;
  font-size: 1.08rem;
}

.report-toggle {
  width: 100%;
  min-height: 72px;
  background: #fff;
  color: var(--ink);
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.report-toggle:hover {
  background: #fff8ed;
}

.report-card.expanded .report-toggle {
  border-bottom: 1px solid var(--line);
}

.report-details {
  padding: 0 16px 16px;
}

.meta {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #111;
  color: #fff;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 850;
}

.badge.warning {
  background: #fff3df;
  color: #111;
}

dl {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.empty-state {
  display: grid;
  min-height: 420px;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  margin-bottom: 6px;
  color: var(--ink);
}

.empty-state.compact {
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.worktime-list {
  display: grid;
  gap: 16px;
}

.worktime-tools {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.worktime-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
}

.worktime-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.worktime-summary strong,
.worktime-summary span {
  display: block;
}

.worktime-summary strong {
  font-size: 1.45rem;
}

.worktime-summary span {
  color: var(--muted);
  font-weight: 800;
}

.worktime-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.worktime-row {
  display: grid;
  grid-template-columns: 120px minmax(160px, 1.1fr) minmax(150px, 1fr) 110px 120px 90px 90px 90px minmax(170px, auto);
  align-items: center;
  gap: 14px;
  min-width: 1180px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.worktime-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.84rem;
}

.worktime-row:last-child {
  border-bottom: 0;
}

.worktime-head {
  background: #eef2f6;
  color: #344054;
  font-weight: 850;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .topbar,
  .workspace {
    display: grid;
  }

  .user-bar {
    justify-content: start;
  }

  .summary-strip {
    min-width: 0;
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .tab-button {
    flex: 0 0 auto;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .report-form {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding: 18px 0;
  }

  .login-screen {
    place-items: start center;
    padding-top: 56px;
  }

  .login-panel {
    padding: 28px 24px 26px;
  }

  .login-panel h1 {
    max-width: 300px;
  }

  .summary-strip,
  .two-column,
  .date-time-grid,
  .time-grid,
  .worktime-tools,
  .list-tools {
    grid-template-columns: 1fr;
  }

  .summary-strip {
    display: grid;
  }

  .summary-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-strip div:last-child {
    border-bottom: 0;
  }

  .list-tools {
    display: grid;
    align-items: stretch;
  }

  .report-toggle,
  .card-actions,
  .form-header-actions,
  .drilling-point-row,
  .employee-item,
  .employee-actions {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .employee-actions {
    padding-left: 0;
    border-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
}
