/* Emglare Clients — vizuální styl převzatý z Emglare Workspace / Agendy (sdílený vzhled), úpravy Clients jsou na konci. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
/* Emglare brand font — Gotham (fallback Poppins). url() relativní kvůli běhu pod /demo. */
@font-face { font-family: 'Gotham'; src: url('fonts/Gotham-Book.otf') format('opentype'); font-weight: 300 450; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('fonts/Gotham-Medium.otf') format('opentype'); font-weight: 500 550; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('fonts/Gotham-Bold.otf') format('opentype'); font-weight: 600 800; font-style: normal; font-display: swap; }

:root {
  --orange: #f18c15;
  --orange-dark: #db7713;
  --orange-soft: #fdf1e3;
  --ink: #17191c;
  --gray: #8a8f96;
  --gray-2: #b2b6bc;
  --line: #e6e7e9;
  --bg: #ededee;
  --card: #ffffff;
  --green: #1e7a4f;
  --green-soft: #e5f5ec;
  --red: #c02626;
  --red-soft: #fdeaea;
  --r-xl: 26px;
  --r-card: 14px;
  --r-l: 20px;
  --r-pill: 999px;
  --shadow: 0 6px 24px rgba(23, 25, 28, .06);
  --shadow-hover: 0 12px 32px rgba(23, 25, 28, .10);
  /* kategorické sloty grafů (validovaná paleta, pevné pořadí) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --other: #b2b6bc;
  --grid: #ececf3;
  --axis: #d3d7dc;
  color-scheme: light;
  font-family: 'Gotham', Poppins, -apple-system, system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 13.5px; -webkit-font-smoothing: antialiased; }
a { color: var(--orange-dark); }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover b { color: var(--orange-dark); }

/* ===== Levý tmavý sidebar (plovoucí, zaoblený) ===== */
.layout { display: flex; min-height: 100vh; padding: 12px; gap: 14px; }
#sidebar {
  width: 228px; flex-shrink: 0; background: var(--ink); border-radius: var(--r-xl);
  display: flex; flex-direction: column; padding: 18px 12px 12px;
  position: sticky; top: 12px; height: calc(100vh - 24px);
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.logo-chip {
  width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #f7a03c, #f18c15 55%, #db7713);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-chip img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.sb-brand .t { font-weight: 600; font-size: 15px; line-height: 1.1; color: #fff; }
.sb-brand .t .wm { height: 22px; display: block; filter: brightness(0) invert(1); }
.sb-brand .t small { display: block; font-weight: 500; font-size: 9px; letter-spacing: .16em; color: #f18c15; padding-top: 2px; margin-left: 2px; }

#nav { flex: 1; overflow-y: auto; display: block; }
#nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 13px;
  color: #b9bdc3; text-decoration: none; font-size: 13px; font-weight: 500; margin-bottom: 3px;
  transition: background .15s, color .15s;
}
#nav a .ic { width: 19px; text-align: center; font-size: 14px; opacity: .9; display: inline-flex; justify-content: center; }
#nav a.active { background: var(--orange); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(241,140,21,.35); }
#nav a:hover:not(.active) { background: rgba(255,255,255,.07); color: #fff; }
#nav .nav-sep { display: block; font-size: 9.5px; font-weight: 600; text-transform: uppercase; color: #6c7178; margin: 16px 13px 7px; letter-spacing: .16em; }
#nav .nav-timer { margin: 4px 2px 12px; padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,.06); color: #fff; font-size: 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
#nav .nav-timer b { font-variant-numeric: tabular-nums; margin-left: auto; font-weight: 600; }
#nav .nav-timer .t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: #b9bdc3; }

#content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar { display: flex; align-items: flex-start; gap: 12px; padding: 14px 8px 10px; position: sticky; top: 0; z-index: 35; background: var(--bg); margin-top: -12px; border-radius: 0 0 14px 14px; }
#hdr-right { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.loading-box { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 70px 0; color: var(--gray); font-size: 13px; }
.spinner { width: 22px; height: 22px; border: 3px solid #e8ebf1; border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.sb-user {
  margin-top: 10px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.06);
  border-radius: 16px; padding: 10px 12px; cursor: pointer; position: relative;
}
.sb-user:hover { background: rgba(255,255,255,.1); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12.5px; flex-shrink: 0;
}
.sb-user .u { min-width: 0; }
.sb-user .u b { font-size: 12.5px; display: block; font-weight: 600; line-height: 1.15; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 4px; }
.sb-user .u span { color: #8b9097; font-size: 10.5px; text-transform: capitalize; }
#user-dropdown {
  position: absolute; left: 6px; bottom: 108%; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-hover); min-width: 170px; display: none; z-index: 30; overflow: hidden; padding: 6px;
}
#user-dropdown a { display: block; padding: 10px 14px; font-size: 12.5px; color: var(--ink); text-decoration: none; border-radius: 10px; font-weight: 500; }
#user-dropdown a:hover { background: var(--bg); }

