/* PriceWatch — Alsendo visual identity: Violet #6D3ADF, Mint #2DF7C2 (accent only), Dark Violet #2F2946 text,
   Light Grey #F7F7F7 background, Poppins. */
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(fonts/poppins-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(fonts/poppins-400-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(fonts/poppins-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(fonts/poppins-600-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(fonts/poppins-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(fonts/poppins-700-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0; }

:root {
  --violet: #6D3ADF; --violet-light: #9C84EF; --mint: #2DF7C2; --dark: #2F2946;
  --grey: #DDDDDD; --bg: #F7F7F7; --white: #FFFFFF;
  --up: #b4235a; --down: #0f7a5c;            /* price up (worse for customer) / down — text-safe on white */
  --radius: 14px; --shadow: 0 2px 10px rgba(47, 41, 70, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Poppins, Arial, sans-serif; color: var(--dark); background: var(--bg); font-size: 14px; line-height: 1.5; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.muted { color: #6b6680; }
.small { font-size: 12px; }

/* header: diagonal Dark Violet -> Violet gradient, mint underline */
.topbar { background: linear-gradient(120deg, var(--dark) 0%, var(--violet) 100%); color: var(--white); border-bottom: 3px solid var(--mint); }
.topbar .inner { max-width: 1440px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 700; font-size: 19px; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand img { display: block; }
.brand-sep { width: 1px; height: 28px; background: rgba(255,255,255,.35); }
.brand .product { font-weight: 600; font-size: 17px; }
.brand.dark { color: var(--dark); }
.brand.dark .brand-sep { background: var(--grey); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--white); opacity: .85; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 13px; }
.nav a:hover { opacity: 1; background: rgba(255,255,255,.1); text-decoration: none; }
.nav a.active { opacity: 1; background: rgba(255,255,255,.16); box-shadow: inset 0 -2px 0 var(--mint); }
/* "Konfigurace" dropdown */
.navdrop { position: relative; }
.navdrop > summary { list-style: none; cursor: pointer; color: var(--white); opacity: .85; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 13px; user-select: none; white-space: nowrap; }
.navdrop > summary::-webkit-details-marker { display: none; }
.navdrop > summary::after { content: "▾"; margin-left: 6px; font-size: 11px; }
.navdrop[open] > summary::after { content: "▴"; }
.navdrop > summary:hover, .navdrop[open] > summary { opacity: 1; background: rgba(255,255,255,.1); }
.navdrop > summary.active { opacity: 1; background: rgba(255,255,255,.16); box-shadow: inset 0 -2px 0 var(--mint); }
.navdrop > summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.navdrop-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 270px; background: var(--white); color: var(--dark); border-radius: 12px; box-shadow: 0 10px 30px rgba(47, 41, 70, .22); padding: 6px; border-top: 3px solid var(--mint); }
.navdrop-panel a { display: block; color: var(--dark); opacity: 1; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.navdrop-panel a span { display: block; font-weight: 400; font-size: 11px; color: #6b6680; }
.navdrop-panel a:hover { background: #f2edfd; text-decoration: none; }
.navdrop-panel a.active { background: #f2edfd; color: var(--violet); box-shadow: inset 3px 0 0 var(--violet); }
.navdrop-sep { margin: 6px 12px 2px; padding-top: 8px; border-top: 1px solid var(--grey); font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--violet); }
.userbox { font-size: 12px; display: flex; gap: 12px; align-items: center; }
.userbox a { color: var(--mint); font-weight: 600; }

main { max-width: 1440px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 0; }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card.violet { background: var(--violet); color: var(--white); }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.sidebar { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.sidebar { grid-template-columns: 1fr; } }

.stat { border-top: 3px solid var(--violet); }
.stat .value { font-size: 26px; font-weight: 700; }
.stat .label { font-size: 12px; color: #6b6680; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 9px 16px; font: 600 13px Poppins, Arial, sans-serif; cursor: pointer; background: var(--violet); color: var(--white); }
.btn:hover { background: #5a2cc7; text-decoration: none; }
.btn.secondary { background: var(--white); color: var(--violet); box-shadow: inset 0 0 0 1.5px var(--violet); }
.btn.secondary:hover { background: #f2edfd; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: var(--white); color: var(--up); box-shadow: inset 0 0 0 1.5px var(--up); }
.btn:disabled { opacity: .5; cursor: wait; }

/* forms */
label { font-size: 12px; font-weight: 600; display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; font: 13px Poppins, Arial, sans-serif; color: var(--dark); padding: 8px 10px; border: 1.5px solid var(--grey); border-radius: 10px; background: var(--white); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109, 58, 223, .15); }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 110px; }

/* filter panel */
.filter-group { border-top: 1px solid var(--grey); padding: 10px 0; }
.filter-group:first-child { border-top: 0; padding-top: 0; }
.filter-group summary { cursor: pointer; font-weight: 600; font-size: 13px; list-style: none; display: flex; justify-content: space-between; }
.filter-group summary::after { content: "▾"; color: var(--violet); }
.filter-group[open] summary::after { content: "▴"; }
.checks { max-height: 220px; overflow: auto; margin-top: 8px; display: grid; gap: 2px; }
.checks label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; font-size: 13px; cursor: pointer; }
.checks .grp { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--violet); margin-top: 6px; }
.checks.inline { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.check-tools { font-size: 11px; display: flex; gap: 10px; margin-top: 4px; }
.check-tools a { cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--violet); }
.filter-search { margin-top: 6px; padding: 5px 8px !important; font-size: 12px !important; }

/* segmented range switch */
.segmented { display: inline-flex; background: var(--white); border-radius: 10px; box-shadow: inset 0 0 0 1.5px var(--grey); padding: 3px; }
.segmented a, .segmented button { white-space: nowrap; border: 0; background: none; font: 600 12px Poppins, Arial, sans-serif; color: var(--dark); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.segmented a:hover { text-decoration: none; background: #f2edfd; }
.segmented .active { background: var(--violet); color: var(--white); }

/* tables */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: #6b6680; padding: 8px 10px; border-bottom: 2px solid var(--grey); white-space: nowrap; position: sticky; top: 0; background: var(--white); }
td { padding: 8px 10px; border-bottom: 1px solid #eeeeee; vertical-align: top; }
tr:hover td { background: #faf8ff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.up { color: var(--up); font-weight: 600; }
.down { color: var(--down); font-weight: 600; }
.zaslat { font-weight: 700; color: var(--violet); }
.bad { color: var(--up); font-weight: 600; }      /* from Zaslat's point of view: competitor cheaper */
.good { color: var(--down); font-weight: 600; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #efeaff; color: var(--violet); }
.badge.ok { background: #dcfcf2; color: var(--down); }
.badge.error { background: #fde7ef; color: var(--up); }
.badge.running, .badge.queued { background: #fff4d6; color: #8a5a00; }
.badge.grey { background: #eeeeee; color: #555; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border-left: 4px solid var(--violet); background: #f2edfd; }
.alert.error { border-color: var(--up); background: #fde7ef; }
.alert.ok { border-color: var(--down); background: #dcfcf2; }

.chart { width: 100%; height: 420px; }
.chart.short { height: 320px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2.5px solid #e4dcfb; border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: linear-gradient(135deg, var(--dark) 0%, var(--violet) 70%, var(--violet-light) 125%); position: relative; overflow: hidden; color: var(--white); padding: 56px; display: flex; flex-direction: column; justify-content: flex-end; }
.login-art h1 { font-size: 40px; line-height: 1.15; position: relative; }
.login-art p { position: relative; }
/* signet centred in a glowing mint ring (signature Alsendo "glow arc") */
.hero-mark { position: absolute; top: 12%; left: 50%; transform: translateX(-50%); width: 400px; height: 400px; display: grid; place-items: center; }
.hero-mark .glow { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--mint); opacity: .6; filter: drop-shadow(0 0 14px var(--mint)); }
.hero-mark img { width: 46%; height: auto; position: relative; filter: drop-shadow(0 12px 30px rgba(20, 10, 60, .45)); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form form { width: 100%; max-width: 360px; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* grid children may shrink (tables/pre scroll inside instead of widening the page) */
.grid > * { min-width: 0; }
pre { max-width: 100%; }

/* mobile: logo row + horizontally scrollable nav row */
@media (max-width: 900px) {
  .topbar .inner { height: auto; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px 0; }
  .brand img { height: 28px; }
  .brand .product { font-size: 15px; }
  .userbox { margin-left: auto; }
  .topbar .inner { position: relative; }
  .nav { order: 3; flex: 0 0 100%; flex-wrap: wrap; gap: 2px; padding-bottom: 6px; }
  .nav a, .navdrop > summary { white-space: nowrap; padding: 6px 10px; }
  .navdrop { position: static; }
  .navdrop-panel { left: 12px; right: 12px; top: calc(100% - 2px); min-width: 0; }
  main { padding: 20px 16px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .segmented { flex-wrap: wrap; }
  h1 { font-size: 22px; }
}

/* page-wide filter bar (one row of popovers above the charts) */
.filterbar { padding: 14px 20px; }
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fb-title { margin-right: 6px; }
details.pop { position: relative; }
details.pop > summary { list-style: none; cursor: pointer; padding: 7px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1.5px var(--grey);
  font-weight: 600; font-size: 13px; background: var(--white); user-select: none; }
details.pop > summary::after { content: " ▾"; color: var(--violet); }
details.pop[open] > summary { box-shadow: inset 0 0 0 1.5px var(--violet); }
details.pop .pop-body { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 280px; max-width: 420px; background: var(--white);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(47, 41, 70, .18); padding: 12px 14px; border-top: 0; }
details.pop:not([open]) > .pop-body { display: none; }
/* phones: an open popover spans the card instead of hanging off the screen edge */
@media (max-width: 700px) {
  .card { position: relative; }
  details.pop { position: static; }
  details.pop .pop-body { left: 10px; right: 10px; min-width: 0; max-width: none; }
}
.fb-active { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #f2edfd; color: var(--violet); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
