@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&family=Space+Mono&display=swap');

:root {
  --green-dark:  #1b4332;
  --green-mid:   #2d6a4f;
  --green-light: #52b788;
  --green-pale:  #d8f3dc;
  --teal-dark:   #0d3349;
  --teal-mid:    #1a5276;
  --teal-light:  #5dade2;
  --gold:        #b7950b;
  --gold-light:  #f1c40f;
  --bg:          #111613;
  --bg2:         #181f1a;
  --bg3:         #1f2922;
  --border:      #2a3830;
  --text:        #e8f5e9;
  --text-muted:  #7a9a80;
  --red:         #c0392b;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 14px; min-height: 100vh; }

/* ── Navbar ── */
.navbar { background: var(--green-dark); border-bottom: 2px solid var(--green-mid); padding: 0.5rem 0; }
.navbar-brand { font-family: 'Playfair Display', serif; font-size: 1.15rem; color: #fff !important; display: flex; align-items: center; gap: 0.4rem; }
.amp { color: var(--green-light); }
.leaf { font-size: 1.4rem; animation: sway 4s ease-in-out infinite; display: inline-block; }
@keyframes sway { 0%,100%{transform:rotate(-5deg)} 50%{transform:rotate(5deg)} }
.nav-link { color: rgba(255,255,255,0.8) !important; border-radius: 6px; padding: 0.4rem 0.8rem !important; font-weight: 500; transition: all .2s; }
.nav-link:hover, .nav-link.active { color: #fff !important; background: rgba(255,255,255,0.12); }
.nav-link i { margin-right: 4px; }
.navbar-toggler { border: 1px solid rgba(255,255,255,0.3); padding: 0.2rem 0.5rem; }

.btn-add { background: var(--green-light); color: var(--green-dark) !important; font-weight: 700; border: none; border-radius: 8px; padding: 0.45rem 1rem; transition: all .2s; display: inline-flex; align-items: center; gap: 4px; }
.btn-add:hover { background: #74c69d; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(82,183,136,.35); }

/* ── User pill ── */
.user-pill { display: flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.08); border-radius: 20px; padding: 4px 12px 4px 4px; }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--green-mid); color: #fff; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.user-name { color: rgba(255,255,255,0.9); font-size: 0.85rem; font-weight: 500; }
.logout-link { color: rgba(255,255,255,0.5); font-size: 0.9rem; transition: color .2s; }
.logout-link:hover { color: #fff; }

/* ── Page header ── */
.page-title { font-family: 'Playfair Display', serif; font-size: 1.75rem; font-weight: 900; color: var(--text); margin: 0; }
.page-sub { color: var(--text-muted); margin: 0.2rem 0 0; font-size: 0.85rem; }
.back-link { color: var(--green-light); text-decoration: none; font-size: 0.88rem; }
.back-link:hover { color: #fff; }

/* ── Cards ── */
.filter-card, .dash-card, .form-section { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.dash-card { height: 100%; }
.dash-card-title { font-family: 'Playfair Display', serif; font-size: 0.95rem; font-weight: 700; color: var(--green-light); margin-bottom: 0.85rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.dash-card-title i { margin-right: 6px; }
.section-title { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--green-light); margin-bottom: 0.85rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.section-title i { margin-right: 6px; }
.purchase-section { border-color: var(--teal-mid); }
.purchase-section .section-title { color: var(--teal-light); }

/* ── Form controls ── */
.form-label { color: var(--text-muted); font-size: 0.78rem; font-weight: 600; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }
.form-control, .form-select { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-size: 0.9rem; }
.form-control:focus, .form-select:focus { background: var(--bg3); border-color: var(--green-light); color: var(--text); box-shadow: 0 0 0 3px rgba(82,183,136,.2); }
.form-select option { background: var(--bg3); }
.input-group-text { background: var(--bg3); border-color: var(--border); color: var(--text-muted); }
.hint-text { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; display: block; text-transform: none; letter-spacing: 0; }

/* ── Date picker ── */
input[type="date"] { color-scheme: dark; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7) sepia(1) saturate(3) hue-rotate(90deg); cursor: pointer; padding: 2px; border-radius: 4px; opacity: 0.8; transition: opacity .2s, transform .2s; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; transform: scale(1.15); }
input[type="date"]::-webkit-datetime-edit { color: var(--text); }
input[type="date"]::-webkit-datetime-edit-text { color: var(--text-muted); }
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field { color: var(--text); }
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus { background: var(--green-mid); border-radius: 3px; color: #fff; outline: none; }
.date-picker-wrap { position: relative; }
.date-input { border-color: var(--green-mid) !important; }
.date-hint { display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; }

/* ── Star rating ── */
.star-row { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.star-btn { width: 32px; height: 32px; border: 1px solid var(--border); background: var(--bg3); color: var(--text-muted); border-radius: 6px; font-size: 0.78rem; font-family: 'Space Mono', monospace; cursor: pointer; transition: all .15s; padding: 0; display: flex; align-items: center; justify-content: center; }
.star-btn:hover { border-color: var(--green-light); color: var(--green-light); background: rgba(82,183,136,.1); }
.star-btn.active { background: var(--green-mid); border-color: var(--green-light); color: #fff; font-weight: 700; }

/* ── Autocomplete ── */
.suggestions-box { position: absolute; z-index: 100; background: var(--bg2); border: 1px solid var(--green-mid); border-radius: 8px; width: 100%; display: none; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.suggestion-item { padding: 0.45rem 0.85rem; cursor: pointer; transition: background .15s; font-size: 0.9rem; }
.suggestion-item:hover { background: var(--bg3); color: var(--green-light); }
.col-md-6 { position: relative; }

/* ── Photo upload ── */
.photo-upload-area { border: 2px dashed var(--border); border-radius: 10px; background: var(--bg3); transition: border-color .2s; }
.photo-upload-area:hover { border-color: var(--green-light); }
.photo-file-input { display: none; }
.photo-upload-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.25rem; cursor: pointer; color: var(--text-muted); text-align: center; font-size: 0.85rem; }
.photo-upload-label:hover { color: var(--green-light); }
.existing-photo { max-width: 100%; max-height: 180px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; }
.existing-photo-wrap { background: var(--bg3); border-radius: 10px; padding: 0.5rem; display: inline-block; }

/* ── Photo modal / lightbox ── */
.photo-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 9999; align-items: center; justify-content: center; cursor: pointer; }
.photo-modal img { max-width: 95vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }

/* ── Desktop table ── */
.journal-table { color: var(--text); margin-bottom: 0; }
.journal-table thead th { background: var(--green-dark); color: rgba(255,255,255,0.8); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border: none; padding: 0.55rem 0.4rem; white-space: nowrap; }
.journal-table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.journal-table tbody tr:hover { background: var(--bg3); }
.journal-table tbody td { padding: 0.45rem 0.4rem; vertical-align: middle; border: none; font-size: 0.82rem; }
.rating-col { text-align: center; }
.strain-name { font-weight: 600; color: var(--green-light); }
.price-val { font-family: 'Space Mono', monospace; color: var(--teal-light); font-size: 0.8rem; }
.ppu { font-family: 'Space Mono', monospace; color: var(--text-muted); font-size: 0.75rem; }

/* ── Mobile cards ── */
.entry-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.entry-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem; }
.ec-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.ec-left { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.ec-date { font-size: 0.8rem; color: var(--text-muted); }
.ec-strain { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; color: var(--green-light); margin-bottom: 0.2rem; }
.ec-brand { margin-bottom: 0.35rem; }
.ec-photo-wrap { margin: 0.5rem 0; }
.ec-photo { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); }
.ec-details { display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; margin: 0.4rem 0; }
.ec-detail { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.ec-detail i { font-size: 0.7rem; }
.ec-ratings { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0; }
.ec-rating-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ec-rating-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; }
.ec-notes { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin: 0.35rem 0; padding: 0.35rem 0.5rem; background: var(--bg3); border-radius: 6px; border-left: 2px solid var(--border); }
.ec-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* ── Owner dot ── */
.owner-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: #111; flex-shrink: 0; }

/* ── Score pips ── */
.score-pip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.72rem; font-weight: 700; font-family: 'Space Mono', monospace; color: #fff; }
.score-10,.score-9,.score-8 { background: #2d6a4f; }
.score-7,.score-6 { background: #5d7a1a; }
.score-5 { background: #7a6210; }
.score-4,.score-3 { background: #7a3410; }
.score-2,.score-1 { background: #7a1010; }
.composite-score { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 26px; border-radius: 13px; font-weight: 700; font-family: 'Space Mono', monospace; font-size: 0.82rem; color: #fff; padding: 0 7px; }

/* ── Brand badge ── */
.brand-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; background: #2a1f0d; color: #d4ac5a; border: 1px solid #5a3e10; white-space: nowrap; }

/* ── Type badges ── */
.type-badge { display: inline-block; padding: 2px 7px; border-radius: 12px; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.type-indica        { background: #3d1a5c; color: #c9a0f5; }
.type-sativa        { background: #1a4a1a; color: #74c69d; }
.type-hybrid        { background: #1a3a5c; color: #7ab8f5; }
.type-indica-hybrid { background: #4a1a4a; color: #d490f0; }
.type-sativa-hybrid { background: #1a4a2a; color: #90e0a0; }
.type-cbd           { background: #4a3a10; color: #f5d060; }
.type-unknown       { background: #2a2a2a; color: #888; }

/* ── Action buttons ── */
.btn-edit { background: rgba(82,183,136,.15); color: var(--green-light); border: 1px solid var(--green-mid); border-radius: 6px; padding: 4px 8px; }
.btn-edit:hover { background: var(--green-mid); color: #fff; }
.btn-del  { background: rgba(192,57,43,.12); color: #e74c3c; border: 1px solid rgba(192,57,43,.3); border-radius: 6px; padding: 4px 8px; }
.btn-del:hover { background: #c0392b; color: #fff; }

/* ── KPI Cards ── */
.kpi-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem 0.75rem; text-align: center; transition: transform .2s; }
.kpi-card:hover { transform: translateY(-2px); }
.kpi-green { border-top: 3px solid var(--green-light); }
.kpi-gold  { border-top: 3px solid var(--gold-light, #f1c40f); }
.kpi-teal  { border-top: 3px solid var(--teal-light); }
.kpi-icon  { font-size: 1.2rem; color: var(--text-muted); display: block; margin-bottom: 0.2rem; }
.kpi-val   { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.kpi-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 0.1rem; }

/* ── User tabs ── */
.user-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.user-tab { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.45rem 1rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--border); color: var(--text-muted); text-decoration: none; transition: all .2s; }
.user-tab:hover { border-color: var(--green-light); color: var(--green-light); }
.user-tab.active { background: var(--green-mid); border-color: var(--green-mid); color: #fff; }
.user-tab-devon.active { background: #7a6210; border-color: var(--gold); }
.tab-count { background: rgba(255,255,255,.2); border-radius: 10px; padding: 1px 7px; font-size: 0.72rem; }

/* ── Dashboard misc ── */
.leader-row { display: flex; align-items: center; gap: 0.5rem; }
.leader-badge { font-size: 0.72rem; color: var(--text-muted); min-width: 65px; }
.leader-strain { font-weight: 600; color: var(--green-light); font-size: 0.9rem; }
.leader-brand { font-size: 0.72rem; color: var(--text-muted); }
.cat-leader-row { display: flex; align-items: center; gap: 0.5rem; padding: 4px 0; border-bottom: 1px solid var(--border); }
.cat-name { min-width: 80px; font-size: 0.78rem; color: var(--text-muted); text-transform: capitalize; }
.cat-strain { font-size: 0.82rem; font-weight: 500; }
.cat-brand { font-size: 0.72rem; color: var(--text-muted); }
.bar-row { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 5px; }
.bar-label { min-width: 100px; font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 7px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green-mid); border-radius: 4px; transition: width .4s ease; }
.bar-fill-gold { background: var(--gold); }
.bar-fill-brand { background: #b7950b; }
.bar-fill-teal { background: var(--teal-mid); }
.bar-val { min-width: 28px; text-align: right; font-family: 'Space Mono', monospace; font-size: 0.75rem; color: var(--text-muted); }
.brand-score-row { display: flex; align-items: center; gap: 0.5rem; padding: 5px 0; border-bottom: 1px solid var(--border); }
.brand-score-name { min-width: 100px; font-size: 0.82rem; font-weight: 500; color: #d4ac5a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Reference ── */
.ref-score-row { display: flex; align-items: center; gap: 0.6rem; padding: 4px 0; border-bottom: 1px solid var(--border); }
.ref-label { min-width: 80px; font-size: 0.8rem; }
.ref-desc { font-size: 0.78rem; color: var(--text-muted); flex: 1; }
.ref-cat-row { display: flex; gap: 0.6rem; padding: 5px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.ref-cat-name { min-width: 90px; font-weight: 600; color: var(--green-light); font-size: 0.8rem; }

/* ── Misc ── */
.empty-state { color: var(--text-muted); }
.empty-leaf { font-size: 3.5rem; display: block; margin-bottom: 0.75rem; }
.toast-alert { position: fixed; top: 60px; right: 1rem; z-index: 1055; min-width: 240px; }
.alert-success { background: var(--green-dark); color: var(--green-light); border-color: var(--green-mid); }
.alert-info    { background: var(--teal-dark);  color: var(--teal-light);  border-color: var(--teal-mid); }
footer { color: var(--text-muted); font-size: 0.75rem; border-top: 1px solid var(--border); margin-top: 2rem; }
.table-responsive { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
hr { border-color: var(--border); }
.text-muted { color: var(--text-muted) !important; }

/* ── Strain link ── */
.strain-link { text-decoration: none; }
.strain-link:hover .strain-name { color: #fff; text-decoration: underline; }
.strain-link:hover .ec-strain { color: #fff; }

/* ── Entry detail view ── */
.big-score {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 14px;
  font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 900; color: #fff;
  line-height: 1;
}
.big-score-label { font-size: 0.58rem; font-family: 'DM Sans', sans-serif; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; opacity: 0.8; margin-top: 2px; }
.detail-grid { display: flex; flex-direction: column; gap: 0; }
.detail-row { display: flex; align-items: baseline; gap: 0.5rem; padding: 6px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { min-width: 90px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); flex-shrink: 0; }
.detail-value { font-size: 0.9rem; color: var(--text); }
.entry-notes { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin: 0; font-style: italic; }
.ratings-grid { display: flex; flex-direction: column; gap: 0.1rem; }
.rating-display-row { display: flex; align-items: center; gap: 0.75rem; padding: 7px 0; border-bottom: 1px solid var(--border); }
.rating-display-row:last-child { border-bottom: none; }
.rdl-label { min-width: 110px; flex-shrink: 0; }
.rdl-name { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); }
.rdl-hint { display: block; font-size: 0.68rem; color: var(--text-muted); }
.rdl-bar-wrap { display: flex; align-items: center; flex: 1; gap: 0; }
.rdl-bar-track { flex: 1; height: 10px; background: var(--bg3); border-radius: 5px; overflow: hidden; }
.rdl-bar-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }
.score-fill-10,.score-fill-9,.score-fill-8 { background: #2d6a4f; }
.score-fill-7,.score-fill-6 { background: #5d7a1a; }
.score-fill-5 { background: #7a6210; }
.score-fill-4,.score-fill-3 { background: #7a3410; }
.score-fill-2,.score-fill-1 { background: #7a1010; }
.composite-row { display: flex; align-items: center; justify-content: space-between; }
.composite-label { font-size: 0.88rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.entry-full-photo { width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 1px solid var(--border); transition: opacity .2s; }
.entry-full-photo:hover { opacity: 0.9; }
.fs-6-ish { font-size: 0.85rem !important; }

/* ── Mobile overrides ── */
@media (max-width: 576px) {
  .page-title { font-size: 1.4rem; }
  .form-section { padding: 0.75rem; }
  .star-btn { width: 30px; height: 30px; font-size: 0.75rem; }
  .kpi-val { font-size: 1.1rem; }
  .kpi-card { padding: 0.65rem 0.5rem; }
  .filter-card { padding: 0.75rem; }
  .dash-card { padding: 0.85rem; }
  .user-tabs { gap: 0.3rem; }
  .user-tab { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
}