/* ===== Obsah ===== */
main { flex: 1; max-width: none; padding: 8px 8px 0; width: 100%; }
#page-title { font-size: 23px; margin: 0 0 8px; font-weight: 600; letter-spacing: -.01em; }
#page-title .wave { margin-right: 6px; }
#page-title .wave .svgi { vertical-align: -2px; color: var(--orange); }
#page-title small { display: block; font-size: 14px; color: var(--gray); font-weight: 300; margin-top: 2px; }

.card {
  background: var(--card); border: 0; border-radius: var(--r-card);
  padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow);
}
h2 { margin: 0 0 16px; font-size: 15px; font-weight: 600; }
h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; }

/* KPI dlaždice */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.kpi .n { font-size: 30px; font-weight: 300; letter-spacing: -.02em; line-height: 1; margin: 0; }
.kpi .l { font-size: 11.5px; color: var(--gray); font-weight: 500; margin-top: 4px; }

/* Formuláře */
label { display: block; font-size: 12px; font-weight: 500; margin: 12px 0 5px; color: #4a4e54; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=month], input[type=date], input[type=time], input[type=search], input[type=url], textarea, select {
  width: 100%; padding: 11px 14px; border: 1px solid #d3d7dc; border-radius: 12px; font-size: 13px;
  background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s; font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 15%, transparent); }
