/* Luxvps theme r21 (3 Dec 2026): layout breaks and German gaps from the 2 Dec 2026 design review
   (items 8, 9, 10, 12, 13, 14, 55, plus the German "Browse" button for 54).
   Loaded by includes/hooks/luxvps_theme_layout.php in <head>, only with the luxvps test theme.
   Every rule starts with "body.lx-body" (or "html body.lx-body") so it wins over luxvps.css, which loads after it.
   Undo: remove includes/hooks/luxvps_theme_layout.php (or run rollback_r21.sh). */

/* 8: side cards never make the page wider (long attachment names on View Ticket,
   long ticket titles in "Your recent tickets" on Open a ticket) */
body.lx-body .lx-page-side,body.lx-body .lx-page-side .sidebar,body.lx-body .lx-page-side .card{min-width:0;max-width:100%}
body.lx-body .sidebar-menu-item-wrapper{min-width:0}
body.lx-body .sidebar-menu-item-wrapper>.sidebar-menu-item-label{min-width:0;flex:1 1 auto;overflow-wrap:anywhere;word-break:break-word}
body.lx-body .recent-ticket{min-width:0}
body.lx-body .recent-ticket .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}

/* 9: phone and tablet menu fits the screen and scrolls, so English / Deutsch at the bottom can be reached;
   the chat button is hidden while the menu is open */
@media (max-width:991.98px){
  body.lx-body .lx-nav{top:56px;bottom:auto;height:calc(100vh - 56px);height:calc(100dvh - 56px);max-height:calc(100dvh - 56px);
    overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
  html body.lx-body.lx-menu-open #lux-chat-launcher{display:none!important}
}

/* 10: phones: the invoices and tickets lists show each row as a small card, so Balance, Status and the
   page buttons are no longer hidden off to the right */
@media (max-width:575.98px){
  body.lx-body #tableInvoicesList,body.lx-body #tableTicketsList{display:block;width:100%!important;min-width:0;border:0}
  body.lx-body #tableInvoicesList thead,body.lx-body #tableTicketsList thead{display:none}
  body.lx-body #tableInvoicesList tbody,body.lx-body #tableTicketsList tbody{display:block;width:100%}
  body.lx-body #tableInvoicesList tbody tr,body.lx-body #tableTicketsList tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:4px;
    align-items:center;padding:12px 14px;border-bottom:1px solid var(--lxb-border);cursor:pointer}
  body.lx-body #tableInvoicesList tbody tr:last-child,body.lx-body #tableTicketsList tbody tr:last-child{border-bottom:0}
  body.lx-body #tableInvoicesList tbody td,body.lx-body #tableTicketsList tbody td{display:block;padding:0!important;border:0!important;background:none!important;
    text-align:left!important;white-space:normal;min-width:0;font-size:13px;line-height:1.4}
  body.lx-body #tableInvoicesList tbody td.dataTables_empty,body.lx-body #tableTicketsList tbody td.dataTables_empty{grid-column:1 / -1}
  /* invoices: number + status / invoice date + total / due date + balance */
  body.lx-body #tableInvoicesList td:nth-child(1){grid-column:1;grid-row:1;font-weight:600;font-size:14px;color:var(--lxb-head)}
  body.lx-body #tableInvoicesList td:nth-child(6){grid-column:2;grid-row:1;justify-self:end}
  body.lx-body #tableInvoicesList td:nth-child(2){grid-column:1;grid-row:2;color:var(--lxb-muted)}
  body.lx-body #tableInvoicesList td:nth-child(4){grid-column:2;grid-row:2;justify-self:end;text-align:right!important;font-weight:600;color:var(--lxb-head)}
  body.lx-body #tableInvoicesList td:nth-child(3){grid-column:1;grid-row:3;color:var(--lxb-muted)}
  body.lx-body #tableInvoicesList td:nth-child(5){grid-column:2;grid-row:3;justify-self:end;text-align:right!important;color:var(--lxb-muted)}
  body.lx-body #tableInvoicesList td:nth-child(1)::before{content:"Invoice #"}
  body.lx-body #tableInvoicesList td:nth-child(2)::before{content:"Invoice date: "}
  body.lx-body #tableInvoicesList td:nth-child(3)::before{content:"Due: "}
  body.lx-body #tableInvoicesList td:nth-child(5)::before{content:"Balance: "}
  html[lang="de"] body.lx-body #tableInvoicesList td:nth-child(1)::before{content:"Rechnung #"}
  html[lang="de"] body.lx-body #tableInvoicesList td:nth-child(2)::before{content:"Rechnungsdatum: "}
  html[lang="de"] body.lx-body #tableInvoicesList td:nth-child(3)::before{content:"F\00E4llig: "}
  html[lang="de"] body.lx-body #tableInvoicesList td:nth-child(5)::before{content:"Offen: "}
  /* tickets: subject + status / department + last update */
  body.lx-body #tableTicketsList td:nth-child(2){grid-column:1;grid-row:1}
  body.lx-body #tableTicketsList td:nth-child(2) a{display:block;border:0!important;padding:0!important;overflow-wrap:anywhere}
  body.lx-body #tableTicketsList td:nth-child(2) .ticket-number{display:block;font-size:12px;color:var(--lxb-muted)}
  body.lx-body #tableTicketsList td:nth-child(2) .ticket-subject{display:block;font-weight:600;font-size:14px}
  body.lx-body #tableTicketsList td:nth-child(3){grid-column:2;grid-row:1;justify-self:end}
  body.lx-body #tableTicketsList td:nth-child(1){grid-column:1;grid-row:2;color:var(--lxb-muted);font-size:12px}
  body.lx-body #tableTicketsList td:nth-child(4){grid-column:2;grid-row:2;justify-self:end;text-align:right!important;color:var(--lxb-muted);font-size:12px}
  /* "Show 10 entries" and the page buttons wrap instead of running off the screen */
  body.lx-body .dataTables_wrapper .dataTables_length,body.lx-body .dataTables_wrapper .dataTables_paginate{float:none!important;max-width:100%}
  body.lx-body .dataTables_wrapper .dataTables_paginate .pagination{flex-wrap:wrap;justify-content:flex-end}
}

