:root{
  --bg: #0b1220;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --accent: #6ee7ff;
  --accent2:#a78bfa;
  --danger:#ff6b6b;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(167,139,250,.25), transparent 60%),
    radial-gradient(900px 500px at 85% 15%, rgba(110,231,255,.20), transparent 60%),
    linear-gradient(180deg, #070b14, var(--bg));
}

.bg{min-height:100%}

.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 14px;
  backdrop-filter: blur(16px);
  background: rgba(10,16,28,.72);
  border-bottom:1px solid var(--border);
}
.topbar-left{display:flex; gap:10px; align-items:center}
.topbar-title{font-weight:700; letter-spacing:.2px}
.logo-dot{
  width:12px;height:12px;border-radius:50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 24px rgba(110,231,255,.35);
}
.topbar-right{display:flex; align-items:center; gap:10px}
.chip{
  font-size:12px; color:var(--muted);
  padding:6px 10px; border:1px solid var(--border);
  background: var(--card); border-radius:999px;
}
.icon-btn{
  text-decoration:none; color:var(--text);
  width:36px; height:36px; display:grid; place-items:center;
  border-radius:12px; border:1px solid var(--border);
  background: var(--card);
}

.container{
  padding:14px;
  padding-bottom:90px; /* kvůli bottom nav */
  max-width: 780px;
  margin: 0 auto;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.card-title{font-weight:700;margin-bottom:10px}

.grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
}
@media (min-width:520px){
  .grid{grid-template-columns: repeat(3, 1fr);}
}

.kpi-title{font-size:12px;color:var(--muted)}
.kpi-value{font-size:26px;font-weight:800;margin-top:6px}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: var(--card2);
  color: var(--text);
  text-decoration:none;
  font-weight:700;
}
.btn-primary{
  border: 1px solid rgba(110,231,255,.35);
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(167,139,250,.18));
}
.actions{display:flex; gap:10px; flex-wrap:wrap}

.muted{color:var(--muted)}
.tiny{font-size:12px}

.auth-wrap{
  min-height:100%;
  display:grid;
  place-items:center;
  padding:18px;
}
.auth-card{width:min(460px, 100%);}
.auth-brand{display:flex; gap:10px; align-items:center; margin-bottom:10px}
.brand-title{font-weight:900; letter-spacing:.8px}
.brand-sub{font-size:12px; color:var(--muted)}

.h1{font-size:20px; margin:12px 0}

.form{display:grid; gap:10px}
.label{font-size:12px; color:var(--muted)}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline:none;
}
.input:focus{border-color: rgba(110,231,255,.45);}

.alert{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  margin: 10px 0;
}
.alert-danger{border-color: rgba(255,107,107,.35)}

.bottomnav{
  position:fixed; left:0; right:0; bottom:0; z-index:30;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:8px;
  padding:10px 10px calc(10px + env(safe-area-inset-bottom));
  backdrop-filter: blur(16px);
  background: rgba(10,16,28,.80);
  border-top:1px solid var(--border);
}
.bn{
  text-decoration:none; color:var(--muted);
  display:grid; justify-items:center; gap:4px;
  padding:10px 8px;
  border-radius:16px;
  border:1px solid transparent;
  font-weight:700;
  font-size:12px;
}
.bn span{font-size:11px}
.bn.active{
  color: var(--text);
  border-color: rgba(110,231,255,.25);
  background: linear-gradient(135deg, rgba(110,231,255,.16), rgba(167,139,250,.12));
}
/* ===== Forms / pages (job_new.php) ===== */

.page{
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 110px; /* dole místo pro bottom bar */
}

.page h1{
  font-size: 34px;
  line-height: 1.1;
  margin: 8px 0 18px;
  letter-spacing: .2px;
}

/* glass card wrapper for forms */
.form{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}

/* stacked labels */
.form label{
  display: block;
  margin: 12px 0;
  color: rgba(255,255,255,.86);
  font-size: 13px;
}

/* inputs full width, modern */
.form input,
.form select,
.form textarea{
  width: 100%;
  margin-top: 8px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: rgba(255,255,255,.92);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
  box-sizing: border-box;
}

.form textarea{
  min-height: 110px;
  resize: vertical;
}

.form input::placeholder,
.form textarea::placeholder{
  color: rgba(255,255,255,.45);
}

/* focus state */
.form input:focus,
.form select:focus,
.form textarea:focus{
  border-color: rgba(120,180,255,.45);
  box-shadow: 0 0 0 4px rgba(120,180,255,.12);
}

/* primary button */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  text-decoration: none;
}

.btn.primary{
  background: linear-gradient(90deg, rgba(80,160,255,.35), rgba(180,90,255,.25));
  border-color: rgba(255,255,255,.18);
}

.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0px); }

/* alerts */
.alert{
  margin: 12px 0 16px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
}

.alert.error{
  border-color: rgba(255,90,90,.35);
  background: rgba(255,90,90,.10);
}

/* desktop spacing */
@media (min-width: 900px){
  .page{ padding: 36px 20px 120px; }
  .form{ padding: 22px; }
}
/* ===== Jobs list ===== */
.page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}

.filters{
  margin: 10px 0 14px;
}

