:root {
  --bg: #f7fafc;
  --bg-accent: radial-gradient(circle at 10% 0%, #e6f0ff 0%, transparent 40%),
    radial-gradient(circle at 90% 100%, #e4f7ef 0%, transparent 45%);
  --panel: #ffffff;
  --text: #163042;
  --muted: #5b7282;
  --border: #d7e1e8;
  --primary: #0a7b61;
  --primary-strong: #075d49;
  --danger: #ba2c2c;
  --shadow: 0 16px 36px rgba(10, 30, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--bg-accent), var(--bg);
  min-height: 100vh;
}

.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.field {
  margin-bottom: 12px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

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

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #87cbb9;
  border-color: #66ad9b;
}

.combo {
  position: relative;
}

.combo-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(10, 30, 45, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.combo-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef3f7;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 0;
}

.combo-option:last-child {
  border-bottom: 0;
}

.combo-option:hover {
  background: #f3f8fb;
}

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

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

#save-btn {
  background: var(--primary);
  color: #fff;
}

#save-btn:hover {
  background: var(--primary-strong);
}

.ghost {
  background: #fff;
  border: 1px solid var(--border);
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.list-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

#count {
  color: var(--muted);
  font-size: 0.95rem;
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.entry {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fcfeff;
}

.entry-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.entry h3 {
  margin: 0;
  font-size: 1.03rem;
}

.entry time {
  color: var(--muted);
  font-size: 0.92rem;
}

.entry p {
  margin: 8px 0 0;
  color: #2d4655;
  white-space: pre-wrap;
}

.entry-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.entry-actions button {
  padding: 8px 10px;
  font-size: 0.92rem;
}

.btn-edit {
  background: #e5f2ee;
  color: #0f5b46;
}

.btn-delete {
  background: #ffeceb;
  color: var(--danger);
}

.empty {
  color: var(--muted);
  margin: 12px 0 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .app {
    padding: 14px;
  }

  .panel {
    padding: 14px;
  }

  .entry-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
