:root {
  --primary: #39ff14;
  --secondary: #a6ff95;
  --background: #000000;
  --surface: #0b0b0b;
  --error: #ff4d4d;
  --on-primary: #000000;
  --on-secondary: #001a00;
  --on-background: #39ff14;
  --on-surface: #39ff14;
  --on-error: #000000;
}

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

html,
body {
  height: 100%;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Courier New", Courier, monospace;
  background: var(--background);
  color: var(--on-background);
  line-height: 1.6;
  padding: 16px;
  max-width: 100%;
  overflow-x: hidden;
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.6);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    rgba(0, 0, 0, 0.08) 0px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(57, 255, 20, 0.04) 4px
  );
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.35) 0px,
      rgba(0, 0, 0, 0.35) 1px,
      rgba(0, 0, 0, 0) 2px
    ),
    radial-gradient(
      rgba(57, 255, 20, 0.12) 1px,
      rgba(0, 0, 0, 0) 1px
    );
  background-size: 100% 3px, 3px 3px;
  mix-blend-mode: screen;
  opacity: 0.22;
  pointer-events: none;
  z-index: 3;
  animation: crt-flicker 3s infinite, crt-noise 0.7s steps(2) infinite;
}

@keyframes crt-flicker {
  0%,
  100% {
    opacity: 0.18;
  }
  40% {
    opacity: 0.26;
  }
  60% {
    opacity: 0.2;
  }
}

@keyframes crt-noise {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 0 0, 60px 120px;
  }
}

[hidden] {
  display: none !important;
}

input,
select,
textarea,
button {
  font-size: 16px;
  font-family: inherit;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-header {
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

.auth-status {
  font-size: 12px;
  opacity: 0.75;
}

.panel {
  border: 1px solid #1f3d1f;
  border-radius: 16px;
  background: rgba(11, 11, 11, 0.9);
  padding: 16px;
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-header h1 {
  font-size: 20px;
  margin-bottom: 4px;
}

.panel-header p {
  font-size: 13px;
  opacity: 0.8;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.field input,
.field select {
  background: #000000;
  color: var(--on-surface);
  border: 1px solid #1f3d1f;
  border-radius: 8px;
  padding: 10px;
}

.field-row {
  display: grid;
  gap: 12px;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  background: var(--primary);
  color: var(--on-primary);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.3);
}

.button.ghost {
  background: transparent;
  color: var(--primary);
  border-color: #1f3d1f;
  box-shadow: none;
}

.button.danger {
  background: var(--error);
  color: var(--on-error);
  border-color: var(--error);
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.3);
}

.icon-button {
  background: transparent;
  border: 1px solid #1f3d1f;
  color: var(--primary);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.form-note {
  font-size: 12px;
  color: var(--secondary);
}

.top-bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.month-label {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.calendar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-header,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-size: 11px;
}

.calendar-header span {
  opacity: 0.75;
}

.calendar-grid {
  min-height: 220px;
}

.calendar-cell {
  background: #050505;
  border: 1px solid #1f3d1f;
  border-radius: 10px;
  padding: 10px 6px;
  color: var(--on-surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-height: 52px;
}

.calendar-cell.selected {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.calendar-cell.blank {
  border: none;
  background: transparent;
  cursor: default;
}

.calendar-day {
  font-size: 14px;
  font-weight: 700;
}

.calendar-meta {
  font-size: 10px;
  opacity: 0.8;
}

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

.entries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.entries-title {
  font-weight: 700;
  font-size: 16px;
}

.entries-date {
  font-size: 12px;
  opacity: 0.8;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-row {
  border: 1px solid #1f3d1f;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #050505;
  gap: 12px;
}

.entry-time {
  font-weight: 700;
}

.entry-meta {
  font-size: 12px;
  opacity: 0.75;
}

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

.empty-state {
  border: 1px dashed #1f3d1f;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
  opacity: 0.8;
}

@media (min-width: 720px) {
  body {
    max-width: 640px;
    margin: 0 auto;
  }

  .field-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
