:root{
  /* --- Brand farby Agrocoop Huta --- */
  --primary:#005300;          /* tmavá zelená — hlavná akčná farba (biely text OK, ~9:1) */
  --primary-hover:#006900;    /* hover — o čosi svetlejšia zelená (biely text stále AA) */
  --primary-dark:#003a00;     /* pressed / aktívny stav */
  --primary-light:#75a04f;    /* accent zelená — jemné hover stavy, rámčeky */
  --primary-soft:#e4f1e0;     /* veľmi svetlý zelený podklad — aktívne prvky, čipy */
  --gold:#ffc010;             /* zlatý akcent — strídmo; VŽDY s tmavým textom */
  --gold-soft:#fff3cd;        /* svetlý zlatý podklad */
  --gold-ink:#5c4600;         /* tmavý text na zlatom/amber podklade */

  /* Pohlavie — funkčné farby, NIE brand; ostávajú modrá/ružová */
  --blue:#1a73e8;
  --blue-dark:#1557b0;
  --blue-soft:#e8f0fe;
  --pink:#d01884;
  --pink-soft:#fce4ec;

  --ink:#202124;
  --ink-2:#5f6368;
  --bg:#f6f7f9;
  --surface:#ffffff;
  --line:#dadce0;
  --red:#c5221f;
  --red-soft:#fce8e6;
  --shadow:0 1px 2px rgba(60,64,67,.08), 0 1px 3px rgba(60,64,67,.12);
  --shadow-md:0 2px 6px rgba(60,64,67,.12), 0 4px 14px rgba(60,64,67,.10);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:"Roboto",system-ui,-apple-system,Segoe UI,sans-serif;
  font-size:14.5px;
  line-height:1.5;
}
h1,h2,h3{margin:0; font-weight:500}
a{color:var(--primary); text-decoration:none; transition:color .12s ease}
button{font-family:inherit}

/* App shell */
.app{display:flex; min-height:100vh}
.sidebar{
  width:232px; flex:0 0 232px; background:var(--surface);
  border-right:1px solid var(--line); display:flex; flex-direction:column;
  padding:20px 12px; position:sticky; top:0; height:100vh;
}
.brand{padding:0 0 14px}
.brand-icon{display:block; width:100%; height:auto}   /* tesne orezané logo → prirodzená výška, bez letterboxu */
.sidebar nav{display:flex; flex-direction:column; gap:2px; flex:1}
.sidebar nav a{
  display:flex; align-items:center; padding:11px 16px; border-radius:20px;
  color:var(--ink-2); font-size:14.5px; font-weight:500;
  transition:background-color .15s ease, color .15s ease;
}
.sidebar nav a:hover{background:rgba(0,83,0,.06); color:var(--primary)}
.sidebar nav a.active{background:var(--primary-soft); color:var(--primary)}
.sidebar-bottom{padding:12px; border-top:1px solid var(--line)}
.sidebar-bottom .user{font-size:13px; color:var(--ink-2); margin-bottom:6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.sidebar-bottom .logout{font-size:13px; color:var(--ink-2)}
.sidebar-bottom .logout:hover{color:var(--red)}

/* tlačidlo „Povoliť upozornenia" na stránke Nastavenia — .btn by inak prebilo atribút hidden */
#enablePushBtn[hidden]{display:none !important}

/* Nastavenia */
.settings-card{padding:0}
.settings-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:18px 20px;
}
.settings-row + .settings-row{border-top:1px solid var(--line)}
.settings-label{font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-2)}
.settings-value{font-size:15px; margin-top:2px}
.settings-hint{font-size:13px; color:var(--ink-2); max-width:46ch}
.settings-row .btn{flex:0 0 auto; white-space:nowrap}

.content{flex:1; padding:32px 40px; max-width:1080px}

/* Auth page */
.auth-page{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:var(--bg);
}
.auth-box{
  width:360px; max-width:90vw; background:var(--surface); border:1px solid var(--line);
  border-top:3px solid var(--gold);            /* jemný zlatý brand akcent na hlavnej vstupnej obrazovke */
  border-radius:16px; padding:0 0 40px; overflow:hidden; box-shadow:var(--shadow);
}
.login-logo{display:block; width:100%; max-width:230px; height:auto; margin:24px auto 4px}
.auth-box > .alert{margin:20px 32px 0}
.auth-box h1{font-size:22px; text-align:center; margin-bottom:4px}
.auth-box .sub{text-align:center; color:var(--ink-2); margin:0 0 28px; font-size:14px}
.auth-box form{padding:24px 32px 0; display:flex; flex-direction:column; gap:16px}

