:root {
  --navy: #0c2030;
  --navy-soft: #17324a;
  --teal: #1a7a72;
  --teal-soft: #e3f0ee;
  --gold: #c9a227;
  --gold-soft: #f7edd2;
  --cream: #f7f5f1;
  --paper: #ffffff;
  --ink: #16232c;
  --ink-soft: #5b6b74;
  --line: #e3ddd2;
  --slate: #64748b;
  --slate-soft: #eceef1;
  --blue: #3b6e91;
  --blue-soft: #e6eef3;
  --amber: #b8863b;
  --amber-soft: #f5ead4;
  --brick: #8a5a52;
  --brick-soft: #ede1de;
  --green: #3f7d52;
  --green-soft: #e4efe6;
  --red: #7a3b3b;
  --red-soft: #f0e2e2;
  --radius: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font-family: var(--font-ui); }
button { cursor: pointer; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 14px 96px;
}

/* ---- Login ---- */
.om-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--navy);
}
.om-login-card {
  background: var(--paper);
  border-radius: 14px;
  padding: 32px 26px;
  width: 100%;
  max-width: 360px;
}
.om-login-brand {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}
.om-login-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 22px; }
.om-login-error {
  background: var(--red-soft); color: var(--red); font-size: 12.5px;
  padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; display: none;
}
.om-login-error.om-show { display: block; }

/* ---- Header ---- */
.om-header {
  background: var(--navy);
  color: #f4f1ea;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.om-header-top { display: flex; align-items: center; justify-content: space-between; }
.om-brand-mark { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.om-header-user { display: flex; align-items: center; gap: 10px; }
.om-header-user-name { font-size: 12.5px; color: #d8dee2; }
.om-header-role {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.04em; background: rgba(255,255,255,0.12); padding: 2px 7px; border-radius: 10px;
}
.om-logout-btn {
  background: none; border: 1px solid rgba(255,255,255,0.25); color: #f4f1ea;
  border-radius: 8px; padding: 6px 10px; font-size: 11.5px; font-weight: 600;
}

/* ---- Section ---- */
.om-section-title {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  margin: 18px 2px 8px; display: flex; align-items: center; justify-content: space-between;
}
.om-section-sub { font-size: 11.5px; color: var(--ink-soft); font-weight: 400; }

.om-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.om-stat-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 8px; text-align: center; border-top: 3px solid var(--slate);
}
.om-stat-card.om-active-filter { box-shadow: 0 0 0 2px var(--navy) inset; }
.om-stat-num { font-family: var(--font-mono); font-size: 24px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.om-stat-label {
  font-size: 10.5px; color: var(--ink-soft); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.02em; line-height: 1.25;
}

.om-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.om-toolbar .om-input, .om-toolbar .om-select { flex: 1; min-width: 120px; }

.om-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.om-empty-note {
  font-size: 12.5px; color: var(--ink-soft); text-align: center; padding: 16px 8px;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 10px;
}

.om-row-card {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--slate);
  border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 10px;
}
.om-row-main { flex: 1; min-width: 0; }
.om-row-name { font-weight: 700; font-size: 13.5px; }
.om-row-sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 1px; }
.om-row-badge {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; padding: 3px 7px;
  border-radius: 20px; white-space: nowrap; color: #fff;
}
.om-wa-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--green);
  color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  font-size: 16px; text-decoration: none;
}

.om-btn {
  border-radius: 8px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); padding: 8px 12px; font-size: 13px;
}
.om-btn-primary { background: var(--gold); border-color: var(--gold); color: #241d05; font-weight: 700; padding: 9px 16px; }
.om-select { border-radius: 8px; border: 1px solid var(--line); background: var(--paper); padding: 8px 10px; font-size: 13px; }

/* ---- Tab bar ---- */
.om-tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px;
  width: calc(100% - 28px); max-width: 452px; background: var(--navy); border-radius: 14px;
  display: flex; padding: 6px; box-shadow: 0 8px 24px rgba(12,32,48,0.28); z-index: 50;
}
.om-tab { flex: 1; background: none; border: none; color: #b9c3ca; padding: 10px 4px; border-radius: 10px; font-size: 12.5px; font-weight: 700; }
.om-tab.om-tab-active { background: var(--gold); color: #241d05; }

/* ---- Modal ---- */
.om-overlay {
  position: fixed; inset: 0; background: rgba(12,32,48,0.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 999;
}
@media (min-width: 640px) { .om-overlay { align-items: center; padding: 24px; } }
.om-modal {
  background: var(--paper); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  border-radius: 14px 14px 0 0; padding: 20px 20px 26px;
}
@media (min-width: 640px) { .om-modal { border-radius: 14px; } }
.om-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.om-modal-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.om-close { background: none; border: none; font-size: 20px; color: var(--ink-soft); line-height: 1; padding: 4px; }
.om-field { margin-bottom: 12px; }
.om-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); font-weight: 700; display: block; margin-bottom: 4px; }
.om-input, .om-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
  font-size: 14px; color: var(--ink); background: var(--cream);
}
.om-textarea { resize: vertical; min-height: 56px; }
.om-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.om-chip-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.om-chip {
  font-size: 12px; padding: 6px 10px; border-radius: 20px; border: 1.5px solid var(--line);
  background: var(--paper); font-weight: 600; color: var(--ink-soft);
}
.om-chip.om-chip-active { color: #fff; }
.om-notes-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; max-height: 160px; overflow-y: auto; }
.om-note { background: var(--cream); border-left: 3px solid var(--teal); border-radius: 0 6px 6px 0; padding: 7px 10px; }
.om-note-date { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-soft); margin-bottom: 2px; }
.om-note-author { font-weight: 700; }
.om-note-text { font-size: 13px; }
.om-add-note { display: flex; gap: 8px; }
.om-add-note .om-textarea { flex: 1; }
.om-note-btn { background: var(--teal); color: #fff; border: none; border-radius: 8px; padding: 0 14px; font-weight: 700; font-size: 13px; }
.om-modal-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.om-delete-btn { background: none; border: none; color: var(--brick); font-size: 12.5px; font-weight: 700; }
.om-save-btn { background: var(--navy); color: #f4f1ea; border: none; border-radius: 8px; padding: 10px 20px; font-weight: 700; font-size: 13.5px; }
.om-modal-error { background: var(--red-soft); color: var(--red); font-size: 12px; padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; display: none; }
.om-modal-error.om-show { display: block; }

.om-status-banner { font-size: 11px; color: var(--ink-soft); text-align: center; margin-top: 14px; }
.om-status-banner b { color: var(--ink); }
.om-view { display: none; }
.om-view.om-view-active { display: block; }

.om-type-tag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 20px; background: var(--slate-soft);
  color: var(--ink); font-weight: 600; margin-right: 4px; display: inline-block;
}

.om-fab {
  position: fixed; right: calc(50% - 226px + 14px); bottom: 78px; z-index: 40;
}
@media (max-width: 480px) { .om-fab { right: 20px; } }
