:root {
  --ih-bg: #0b0e1a;
  --ih-bg-2: #121629;
  --ih-card: #171b30;
  --ih-border: #262c47;
  --ih-cyan: #22d3ee;
  --ih-purple: #8b5cf6;
  --ih-pink: #ec4899;
  --ih-grad: linear-gradient(135deg, var(--ih-cyan), var(--ih-purple) 55%, var(--ih-pink));
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(34, 211, 238, .12), transparent 55%),
    var(--ih-bg);
  min-height: 100vh;
  padding-bottom: 84px; /* prostor za tabbar */
}

/* ---- Topbar ---- */
.ih-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(11, 14, 26, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ih-border);
}
.ih-brand {
  font-weight: 700; font-size: 1.15rem; text-decoration: none;
  background: var(--ih-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ih-brand i { -webkit-text-fill-color: var(--ih-cyan); }
.ih-top-actions { display: flex; align-items: center; gap: 16px; }
.ih-logout { color: #9aa3c7; font-size: 1.25rem; text-decoration: none; }
.ih-logout:hover { color: var(--ih-cyan); }

.ih-main { max-width: 640px; padding-top: 16px; padding-bottom: 8px; }

/* ---- Greeting ---- */
.ih-greeting h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 2px; }

/* ---- Dashboard: sažetak chipovi ---- */
.ih-chips-row { display: flex; gap: 8px; margin: 14px 0; }
.ih-stat {
  flex: 1; text-decoration: none; text-align: center;
  background: var(--ih-card); border: 1px solid var(--ih-border);
  border-radius: 14px; padding: 10px 4px;
}
.ih-stat-num { display: block; font-size: 1.4rem; font-weight: 800; color: #e6e9f5; line-height: 1; }
.ih-stat-lbl { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: #7c85ac; margin-top: 4px; }
.ih-stat.is-warn { border-color: rgba(245, 158, 11, .5); }
.ih-stat.is-warn .ih-stat-num { color: #fcd34d; }

/* ---- Dashboard: brze akcije ---- */
.ih-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.ih-action {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: #cdd3ee; font-size: .72rem; font-weight: 600;
  background: var(--ih-bg-2); border: 1px solid var(--ih-border);
  border-radius: 14px; padding: 12px 4px;
}
.ih-action i {
  font-size: 1.25rem;
  background: var(--ih-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ih-action:hover { border-color: var(--ih-purple); color: #fff; }

/* ---- Dashboard: shopping peek ---- */
.ih-peek { display: flex; flex-wrap: wrap; gap: 6px; }
.ih-peek-tag {
  background: var(--ih-bg-2); border: 1px solid var(--ih-border);
  border-radius: 999px; padding: 5px 12px; font-size: .85rem;
}
.ih-peek-more { color: #7c85ac; font-size: .85rem; align-self: center; }

/* ---- Card ---- */
.ih-card {
  background: var(--ih-card);
  border: 1px solid var(--ih-border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.ih-card-head {
  font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.ih-card-head i {
  background: var(--ih-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-right: 6px;
}
.ih-card-link { font-size: .82rem; font-weight: 500; color: var(--ih-cyan); text-decoration: none; }
.ih-empty { text-align: center; color: #6f78a0; padding: 18px 8px; }
.ih-empty i { font-size: 1.8rem; display: block; margin-bottom: 6px; opacity: .6; }
.ih-empty p { margin: 0; font-size: .92rem; }
.ih-foot { text-align: center; font-size: .85rem; margin-top: 4px; }

/* ---- Tabbar (mobile-first bottom nav) ---- */
.ih-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(11, 14, 26, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--ih-border);
}
.ih-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: #7c85ac; font-size: .68rem; flex: 1;
  padding: 4px 0;
}
.ih-tab i { font-size: 1.25rem; }
.ih-tab.active { color: var(--ih-cyan); }
.ih-tab.disabled { opacity: .45; pointer-events: none; }

/* ---- Auth ---- */
.ih-auth { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.ih-auth-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--ih-card); border: 1px solid var(--ih-border);
  border-radius: 22px; padding: 32px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.ih-auth-logo {
  width: 68px; height: 68px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 20px;
  background: var(--ih-grad); font-size: 2rem; color: #fff;
  box-shadow: 0 12px 30px rgba(139, 92, 246, .45);
}
.ih-auth-title { font-weight: 800; margin-bottom: 2px; }
.ih-auth-sub { color: #7c85ac; margin-bottom: 24px; }
.ih-auth-card .form-label { text-align: left; display: block; color: #aab2d6; font-size: .85rem; }
.ih-auth-card .form-control { text-align: left; background: var(--ih-bg-2); border-color: var(--ih-border); }

.ih-btn-primary {
  background: var(--ih-grad); border: none; color: #fff; font-weight: 600;
  box-shadow: 0 10px 24px rgba(139, 92, 246, .35);
}
.ih-btn-primary:hover { color: #fff; filter: brightness(1.06); }

/* ---- Page head ---- */
.ih-page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.ih-page-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }

/* ---- Quick add ---- */
.ih-quick {
  display: flex; align-items: center; gap: 8px;
  background: var(--ih-card); border: 1px solid var(--ih-border);
  border-radius: 14px; padding: 8px 10px; margin-bottom: 18px;
}
.ih-quick > i { color: var(--ih-purple); font-size: 1.1rem; }
.ih-quick .form-control { background: transparent; border: none; box-shadow: none !important; }
.ih-quick .btn { flex: none; }
.ih-quick-note { color: #9aa3c7; font-size: .88rem; margin-bottom: 14px; }

/* ---- Day + events ---- */
.ih-day { margin-bottom: 16px; }
.ih-day-label {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: #7c85ac; font-weight: 700; margin-bottom: 8px;
}
.ih-day-label.is-today { color: var(--ih-cyan); }
.ih-day-empty { color: #3f465f; font-size: .9rem; padding-left: 2px; }

.ih-event {
  display: flex; gap: 12px; text-decoration: none; color: inherit;
  background: var(--ih-card); border: 1px solid var(--ih-border);
  border-radius: 14px; padding: 12px; margin-bottom: 8px;
}
.ih-event:hover { border-color: var(--ih-purple); }
.ih-event--flat { background: var(--ih-bg-2); }
.ih-event-time {
  min-width: 52px; font-weight: 700; color: var(--ih-cyan); font-size: .95rem;
}
.ih-event-time--date { display: flex; flex-direction: column; line-height: 1.15; }
.ih-event-time--date small { color: #7c85ac; font-weight: 500; }
.ih-allday { font-size: .72rem; color: #7c85ac; font-weight: 600; }
.ih-event-title { font-weight: 600; }
.ih-event-title i { font-size: .8rem; color: var(--ih-purple); margin-left: 4px; }
.ih-event-meta { font-size: .82rem; color: #9aa3c7; margin-top: 2px; }
.ih-dots { display: flex; gap: 4px; margin-top: 6px; }
.ih-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* ---- Toggle (Mjesec/Agenda) ---- */
.ih-toggle {
  display: inline-flex; background: var(--ih-bg-2);
  border: 1px solid var(--ih-border); border-radius: 999px; padding: 3px;
}
.ih-toggle a {
  text-decoration: none; color: #9aa3c7; font-size: .85rem; font-weight: 600;
  padding: 5px 14px; border-radius: 999px;
}
.ih-toggle a.active { background: var(--ih-grad); color: #fff; }

/* ---- Mjesečni kalendar ---- */
.ih-cal { margin-bottom: 16px; }
.ih-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ih-cal-title { font-weight: 700; font-size: 1.05rem; }
.ih-cal-nav {
  text-decoration: none; color: var(--ih-cyan); font-size: 1.6rem; line-height: 1;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; background: var(--ih-bg-2); border: 1px solid var(--ih-border);
}
.ih-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ih-cal-dow { margin-bottom: 4px; }
.ih-cal-dow-cell {
  text-align: center; font-size: .7rem; font-weight: 700; color: #7c85ac;
  text-transform: uppercase;
}
.ih-cal-cell {
  position: relative; aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 6px; text-decoration: none; color: #cdd3ee;
  background: var(--ih-card); border: 1px solid var(--ih-border); border-radius: 12px;
  font-size: .9rem;
}
.ih-cal-cell--empty { background: transparent; border-color: transparent; }
.ih-cal-cell.is-today { border-color: var(--ih-cyan); color: var(--ih-cyan); font-weight: 700; }
.ih-cal-cell.is-selected { background: rgba(139, 92, 246, .22); border-color: var(--ih-purple); }
.ih-cal-num { line-height: 1; }
.ih-cal-dots {
  position: absolute; bottom: 6px; display: flex; gap: 3px; justify-content: center;
}
.ih-cal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* Selektirani dan ispod grida */
.ih-selday {
  background: var(--ih-card); border: 1px solid var(--ih-border);
  border-radius: 18px; padding: 14px; margin-bottom: 16px;
}
.ih-selday-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; margin-bottom: 10px;
}

/* ---- Form ---- */
.ih-form .form-control, .ih-form .form-select { background: var(--ih-bg-2); border-color: var(--ih-border); }
.ih-form .form-label { color: #aab2d6; font-size: .85rem; }
.ih-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ih-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--ih-bg-2); border: 1px solid var(--ih-border);
  border-radius: 999px; padding: 6px 12px; font-size: .9rem;
}
.ih-chip input { accent-color: var(--ih-purple); }
.ih-details summary { cursor: pointer; color: #aab2d6; font-weight: 500; }
.ih-details summary i { color: var(--ih-purple); margin-right: 4px; }

/* ---- Expiry stavke ---- */
.ih-item {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  background: var(--ih-card); border: 1px solid var(--ih-border);
  border-left: 4px solid var(--ih-border);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
}
.ih-item--flat { background: var(--ih-bg-2); }
.ih-item:hover { border-color: var(--ih-purple); }
.ih-item-main { flex: 1; min-width: 0; }
.ih-item-title { font-weight: 600; }
.ih-item-title i { font-size: .8rem; color: #7c85ac; margin-left: 4px; }
.ih-item-meta { font-size: .82rem; color: #9aa3c7; margin-top: 2px; }
.ih-item--expired { border-left-color: #ef4444; }
.ih-item--soon { border-left-color: #f59e0b; }
.ih-item--ok { border-left-color: #10b981; }

.ih-badge {
  flex: none; font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.ih-badge--expired { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.ih-badge--soon { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.ih-badge--ok { background: rgba(16, 185, 129, .15); color: #6ee7b7; }

/* ---- Shopping lista ---- */
.ih-sync { font-size: .8rem; }
.ih-sl-add {
  display: flex; gap: 8px; margin-bottom: 18px;
}
.ih-sl-add .form-control { background: var(--ih-card); border-color: var(--ih-border); flex: 1; }
.ih-sl-add .form-select {
  background: var(--ih-card); border-color: var(--ih-border); width: auto; flex: none;
}
.ih-sl-add .btn { flex: none; }

.ih-sl-group { margin-bottom: 18px; }
.ih-sl-cat {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
  color: #7c85ac; font-weight: 700; margin-bottom: 6px;
}
.ih-sl-clearbtn { background: none; border: none; padding: 0; cursor: pointer; }

.ih-sl-row {
  display: flex; align-items: center;
  background: var(--ih-card); border: 1px solid var(--ih-border);
  border-radius: 12px; margin-bottom: 6px; overflow: hidden;
}
.ih-sl-toggle { flex: 1; min-width: 0; margin: 0; }
.ih-sl-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: inherit; text-align: left;
  padding: 12px 14px; cursor: pointer; font-size: 1rem;
}
.ih-sl-btn i { font-size: 1.15rem; color: #7c85ac; flex: none; }
.ih-sl-btn.is-checked i { color: var(--ih-cyan); }
.ih-sl-name small { color: #9aa3c7; margin-left: 4px; }
.ih-sl-name.is-checked { text-decoration: line-through; color: #6f78a0; }
.ih-sl-del { margin: 0; }
.ih-sl-x {
  background: none; border: none; color: #6f78a0; padding: 12px 14px; cursor: pointer;
}
.ih-sl-x:hover { color: #ef4444; }
.ih-sl-bought .ih-sl-row { background: var(--ih-bg-2); opacity: .85; }

/* ---- Bitni datumi ikona ---- */
.ih-date-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.1rem; color: #fff;
  background: var(--ih-grad);
}

/* ---- Desktop ---- */
@media (min-width: 768px) {
  .ih-main { padding-top: 24px; }
  .ih-greeting h1 { font-size: 1.9rem; }
}
