:root {
  --bg-1: #fff9ef;
  --bg-2: #f8f6f2;
  --card: #ffffff;
  --text: #171412;
  --muted: #665a53;
  --line: #e8ded6;
  --brand: #0d6e6e;
  --brand-2: #134766;
  --danger: #b12030;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  background:
    radial-gradient(90rem 35rem at 85% -10%, #ffeabf 0%, transparent 55%),
    radial-gradient(80rem 25rem at -10% 0%, #dbf5f3 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.hero {
  padding: 1.3rem 1.5rem;
  border-radius: 16px;
  background: linear-gradient(120deg, #113e4f 0%, #0e776d 100%);
  color: #f8faf9;
}

.eyebrow {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0 0 0.5rem 0;
}

h1 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

h2 {
  font-size: 1.05rem;
}

.hero p {
  margin: 0;
  max-width: 70ch;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filters {
  margin-top: 0.55rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d8cbc2;
  border-radius: 10px;
  background: #fff;
  padding: 0.58rem 0.7rem;
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  padding: 0.58rem 0.82rem;
  cursor: pointer;
}

button.ghost {
  background: #fff;
  color: var(--brand-2);
  border-color: #c8dbe0;
}

button.danger {
  background: #fff6f7;
  color: var(--danger);
  border-color: #efbcc3;
}

.actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.bar p {
  margin: 0;
  color: var(--muted);
}

.filter-actions {
  align-items: center;
}

.db-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid #c8dbe0;
  border-radius: 999px;
  color: var(--brand-2);
  background: #f5fbff;
  font-size: 0.78rem;
  white-space: nowrap;
}

.file-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.58rem 0.82rem;
  border: 1px solid #c8dbe0;
  border-radius: 10px;
  color: var(--brand-2);
  background: #fff;
  cursor: pointer;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.table-wrap {
  margin-top: 0.5rem;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  table-layout: fixed;
}

col.col-date {
  width: 90px;
}

col.col-time {
  width: 74px;
}

col.col-person {
  width: 120px;
}

col.col-status {
  width: 110px;
}

col.col-category {
  width: 130px;
}

col.col-actions {
  width: 150px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.6rem;
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  color: var(--muted);
}

td {
  font-size: 0.84rem;
}

.message {
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.inline-editor {
  background: #f7fbfb;
}

.inline-editor td {
  border-bottom: 2px solid #d7ece9;
}

.inline-editor input,
.inline-editor select,
.inline-editor textarea {
  min-width: 0;
  font-size: 0.82rem;
  padding: 0.36rem 0.48rem;
}

.inline-editor textarea {
  min-height: 72px;
}

.auto-stamp {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #2f6f68;
  background: #dbf4ef;
  border: 1px solid #a2ddd0;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  margin-bottom: 0.32rem;
}

.row-actions {
  white-space: nowrap;
}

.chip {
  display: inline-block;
  padding: 0.22rem 0.58rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.chip.status {
  color: #3f3b37;
  background: #f3eee9;
  border-color: #e5d8cd;
}

.chip.warning {
  color: #7d4f08;
  background: #fff4dd;
  border-color: #efc983;
}

.chip.maintenance {
  color: #00645e;
  background: #e7fffb;
  border-color: #95dfd4;
}

.chip.information {
  color: #1b4e84;
  background: #eaf5ff;
  border-color: #9ec8ef;
}

.chip.very-important {
  color: #7b1426;
  background: #ffe6ea;
  border-color: #ef9aad;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
}

@media (max-width: 900px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

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