/* VIAVIVA UI-01 — „Моето ViaViva“ (само за my-viaviva.html). Не засяга portal-v2.css. */
:root{
  --vv-navy:#153a6b;
  --vv-navy-strong:#102f5b;
  --vv-blue:#0788bd;
  --vv-blue-ink:#06699a;
  --vv-blue-soft:#e6f3fa;
  --vv-bg:#f4f8fc;
  --vv-surface:#fff;
  --vv-line:#d8e2ed;
  --vv-line-strong:#b9c9da;
  --vv-text:#17243a;
  --vv-muted:#55657b;
  --vv-dev:#6b5a1e;
  --vv-dev-bg:#fbf3d8;
  --vv-preview:#0b5f4a;
  --vv-preview-bg:#ddf3ea;
  --vv-focus:#0a9dce;
  --vv-radius:20px;
  --vv-radius-sm:12px;
  --vv-shadow:0 12px 32px rgba(31,70,112,.08);
  --vv-tap:48px;
}
*{box-sizing:border-box}
html{background:var(--vv-bg);-webkit-text-size-adjust:100%}
body.vv{
  margin:0;min-height:100vh;color:var(--vv-text);
  background:radial-gradient(circle at 15% 0,rgba(9,151,201,.08),transparent 32rem),linear-gradient(180deg,#f8fbfe 0,#f2f7fb 100%);
  font:16px/1.5 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.ico{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ico-lg{width:30px;height:30px}
.ico-sm{width:16px;height:16px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
[hidden]{display:none!important}
a{color:var(--vv-blue-ink)}
h1,h2,h3{color:var(--vv-navy-strong);letter-spacing:-.015em;margin:0}
p{margin:0;overflow-wrap:anywhere}

/* Фокус — видим за клавиатура */
:focus{outline:none}
:focus-visible{outline:3px solid var(--vv-focus);outline-offset:3px;border-radius:10px}
main:focus-visible{outline:none}

.skip{position:absolute;left:12px;top:-60px;z-index:50;background:var(--vv-navy);color:#fff;padding:12px 16px;border-radius:10px;text-decoration:none;font-weight:600}
.skip:focus{top:12px}

/* Горна лента */
.topbar{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.94);backdrop-filter:saturate(1.4) blur(10px);-webkit-backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--vv-line);padding-top:env(safe-area-inset-top)}
.topbar-in{max-width:1200px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:10px 16px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:12px;min-width:0}
.brand img{width:56px;height:56px;border-radius:14px;object-fit:contain;box-shadow:0 2px 8px rgba(21,58,107,.12)}
.brand h1{font-size:22px;line-height:1.15}
.brand-sub{color:var(--vv-muted);font-size:14px}
.account{position:relative;display:flex;align-items:center;gap:6px;margin-left:auto}
.bar-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--vv-tap);min-width:var(--vv-tap);
  padding:8px 14px;border:1px solid var(--vv-line);border-radius:14px;background:#fff;color:var(--vv-navy);
  font-weight:600;font-size:15px;line-height:1.2;font-family:inherit;text-decoration:none;cursor:pointer;
}
.bar-btn:hover{background:var(--vv-blue-soft);border-color:var(--vv-line-strong)}
.bar-btn[aria-expanded="true"]{background:var(--vv-blue-soft);border-color:var(--vv-blue)}
.bar-btn-out{background:var(--vv-navy);border-color:var(--vv-navy);color:#fff}
.bar-btn-out:hover{background:var(--vv-navy-strong);border-color:var(--vv-navy-strong)}
.bar-btn:disabled{opacity:.6;cursor:progress}

/* Меню „Настройки“ */
.settings{position:relative}
.menu{position:absolute;right:0;top:calc(100% + 8px);width:min(340px,calc(100vw - 32px));background:#fff;border:1px solid var(--vv-line);border-radius:16px;box-shadow:0 18px 48px rgba(21,58,107,.18);padding:10px;z-index:30}
.menu-title{font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--vv-muted);padding:6px 10px 8px}
.menu-list{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.menu-item{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:10px 12px;border:0;border-radius:12px;background:transparent;color:var(--vv-text);font-weight:600;font-size:15px;line-height:1.3;font-family:inherit;text-align:left;text-decoration:none;cursor:pointer}
.menu-item .ico{color:var(--vv-blue-ink)}
.menu-item small{display:block;font-weight:400;font-size:13px;color:var(--vv-muted)}
.menu-item:hover{background:var(--vv-blue-soft)}
.menu-help{font-size:14px;color:var(--vv-muted);padding:0 10px}
.menu-help:not(:empty){padding:8px 10px 4px}

/* Основно съдържание */
main{max-width:1200px;margin:0 auto;padding:20px 16px 32px}
.hero{display:flex;align-items:center;justify-content:space-between;gap:16px 24px;flex-wrap:wrap;padding:24px;border-radius:var(--vv-radius);background:linear-gradient(135deg,var(--vv-navy) 0,#1b5a8f 60%,#0a6e9e 100%);color:#fff;box-shadow:var(--vv-shadow)}
.hero h2{color:#fff;font-size:clamp(22px,3.2vw,30px);line-height:1.15}
.hero-text{flex:1 1 320px;min-width:0}
.hero-text p{margin-top:6px;color:#e3eef8;max-width:46ch}
.cta{
  flex:0 1 auto;display:flex;align-items:center;gap:14px;min-height:72px;padding:14px 22px;border-radius:18px;
  background:#fff;color:var(--vv-navy-strong);text-decoration:none;box-shadow:0 10px 24px rgba(4,30,60,.25);
  font-weight:800;font-size:22px;line-height:1.15;
}
.cta .ico-lg{color:var(--vv-blue-ink)}
.cta small{display:block;font-weight:500;font-size:14px;color:var(--vv-muted);margin-top:2px}
.cta-arrow{margin-left:auto;color:var(--vv-blue-ink);transition:transform .15s}
.cta:hover .cta-arrow{transform:translateX(3px)}
.cta:hover{background:#f3f9fd}
.cta:focus-visible{outline-color:#fff;outline-offset:4px}

.status{min-height:24px;margin:14px 2px;color:var(--vv-muted)}
.status:empty{margin:6px 0;min-height:0}

.card{background:var(--vv-surface);border:1px solid var(--vv-line);border-radius:var(--vv-radius);padding:20px;box-shadow:var(--vv-shadow)}
.guest{display:grid;gap:12px;justify-items:start}
.guest h2{font-size:22px}

.profile-bar{display:grid;grid-template-columns:auto minmax(0,420px);justify-content:start;align-items:center;gap:6px 14px;margin:0 0 16px;padding:14px 16px;background:#fff;border:1px solid var(--vv-line);border-radius:16px}
.profile-label{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--vv-navy)}
.profile-label .ico{color:var(--vv-blue-ink)}
select{
  width:100%;min-height:var(--vv-tap);padding:10px 40px 10px 12px;border:1px solid var(--vv-line-strong);border-radius:12px;background:#fff;color:var(--vv-text);
  font-size:16px;line-height:1.3;font-family:inherit;appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23153a6b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;background-size:18px;
}
.hint{grid-column:2;font-size:13px;color:var(--vv-muted)}

/* Мрежа с разделите — редът в HTML е редът на четене */
.grid{display:grid;grid-template-columns:1fr;gap:14px;align-items:start}
.mod{display:flex;flex-direction:column;gap:14px;min-width:0}
.mod-head{display:flex;align-items:flex-start;gap:12px}
.mod-head>div{min-width:0;flex:1}
.mod h2{font-size:19px;line-height:1.25}
.mod-sub{color:var(--vv-muted);font-size:14px;margin-top:3px}
.mod-ico{display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:var(--vv-blue-soft);color:var(--vv-blue-ink);flex:none}
.mod-text{color:var(--vv-muted);font-size:15px}
.mod-actions{display:flex;flex-wrap:wrap;gap:8px}
.mod-dev{background:#fbfcfe;box-shadow:none;border-style:dashed;border-color:var(--vv-line-strong)}
.mod-dev .mod-ico{background:#eef1f5;color:#5c6b80}
.mod-dev h2{color:#2c3d55}
.badge{display:inline-block;padding:2px 10px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.6}
.badge-dev{background:var(--vv-dev-bg);color:var(--vv-dev)}
.badge-preview{background:var(--vv-preview-bg);color:var(--vv-preview)}
.count{flex:none;min-width:32px;height:32px;padding:0 10px;border-radius:999px;background:var(--vv-blue-soft);color:var(--vv-navy);font-weight:700;display:grid;place-items:center;font-size:14px}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--vv-tap);padding:10px 16px;border-radius:12px;border:1px solid transparent;font-weight:600;font-size:15px;line-height:1.25;font-family:inherit;text-decoration:none;cursor:pointer;text-align:center}
.btn-primary{background:var(--vv-navy);color:#fff}
.btn-primary:hover{background:var(--vv-navy-strong)}
.btn-secondary{background:var(--vv-blue-soft);color:var(--vv-navy-strong);border-color:#c5e2f1}
.btn-secondary:hover{background:#d6ecf7}
.btn-ghost{background:#fff;color:var(--vv-navy);border-color:var(--vv-line-strong)}
.btn-ghost:hover{background:var(--vv-blue-soft)}
.btn:disabled{opacity:.6;cursor:progress}

.badge-info{background:#e3effb;color:#123f73}
.badge-live{background:var(--vv-preview-bg);color:var(--vv-preview)}
.m2-groups{display:grid;gap:8px}
.m2-group{display:grid;gap:8px;padding:12px;border-radius:12px;background:#f1f4f8}
.mod-live .m2-group{background:#f5f9fc;border:1px solid var(--vv-line)}
.m2-group-head{display:flex;gap:10px;align-items:flex-start}
.m2-group-head .ico{width:20px;height:20px;margin-top:2px;color:#5c6b80}
.mod-live .m2-group-head .ico{color:var(--vv-blue-ink)}
.m2-group h3{font-size:15px;line-height:1.3;color:#2c3d55}
.m2-desc{font-size:13px;color:var(--vv-muted)}
.m2-slot{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.m2-slot .btn{min-height:44px;padding:8px 14px;font-size:14px}
.m2-count{font-size:13px;font-weight:600;color:var(--vv-navy)}
.soon{display:inline-block;font-size:12px;font-weight:700;color:#4f5e72;text-transform:uppercase;letter-spacing:.04em;padding:2px 8px;border-radius:999px;background:#e4e9f0}

/* Часове */
.appts{display:grid;gap:10px}
.appts-group{margin:4px 0 0;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--vv-muted)}
.appt{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;align-items:start;padding:12px;border:1px solid var(--vv-line);border-radius:14px;background:#fff}
.appt-date{grid-row:span 2;display:grid;place-items:center;min-width:62px;padding:6px 8px;border-radius:12px;background:var(--vv-blue-soft);color:var(--vv-navy-strong);text-align:center;line-height:1.1}
.appt-date b{font-size:22px}
.appt-date span{font-size:12px;text-transform:uppercase;font-weight:600}
.appt-main{min-width:0}
.appt-title{font-weight:700;color:var(--vv-navy-strong)}
.appt-meta{color:var(--vv-muted);font-size:14px}
.appt-tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center;grid-column:2}
.tag{display:inline-block;padding:1px 9px;border-radius:999px;font-size:13px;background:#eef2f7;color:#34445a}
.tag-booked{background:#ddf3ea;color:#0b5f4a}
.tag-cancelled{background:#fde8e8;color:#8f1d1d}
.appt .btn{grid-column:1/-1;justify-self:start;margin-top:6px}
.appt-past{background:#fbfcfe}
.appt-past .appt-date{background:#eef1f5;color:#3b4a60}
.empty{color:var(--vv-muted);padding:6px 0}
/* FIX02: следващ час + раздели „Предстоящи / Минали / Отменени“ */
.appt-next{display:grid;gap:8px}
.appt-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:4px;padding:4px;border-radius:14px;background:#eef3f8}
.appt-tab{display:flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:6px 8px;border:1px solid transparent;border-radius:11px;background:transparent;color:var(--vv-navy);font-family:inherit;font-weight:600;font-size:15px;line-height:1.2;cursor:pointer}
.appt-tab:hover{background:#fff}
.appt-tab[aria-expanded="true"]{background:#fff;border-color:var(--vv-blue);box-shadow:0 2px 8px rgba(21,58,107,.12)}
.appt-tab-count{min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:#dbe6f1;color:var(--vv-navy);font-size:13px;font-weight:700;display:inline-grid;place-items:center}
.appt-tab[aria-expanded="true"] .appt-tab-count{background:var(--vv-navy);color:#fff}
.appt-panel{display:grid;gap:10px;margin-top:2px}
.appt-list{display:grid;gap:10px}
.appt-more{justify-self:start}
@media (max-width:420px){
  .appt-tab{flex-direction:column;gap:3px;font-size:13px;padding:6px 4px}
  .appt-more{justify-self:stretch}
}
.empty a{font-weight:600}

.foot{max-width:1200px;margin:0 auto;padding:8px 16px calc(28px + env(safe-area-inset-bottom));color:var(--vv-muted);font-size:13px}

/* Таблет */
@media (min-width:640px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mod-wide-lg{grid-column:1/-1}
}
/* Таблет: досието и часовете на цял ред */
@media (min-width:640px) and (max-width:1023px){
  #recordCard,.mod-wide{grid-column:1/-1}
}
/* Ред с час: бутонът вдясно само когато самият списък е достатъчно широк */
.appts{container-type:inline-size}
@container (min-width:560px){
  .appt{grid-template-columns:auto minmax(0,1fr) auto}
  .appt .btn{grid-column:3;grid-row:1/span 2;align-self:center;margin:0}
  .appt-tags{grid-column:2}
}
/* Компютър */
@media (min-width:1024px){
  main{padding-top:28px}
  .hero{padding:32px 36px}
  .cta{min-width:340px}
  .grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
  .mod-wide{grid-column:span 2}
  .mod-wide-lg{grid-column:span 2}
  .card{padding:22px 24px}
}
/* Телефон */
@media (max-width:639px){
  .hero{padding:20px}
  .cta{flex:1 1 100%;min-height:76px}
  .profile-bar{grid-template-columns:1fr}
  .hint{grid-column:1}
  .mod-actions .btn{flex:1 1 100%}
  .wide-only{display:none}
  .settings{position:static}
  .menu{width:min(360px,calc(100vw - 24px))}
  .bar-btn{flex-direction:column;gap:2px;padding:6px 8px;min-width:60px;font-size:12px;border-radius:12px}
  .bar-btn .ico{width:22px;height:22px}
}
@media (max-width:420px){
  .topbar-in{padding:8px 12px}
  main{padding:14px 12px 24px}
  .brand img{width:44px;height:44px;border-radius:11px}
  .brand h1{font-size:19px}
  .brand-sub{font-size:13px}
  .card{padding:16px}
  .cta{font-size:20px;padding:14px 16px;gap:12px}
}
@media (max-width:359px){
  .brand-sub{display:none}
  .account{gap:4px}
  .bar-btn{min-width:54px;padding:6px 6px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media (forced-colors:active){.card,.bar-btn,.btn,.cta,.menu{border:1px solid CanvasText}.badge,.soon{border:1px solid CanvasText}}
@media print{.topbar,.cta,.foot{display:none}}
