/* =========================================================================
   HOMELAB REFRESH – Přípojto CRM (vtiger 6.5)  •  v 20260630h
   Centrální override pro VŠECHNY skiny (Header.tpl, před </head>).
   Brand: červená #ca282a / hover #a90808 / inkoust #2b2f33
   ========================================================================= */

/* 1) Typografie */
body, .bodyContents, table td, table th, input, select, textarea, button,
.fieldValue, .value, .dvtCellInfo, .listViewEntriesTable td {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 13px !important;
    color: #2b2f33;
}
body { line-height: 1.5 !important; -webkit-font-smoothing: antialiased; }

/* 2) Tlačítka – plochá moderní, SÉMANTICKÉ barvy zachované (žádná stěna červené) */
.btn {
    border-radius: 4px !important;
    padding: 6px 14px !important;
    text-shadow: none !important;
    box-shadow: none !important;
    background-image: none !important;
    transition: background-color .15s ease, border-color .15s ease !important;
    /* neutrální základ pro tlačítka bez sémantické barvy */
    background-color: #f1f2f4 !important;
    color: #2b2f33 !important;
    border: 1px solid #d3d7dc !important;
}
.btn:hover { background-color: #e5e7ea !important; border-color: #c3c8ce !important; }
/* sémantické barvy (pořadí ZA .btn, aby vyhrály) */
.btn-success { background-color:#3f9c42 !important; border-color:#368038 !important; color:#fff !important; }
.btn-success:hover { background-color:#368038 !important; }
.btn-warning { background-color:#e0922f !important; border-color:#c87f24 !important; color:#fff !important; }
.btn-warning:hover { background-color:#c87f24 !important; }
.btn-danger  { background-color:#ca282a !important; border-color:#a90808 !important; color:#fff !important; }
.btn-danger:hover { background-color:#a90808 !important; }
.btn-primary { background-color:#ca282a !important; border-color:#a90808 !important; color:#fff !important; }
.btn-primary:hover { background-color:#a90808 !important; }
.btn-info { background-color:#3a87ad !important; border-color:#2f6f8f !important; color:#fff !important; }
.btn-info:hover { background-color:#2f6f8f !important; }

/* 3) Odkazy / accent v brand červené */
a, a:visited { color: #ca282a; }
a:hover { color: #a90808; }

/* 4) Seznamy – jen vzdušnější řádky (BEZ zebrování/hover – přebíjelo barvy stavů) */
.listViewEntriesTable td, .listViewEntriesTable th { padding: 8px 10px !important; }

/* 5) Detail – čitelnější label/hodnota, vzdušnější řádky */
.detailViewTable td, .detailViewTable th { padding-top: 8px !important; padding-bottom: 8px !important; }
.fieldLabel { color: #6b7178 !important; }
.fieldValue { color: #2b2f33 !important; }

/* 6) Jemné ohraničení kontejnerů */
.contents, .detailViewContainer, .listViewContentDiv, .blockContainer { border-color: #e3e6ea !important; }

/* 7) HORNÍ NAVIGACE – jen barevné doladění, BEZ změny rozměrů (kvůli ikoně domů) */
.navbar.navbar-fixed-top #topMenus .navbar-inner .menuBar .nav.modulesList li.tabs a { text-shadow:none !important; }
.navbar.navbar-fixed-top #topMenus .navbar-inner .menuBar .nav.modulesList li.tabs:hover a { background:#2a2f35 !important; color:#ffffff !important; }
.navbar.navbar-fixed-top #topMenus .navbar-inner .menuBar .nav.modulesList li.tabs a.selected,
.navbar.navbar-fixed-top #topMenus .navbar-inner .menuBar .nav.modulesList li.tabs.selected a {
    background:#131619 !important; color:#ffffff !important; box-shadow: inset 0 -3px 0 #ca282a !important;
}
.navbar.navbar-fixed-top #topMenus .navbar-inner .menuBar .nav.modulesList li.tabs a img { vertical-align:middle !important; }

/* 8) Telefon v detailu – větší a tučnější číslo (ikonka kopírování zůstává) */
td.fieldValue .value[data-field-type="phone"],
td.fieldValue .value[data-field-type="phone"] a.phoneField {
    font-size: 18px !important;
    font-weight: 700 !important;
}


/* HOMELAB – hezčí vyhledávání v prvních kontaktech (pj-search-restyle) */
.searchElement form[action*="module=hledani"]{display:inline-flex !important;align-items:stretch;vertical-align:middle;}
/* vždy uprostřed hlavičky (kotva = .actionsContainer = full-width řádek s logem) */
@media(min-width:901px){
  .actionsContainer.row-fluid{position:relative;}
  .searchElement form[action*="module=hledani"]{
    position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:5;
  }
}
.searchElement form[action*="module=hledani"] input[name="prohledanileadu"]{
  height:36px;box-sizing:border-box;width:300px;max-width:46vw;
  padding:6px 14px;font-size:13px;color:#2b2f33;
  background:#fff;border:1px solid #d4d9de;border-right:none;
  border-radius:18px 0 0 18px;outline:none;box-shadow:none;margin:0;
  transition:border-color .15s, box-shadow .15s;
}
.searchElement form[action*="module=hledani"] input[name="prohledanileadu"]::placeholder{color:#9aa3ab;}
.searchElement form[action*="module=hledani"] input[name="prohledanileadu"]:focus{
  border-color:#CA282A;box-shadow:0 0 0 3px rgba(202,40,42,.12);
}
.searchElement form[action*="module=hledani"] input[type="submit"]{
  height:36px;box-sizing:border-box;margin:0;cursor:pointer;
  background:#CA282A !important;color:#fff !important;
  padding:6px 18px !important;font-size:13px;font-weight:600;letter-spacing:.2px;
  border:1px solid #CA282A !important;border-radius:0 18px 18px 0 !important;
  transition:background .15s;
}
.searchElement form[action*="module=hledani"] input[type="submit"]:hover{
  background:#a91f21 !important;border-color:#a91f21 !important;
}

/* HOMELAB – mobilní zobrazení (pj-mobile-fixes): vtiger drží min-width 1200px */
@media(max-width:900px){
  .mainContainer.row-fluid{min-width:0 !important;}
  .navbar.commonActionsContainer,.navbar-inner,.menuBar.row-fluid,.actionsContainer.row-fluid{min-width:0 !important;width:auto !important;}
  .contentsDiv{padding-left:4px;padding-right:4px;}
  /* široké tabulky (Kontrola, kalendář Diáře) scrollují uvnitř, ne celá stránka */
  .listViewPageDiv{overflow-x:auto;-webkit-overflow-scrolling:touch;}
  /* modulová navigace i na mobilu: largeNav jako horizontálně scrollovatelný pruh */
  #largeNav{display:flex !important;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:calc(100vw - 90px);scrollbar-width:none;}
  #largeNav::-webkit-scrollbar{display:none;}
  #largeNav > li{flex:0 0 auto;float:none;white-space:nowrap;}
  #shortNav{display:none !important;}
}

/* ---------- DETAIL VIEW modernizace (První kontakt & spol., 2026-07-03) ----------
   Sladeno s live.php/login stylem: karty, jemne oddelovace, stitky vs. hodnoty.
   Dark rezim resi invert filtr automaticky. Reverzne: smazat tento blok. */
.detailViewContainer { background: transparent; }
.detailViewContainer h4.recordLabel { font-size: 21px; font-weight: 700; color: #22303c; }

/* bloky jako karty */
table.detailview-table {
  border-collapse: separate !important; border-spacing: 0;
  border: 1px solid #e3e8ed !important; border-radius: 12px; overflow: visible;
  box-shadow: 0 2px 12px rgba(20,30,40,.06); background: #fff;
  margin-bottom: 18px !important;
}
table.detailview-table th.blockHeader {
  background: #f7f9fb !important; border: 0 !important;
  border-bottom: 1px solid #e3e8ed !important; padding: 12px 16px !important;
  font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: #5a6673;
}
table.detailview-table td {
  border: 0 !important; border-bottom: 1px solid #f0f3f6 !important;
  padding: 9px 16px !important; vertical-align: middle;
}
table.detailview-table tr:last-child td { border-bottom: 0 !important; }
table.detailview-table tr:hover td { background: #fbfcfd; }
td.fieldLabel { color: #3f4a55 !important; font-size: 13px !important; font-weight: 600; }
td.fieldLabel label, td.fieldLabel .muted { color: #3f4a55 !important; font-weight: 600; font-size: 13px; }
td.fieldValue { color: #22303c !important; font-weight: 500; }
td.fieldValue a { color: #ca282a; }

/* akcni tlacitka nahore */
.detailViewButtoncontainer .btn {
  border-radius: 8px !important; padding: 6px 16px; height: auto;
  background: #fff; border: 1px solid #d4d9de; color: #3a4652;
  box-shadow: none !important; text-shadow: none !important; background-image: none !important;
  transition: border-color .12s, color .12s;
}
.detailViewButtoncontainer .btn:hover { border-color: #ca282a; color: #ca282a; background: #fff; }
.detailViewButtoncontainer .btn strong { font-weight: 600; }
.detailViewButtoncontainer button[id$="LBL_SEND_EMAIL"] {
  background: #ca282a !important; border-color: #ca282a !important; color: #fff !important;
}
.detailViewButtoncontainer button[id$="LBL_SEND_EMAIL"]:hover { background: #a91f21 !important; }

/* pravy panel souvisejicich zalozek */
.related.span2 { padding-top: 6px; }
.related ul, .related .nav { border: 1px solid #e3e8ed; border-radius: 12px; background: #fff; padding: 8px; box-shadow: 0 2px 12px rgba(20,30,40,.05); }
.related li { list-style: none; }
.related li a {
  display: block; padding: 8px 12px; border-radius: 8px; color: #3a4652 !important;
  text-decoration: none; font-weight: 500; font-size: 13px;
}
.related li a:hover { background: rgba(202,40,42,.07); color: #ca282a !important; }
.related li.active a, .related li a.active { background: #2b3540 !important; color: #fff !important; }

/* info pruh 'kdo je na strance' (#aktivniUzivatele ma inline border) */
#aktivniUzivatele {
  border: 1px solid #e3e8ed !important; border-radius: 10px !important;
  background: #f7f9fb; color: #3f4a55; padding: 8px 14px !important;
  font-size: 13px !important; margin-bottom: 14px !important;
}

/* ---------- HORNI MENU modernizace (2026-07-03) ---------- */
.navbar-fixed-top, .navbar-fixed-top .navbar-inner {
  /* barvu NElockovat - urcuje ji vtiger skin (paleta/stetka); fix 2026-07-03 */
  background-image: none !important;
  border: 0 !important; box-shadow: 0 2px 12px rgba(0,0,0,.28) !important;
}
#largeNav > li > a {
  color: #c6cdd4 !important; font-weight: 600; letter-spacing: .2px;
  background: transparent !important; text-shadow: none !important;
  position: relative; transition: color .12s, background .12s;
}
#largeNav > li > a:hover, #largeNav > li > a:focus {
  color: #fff !important; background: rgba(255,255,255,.07) !important;
}
#largeNav > li > a.selected {
  color: #fff !important; background: rgba(255,255,255,.05) !important;
}
#largeNav > li > a.selected::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: 0;
  height: 3px; background: #ca282a; border-radius: 2px 2px 0 0;
}
#largeNav .dropdown-menu { border-radius: 10px !important; }
#largeNav .lnd-mail-badge, #largeNav .badge { box-shadow: none !important; }
html[data-lnd="dark"] .navbar-fixed-top { filter: invert(1) hue-rotate(180deg); }

/* rohy karet bez overflow:hidden (dropdowny se nesmi orezavat) */
table.detailview-table tr:first-child th:first-child, table.detailview-table tr:first-child td:first-child { border-top-left-radius: 12px; }
table.detailview-table tr:first-child th:last-child, table.detailview-table tr:first-child td:last-child { border-top-right-radius: 12px; }
table.detailview-table tr:last-child td:first-child { border-bottom-left-radius: 12px; }
table.detailview-table tr:last-child td:last-child { border-bottom-right-radius: 12px; }

/* ---------- LIST VIEW modernizace (seznam prvnich kontaktu & spol., 2026-07-03) ---------- */
/* tlacitka nahore */
.listViewTopMenuDiv .btn, .listViewActionsDiv .btn, .listViewPageDiv .btn {
  border-radius: 8px !important; background: #fff; border: 1px solid #d4d9de; color: #3a4652;
  box-shadow: none !important; text-shadow: none !important; background-image: none !important;
}
.listViewTopMenuDiv .btn:hover, .listViewActionsDiv .btn:hover { border-color: #ca282a; color: #ca282a; }
.listViewTopMenuDiv .btn.addButton {
  background: #ca282a !important; border-color: #ca282a !important; color: #fff !important; font-weight: 600;
}
.listViewTopMenuDiv .btn.addButton:hover { background: #a91f21 !important; }

/* abecedni lista */
.alphabetSorting { padding: 4px 2px !important; }
.alphabetSorting td, .alphabetSorting a {
  font-size: 11px !important; color: #8b97a5 !important; border: 0 !important;
}
.alphabetSorting a { display: inline-block; padding: 2px 6px; border-radius: 6px; text-decoration: none; }
.alphabetSorting a:hover { background: rgba(202,40,42,.09); color: #ca282a !important; }

/* tabulka seznamu jako karta */
table.listViewEntriesTable {
  border-collapse: separate !important; border-spacing: 0;
  border: 1px solid #e3e8ed !important; border-radius: 12px;
  box-shadow: 0 2px 12px rgba(20,30,40,.06); background: #fff; overflow: visible;
}
table.listViewEntriesTable th, table.listViewEntriesTable td { border: 0 !important; }
tr.listViewHeaders th {
  background: #f7f9fb !important; border-bottom: 1px solid #e3e8ed !important;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #5a6673 !important;
  padding: 10px 12px !important;
}
tr.listViewHeaders th a { color: #5a6673 !important; }
/* radek s vyhledavacimi poli */
tr.listViewSearchContainer td, table.listViewEntriesTable tbody tr:first-child:has(input[type="text"]) td {
  /* SEARCHROW-FIX 2026-07-07: search radek JE tbody:first-child (bez tridy); stary selektor
     first-child + tr trefoval 2. radek = v Dohledu 2. cloveka (klasslesne radky) */
  /* fix 2026-07-03: :not(.listViewEntries) - selektor chytal i PRVNI datovy radek
     a prekryval barvy EERainbowList (zeleny 1. hovor apod.) */
  border-bottom: 1px solid #e3e8ed !important; background: #fbfcfd;
}
table.listViewEntriesTable input[type="text"]:not(.select2-input) {
  border: 1px solid #d4d9de !important; border-radius: 8px !important;
  padding: 4px 10px !important; box-shadow: none !important; height: 26px;
}
table.listViewEntriesTable input[type="text"]:not(.select2-input):focus { border-color: #ca282a !important; box-shadow: 0 0 0 3px rgba(202,40,42,.10) !important; }
/* select2 pole (Přidělené k, Stav…) — vlastní kontejner, vnitřní input nechat být */
.listViewEntriesTable .select2-container .select2-choices,
.listViewEntriesTable .select2-container .select2-choice {
  border: 1px solid #d4d9de !important; border-radius: 8px !important;
  background: #fff !important; background-image: none !important;
  box-shadow: none !important; min-height: 26px;
}
.listViewEntriesTable .select2-container .select2-input {
  border: 0 !important; box-shadow: none !important; background: transparent !important;
  height: 24px; margin: 0; padding: 2px 8px !important;
}
.listViewEntriesTable .select2-container-active .select2-choices,
.listViewEntriesTable .select2-container-active .select2-choice { border-color: #ca282a !important; }
/* radky */
tr.listViewEntries td { border-bottom: 1px solid #f0f3f6 !important; padding: 8px 12px !important; }
tr.listViewEntries:nth-child(odd) { background: #fcfdfe; }
tr.listViewEntries:hover td { background: rgba(202,40,42,.05) !important; }
tr.listViewEntries:last-child td { border-bottom: 0 !important; }
tr.listViewEntries a { color: #ca282a; }
