:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --surface-3: #eef2f6;
  --border: #dde3ea;
  --text: #1f2937;
  --muted: #667085;
  --primary: #0f766e;
  --primary-hover: #0b5e58;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warning-bg: #fff7e8;
  --warning-border: #f2d6a2;
  --warning-text: #8a5a00;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  background: #fbfcfd;
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main {
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.logo {
  width: 48px;
  height: 48px;
  color: var(--primary);
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel {
  min-height: 280px;
}

.hidden {
  display: none !important;
}

.small-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.tab.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.15);
  border-color: var(--primary);
}

textarea {
  resize: vertical;
  min-height: 130px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-3);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecdca;
}

.stack {
  display: grid;
  gap: 10px;
}

.plan-box,
.usage-box {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.plan-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.usage-box {
  display: grid;
  gap: 8px;
}

.billing-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h2 {
  margin: 0 0 6px;
  font-size: 28px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
}

.filters {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.notes-list {
  display: grid;
  gap: 10px;
}

.note-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: white;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.note-item:hover {
  border-color: #c7d2de;
  transform: translateY(-1px);
}

.note-item.active {
  border-color: var(--primary);
  background: #f0fdfa;
}

.note-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.note-item-head strong {
  font-size: 15px;
  line-height: 1.35;
}

.note-item-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}

.detail-panel {
  display: flex;
  flex-direction: column;
}

.note-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.note-header h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.note-content {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 16px;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.date-grid strong {
  display: block;
  font-size: 14px;
}

.empty-state,
.empty-mini {
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-2);
}

.empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.empty-mini {
  padding: 18px;
  text-align: center;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero {
  min-height: calc(100vh - 56px);
  display: grid;
  align-content: center;
  gap: 18px;
  max-width: 840px;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #166534;
  font-size: 13px;
  font-weight: 600;
}

.hero h2 {
  margin: 0;
  font-size: 44px;
  line-height: 1.08;
  max-width: 700px;
}

.hero p {
  margin: 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 760px;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.hero-point {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 8px;
}

.hero-point strong {
  font-size: 16px;
}

.hero-point span {
  color: var(--muted);
  line-height: 1.55;
}

.note-form {
  margin-top: 4px;
}

.guest-mode {
  display: grid;
  align-items: center;
}

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .main {
    padding: 18px;
  }

  .hero {
    min-height: auto;
    padding: 12px 0 24px;
  }

  .hero h2 {
    font-size: 34px;
  }

  .hero-points {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sidebar {
    padding: 16px;
  }

  .main {
    padding: 16px;
  }

  .plan-box,
  .date-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .note-header,
  .note-item-head {
    flex-direction: column;
  }

  .hero h2 {
    font-size: 28px;
  }

  .hero p {
    font-size: 16px;
  }

  .actions-row {
    width: 100%;
  }

  .actions-row .btn {
    width: 100%;
  }
}