/* =========================
   Elteks AEG – baaskujundus
   ========================= */

/* Reset / baas */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Arial,sans-serif;
  color: #0f172a;
  background: #fff;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* Väldi vasak-parem "hüpet" kerimisriba ilmumisel/kaomisel */
:root { scrollbar-gutter: stable both-edges; }
html  { overflow-y: scroll; } /* universaalne reservatsioon ka vanemates brauserites */

/* Ühine konteiner – peab olema sama päisel ja sisuosal */
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Päis (kõigil lehtedel sama) */
.header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

/* Päise sisurida – ilma laiuse/paddinguta! */
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;           /* võta kogu .page laius, et userbar surutaks paremale */
}

/* Kui päises on .page ümbris, tee sellest flex-konteiner,
   et header-innerit poleks üldse vaja arvestada */
.header .page { display: block; height: auto; }  /* ära tee .page’ist flexi */

.logo img { height: 28px; width: auto; display: block; }

/* Sisu */
main.page { padding-top: 28px; }
h1 { font-size: 24px; margin: 0 0 16px 0; }
h2 { font-size: 20px; margin: 0 0 12px 0; }
.muted { color: #6b7280; }

/* Kitsas ümbris pealkirjale + vormile (joondub indeksi vasakuga) */
.narrow { max-width: 560px; margin: 0 auto; }
.narrow h1 { margin: 0 0 20px 0; }
.narrow-420{ max-width:420px; margin:0 auto; }

/* Kaardid / lingiplaadid (nagu objektil) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
/* Kaardid / lingiplaadid (hover maha üle saidi) */
.card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  display: block;
  background: #fff;
  color: #0f172a;
  /* võta animatsioonist varju/transform välja */
  transition: background .16s, border-color .16s;
}

/* hover ei muuda enam midagi */
.card:hover {
  background: #fff;           /* sama mis vaikimisi */
  border-color: #e5e7eb;      /* sama mis vaikimisi */
  box-shadow: none;
  transform: none;
}