/* Page header */
.page-header{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin:8px 0 20px;
}
.page-header h1{font-size:22px; display:flex; align-items:center; gap:10px}
.page-header h2{font-size:17px; margin-top:32px}

/* Buttons */
.btn{
  border:1px solid transparent; border-radius:20px; padding:9px 20px;
  font-size:14px; font-weight:500; cursor:pointer; display:inline-flex; align-items:center; gap:6px;
  transition:background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-primary{background:var(--primary); color:#fff}
.btn-primary:hover{background:var(--primary-hover)}
.btn-primary:active{background:var(--primary-dark)}
.btn-secondary{background:var(--surface); color:var(--primary); border-color:var(--primary-light)}
.btn-secondary:hover{background:var(--primary-soft); border-color:var(--primary)}
.btn-block{width:100%; justify-content:center}
.btn-icon{
  background:transparent; border:none; color:var(--ink-2); cursor:pointer;
  font-size:14px; width:28px; height:28px; border-radius:50%; line-height:1;
  transition:background-color .12s ease, color .12s ease;
}
.btn-icon:hover{background:var(--red-soft); color:var(--red)}

/* Forms */
label{display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--ink-2); font-weight:500}
input[type=text], input[type=email], input[type=password], input[type=date], textarea{
  font-family:inherit; font-size:14.5px; color:var(--ink); padding:10px 12px;
  border:1px solid var(--line); border-radius:8px; background:var(--surface);
}
input:focus, textarea:focus{outline:2px solid var(--primary); outline-offset:-1px; border-color:var(--primary)}
textarea{resize:vertical}

.field-group{display:flex; flex-direction:column; gap:8px}
.field-label{font-size:13px; color:var(--ink-2); font-weight:500}
.sex-toggle{display:flex; gap:10px}
.sex-toggle label{
  flex:1; flex-direction:row; align-items:center; justify-content:center; gap:6px;
  border:1px solid var(--line); border-radius:8px; padding:10px; cursor:pointer;
  font-size:14px; font-weight:500; color:var(--ink);
}
.sex-toggle input{accent-color:var(--blue)}
.sex-toggle label:has(input[value="samec"]:checked){border-color:var(--blue); background:var(--blue-soft); color:var(--blue-dark)}
.sex-toggle label:has(input[value="samica"]:checked){border-color:var(--pink); background:var(--pink-soft); color:var(--pink)}

.alert{
  background:var(--red-soft); color:var(--red); border-radius:8px; padding:12px 14px;
  font-size:13.5px; margin-bottom:16px;
}
.empty{
  color:var(--ink-2); background:var(--surface); border:1px dashed var(--line);
  border-radius:12px; padding:32px; text-align:center; font-size:14px;
}
.back-link{display:inline-block; margin-bottom:16px; font-size:13.5px; color:var(--ink-2)}
.back-link:hover{color:var(--primary)}

/* Table */
.tablewrap{
  background:var(--surface); border:1px solid var(--line); border-radius:12px;
  overflow:hidden; box-shadow:var(--shadow);
}
table{width:100%; border-collapse:collapse}
th, td{text-align:left; padding:13px 16px; font-size:14px}
th{
  font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-2);
  border-bottom:1px solid var(--line); font-weight:500;
}
tbody tr{border-bottom:1px solid var(--line)}
tbody tr:last-child{border-bottom:none}
tbody tr:hover{background:var(--bg)}
.row-link{color:var(--ink); font-weight:500}
.row-link:hover{color:var(--primary)}
.row-actions{width:1%; text-align:right}
.row-actions form{display:inline}

/* Badges */
.badge{
  display:inline-flex; align-items:center; font-size:12px; font-weight:500;
  padding:4px 10px; border-radius:100px;
}
.badge-m{background:var(--blue-soft); color:var(--blue-dark)}
.badge-f{background:var(--pink-soft); color:var(--pink)}
.badge-stk-green{background:var(--primary-soft); color:var(--primary)}
.badge-stk-orange{background:var(--gold-soft); color:var(--gold-ink)}   /* „STK sa blíži" — zlatý/amber akcent, tmavý text */
.badge-stk-red{background:var(--red-soft); color:var(--red)}