.filters-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.input, .select{
  flex: 1 1 220px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: rgba(255,255,255,.92);
  outline:none;
  box-sizing:border-box;
}

.small{ font-size: 12px; }
.muted{ color: rgba(255,255,255,.65); }

.list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.card{
  display:block;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  color: rgba(255,255,255,.92);
  text-decoration:none;
}

.card:hover{ filter: brightness(1.02); }

.badge{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  color: rgba(255,255,255,.85);
}

.job-top{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 10px;
}

.job-title{
  font-weight: 800;
  letter-spacing: .2px;
}

.job-meta{
  display:grid;
  gap:6px;
  font-size: 13px;
  color: rgba(255,255,255,.78);
}
/* ===== Job detail actions ===== */
.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.actions .btn{
  width: auto;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
}
.map-pop { color: rgba(255,255,255,.92); }
.map-pop-title { font-weight: 800; margin-top: 8px; }
.map-pop-addr { margin-top: 6px; color: rgba(255,255,255,.75); font-size: 12px; }
.map-pop-link{
  display:inline-flex;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  text-decoration:none;
  font-weight: 800;
}
.map-pop-badge{
  display:inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  font-size: 12px;
}
/* Leaflet fix: globální img styly rozbíjí mapové dlaždice */
.leaflet-container img{
  max-width: none !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
}

.leaflet-container{
  z-index: 1;
}
.map{
  position: relative;
  height: 52vh;
  min-height: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.15);
}
/* ===== Dashboard: seznam dnešních / zítřejších zakázek ===== */
.joblist{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.jobcard{
  padding: 14px;
}

.jobrow{
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.jobinfo{
  min-width: 0;            /* důležité pro zalamování textu */
  flex: 1 1 auto;
}

.jobtitle a{
  text-decoration: none;
  color: inherit;
}

.jobmeta{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.jobaddr,
.jobperson,
.jobphone,
.jobmail{
  overflow-wrap: anywhere; /* dlouhý email/ulice se nezničí layout */
  word-break: break-word;
}

.jobactions{
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 170px;         /* pravý sloupec na desktopu */
}

.jobactions .btn{
  width: 100%;
  justify-content: center;
}

/* ===== Mobil: akce pod sebe, bez překryvů ===== */
@media (max-width: 720px){
  .jobrow{
    flex-direction: column;
  }

  .jobactions{
    flex: 1 1 auto;
    width: 100%;
  }
}
.jobcard{ position: relative; }
.jobcard-link{
  position:absolute; inset:0;
  z-index: 1;
  border-radius: inherit;
}
.jobrow{ position: relative; }        /* BEZ z-indexu, ať neblokuje overlay link */
.jobactions{ position: relative; z-index: 2; }  /* akce nech nad linkem */
/* ===== MAP POPUP ČITELNOST (Leaflet) ===== */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip{
  background: rgba(10,16,28,.92) !important;
  color: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 18px 60px rgba(0,0,0,.45) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.leaflet-popup-content{
  margin: 12px 14px !important;
}
.leaflet-popup-close-button{
  color: rgba(255,255,255,.85) !important;
}
.leaflet-popup-close-button:hover{
  color: rgba(255,255,255,1) !important;
}

/* input/select uvnitř popupu */
.leaflet-popup-content .input,
.leaflet-popup-content select.select{
  width: 100% !important;
  padding: 12px 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(0,0,0,.30) !important;
  color: rgba(255,255,255,.92) !important;
  outline: none !important;
}
.leaflet-popup-content .input::placeholder{
  color: rgba(255,255,255,.45) !important;
}

/* tlačítka v popupu ať jsou čitelný */
.leaflet-popup-content .btn{
  width: auto;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
}


  .plan-grid{
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
    padding-bottom: 0;
  }
  .day-col{
    min-width: 0;
    width: 100%;
  }
/* ===== PLÁNOVAČ: sjednocení vzhledu s aplikací + čitelný text ===== */

/* sloupce (okna) */
.day-col{
  background: rgba(255,255,255,.06) !important;  /* stejné jako .card */
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.92) !important;
  box-shadow: 0 18px 60px rgba(0,0,0,.25) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* hlavička sloupce */
.day-col-head{
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.92) !important;
}
.day-col-sub{
  color: rgba(255,255,255,.65) !important;
}

/* tělo sloupce */
.day-col-body{
  color: rgba(255,255,255,.92) !important;
}

/* karty zakázek uvnitř (ať nejsou bílé a text nezmizí) */
.job-card{
  background: rgba(0,0,0,.22) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,255,255,.92) !important;
}

/* texty v kartách */
.job-title{ color: rgba(255,255,255,.92) !important; }
.job-meta{ color: rgba(255,255,255,.75) !important; }

/* hint když je prázdno */
.drop-hint{
  border-color: rgba(255,255,255,.18) !important;
  color: rgba(255,255,255,.70) !important;
  background: rgba(0,0,0,.14);
}

/* čipy statusů (ať sedí do dark UI) */
.job-chip{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.10);
}

/* tvoje status barvy necháme, jen jim sjednotíme border */
.chip-open, .chip-scheduled, .chip-done, .chip-cancelled{
  border: 1px solid rgba(255,255,255,.14) !important;
}