.hg-shell{max-width:1400px}
.hg-toolbar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:14px;margin-bottom:14px}
.hg-year-switch{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
/* styles.css annab .outline-button-ile globaalse margin:14px 21px 0 — siin
   peavad kõik tööriistariba elemendid olema ühel joonel. */
.hg-year-switch .outline-button{margin:0}
.hg-year-switch .outline-button,.hg-year-switch .partner-filter{height:34px;box-sizing:border-box}
.hg-year-switch strong{font:600 16px 'Space Grotesk',sans-serif}
.hg-undone-filter{margin-left:12px}
.hg-partner-filter{margin-left:12px}
.hg-undone-filter.active{background:#ffebe3;border-color:#f0c9bc;color:var(--coral-ink);font-weight:700}
.hg-legend{display:flex;flex-wrap:wrap;gap:14px}
.hg-legend-item{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted)}
.hg-dot{width:9px;height:9px;border-radius:3px;display:inline-block}
.hg-dot.done{background:#2f7a58}
.hg-dot.due{background:#c8891f}
.hg-dot.planned{background:transparent;box-shadow:inset 0 0 0 1.5px #8a938d}

.hg-table-wrap{overflow:auto;max-height:78vh;border:1px solid var(--line);border-radius:10px;background:#fff}
.hg-scroll-hint{display:none}
.hg-table{border-collapse:collapse;width:100%;min-width:1180px;font-size:11px}
.hg-table th,.hg-table td{border:1px solid #e7ebe8;padding:7px 8px;text-align:center;white-space:nowrap}
.hg-table thead th{background:#f6f8f5;color:var(--muted);font-size:11px;letter-spacing:.3px;text-transform:uppercase}
.hg-table tbody td:nth-child(1),.hg-table tbody td:nth-child(2),.hg-table tbody td:nth-child(3),.hg-table tbody td:nth-child(4){text-align:left;white-space:normal}
.hg-table tbody td:nth-child(1){font-weight:600;color:var(--ink)}
.hg-table tbody td:nth-child(3){font-weight:700;font-size:11px;color:#4c564f}
.hg-table tbody td:nth-child(4){font-size:11px;color:var(--muted);padding:3px 4px}
.hg-note-cell{display:flex;align-items:center;gap:4px}
.hg-note-input{width:100%;min-width:120px;box-sizing:border-box;border:1px solid transparent;border-radius:5px;padding:4px 6px;font:inherit;color:inherit;background:transparent}
.hg-note-input:hover{border-color:var(--line)}
.hg-note-input:focus{border-color:#8fd2ab;background:#fff;outline:none}
.hg-next-note-btn{flex:none;width:20px;height:20px;line-height:1;border:1px solid var(--line);border-radius:5px;background:#fff;color:#c7ceca;font-size:11px;cursor:pointer;padding:0}
.hg-next-note-btn:hover{border-color:#8a938d;color:var(--muted)}
.hg-next-note-btn.active{background:#fdf1da;border-color:#f0d29a;color:var(--amber-ink)}
.hg-warn{display:inline-block;margin-left:3px;color:#c8891f;font-size:11px;cursor:default}
.hg-group-a{background:#fbfcfa}
.hg-group-b{background:#fff}

/* Freeze päise rida (mõlemad read) ja objekti veerg, et laia/pika tabeli
   juures säiliks kontekst. Teine päiserida (kuunimed) nihutatakse esimese
   rea tegeliku kõrguse võrra allapoole — see arvutatakse JS-is. */
.hg-table thead tr:first-child th{position:sticky;top:0;z-index:2;background:#f6f8f5}
.hg-table thead tr:last-child th{position:sticky;top:var(--hg-row1-height,28px);z-index:2;background:#f6f8f5}
.hg-table thead tr:first-child th:first-child{left:0;z-index:3}
.hg-table thead th.q-shade{background:#e9ece9}
#hg-search{width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:6px;padding:5px 7px;font:600 11px 'Space Grotesk',sans-serif;text-transform:none;letter-spacing:0;color:var(--ink);background:#fff}
#hg-search::placeholder{color:var(--muted);font-weight:500}
.hg-table tbody td:nth-child(1){position:sticky;left:0;z-index:1;background-color:inherit}

.hg-cell{cursor:default;font-weight:700;position:relative}
.hg-cell.clickable{cursor:pointer}
.hg-cell.clickable:hover{outline:2px solid #c7d2cb;outline-offset:-2px}
/* Kvartalite veerud vaheldumisi valge/hall, et I/II/III/IV KV oleks reas
   silmaga kergesti eristatavad. Peab tulema ENNE visit-* reegleid, et
   päris kande roheline/punane värv jääks alati peale (võrdse
   spetsiifilisuse korral võidab hilisem reegel). */
.hg-cell.q-shade{background:#f2f4f2}
.hg-cell.visit-quarterly{background:#e4f3eb;color:var(--green-ink)}
.hg-cell.visit-annual{background:#fbe2df;color:#b8402a}
/* Plaanitud (veel tegemata) hooldus — õõnes raam, MITTE täidetud taust, et
   see ei paistaks visuaalselt sama, mis juba tehtud hooldus. */
.hg-cell.planned-quarterly{box-shadow:inset 0 0 0 1.5px #8fd2ab;color:#4c564f}
.hg-cell.planned-annual{box-shadow:inset 0 0 0 1.5px #e8a99f;color:#4c564f}
.hg-cell .hg-dot{margin-right:3px;vertical-align:1px}

/* Jooksva kuu veerg märgitakse sinise ääre, mitte taustavärviga — nii ei
   segune see kande enda olekuvärviga (roheline/punane). */
.hg-cell.current-month{box-shadow:inset 0 2px 0 #4c6ef5, inset 0 -2px 0 #4c6ef5}

@media(max-width:760px){
  .hg-toolbar{flex-direction:column;align-items:flex-start}

  /* Objekt/Leping/Teenus/Märkus veergudel polnud laiuspiirangut — kitsal
     ekraanil sõid need (eriti pikad objekti/kliendi nimed ja 120px
     märkuseväli) peaaegu kogu nähtava ala ära, enne kui ükski kuuveerg
     jõudis üldse paista. Kuna mobiilis brauser peidab kerimisriba,
     tundus, nagu graafikut polekski, kuigi see oli lihtsalt paremal
     pool nähtamatult "ootel". Kitsendame need veerud, et osa kuudest
     oleks kohe, ilma kerimiseta näha. */
  .hg-table{min-width:900px}
  .hg-table tbody td:nth-child(1),.hg-table thead th:nth-child(1){max-width:84px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .hg-table tbody td:nth-child(1) small{display:none}
  .hg-table tbody td:nth-child(2),.hg-table thead th:nth-child(2){max-width:40px;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .hg-table tbody td:nth-child(3){max-width:44px;font-size:11px}
  .hg-table tbody td:nth-child(4),.hg-table thead th:nth-child(4){max-width:70px}
  .hg-note-input{min-width:0;font-size:11px;padding:4px 3px}
  .hg-scroll-hint{display:block;text-align:right;font-size:11px;color:var(--muted);margin:6px 2px 0}
}
/* Plaanitud kuupäeva soovitus (vt hooldusgraafik.js openPlanModal, due-planner.js) */
.plan-suggestion{margin-top:12px;background:#f1f9f4;border:1px solid #cde8d8;border-radius:8px;padding:10px 12px}
.plan-suggestion-text{margin:0;font-size:11.5px;line-height:1.5;color:#2f6b52}
.plan-gap-warn{color:var(--coral-ink)!important;font-weight:600}
/* Objekti nimi graafikus — link objekti kaardile */
.hg-object-link{color:inherit;text-decoration:none;font-weight:600}
.hg-object-link:hover{color:var(--coral,#ee795f);text-decoration:underline}
