/* Dopasowania funkcjonalnych widoków PHP do panelu wzorcowego Python.
   Układ dashboardu, paska bocznego i kart pozostaje 1:1 z wersją Python. */
.toolbar{display:flex;gap:10px;justify-content:flex-end;align-items:center;margin:0 0 18px}
.toolbar form{margin:0}
.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.form-card{max-width:none}
.app-page .content>.form-card,.app-page .content>.panel{border:1px solid #183b50;background:linear-gradient(145deg,rgba(7,22,34,.96),rgba(3,13,21,.98));padding:22px}
.top-alerts svg,.nav-svg svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.message-card{padding:18px;margin-bottom:12px;border:1px solid #203f54;background:#061520}
.message-card.unread{border-color:#8b5cf6;box-shadow:0 0 24px rgba(139,92,246,.12)}
.public-page main>.flash{max-width:1200px;margin:15px auto}
.status-open{color:#57e99a}
.owner-overlay{background:linear-gradient(145deg,rgba(32,176,255,.18),rgba(4,23,38,.18)),repeating-linear-gradient(0deg,rgba(80,201,255,.045) 0,rgba(80,201,255,.045) 1px,transparent 1px,transparent 5px)!important;backdrop-filter:blur(.6px)}

/* Spójna szerokość i gęstość menu jak w panelu Python. */
.sidebar{width:260px}
.app-shell{grid-template-columns:260px minmax(0,1fr)}
.side-nav{padding:18px 10px}
.nav-item{padding:11px 13px;margin:2px 0;gap:12px}
.nav-label{margin:18px 12px 7px}

/* W wersji PHP tabela używa klasy table-wrap zamiast table. */
.table-wrap{overflow:auto;background:#06111b;border-radius:4px;border:1px solid #1c3548}
.dashboard-panel>.table-wrap{border:0;border-radius:0;margin:0 -14px -14px}

/* Piąta szybka akcja ma ten sam charakter jak pozostałe. */
.quick.invoice{color:#62d6ff}

/* Karty nie mogą stykać się nawet przy nietypowym zoomie przeglądarki. */
.metric-grid,.dashboard-layout,.dashboard-bottom,.dashboard-main,.dashboard-side{min-width:0}
.metric{min-width:0}
.metric>div{min-width:0}
.metric small{line-height:1.35}
.dashboard-panel{min-width:0}
.recent-order>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media(max-width:1250px){
  .cards.five{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  .cards.five{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .cards.five{grid-template-columns:1fr}
  .toolbar{flex-wrap:wrap;justify-content:stretch}
  .toolbar>*{flex:1}
}


/* ===== v5.1.5: kompaktowe menu, profesjonalne modale i awatar ===== */

/* Gęstsza nawigacja panelu — mniejsza wysokość pozycji i grup. */
.sidebar{width:272px}
.app-shell{grid-template-columns:272px minmax(0,1fr)}
.logo-wrap{height:104px;padding:10px 16px 8px}
.logo-wrap img{max-width:210px;max-height:66px}
.side-nav{padding:10px 9px 14px}
.nav-label{margin:11px 11px 4px;font-size:9px;line-height:1.2;letter-spacing:1.35px}
.nav-item{
  min-height:34px;
  padding:7px 11px;
  margin:1px 0;
  gap:10px;
  border-radius:5px;
  font-size:12px;
  line-height:1.15;
}
.nav-icon{width:19px;font-size:16px;line-height:1}
.sidebar-footer{padding:10px 16px}
@media(max-width:900px){
  .app-shell{grid-template-columns:1fr}
}

/* Wyraźne odstępy pomiędzy akcjami w całym panelu. */
.actions,.toolbar,.message-actions,.avatar-form-actions{gap:14px}
.actions .button,.actions button,.modal-actions .button,.modal-actions button{
  min-width:124px;
}
.button,button{
  line-height:1.2;
}
.module-title{gap:22px}

/* Modal jako osobna, profesjonalna karta aplikacji. */
.record-modal{
  width:min(820px,calc(100vw - 32px));
  max-height:min(90vh,920px);
  margin:auto;
  padding:0;
  overflow:hidden;
  border:1px solid #2b7eaf;
  border-radius:16px;
  background:
    radial-gradient(circle at 80% 0,rgba(28,142,220,.15),transparent 34%),
    linear-gradient(155deg,#081c2b 0,#04111b 62%,#020910 100%);
  box-shadow:
    0 34px 110px rgba(0,0,0,.78),
    0 0 0 1px rgba(102,201,255,.06) inset,
    0 0 44px rgba(31,166,255,.18);
}
.record-modal[open]{animation:ghModalIn .18s ease-out}
@keyframes ghModalIn{
  from{opacity:0;transform:translateY(14px) scale(.985)}
  to{opacity:1;transform:none}
}
.record-modal::backdrop{
  background:rgba(0,5,10,.78);
  backdrop-filter:blur(7px);
}
.record-modal-form{
  display:flex!important;
  flex-direction:column;
  max-height:min(90vh,920px);
  gap:0!important;
}
.modal-heading{
  position:relative;
  top:auto;
  flex:0 0 auto;
  padding:23px 26px 20px;
  border-bottom:1px solid rgba(76,145,187,.28);
  background:linear-gradient(180deg,rgba(10,31,46,.98),rgba(5,19,30,.96));
}
.modal-heading::after{
  content:"";
  position:absolute;
  left:26px;right:26px;bottom:-1px;height:1px;
  background:linear-gradient(90deg,#29baff,rgba(155,77,255,.75),transparent);
  box-shadow:0 0 14px rgba(41,186,255,.6);
}
.modal-heading small{font-size:9px;letter-spacing:.22em;color:#55caff}
.modal-heading h2{font-size:23px;letter-spacing:.025em;text-transform:none;margin-top:5px}
.modal-close{
  flex:0 0 40px;
  width:40px;height:40px;
  border-radius:10px;
  border:1px solid #31566f;
  background:#071722;
  color:#a9c0ce;
  transition:.18s ease;
}
.modal-close:hover{
  transform:rotate(4deg);
  color:#fff;
  border-color:#43c8ff;
  background:#0a2638;
  box-shadow:0 0 18px rgba(67,200,255,.2);
}
.modal-grid{
  flex:1 1 auto;
  overflow:auto;
  grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:20px;
  row-gap:17px;
  padding:25px 27px 27px;
  scrollbar-width:thin;
  scrollbar-color:#245d7d #05131e;
}
.modal-grid label{
  min-width:0;
  gap:8px;
  color:#b8ccd8;
  font-size:11px;
  letter-spacing:.015em;
}
.modal-grid label>em{margin-left:3px}
.modal-grid input,.modal-grid select,.modal-grid textarea{
  min-height:43px;
  border:1px solid #294d63;
  border-radius:8px;
  padding:11px 12px;
  background:linear-gradient(180deg,#04111b,#030b12);
  box-shadow:inset 0 1px 10px rgba(0,0,0,.34);
  transition:border-color .16s,box-shadow .16s,background .16s;
}
.modal-grid textarea{min-height:112px;line-height:1.5}
.modal-grid input:hover,.modal-grid select:hover,.modal-grid textarea:hover{border-color:#35677f}
.modal-grid input:focus,.modal-grid select:focus,.modal-grid textarea:focus{
  outline:none;
  border-color:#28b9ff;
  background:#061724;
  box-shadow:0 0 0 3px rgba(40,185,255,.1),0 0 18px rgba(40,185,255,.08);
}
.field-help{margin-top:-2px;font-size:10px}
.modal-actions{
  position:relative;
  bottom:auto;
  flex:0 0 auto;
  gap:14px;
  padding:18px 27px 20px;
  border-top:1px solid rgba(76,145,187,.28);
  background:linear-gradient(180deg,rgba(5,18,29,.97),rgba(3,12,20,.99));
}
.modal-actions .button{
  min-width:142px;
  padding:11px 18px;
  border-radius:7px;
}
.modal-actions .secondary{
  color:#c3d2dc;
  background:#101f2a;
  border-color:#405a6b;
}
.modal-actions .secondary:hover{border-color:#708796;color:#fff}
@media(max-width:720px){
  .record-modal{width:calc(100vw - 18px);border-radius:12px}
  .record-modal-form{max-height:92vh}
  .modal-grid{grid-template-columns:1fr;padding:19px 18px 22px;gap:14px}
  .modal-heading{padding:19px 18px 16px}
  .modal-heading::after{left:18px;right:18px}
  .modal-actions{padding:15px 18px 18px;gap:10px}
  .modal-actions .button{width:100%;min-width:0}
}

/* Profesjonalny ekran profilu i poprawny podgląd awatara. */
.avatar-settings-page{max-width:850px;margin:0 auto;padding:24px 0 48px}
.avatar-settings-card{border-radius:13px;padding:28px}
.avatar-settings-content{border-radius:10px;padding:20px}
.avatar-preview-large{border-radius:24px}
.avatar-preview-large img{display:block;width:100%;height:100%;object-fit:cover}
.avatar-file-field{
  padding:18px;
  border:1px dashed #32627d;
  border-radius:10px;
  background:#05131e;
}
.avatar-file-field input{padding:10px;background:#030b12}
.avatar-form-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  margin-top:16px;
}
.avatar-form-actions .button{min-width:150px;text-align:center}
.avatar-remove-form{
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid #18384d;
  text-align:right;
}
.avatar-remove-form .danger{padding:9px 13px}
@media(max-width:620px){
  .avatar-form-actions{flex-direction:column-reverse;align-items:stretch}
  .avatar-form-actions .button{width:100%}
}


/* Fix floating contact buttons spacing */
.floating-phone,.fab-phone,#floating-phone{
  bottom: 116px !important;
  right: 24px !important;
  z-index: 1200;
}
.floating-chat,.fab-chat,#floating-chat{
  bottom: 32px !important;
  right: 24px !important;
  z-index: 1201;
}
@media (max-width:768px){
  .floating-phone,.fab-phone,#floating-phone{bottom:108px !important;}
  .floating-chat,.fab-chat,#floating-chat{bottom:24px !important;}
}


/* ===== GeekHouse Panel 5.2.0 final overrides ===== */
.sidebar{width:272px}.app-shell{grid-template-columns:272px minmax(0,1fr)}
.side-nav{padding:10px 9px 14px}.nav-label{margin:12px 11px 4px}.nav-item{min-height:34px;padding:6px 10px;margin:1px 0;gap:10px}
.nav-icon{width:20px;height:20px;display:grid;place-items:center}.nav-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.modal-body .modal-grid{padding:0;overflow:visible}.modal-body{padding:22px 24px;overflow:auto}.record-modal-form{max-height:90vh}.modal-actions{display:flex;justify-content:flex-end}
.top-search-wrap{position:relative;margin-left:auto;width:min(440px,38vw)}.top-search-wrap .top-search{width:100%;margin:0}
.metric-grid .metric{display:flex}.attention-grid{display:grid}
@media(max-width:900px){.app-shell{grid-template-columns:1fr}.workspace{grid-column:1}}