/* 12: top bar knowledgebase search. Wide screens: the box grows so the whole placeholder shows (also German).
   Laptops (992 to 1279px): a search button like on phones, which opens the search row under the top bar.
   The name next to the avatar shows from 1440px (it is in the account menu below that). */
body.lx-body .lx-search .lx-input{text-overflow:ellipsis}
@media (min-width:1280px){body.lx-body .lx-search{flex:1 1 300px;max-width:360px}}
@media (min-width:992px) and (max-width:1439.98px){body.lx-body .lx-user-name,body.lx-body .lx-user-chev{display:none}}
@media (min-width:992px) and (max-width:1279.98px){
  body.lx-body #header .lx-search{display:none}
  body.lx-body #header #lxSearchToggle.lx-show-phone{display:inline-flex!important}
}

/* 13: My services between 1200 and 1599px: the same two-line rows as on tablets, so service names stay on one
   line and hostnames are not cut (the 6-column table only fits from 1600px) */
@media (min-width:1200px) and (max-width:1599.98px){
  body.lx-body .lx-svc.lx-svc-p{grid-template-columns:minmax(0,1fr) 150px 110px auto;grid-template-areas:"name ip status btns" "run run run run";row-gap:10px}
  body.lx-body .lx-svc-p.lx-svc-head{display:none}
  body.lx-body .lx-svc-p .lx-svc-name{grid-area:name}
  body.lx-body .lx-svc-p .lx-svc-ip{grid-area:ip}
  body.lx-body .lx-svc-p .lx-svc-status{grid-area:status}
  body.lx-body .lx-svc-p .lx-svc-btns{grid-area:btns}
  body.lx-body .lx-svc-p .lx-svc-run{grid-area:run;padding-right:0;flex-direction:row;align-items:center;gap:14px}
  body.lx-body .lx-svc-p .lx-svc-run:empty{display:none}
  body.lx-body .lx-svc-p .lx-svc-run .lx-bar{flex:1 1 auto;max-width:360px}
  body.lx-body .lx-svc-p .lx-svc-days{white-space:nowrap}
  body.lx-body .lx-svc-p .lx-svc-price,body.lx-body .lx-svc-p .lx-svc-price-h{display:none}
  body.lx-body .lx-svc-p .lx-svc-price-sub{display:inline}
  body.lx-body .lx-svc-p .lx-svc-name>span{white-space:normal;overflow-wrap:anywhere}
}

/* 14: the chat button no longer sits on buttons. Space under the last card so it can scroll clear of the
   button; tablets get the round icon button that phones already have, at the normal height */
body.lx-body .lx-main>.lx-content{margin-bottom:72px}
@media (min-width:481px) and (max-width:991.98px){
  html body.lx-body #lux-chat-launcher{width:52px;height:52px;padding:0;gap:0;transform:none}
  html body.lx-body #lux-chat-launcher .lux-launcher-label{display:none}
  html body.lx-body #lux-chat-launcher svg{width:22px;height:22px}
}

/* 55: German menu words stay on one line on desktop ("Neuen Server bestellen", "Benutzer und Kontakte") */
@media (min-width:992px){
  html[lang="de"] body.lx-body .lx-nav{padding-right:8px}
  html[lang="de"] body.lx-body .lx-nav a.sub{padding-right:4px;letter-spacing:-0.1px;white-space:nowrap}
}

/* 54: the file button says "Durchsuchen" in German (was "Browse") */
html[lang="de"] body.lx-body .custom-file-label::after{content:"Durchsuchen"}

/* r21b (3 Dec 2026) item 10 follow-up: German invoices table was 5-17px wider than the screen
   between 576px and 1199px ("Rechnungsnummer", "Faelligkeitsdatum"). Headers may now wrap, cells a bit tighter. */
@media (min-width: 576px) and (max-width: 1199.98px) {
    html body.lx-body #tableInvoicesList > thead > tr > th { white-space: normal; hyphens: auto; -webkit-hyphens: auto; vertical-align: bottom; }
    html body.lx-body #tableInvoicesList > thead > tr > th,
    html body.lx-body #tableInvoicesList > tbody > tr > td { padding-left: 8px; padding-right: 8px; }
}
