/* =====================================================================
   WebPages Business One — Design systém
   Barevná paleta odvozena přímo z loga WebPages (dominantní tmavě modrá,
   doplňkové barvy: světle modrá, zelená, limetková, jantarová, oranžová,
   magenta — dle sedmi barevných pruhů v logu).
   ===================================================================== */

:root {
  --wp-primary: #22509f;        /* tmavě modrá (logo) — hlavní brand barva */
  --wp-primary-light: #337abd;  /* světle modrá (logo) — hover/gradienty */
  --wp-primary-dark: #0e2a52;   /* hluboká námořní modrá — sidebar */
  --wp-accent: #ea5707;         /* oranžovočervená (logo) — CTA / aktivní stav */
  --wp-success: #2d8429;        /* zelená (logo) — dokončené/úspěch */
  --wp-warning: #f6a100;        /* jantarová (logo) */
  --wp-danger: #cf3a12;         /* sytější červenooranžová — mazání/nebezpečí */
  --wp-teal: #337abd;
  --wp-violet: #ae4683;         /* magenta (logo) — doplňkový akcent */
  --wp-lime: #8dbe23;           /* limetková zelená (logo) */

  --wp-bg: #f2f5fa;
  --wp-surface: #ffffff;
  --wp-border: #e3e8f0;
  --wp-text: #1f2333;
  --wp-text-muted: #707b8c;

  --wp-radius: 14px;
  --wp-radius-sm: 9px;
  --wp-shadow: 0 4px 24px rgba(15, 35, 66, 0.07);
  --wp-shadow-lg: 0 12px 40px rgba(15, 35, 66, 0.14);

  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

body {
  background: var(--wp-bg);
  color: var(--wp-text);
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.94rem;
}

h1, h2, h3, h4, h5, h6, .brand-text, .topbar-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--wp-primary-dark);
}

a { text-decoration: none; color: var(--wp-primary); }
a:hover { color: var(--wp-primary-light); }

