/* B&B Casermaggio — calendario leggibile v4 */

table.m1.t1color {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 14px !important;
}

table.m1.t1color tr.beb-gruppo-a td {
  background-color: #ffffff !important;
}

table.m1.t1color tr.beb-gruppo-b td {
  background-color: #eef2f7 !important;
}

table.m1.t1color tr.beb-gruppo-a td.t1left,
table.m1.t1color tr.beb-gruppo-b td.t1left {
  background-color: inherit !important;
  background-clip: padding-box;
}

table.m1.t1color tr.beb-nuova-stanza td {
  border-top: 2px solid #94a3b8 !important;
}

/* Scroll orizzontale calendario */
.tab_cont {
  overflow-x: auto !important;
  overflow-y: visible !important;
  max-width: 100% !important;
  padding-bottom: 14px !important;
  -webkit-overflow-scrolling: touch;
}

table.m1ext {
  min-width: max-content !important;
}

/* Intestazione date */
table.m1.t1color tr.rd_r td,
table.m1.t1color tr.rd_r td.m1top,
table.m1.t1color td.m1top {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  background-color: #f1f5f9 !important;
  padding: 8px 4px !important;
  line-height: 1.3 !important;
  min-width: 44px !important;
}

table.m1.t1color tr.rd_r td:first-child,
table.m1.t1color tr.rd_r td:last-child {
  font-size: 13px !important;
  padding: 6px 4px !important;
}

table.m1.t1color tr.rd_r button img {
  width: 18px !important;
  height: 18px !important;
}

/* Righe stanze — più alte */
table.m1.t1color tr[class*="beb-gruppo"] td {
  font-size: 14px !important;
  padding: 3px 2px !important;
  line-height: 1.35 !important;
  border-color: #cbd5e1 !important;
  min-height: 88px !important;
  height: 88px !important;
}

table.m1.t1color tr[class*="beb-gruppo"] td:not(.t1left):not(.pren) {
  min-width: 48px !important;
  width: 48px !important;
}

table.m1.t1color tr[class*="beb-gruppo"]:hover td.t1left {
  background-color: #e2e8f0 !important;
}

/* Colonna stanze — sticky + più compatta */
table.m1.t1color td.t1left.beb-nome-posto {
  position: sticky !important;
  left: 0 !important;
  z-index: 4 !important;
  text-align: left !important;
  vertical-align: middle !important;
  min-width: 280px !important;
  max-width: 300px !important;
  padding: 0 !important;
  box-shadow: 4px 0 10px -2px rgba(0, 0, 0, 0.14);
  border-right: 2px solid #cbd5e1 !important;
}