/* Vormid */
label { display: block; font-weight: 700; margin: 10px 0 6px; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
.input-clickable { cursor: default; } /* kuupäeva/kellaaja välja nool, mitte kiri */

/* Nupud – ümarad ja suuremad (nagu objektil) */
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  font-weight: 700;
}
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: #2563eb; color: #fff; border-color: #1963b2; }
.btn-primary:hover { background: #1d4ed8; }
.btn-light { background: #f3f4f6; color: #111; border-color: #e5e7eb; font-weight: 400; }
.btn-light:hover { background: #e5e7eb; }
.btn-danger { background: #c13535; color: #fff; border-color: #a12a2a; }

/* Väiksem nupp variatsiooniks */
.btn-sm {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
}

/* time/new.php mobiilipaigutus */
@media (max-width: 600px) {
  .actions.actions--time-new {
    flex-direction: column;        /* virna */
    align-items: stretch;
    gap: 14px;                     /* suurem õhuruum nuppude vahel */
  }
  .actions.actions--time-new .btn-primary {
    width: 100%;                   /* Salvesta täislaiuses */
  }
  .actions.actions--time-new .btn-light {
    align-self: flex-start;        /* graafiku nupp vasakule */
    width: fit-content;            /* väiksem nupp */
  }
}

/* Tabelid */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}
th {
  background: #f3f4f6;
  text-align: left;
  font-weight: 600;
}
tr:last-child td { border-bottom: none; }
@media (max-width: 700px){ .actions { flex-direction: column; } }

/* Päise kasutajamenüü (kui kasutusel) */
.userbar { display: flex; align-items: center; gap: 10px; }
.user-dd { position: relative; }
.user-dd summary { list-style: none; cursor: pointer; }
.user-dd summary::-webkit-details-marker { display: none; }
.user-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 0; cursor: pointer; }
.user-btn:focus { outline: 2px solid #6aa3ff; outline-offset: 2px; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: #e5e7eb; display: inline-block; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 14px; }
.user-email { color: #6b7280; font-size: 12px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 8px; z-index: 100; display: none;
}
.user-dd[open] .menu { display: block; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: #111; font: inherit;
}
.menu a:hover, .menu button:hover { background: #f3f4f6; }
.menu hr { border: 0; border-top: 1px solid #e5e7eb; margin: 6px 0; }

/* Popoverid (kalender + kellaajad) – vaikimisi peidus */
.pop {
  position: absolute;
  left: 0; right: auto; top: 100%;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  z-index: 1000;
  min-width: 240px;
  display: none;
}
.pop .hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-bottom: 1px solid #e5e7eb;
}
.pop .hd b { font-size: 14px; }
.pop .hd button { border: 0; background: #fff; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.pop .hd button:hover { background: #f3f4f6; }
.pop .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 8px; }
.pop .cell { padding: 8px; border-radius: 8px; text-align: center; cursor: pointer; }
.pop .cell:hover { background: #f3f4f6; }
.pop .cell.dis { opacity: .45; pointer-events: none; cursor: default; }
.pop .time-list { max-height: 240px; overflow: auto; padding: 8px; }
.pop .time-item { padding: 8px; border-radius: 8px; cursor: pointer; }
.pop .time-item:hover { background: #f3f4f6; }

/* Toast-teated (all paremal) */
.toast-wrap {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  background: #fff;
}
.toast.ok { background: #ecfdf5; border-color: #d1fae5; color: #065f46; }
.toast.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Jalus */
footer.page { padding: 20px 16px 40px; color: #6b7280; text-align: center; }

.item-dd summary::-webkit-details-marker { display: none; }
.item-dd[open] .menu { display: block; }

/* Modaal vaikimisi peidus, ava .is-open klassiga */
.modal-backdrop { display: none; }
.modal-backdrop.is-open { display: flex; }

/* Ohtlik nupp ei muutu halliks hoveril */
.btn-danger:hover { background: #a12a2a; color: #fff; }

/* ---- KUSTUTA KOGU .card VARI JA TÕUS GLOBAALSELT ---- */
.card,
.card * ,
.card::before,
.card::after {
  box-shadow: none !important;
  filter: none !important;                    /* kui kuskil kasutati drop-shadow() */
}

.card,
.card:hover,
.card:focus,
.card:active {
  transform: none !important;                 /* tõus (translate/scale) maha */
  transition: background .16s, border-color .16s !important; /* ilma transformita */
}

/* Kui mõni koht lisas varju utility klassiga (nt .shadow-md), nullime ka need kaardi sees */
.card [class*="shadow"],
.card:hover [class*="shadow"] {
  box-shadow: none !important;
  filter: none !important;
}
/* Ainult link-kaartidele kerge hover (hall taust), ilma varjuta/tõusuta */
.link-card {
  transition: background .16s, border-color .16s !important;
}
.link-card:hover,
.link-card:focus {
  background: #f3f4f6 !important;  /* helehall */
  border-color: #e5e7eb !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Link-kaardid: tüpograafia */
.link-card {
  color: #0f172a;                 /* kogu kaardi tekst jääb tavaline, mitte sinine link */
  text-decoration: none;
}

/* Pealkiri (esimene rida, <strong>) */
.link-card > strong {
  display: block;
  font-weight: 700;
  font-size: 16px;                /* vajadusel kohanda 15–17px */
  line-height: 1.25;
  color: #0f172a;                 /* must */
}

/* Alamtekst (meta-rida) – veidi väiksem ja helehall */
.link-card .meta {
  margin-top: 4px;
  font-size: 14px;                /* väiksem kui pealkiri */
  line-height: 1.35;
  color: #6b7280;                 /* helehall */
  font-weight: 400;
}

/* Hoveril muudame vaid tausta; tekstivärvid ei muutu */
.link-card:hover,
.link-card:focus {
  background: #f3f4f6 !important;
  border-color: #e5e7eb !important;
}
.link-card:hover > strong,
.link-card:hover .meta,
.link-card:focus > strong,
.link-card:focus .meta {
  color: inherit;                 /* väldib halli → musta “hüpet” */
}

/* horisontaalne nupuriba mobiilis */
@media (max-width:700px){
  .actions.actions--row{
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    gap:8px !important;
    justify-content:space-between !important;
    align-items:stretch !important;
  }
  .actions.actions--row > *{
    flex:1 1 0 !important;
    min-width:0 !important;
  }
  .actions.actions--row > a.btn,
  .actions.actions--row > button.btn{
    display:inline-flex !important;
    width:auto !important;
    height:40px !important;
    line-height:1 !important;
  }
}
.card.form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  max-width: 600px;
  margin: 0 auto;
}

.card-box.warn {
  background: #fff7ed;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