/* Cards */
.card{
  background:var(--surface); border:1px solid var(--line); border-radius:12px;
  padding:20px; box-shadow:var(--shadow);
}
.detail-card{margin-bottom:8px}
.detail-grid{display:grid; grid-template-columns:repeat(3, 1fr); gap:20px}
.detail-grid > div{display:flex; flex-direction:column; gap:4px}
.detail-label{font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-2)}
.detail-grid > div > span:last-child{font-size:15px}

.cards-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px}
.field-card{
  position:relative; display:flex; flex-direction:column; gap:6px; color:var(--ink);
  transition:box-shadow .15s, border-color .15s;
}
.field-card:hover{box-shadow:var(--shadow-md); border-color:var(--primary-light)}
.field-icon{font-size:22px}
.field-card h3{font-size:15.5px}
.field-card .muted{color:var(--ink-2); font-size:13px; margin:0}
.field-delete{position:absolute; top:12px; right:12px}

/* Field work list */
.worklist{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px}
.worklist li{
  background:var(--surface); border:1px solid var(--line); border-radius:10px;
  padding:14px 16px; display:flex; align-items:flex-start; gap:16px;
  box-shadow:var(--shadow);
}
.worklist-date{
  flex:0 0 auto; font-size:12.5px; font-weight:500; color:var(--primary);
  background:var(--primary-soft); padding:4px 10px; border-radius:100px; white-space:nowrap;
}
.worklist-desc{flex:1; font-size:14px}
.worklist li form{margin-left:auto}

/* Modal */
dialog{
  border:none; border-radius:16px; padding:0; width:420px; max-width:92vw;
  max-height:88vh; overflow-y:auto; margin:auto;
  box-shadow:0 8px 28px rgba(32,33,36,.28);
}
dialog::backdrop{background:rgba(32,33,36,.5)}
dialog form{padding:26px; display:flex; flex-direction:column; gap:16px}
dialog h2{font-size:18px; margin-bottom:2px}
.modal-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:6px}

/* Responsive */
@media (max-width: 820px){
  .app{flex-direction:column}

  /* Horná lišta — len logo vľavo, nič viac */
  .sidebar{
    width:100%; flex:none; height:auto; position:static;
    flex-direction:row; align-items:center; justify-content:flex-start;
    padding:10px 16px;
    border-right:none; border-bottom:1px solid var(--line);
  }
  .brand{padding:0; width:auto}
  .brand-icon{width:auto; height:46px; max-width:230px; object-fit:contain}
  .sidebar-bottom{display:none}

  /* Hlavné menu — plávajúca spodná lišta v štýle „liquid glass" */
  .sidebar nav{
    position:fixed; z-index:200;
    left:12px; right:12px;
    top:auto;
    bottom:22px;                                        /* obyčajná hodnota – nikdy sa nezahodí */
    bottom:calc(22px + env(safe-area-inset-bottom, 0px)); /* prehliadače s env() to prepíšu (levituje aj nad iPhone home-indicatorom) */
    flex-direction:row; gap:2px; flex:none;
    padding:8px;
    border-radius:24px;
    background:rgba(255,255,255,.72);
    -webkit-backdrop-filter:blur(20px) saturate(180%);
    backdrop-filter:blur(20px) saturate(180%);
    border:1px solid rgba(255,255,255,.5);
    box-shadow:0 8px 30px rgba(32,33,36,.20), 0 2px 6px rgba(32,33,36,.12);
  }
  .sidebar nav a{
    flex:1;
    justify-content:center; align-items:center; text-align:center;
    padding:12px 4px; border-radius:16px;
    font-size:14px; font-weight:500;
  }
  .sidebar nav a:hover{background:transparent}
  .sidebar nav a.active{background:rgba(0,83,0,.12); color:var(--primary)}

  /* aby posledný obsah nezostal pod plávajúcou lištou */
  .content{padding:16px 16px 104px}
  .content{padding:16px 16px calc(104px + env(safe-area-inset-bottom, 0px))}
  .page-header{flex-wrap:wrap}
  .detail-grid{grid-template-columns:1fr}
  .tablewrap{overflow-x:auto}
  .settings-row{flex-wrap:wrap}
}

@media (max-width: 480px){
  .content{padding:12px 12px 104px}
  .content{padding:12px 12px calc(104px + env(safe-area-inset-bottom, 0px))}
  .auth-box form{padding:20px 20px 0}
  .auth-box > .alert{margin:16px 20px 0}
}