table.m1.t1color tr.beb-pal-A td.t1left.beb-nome-posto { border-left: 6px solid #2563eb !important; }
table.m1.t1color tr.beb-pal-B td.t1left.beb-nome-posto { border-left: 6px solid #059669 !important; }
table.m1.t1color tr.beb-pal-C td.t1left.beb-nome-posto { border-left: 6px solid #d97706 !important; }

.beb-cell {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 88px;
}

.beb-posto-badge {
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: #475569;
}

.beb-cell-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 8px 8px 6px;
  gap: 2px;
}

.beb-sede {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.beb-riga2 {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.3;
}

.beb-pal { font-weight: 700; color: #1e40af; }
tr.beb-pal-B .beb-pal { color: #047857; }
tr.beb-pal-C .beb-pal { color: #b45309; }

.beb-num {
  font-weight: 800;
  font-size: 17px;
  color: #0f172a;
}

.beb-posto-txt {
  font-weight: 600;
  color: #475569;
  font-size: 13px;
}

table.m1.t1color td.pren,
table.m1.t1color td.pren table td {
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.tab_cont table,
.tab_cont form,
.tab_cont input,
.tab_cont select,
.tab_cont button {
  font-size: 14px !important;
}

.beb-situazione {
  font-size: 15px !important;
  font-weight: 600;
  color: #334155;
  margin: 8px 0 10px;
  text-align: center;
}

table.m1.t1color td.t1left small,
table.m1.t1color td.t1left small small {
  font-size: inherit !important;
}

/* Nascondi menu commerciali */
#nb_iexp, #nb_ipri, #nb_irul, #nb_pos,
#nb_rat, #nb_exc, #nb_tax, #nb_cas, #nb_rul, #nb_doc, #nb_sta, #nb_rpa, #nb_cdoc,
#nb_inv, #nb_roo,
.nb_rat, .nb_ins li:has(#nb_iexp), .nb_ins li:has(#nb_irul),
form[action*="creaprezzi.php"], form[action*="costi.php"], form[action*="crearegole.php"],
button.ipri, button.inex, button.irul, button.vpos,
select[name="tipo_tabella"] option[value="inventario"],
select[name="tipo_tabella"] option[value="appartamenti"],
#mm_act form[action*="costi.php"] {
  display: none !important;
}

table.ckin tr td:nth-child(4),
table.ckin tr td:nth-child(5) {
  display: none !important;
}

.beb-nascondi-prezzi,
.beb-nascondi-prezzi * {
  display: none !important;
}

/* Memo — quadrati più grandi */
table.m1.t1color td.beb-memo-cella {
  padding: 0 !important;
  vertical-align: top !important;
  min-width: 48px !important;
  width: 48px !important;
  height: 88px !important;
  cursor: pointer;
}

table.m1.t1color td.beb-memo-cella .beb-memo-inner {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 88px;
  padding: 7px 5px;
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: #475569;
  background: #fafafa;
  word-break: break-word;
  white-space: pre-wrap;
  overflow: hidden;
  cursor: pointer;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
}

table.m1.t1color td.beb-memo-cella:hover .beb-memo-inner {
  background: #f1f5f9;
  border-color: #64748b;
}

table.m1.t1color td.beb-memo-cella.beb-memo-ha-testo .beb-memo-inner {
  color: #1e293b;
  font-weight: 500;
  background: #fef9c3;
  border: 1px solid #fde047;
}

table.m1.t1color td.beb-memo-cella.beb-memo-active .beb-memo-inner {
  background: #fffbeb !important;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

table.m1.t1color td.beb-memo-cella .beb-memo-inner:empty::before {
  content: '+ memo';
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

table.m1.t1color td.beb-memo-cella.beb-memo-ha-testo .beb-memo-inner:empty::before {
  content: '';
}

/* Editor popup memo */
#beb-memo-editor {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.4);
}

.beb-memo-editor-box {
  position: fixed;
  width: min(460px, calc(100vw - 20px));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  border: 2px solid #f59e0b;
  overflow: hidden;
}

.beb-memo-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  line-height: 1.35;
}

.beb-memo-editor-chiudi {
  border: none;
  background: #fef3c7;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #78716c;
  padding: 2px 8px;
}

.beb-memo-editor-area {
  display: block;
  width: 100%;
  min-height: 160px;
  max-height: 280px;
  padding: 14px 16px;
  border: none;
  resize: vertical;
  font-family: inherit;
  font-size: 16px !important;
  line-height: 1.5 !important;
  color: #1e293b;
  box-sizing: border-box;
}

.beb-memo-editor-area:focus {
  outline: none;
  background: #fffef5;
}

.beb-memo-editor-foot {
  padding: 10px 14px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* B&B no-profit — prenotazione e modifica senza prezzi */
body.beb-no-profit #ir_dat,
body.beb-no-profit .beb-nascondi-prezzi,
body.beb-no-profit .beb-nascondi-prezzi * {
  display: none !important;
}

body.beb-no-profit form[name="modifica_prenota"] table#tab_pren,
body.beb-no-profit form[name="inserisci_prenota"] .linhbox:has(input[name*="caparra"]),
body.beb-no-profit form[name="inserisci_prenota"] .linhbox:has(select[name*="commissioni"]) {
  /* caparra/commissioni già nascosti via privilegi */
}