input::placeholder, textarea::placeholder { color: #b2b6bc; }
textarea { min-height: 58px; resize: vertical; }
.card input[type=text], .card input[type=password], .card input[type=search], .card input[type=date], .card input[type=time], .card textarea, .card select { background: #f3f4f5; }
.hint { font-size: 11.5px; color: var(--gray); margin-top: 5px; line-height: 1.55; font-weight: 400; }

/* Tlačítka — pilulky */
button {
  background: var(--orange); color: #fff; border: 0; border-radius: var(--r-pill); padding: 10px 20px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .12s, transform .1s, box-shadow .12s; box-shadow: 0 6px 18px rgba(241,140,21,.30);
}
button:hover { background: var(--orange-dark); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { opacity: .5; cursor: default; transform: none; }
button.secondary { background: #fff; color: #35404f; border: 1px solid #e2e2ec; box-shadow: none; }
button.secondary:hover { border-color: var(--orange); color: var(--orange); background: #fff; }
button.danger { background: var(--red); box-shadow: 0 6px 18px rgba(192,38,38,.25); }
button.small { padding: 6px 14px; font-size: 11.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.meta { font-size: 12px; color: var(--gray); line-height: 1.7; font-weight: 400; }

/* Tabulky */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #9a9daa; font-weight: 600; border-bottom: 1px solid #ececf3; padding: 8px 10px; }
table td { border-bottom: 1px solid #f1f1f6; padding: 11px 10px; vertical-align: middle; }
table tr:last-child td { border-bottom: 0; }
table tr:hover td { background: #fafafe; }

.badge { background: #f1f2f3; border-radius: var(--r-pill); padding: 3px 10px; font-size: 10.5px; color: var(--gray); font-weight: 600; }
.tag { border-radius: var(--r-pill); padding: 3px 12px; font-size: 11px; color: #fff; display: inline-block; font-weight: 600; background: var(--gray); }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; width: fit-content; flex-wrap: wrap; }
.tabs button { background: var(--card); color: var(--ink); box-shadow: var(--shadow); padding: 8px 18px; font-weight: 500; border: 0; }
.tabs button:hover { background: var(--card); color: var(--ink); }
.tabs button.active { background: var(--ink); color: #fff; font-weight: 600; }

/* ===== Footer ===== */
footer { padding: 16px 22px 14px; font-size: 11.5px; color: var(--gray-2); display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
footer a { color: var(--gray); text-decoration: none; }
footer a:hover { color: var(--orange-dark); }

/* ===== Login — tmavá centrovaná karta ===== */
body.auth-mode #sidebar, body.auth-mode #topbar, body.auth-mode #footer { display: none !important; }
body.auth-mode .layout { padding: 0; gap: 0; }
body.auth-mode main { max-width: none; padding: 0; background: none; }
#login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1100px 600px at 12% -10%, #6b430f 0%, #141517 55%),
              radial-gradient(700px 500px at 105% 110%, #3d2607 0%, transparent 60%), #141517;
  position: relative;
}
@keyframes authIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.auth-card {
  width: 100%; max-width: 460px; background: #212427; border-radius: 26px; padding: 44px 42px 38px;
  box-shadow: 0 30px 90px rgba(0,0,0,.55); animation: authIn .5s cubic-bezier(.2,.8,.25,1) both; text-align: center;
}
.auth-logo {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 22px;
  background: linear-gradient(135deg, #f7a03c 0%, var(--orange) 55%, #e14a12 100%);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(241,140,21,.35);
}
.auth-logo img { width: 42px; height: 42px; filter: brightness(0) invert(1); }
.auth-brand { margin-bottom: 4px; }
.auth-brand .wm { height: 30px; display: block; margin: 0 auto; filter: brightness(0) invert(1); }
.auth-brand span { display: block; font-size: 10px; font-weight: 500; letter-spacing: .3em; color: var(--orange); text-transform: uppercase; margin-top: 2px; margin-left: 3px; }
.auth-card h2 { color: #9aa0a6; font-size: 14.5px; font-weight: 400; margin: 18px 0 26px; letter-spacing: 0; }
.field { position: relative; margin-bottom: 20px; text-align: left; }
.field label { position: absolute; top: -8px; left: 14px; background: #212427; padding: 0 7px; font-size: 11px; color: #9aa0a6; margin: 0; font-weight: 400; z-index: 1; }
.field input {
  background: transparent; border: 1px solid #4a4f55; border-radius: 12px; color: #fff;
  padding: 14px 44px 14px 16px; font-size: 14px; width: 100%;
}
.field input:focus { background: transparent; border-color: var(--orange); box-shadow: none; }
.field input::placeholder { color: #5a6066; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none !important; box-shadow: none !important; color: #9aa0a6; padding: 8px 10px; font-size: 15px;
}
.eye:hover { color: #fff; transform: translateY(-50%); }
.eye svg { display: block; }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: -6px 0 20px; font-size: 12.5px; }
.auth-row a { color: var(--orange); text-decoration: none; font-weight: 500; }
.auth-card button.w100 { width: 100%; padding: 15px; font-size: 15px; border-radius: 14px; margin-top: 2px; }
.auth-back { margin-top: 18px; font-size: 12.5px; }
.auth-back a { color: #9aa0a6; text-decoration: none; }
.auth-back a:hover { color: #fff; }
.auth-error { background: rgba(192,38,38,.18); color: #ff9b9b; border-radius: 12px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 16px; display: none; text-align: left; }
.auth-sub { color: #9aa0a6; font-size: 12.5px; margin: -18px 0 22px; font-weight: 300; }
.auth-foot { position: absolute; bottom: 18px; left: 0; right: 0; font-size: 11px; color: #6c7178; text-align: center; }
.auth-foot a { color: #9aa0a6; }

/* ===== Toggle přepínač ===== */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 400; color: #4a4e54; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .tr { width: 38px; height: 22px; background: #d6d9dd; border-radius: 99px; transition: background .15s; position: relative; flex-shrink: 0; }
.switch .tr::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .tr { background: var(--orange); }
.switch input:checked + .tr::after { left: 19px; }
.switch input:focus-visible + .tr { box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 30%, transparent); }
.switch.dark { color: #9aa0a6; }
.switch.dark .tr { background: #4a4f55; }
.switch.dark input:checked + .tr { background: var(--orange); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17,19,22,.5); display: flex; align-items: center; justify-content: center;
  z-index: 85; padding: 20px; animation: authIn .15s both;
}
.modal { background: #fff; border-radius: 16px; padding: 30px 34px 28px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); position: relative; }
.modal h3 { font-size: 16px; margin: 0 0 10px; text-align: center; width: 100%; }
.modal > .row:last-of-type { justify-content: center; margin-top: 20px; }
.modal .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
/* plovoucí popisky jako na loginu */
.modal label { display: inline-block; position: relative; z-index: 2; margin: 10px 0 0 12px; padding: 0 6px; background: #fff; font-size: 11px; color: var(--gray); font-weight: 500; }
.modal label + input, .modal label + select, .modal label + textarea,
.modal div > label + input, .modal div > label + select, .modal div > label + textarea { margin-top: -8px; }
.modal .switch { display: inline-flex; position: static; margin: 14px 16px 0 4px; padding: 0; background: none; font-size: 13px; color: #4a4e54; font-weight: 400; }
.modal .hint { margin: 6px 0 4px 4px; }
.modal .new-tag { margin-top: 8px; gap: 8px; flex-wrap: nowrap; }
.modal .new-tag input { flex: 1; min-width: 0; }
.modal .entry-history { margin: 18px 0 0; padding: 12px 14px; border: 1px solid var(--line, #e6e8eb); border-radius: 12px; font-size: 12.5px; }
.modal .entry-history .eh-title { font-size: 11px; color: var(--gray); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.modal .entry-history ul { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.modal .entry-history li { padding: 6px 0; border-top: 1px solid var(--line, #eef0f2); color: #4a4e54; line-height: 1.5; }
.modal .entry-history li:first-child { border-top: 0; padding-top: 0; }
.modal .entry-history .eh-head { color: var(--gray); font-size: 11.5px; }

/* Toast */
#msg {
  position: fixed; bottom: 18px; right: 18px; background: var(--ink); color: #fff;
  padding: 13px 20px; border-radius: 18px; display: none; max-width: 440px; z-index: 99; font-size: 13px;
  box-shadow: var(--shadow-hover); animation: authIn .25s both;
}
.svgi { vertical-align: -3px; }

/* ===== Obsahový styl (Prodify-like) ===== */
main {
  background:
    linear-gradient(to right, rgba(120,120,160,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120,120,160,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  border-radius: 14px;
}
.card { border: 1px solid #e7e7f0; box-shadow: none; border-radius: 16px; }
.card:hover { box-shadow: 0 6px 24px rgba(30,30,60,.05); }
.kpi { border: 1px solid #e7e7f0; box-shadow: none; border-radius: 16px; }

.ui-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ui-title { margin: 0; font-size: 15px; font-weight: 600; }
.ui-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ui-ic {
  width: 34px; height: 34px; border-radius: 10px; background: #f1f0fa; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
}
.ui-kpi { display: flex; align-items: center; gap: 12px; }
.ui-kpi .n { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.ui-kpi .l { font-size: 11.5px; color: var(--gray); font-weight: 500; margin-top: 2px; }
.ui-kpi .s { font-size: 11px; color: var(--gray-2); margin-top: 1px; }
.ui-kpi.tone-brand .ui-ic { background: #fdeeda; color: var(--orange); }
.ui-kpi.tone-ok .ui-ic { background: #e2f6ec; color: #1d9e63; }
.ui-kpi.tone-warn .ui-ic { background: #fdf3dc; color: #c78a12; }
.ui-kpi.tone-info .ui-ic { background: #e2edfd; color: #2760b8; }

.ui-chip {
  display: inline-block; padding: 4px 10px; border-radius: 9px; font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; background: #f0f0f6; color: #5a5e68;
}
.ui-chip.tone-ok { background: #d9f4e6; color: #157a4c; }
.ui-chip.tone-warn { background: #fdeecd; color: #a1730e; }
.ui-chip.tone-danger { background: #fddddd; color: #c03434; }
.ui-chip.tone-info { background: #e2edfd; color: #2760b8; }
.ui-chip.tone-brand { background: #fdeeda; color: #c56f0a; }

.ui-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ui-empty { display: flex; align-items: center; gap: 8px; color: var(--gray); font-size: 13px; padding: 22px 0; justify-content: center; }
.ui-empty span { font-size: 18px; opacity: .6; }

/* kompaktní filtry v hlavičce karty */
.flt-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card .flt-bar input[type=text], .card .flt-bar input[type=search], .card .flt-bar select {
  width: auto; padding: 9px 14px; border-radius: 99px; font-size: 12.5px;
  background: #f3f4f5; border: 1px solid transparent;
}
.card .flt-bar input[type=search] { max-width: 300px; min-width: 220px; }
.card .flt-bar select { max-width: 220px; cursor: pointer; }
.card .flt-bar input:focus, .card .flt-bar select:focus { border-color: var(--orange); background: #fff; }


/* ===================== Emglare Clients ===================== */
.server-page { display: grid; place-items: center; min-height: 100vh; margin: 0; background: var(--bg); }
.server-card { background: #fff; border-radius: 14px; padding: 32px; max-width: 440px; margin: 16px; box-shadow: var(--shadow); }
.server-card h2 { margin: 0 0 10px; }
.server-card p { color: #5b6270; line-height: 1.5; }
a.btn { display: inline-block; text-decoration: none; background: var(--orange); color: #fff; border-radius: var(--r-pill); padding: 10px 20px; font-weight: 600; font-size: 12.5px; }

.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.page-head h1 { font-size: 23px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.page-head .sub { color: var(--gray); font-size: 13px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--gray); text-decoration: none; font-size: 12.5px; margin-bottom: 6px; }
.back:hover { color: var(--orange-dark); }

/* filtry: pilulky */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { background: #fff; color: #35404f; border: 1px solid #e2e2ec; box-shadow: none; padding: 7px 14px; font-weight: 500; font-size: 12px; }
.chip-btn:hover { background: #fff; color: var(--orange-dark); border-color: var(--orange); transform: none; }
.chip-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-btn .cnt { opacity: .6; margin-left: 4px; font-weight: 400; }

/* seznamy */
.list-table td.name { font-weight: 600; }
.list-table td .muted, .muted { color: var(--gray); font-weight: 400; }
.list-table tr { cursor: pointer; }
.list-table td.nowrap { white-space: nowrap; }
.ui-chip { margin: 0 4px 2px 0; }
.ui-chip.t-client { background: #fdeeda; color: #c56f0a; }
.ui-chip.t-supplier { background: #e2edfd; color: #2760b8; }
.ui-chip.t-partner { background: #efe6fb; color: #6a3fb5; }
.ui-chip.t-other, .ui-chip.t-contact { background: #f0f0f6; color: #5a5e68; }
.ui-chip.s-active { background: #d9f4e6; color: #157a4c; }
.ui-chip.s-prospect { background: #fdf3dc; color: #a1730e; }
.ui-chip.s-former { background: #f0f0f6; color: #8a8f96; }
.tagpill { display: inline-block; background: #f3f4f5; border-radius: 99px; padding: 2px 9px; font-size: 11px; margin: 0 4px 3px 0; color: #4a4e54; }

/* detail */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.facts dt { color: var(--gray); font-weight: 500; }
.facts dd { margin: 0; word-break: break-word; }
.people-row, .comm-row, .proj-row { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid #f1f1f6; }
.people-row:first-child, .comm-row:first-child, .proj-row:first-child { border-top: 0; }
.people-row .who { min-width: 0; flex: 1; }
.people-row .who a { font-weight: 600; color: var(--ink); text-decoration: none; }
.people-row .who a:hover { color: var(--orange-dark); }
.people-row .who .muted { display: block; font-size: 12px; }
.people-row.ended { opacity: .6; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 54px; height: 54px; font-size: 18px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.quick a, .quick button { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; background: #fff; color: #35404f; border: 1px solid #e2e2ec; border-radius: 99px; padding: 7px 14px; font-size: 12px; font-weight: 500; box-shadow: none; }
.quick a:hover, .quick button:hover { border-color: var(--orange); color: var(--orange-dark); background: #fff; transform: none; }
.comm-row { align-items: flex-start; }
.comm-row .ic { width: 30px; height: 30px; border-radius: 9px; background: #f1f0fa; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.comm-row .body { min-width: 0; flex: 1; }
.comm-row .body b { display: block; font-size: 13px; }
.comm-row .body .muted { font-size: 11.5px; }
.comm-row .text { white-space: pre-wrap; font-size: 12.5px; color: #3c4047; margin-top: 6px; max-height: 7.5em; overflow: hidden; }
.comm-row.open .text { max-height: none; }
.comm-row .atts { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.comm-row .atts a { font-size: 11.5px; background: #f3f4f5; border-radius: 8px; padding: 3px 8px; color: var(--ink); text-decoration: none; }
.cat { display: block; margin-top: 2px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--gray); }
.cat.price { color: var(--red); font-weight: 600; }

/* založení s kontrolou duplicit */
.match-box { margin-top: 14px; border: 1px solid #fde3bf; background: #fffaf2; border-radius: 12px; padding: 12px 14px; font-size: 12.5px; }
.match-box b { display: block; margin-bottom: 6px; }
.match-box .m { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #fbe9cf; }
.match-box .m:first-of-type { border-top: 0; }
.match-box .m .who { flex: 1; min-width: 0; }
.match-box.warn { border-color: #f5c2c2; background: #fff6f6; }
.whois { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #f6f7f8; }
.whois .q { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: #fff; border-radius: 12px; box-shadow: var(--shadow-hover); max-height: 240px; overflow-y: auto; margin-top: 4px; }
.combo-list div { padding: 9px 14px; cursor: pointer; font-size: 13px; }
.combo-list div:hover, .combo-list div.hl { background: var(--orange-soft); }
.combo-list div small { color: var(--gray); margin-left: 6px; }
.repeat-row { display: flex; gap: 8px; margin-top: 6px; }
.repeat-row input { flex: 1; }
.repeat-row button { padding: 6px 12px; }
.checks { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 8px; }
.checks label { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; padding: 0 !important; background: none !important; font-size: 13px !important; color: var(--ink) !important; }
.checks input { width: auto; margin: 0; }
.modal.wide { max-width: 760px; }
.modal .section { margin-top: 18px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); font-weight: 600; }

/* import */
.import-table select { padding: 6px 10px; border-radius: 9px; font-size: 12px; width: auto; }
.import-table td { vertical-align: top; font-size: 12.5px; }
.import-table .res-ok { color: var(--green); }
.import-table .res-fail { color: var(--red); }
.drop { border: 2px dashed #d3d7dc; border-radius: 16px; padding: 30px; text-align: center; color: var(--gray); }
.drop.over { border-color: var(--orange); background: var(--orange-soft); }

/* mobil */
#menu-btn { display: none; }
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 120px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .layout { flex-direction: column; padding: 0; gap: 0; }
  #sidebar { width: auto; height: auto; position: sticky; top: 0; z-index: 40; border-radius: 0; padding: 10px 16px; flex-direction: row; align-items: center; gap: 10px; }
  .sb-brand { border: 0; margin: 0; padding: 0; flex: 1; }
  #menu-btn { display: inline-flex; background: rgba(255,255,255,.08); box-shadow: none; padding: 8px 12px; }
  #nav, .sb-user { display: none; }
  #sidebar.open { flex-wrap: wrap; }
  #sidebar.open #nav { display: block; width: 100%; order: 3; padding-top: 8px; }
  #sidebar.open .sb-user { display: flex; width: 100%; order: 4; }
  main { padding: 12px 16px 0; border-radius: 0; }
  .card { padding: 16px; }
  .list-table .hide-m { display: none; }
  .modal { padding: 22px 18px; }
  .modal .grid2 { grid-template-columns: 1fr; }
  .page-head .actions { margin-left: 0; width: 100%; }
}