/* Vlastný dátumový picker */
.datepicker{position:relative}
.date-native{position:absolute; opacity:0; pointer-events:none; width:1px; height:1px; overflow:hidden}
.date-display{
  display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%;
  font-family:inherit; font-size:14.5px; color:var(--ink); padding:10px 12px;
  border:1px solid var(--line); border-radius:8px; background:var(--surface); cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.date-display.placeholder{color:var(--ink-2)}
.date-display .cal-icon{flex:0 0 auto; display:flex; color:var(--ink-2)}
.datepicker.open .date-display{outline:2px solid var(--primary); outline-offset:-1px; border-color:var(--primary)}
.date-display.date-error{border-color:var(--red); outline:2px solid var(--red); outline-offset:-1px}

.date-panel{
  position:fixed; z-index:1000; width:280px;
  background:var(--surface); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 8px 28px rgba(32,33,36,.28); padding:14px;
}
.date-panel-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.date-panel-head .dp-title{font-size:14px; font-weight:500; text-transform:capitalize}
.date-panel-head button{
  background:transparent; border:none; cursor:pointer; color:var(--ink-2);
  width:28px; height:28px; border-radius:50%; font-size:16px; line-height:1;
}
.date-panel-head button:hover{background:var(--primary-soft); color:var(--primary)}
.date-panel-head button:disabled{opacity:.3; cursor:default; background:none; color:var(--ink-2)}
.dp-weekdays{display:grid; grid-template-columns:repeat(7,1fr); gap:2px; margin-bottom:4px}
.dp-weekdays span{text-align:center; font-size:11px; color:var(--ink-2); font-weight:500}
.dp-days{display:grid; grid-template-columns:repeat(7,1fr); gap:2px}
.dp-day{
  background:none; border:none; border-radius:50%; width:32px; height:32px; font-size:13.5px;
  color:var(--ink); cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background-color .1s ease, color .1s ease;
}
.dp-day:hover:not(:disabled){background:var(--primary-soft)}
.dp-day.dp-muted{color:var(--ink-2); opacity:.45}
.dp-day.dp-today{font-weight:700; color:var(--primary)}
.dp-day.dp-selected{background:var(--primary); color:#fff; font-weight:500}
.dp-day:disabled{opacity:.25; cursor:not-allowed}

/* --- Počasie --- */
.weather-chip{
  display:inline-flex; align-items:center; gap:8px; align-self:flex-start;
  margin:0 0 14px; padding:4px 6px;
  border-radius:12px; color:var(--ink);
  transition:background-color .15s ease;
}
.weather-chip:hover{background:var(--primary-soft)}
.weather-chip.active{background:var(--primary-soft); color:var(--primary)}
.weather-chip-ico{width:34px; height:34px; flex:0 0 auto; display:block}
.weather-chip-temp{font-size:15px; font-weight:600}

.weather-now{display:flex; align-items:center; gap:18px; margin-bottom:8px}
.weather-now-ico{width:72px; height:72px; flex:0 0 auto}
.weather-now-temp{font-size:34px; font-weight:600; line-height:1}
.weather-now-meta{color:var(--ink-2); font-size:14px; margin-top:6px}

.section-title{font-size:17px; font-weight:500; margin:28px 0 12px}

.hourly-strip{
  display:flex; gap:8px; overflow-x:auto; padding:2px 2px 10px;
  -webkit-overflow-scrolling:touch;
}
.hour-cell{
  flex:0 0 auto; width:64px; text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  background:var(--surface); border:1px solid var(--line); border-radius:12px;
  padding:10px 4px;
}
.hour-time{font-size:11.5px; color:var(--ink-2)}
.hour-ico{width:34px; height:34px}
.hour-temp{font-size:14px; font-weight:600}
.hour-pp{font-size:11px; color:var(--primary); min-height:14px}

.day-ico{width:34px; height:34px; display:block}
.muted-sm{font-size:11.5px; color:var(--ink-2)}
.weather-src{margin-top:18px}

@media (max-width: 820px){
  .weather-chip{margin:0 0 0 auto; padding:2px 4px; gap:9px}
  .weather-chip-ico{width:46px; height:46px}
  .weather-chip-temp{font-size:19px}
  .weather-now-ico{width:60px; height:60px}
  .weather-now-temp{font-size:30px}
}