::selection { background: var(--wp-primary-light); color: #fff; }

/* ---------------------------------------------------------------------
   App shell (sidebar + topbar)
--------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--wp-primary-dark) 0%, #163a6e 100%);
  color: #dbe6f2;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.3rem 1.1rem;
}

.brand-link { display: flex; align-items: center; gap: .7rem; color: #fff; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(15, 35, 66, .4);
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text { display: flex; flex-direction: column; font-size: 1.05rem; line-height: 1.15; color: #fff; }
.brand-text small { font-family: 'Inter', sans-serif; font-weight: 400; font-size: .66rem; color: #a9c3e0; text-transform: uppercase; letter-spacing: .06em; }

.sidebar-close { background: none; border: none; color: #cfe0f0; font-size: 1.1rem; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .9rem; }

.nav-section-label {
  font-size: .68rem;
  letter-spacing: .08em;
  color: #7a9cc9;
  margin: 1.1rem .6rem .4rem;
  font-weight: 600;
}
.nav-section-label:first-child { margin-top: .3rem; }
.nav-section-label.nav-collapsible {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.nav-section-label.nav-collapsible:hover { color: #a9c6e8; }
.nav-collapse-icon { transition: transform .2s ease; font-size: .75rem; }
.nav-collapse-group {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.nav-collapse-group.is-open { max-height: 400px; }
.nav-collapse-icon.is-open { transform: rotate(180deg); }
.nav-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  font-size: .62rem;
  font-weight: 700;
  color: #cfe0f0;
  flex-shrink: 0;
}
.side-link.active .nav-step { background: rgba(255,255,255,.35); color: #fff; }

.doc-step { display: flex; gap: .7rem; align-items: flex-start; }
.doc-step-num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--wp-bg);
  border: 2px solid var(--wp-border);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
  color: var(--wp-text-muted);
}
.doc-step-body { flex: 1; min-width: 0; }
.doc-step-arrow { padding-left: 11px; color: var(--wp-border); font-size: .85rem; margin: .1rem 0; }

.side-link {
  display: flex; align-items: center; gap: .8rem;
  padding: .62rem .75rem;
  border-radius: 10px;
  color: #cfe0f0;
  font-weight: 500;
  font-size: .89rem;
  margin-bottom: .15rem;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.side-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.side-link:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.side-link.active {
  background: linear-gradient(90deg, var(--wp-accent), #ff8c4a);
  color: #fff;
  box-shadow: 0 6px 16px rgba(234, 87, 7, .3);
}
.side-link.active i { opacity: 1; }

.sidebar-footer {
  padding: 1rem .9rem 1.3rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user { display: flex; align-items: center; gap: .7rem; padding: .4rem .3rem .9rem; }
.su-info { line-height: 1.2; overflow: hidden; }
.su-name { color: #fff; font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.su-role { color: #9fc3e8; font-size: .72rem; }
.logout-link { color: #cfe0f0; }
.logout-link:hover { background: rgba(255,255,255,.08); color: #fff; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6, 16, 32, .5);
  z-index: 1035;
}
.sidebar-backdrop.is-visible { display: block; }

/* Main column */
.main-col {
  flex: 1;
  min-width: 0; /* zabrání flex položce roztáhnout se přes šířku obrazovky kvůli obsahu (tabulky, taby) */
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body { overflow-x: hidden; }

/* Lišta "Zobrazit jako" — viditelná na úplně každé stránce po celou dobu impersonace.
   Napevno JEDEN řádek s pevnou výškou (žádné zalamování, žádné měření v JS) — text,
   který se nevejde, se zkrátí třemi tečkami. Tím je jisté, že lišta nikdy nemůže
   překrýt menu ani obsah pod sebou, protože oba mají spolehlivě stejný pevný odstup. */
.impersonate-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1070;
  height: 44px;
  background: linear-gradient(90deg, var(--wp-success), #55a83c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 0 3.5rem 0 1rem;
  font-size: .82rem;
  white-space: nowrap;
}
.impersonate-bar .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impersonate-bar strong { font-weight: 700; }
.impersonate-bar .btn-light { padding: .2rem .7rem; font-size: .78rem; font-weight: 600; flex-shrink: 0; white-space: nowrap; }
body.is-impersonating .app-shell { margin-top: 44px; }
body.is-impersonating .sidebar { top: 44px; }
body.is-impersonating .auth-wrap { margin-top: 44px; min-height: calc(100vh - 44px); }
@media (max-width: 575.98px) {
  .impersonate-bar .txt { max-width: 46vw; }
}
.topbar {
  height: 68px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--wp-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.6rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-title { margin: 0; font-size: 1.15rem; white-space: nowrap; }

.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search i { position: absolute; left: 14px; color: var(--wp-text-muted); font-size: .9rem; }
.topbar-search input {
  width: 100%;
  border: 1px solid var(--wp-border);
  background: var(--wp-bg);
  border-radius: 10px;
  padding: .55rem .8rem .55rem 2.3rem;
  font-size: .85rem;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.topbar-search input:focus { border-color: var(--wp-primary-light); box-shadow: 0 0 0 3px rgba(34,80,159,.15); background: #fff; }

.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.btn-icon {
  border: none;
  background: transparent;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--wp-text-muted);
  font-size: 1.15rem;
  transition: background .15s ease, color .15s ease;
}
.btn-icon:hover { background: var(--wp-bg); color: var(--wp-primary); }
.dropdown-toggle-noarrow::after { display: none; }

.notif-dot {
  position: absolute; top: 3px; right: 3px;
  background: var(--wp-accent);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  min-width: 17px; height: 17px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  padding: 0 2px;
}

.app-main {
  flex: 1;
  padding: 1.75rem 1.9rem;
}

.app-footer {
  text-align: center;
  color: var(--wp-text-muted);
  font-size: .78rem;
  padding: 1.2rem;
}

.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------------
   Auth (login) page
--------------------------------------------------------------------- */
.auth-body { background: var(--wp-bg); }

.auth-wrap {
  min-height: 100vh;
  display: flex;
}
.auth-visual {
  flex: 1.1;
  background: radial-gradient(circle at 20% 20%, #2f6fc4, var(--wp-primary-dark) 60%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  position: relative;
  overflow: hidden;
}
.auth-visual::before, .auth-visual::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.auth-visual::before { width: 340px; height: 340px; top: -100px; right: -100px; }
.auth-visual::after { width: 220px; height: 220px; bottom: -60px; left: -60px; background: rgba(234,87,7,.18); }
.auth-visual .brand-mark { width: 56px; height: 56px; font-size: 1.6rem; margin-bottom: 1.5rem; }
.auth-visual h2 { color: #fff; font-size: 2rem; max-width: 420px; position: relative; z-index: 1; }
.auth-visual p { color: #cfe0f5; max-width: 380px; position: relative; z-index: 1; }
.auth-visual .auth-badges { display: flex; gap: .6rem; margin-top: 2rem; flex-wrap: wrap; position: relative; z-index: 1; }
.auth-visual .auth-badges span {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  padding: .4rem .85rem;
  border-radius: 30px;
  font-size: .78rem;
}

.auth-form-col {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card .form-control { padding: .7rem .9rem; border-radius: 10px; border-color: var(--wp-border); }
.auth-card .form-control:focus { border-color: var(--wp-primary-light); box-shadow: 0 0 0 3px rgba(34,80,159,.15); }
.auth-card .btn-primary { padding: .7rem; border-radius: 10px; font-weight: 600; }

/* ---------------------------------------------------------------------
   Cards, tables, badges (shared across app)
--------------------------------------------------------------------- */
.card {
  border: 1px solid var(--wp-border);
  box-shadow: var(--wp-shadow);
  border-radius: var(--wp-radius);
  background: var(--wp-surface);
}

.card h5, .card h6 { display: flex; align-items: center; gap: .45rem; }
.card h5 i, .card h6 i { color: var(--wp-primary); }

.btn { border-radius: 9px; font-weight: 500; font-size: .87rem; }
.btn-primary { background: linear-gradient(135deg, var(--wp-primary-light), var(--wp-primary)); border: none; box-shadow: 0 6px 16px rgba(34,80,159,.28); }
.btn-primary:hover { background: linear-gradient(135deg, #2a63b8, var(--wp-primary-dark)); }
.btn-outline-secondary { border-color: var(--wp-border); color: var(--wp-text-muted); }
.btn-outline-danger { --bs-btn-hover-bg: var(--wp-danger); --bs-btn-hover-border-color: var(--wp-danger); }

.form-control, .form-select {
  border-radius: 9px;
  border-color: var(--wp-border);
  font-size: .89rem;
}
.form-control:focus, .form-select:focus { border-color: var(--wp-primary-light); box-shadow: 0 0 0 3px rgba(34,80,159,.13); }
.form-label { font-size: .82rem; font-weight: 600; color: var(--wp-text); margin-bottom: .3rem; }

.badge-priority {
  color: #fff;
  padding: .32em .65em;
  border-radius: 7px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.status-pill {
  display: inline-block;
  padding: .3em .75em;
  border-radius: 30px;
  color: #fff;
  font-size: .74rem;
  font-weight: 600;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-sm { width: 34px; height: 34px; font-size: .76rem; }
.avatar-md { width: 42px; height: 42px; font-size: .85rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }

.table { margin-bottom: 0; }
.table thead th {
  border-bottom: 1px solid var(--wp-border);
  color: var(--wp-text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  padding-top: .3rem;
}
.table > :not(caption) > * > * { padding: .75rem .6rem; }
.table-hover tbody tr { transition: background .12s ease; }
.table-hover tbody tr:hover { background: #eef3fa; }
.table td, .table th { vertical-align: middle; border-color: var(--wp-border); }

.nav-tabs { border-bottom: 1px solid var(--wp-border); gap: .2rem; }
.nav-tabs .nav-link {
  border: none;
  color: var(--wp-text-muted);
  font-weight: 600;
  font-size: .87rem;
  padding: .65rem 1.1rem;
  border-radius: 10px 10px 0 0;
}
.nav-tabs .nav-link i { margin-right: .3rem; }
.nav-tabs .nav-link:hover { background: #eef3fa; color: var(--wp-primary); }
.nav-tabs .nav-link.active { color: var(--wp-primary); background: var(--wp-surface); box-shadow: inset 0 -2px 0 var(--wp-primary); }

/* Stat cards */
.stat-card {
  border-radius: var(--wp-radius);
  color: #fff;
  padding: 1.35rem 1.4rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--wp-shadow-lg);
}
.stat-card::after {
  content: '';
  position: absolute;
  width: 120px; height: 120px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  top: -40px; right: -30px;
}
.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: .8rem;
}
.stat-card.blue { background: linear-gradient(135deg,#337abd,#173a6b); }
.stat-card.red { background: linear-gradient(135deg,#ea5707,#a83c05); }
.stat-card.green { background: linear-gradient(135deg,#2d8429,#153f13); }
.stat-card.gray { background: linear-gradient(135deg,#64748b,#334155); }

.chat-bubble {
  background: var(--wp-bg);
  border-radius: 12px;
  padding: .7rem 1rem;
  margin-bottom: .6rem;
}
.chat-bubble .meta { font-size: .72rem; color: var(--wp-text-muted); margin-bottom: .15rem; }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--wp-text-muted);
}
.empty-state i { font-size: 2.2rem; opacity: .35; margin-bottom: .6rem; display: block; }
.empty-state-clickable { cursor: pointer; border-radius: 10px; transition: background .15s ease; }
.empty-state-clickable:hover { background: #f2f5fa; }
.empty-state-clickable:hover i { opacity: .6; }

.section-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--wp-text-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}
.section-label i { color: var(--wp-primary); font-size: .95rem; }

/* ---------------------------------------------------------------------
   Responsivita — společné prvky
--------------------------------------------------------------------- */
.nav-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.nav-tabs .nav-link { white-space: nowrap; }

.calendar-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------------
   Kalendář — Google Calendar styl
--------------------------------------------------------------------- */
.gcal-card { overflow: hidden; }
.gcal-nav { display: flex; align-items: center; gap: .3rem; }
.gcal-today-btn { border-radius: 20px; }
.gcal-nav-btn { width: 34px; height: 34px; border: 1px solid var(--wp-border); border-radius: 50%; }
.gcal-nav-btn:hover { background: var(--wp-bg); }

.gcal-legend { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.gcal-legend-item { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--wp-text-muted); }
.gcal-legend-item i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.gcal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  min-width: 840px;
}
.gcal-weekday {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--wp-text-muted);
  padding: .8rem 0 .6rem;
  border-bottom: 1px solid var(--wp-border);
  background: var(--wp-surface);
  position: sticky;
  top: 0;
}
.gcal-cell {
  min-height: 118px;
  border-right: 1px solid var(--wp-border);
  border-bottom: 1px solid var(--wp-border);
  padding: .4rem .4rem .5rem;
  cursor: pointer;
  transition: background .12s ease;
  position: relative;
}
.gcal-cell:hover { background: #f7f9fc; }
.gcal-cell.weekend { background: #fafbfd; }
.gcal-cell.weekend:hover { background: #f2f5fa; }
.gcal-cell.out-month { background: #fbfbfd; }
.gcal-cell.out-month:hover { background: #f4f5f8; }
.gcal-cell.out-month .gcal-daynum { color: #c2c7d1; }
.gcal-cell:nth-child(7n) { border-right: none; }

.gcal-daynum-wrap { display: flex; justify-content: flex-end; margin-bottom: .3rem; }
.gcal-daynum {
  font-size: .82rem;
  font-weight: 600;
  color: var(--wp-text);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.gcal-cell.is-today { background: #eef4fc; }
.gcal-cell.is-today:hover { background: #e4edfa; }
.gcal-cell.is-today .gcal-daynum {
  background: var(--wp-primary);
  color: #fff;
}

.gcal-events { display: flex; flex-direction: column; gap: 3px; }
.gcal-event-chip {
  border-left: 3px solid #6c757d;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: .72rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--wp-text);
}
.gcal-event-time { font-weight: 700; margin-right: 4px; }
.gcal-event-title { }
.gcal-more {
  font-size: .7rem;
  color: var(--wp-text-muted);
  font-weight: 600;
  padding: 1px 6px;
}
.gcal-more:hover { color: var(--wp-primary); }

/* Přepínač zobrazení (Den / 3 dny / Týden / Měsíc) */
.gcal-view-switch {
  display: inline-flex;
  background: var(--wp-bg);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.gcal-view-switch a {
  padding: .4rem .75rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--wp-text-muted);
  white-space: nowrap;
}
.gcal-view-switch a:hover { color: var(--wp-primary); }
.gcal-view-switch a.active { background: var(--wp-surface); color: var(--wp-primary); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* Časová mřížka (den / 3 dny / týden) */
.gcal-timegrid {
  display: grid;
  min-width: 100%;
}
.gcal-tg-corner {
  position: sticky; top: 0; left: 0; z-index: 3;
  background: var(--wp-surface);
  border-bottom: 1px solid var(--wp-border);
}
.gcal-tg-head {
  position: sticky; top: 0; z-index: 2;
  background: var(--wp-surface);
  border-bottom: 1px solid var(--wp-border);
  border-left: 1px solid var(--wp-border);
  text-align: center;
  padding: .5rem .3rem;
  cursor: pointer;
}
.gcal-tg-head:hover { background: #f7f9fc; }
.gcal-tg-head-wd { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--wp-text-muted); font-weight: 700; }
.gcal-tg-head-num { font-size: 1.05rem; font-weight: 700; color: var(--wp-text); margin-top: 2px; }
.gcal-tg-head.is-today .gcal-tg-head-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--wp-primary); color: #fff;
}
.gcal-tg-label {
  font-size: .68rem;
  color: var(--wp-text-muted);
  text-align: right;
  padding: .3rem .5rem 0 0;
  border-bottom: 1px solid var(--wp-border);
  white-space: nowrap;
}
.gcal-tg-allday {
  min-height: 34px;
  border-left: 1px solid var(--wp-border);
  border-bottom: 2px solid var(--wp-border);
  padding: 2px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gcal-tg-allday:hover { background: #f7f9fc; }
.gcal-tg-cell {
  min-height: 42px;
  border-left: 1px solid var(--wp-border);
  border-bottom: 1px solid var(--wp-border);
  padding: 1px 4px;
  cursor: pointer;
}
.gcal-tg-cell:hover { background: #f7f9fc; }
.gcal-tg-cell.is-today { background: #eef4fc11; }
.gcal-tg-cell.is-today:hover { background: #eef4fc; }
.gcal-event-timed { margin-top: 1px; }

@media (max-width: 767.98px) {
  .gcal-view-switch a { padding: .35rem .55rem; font-size: .74rem; }
}

@media (max-width: 767.98px) {
  .gcal-cell { min-height: 90px; }
}


.table-responsive { -webkit-overflow-scrolling: touch; }

/* Mobilní vyhledávání (ikona v topbaru rozbalí input přes celou šířku) */
.mobile-search-toggle { display: none; }
.mobile-search-bar {
  display: none;
  position: fixed;
  top: 68px; left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--wp-border);
  padding: .7rem 1rem;
  z-index: 1015;
  box-shadow: var(--wp-shadow);
}
.mobile-search-bar.is-open { display: flex; gap: .5rem; }
.mobile-search-bar input {
  flex: 1;
  border: 1px solid var(--wp-border);
  background: var(--wp-bg);
  border-radius: 10px;
  padding: .55rem .8rem;
  font-size: .9rem;
  outline: none;
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--wp-shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .main-col { margin-left: 0; }
  .sidebar-close { display: block !important; }
  .auth-visual { display: none; }
}

@media (max-width: 767.98px) {
  .stat-card { padding: 1.1rem 1.2rem; }
  .stat-card .fs-2 { font-size: 1.5rem; }
  .card { border-radius: 12px; }
  h3 { font-size: 1.35rem; }
  .topbar-title { font-size: 1rem; }
  .btn { font-size: .82rem; }
  /* Hlavičky se skupinou tlačítek se na mobilu zalomí pod sebe */
  .d-flex.justify-content-between.align-items-center.mb-3,
  .d-flex.justify-content-between.align-items-start.mb-3 {
    flex-wrap: wrap;
    row-gap: .6rem;
  }
}

@media (max-width: 575.98px) {
  .app-main { padding: 1.1rem .9rem; }
  .topbar { padding: 0 .9rem; gap: .6rem; }
  .topbar-search { display: none; }
  .mobile-search-toggle { display: inline-flex; }
  .table thead th, .table td { font-size: .82rem; }
  .avatar-sm { width: 28px; height: 28px; font-size: .68rem; }
  .app-main .row.g-3 > [class*="col-md-4"] { margin-bottom: 0; }
}

/* ---- Tabulkový editor položek zakázky ---- */
.items-table-wrap { border: 1px solid var(--wp-border, #e3e8f0); border-radius: 10px; overflow: hidden; }
.items-table-header, .item-row-main {
  display: flex; align-items: center; gap: .5rem;
}
.items-table-header {
  background: #f2f5fa; padding: .5rem .75rem;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #7a8aa3;
}
.item-row {
  border-top: 1px solid var(--wp-border, #e3e8f0);
  padding: .5rem .75rem;
  background: #fff;
}
.item-row:hover { background: #fafbfd; }
.item-row.dragging { opacity: .4; }
.item-row-main { margin-bottom: .3rem; }
.item-row-sub { display: flex; align-items: center; gap: .5rem; }
.it-col-main { flex: 1 1 auto; min-width: 0; }
.it-col-qty { flex: 0 0 80px; }
.it-col-unit { flex: 0 0 90px; }
.it-col-price { flex: 0 0 100px; }
.it-col-vat { flex: 0 0 70px; }
.it-col-total { flex: 0 0 120px; }
.it-col-actions { flex: 0 0 64px; display: flex; align-items: center; justify-content: flex-end; gap: .1rem; }
.it-col-discount { flex: 1 1 auto; }
.item-row-main input, .item-row-main select { font-size: .85rem; }
.item-row-sub input[type="text"] { font-size: .8rem; border: none; background: transparent; padding-left: 0; }
.item-row-sub input[type="text"]:focus { background: #fff; border: 1px solid var(--wp-border, #e3e8f0); padding-left: .5rem; }
.item-title-input { border: none; font-weight: 600; padding-left: 0; }
.item-title-input:focus { border: 1px solid var(--wp-border, #e3e8f0); padding-left: .5rem; }
.move-handle { cursor: grab; }
@media (max-width: 767px) {
  .it-col-qty, .it-col-unit, .it-col-price, .it-col-vat { flex: 1 1 25%; }
  .item-row-main { flex-wrap: wrap; }
}
