/* Da collocare in css/scadenze-responsive.css accanto agli stili esistenti. */
body { background: #f4f7fb; color: #17263c; }
/* La barra resta fissa senza sovrapporsi al titolo della pagina. */
body { margin-top: 0; padding-top: 64px; }
.app-navbar { position: fixed; inset: 0 0 auto; z-index: 1030; height: 64px; min-height: 64px; margin: 0; border: 0; background: #17263c; box-shadow: 0 3px 14px rgba(15, 30, 55, .14); }
.app-navbar .app-navbar-inner { display: flex; align-items: center; gap: 20px; height: 64px; padding: 0 22px; }
.app-navbar .app-brand { float: none; display: inline-flex; align-items: center; height: auto; padding: 0; margin: 0; border-radius: 8px; overflow: hidden; background: #fff; }
.app-navbar .app-brand img { display: block; width: 151px; height: auto; }
.app-navbar .app-brand:hover, .app-navbar .app-brand:focus { color: #fff; }
.app-notice { max-width: min(48vw, 540px); margin-left: auto; padding: 7px 12px; border-radius: 8px; background: #264b72; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-user-menu { margin-left: auto; }
.app-user-details { position: relative; }
.app-user-toggle { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 4px 10px; border-radius: 9px; color: #eaf2ff; cursor: pointer; list-style: none; white-space: nowrap; }
.app-user-toggle::-webkit-details-marker { display: none; }
.app-user-toggle:hover, .app-user-toggle:focus, .app-user-details[open] > .app-user-toggle { background: #29415f; color: #fff; }
.app-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #2d75c8; color: #fff; font-size: 11px; }
.app-chevron { margin-left: 4px; }
.app-menu-panel { position: absolute; top: calc(100% + 7px); right: 0; width: 265px; max-width: calc(100vw - 18px); padding: 7px; border: 1px solid #e0e8f1; border-radius: 10px; background: #fff; box-shadow: 0 14px 35px rgba(15, 30, 55, .18); }
.app-menu-panel a { display: block; padding: 10px 12px; border-radius: 6px; color: #24374f; text-decoration: none; white-space: normal; }
.app-menu-panel a:hover, .app-menu-panel a:focus { background: #edf4fd; color: #145bbb; text-decoration: none; }
.app-menu-panel .app-logout { border-top: 1px solid #e4ebf4; margin-top: 5px; }
#page-wrapper { padding-top: 18px; }
.page-header { margin-top: 12px; font-weight: 700; letter-spacing: -.03em; border: 0; }
.breadcrumb { background: transparent; padding-left: 0; }
.btnInserisci { display: inline-flex; gap: 8px; align-items: center; margin: 8px 15px 22px; padding: 11px 17px; border-radius: 10px; background: #125cc4; color: #fff; font-weight: 700; }
.btnInserisci:hover, .btnInserisci:focus { color: #fff; background: #0e4799; text-decoration: none; }
.panel { border: 1px solid #e2e9f2; border-radius: 14px; box-shadow: 0 5px 20px rgba(23,38,60,.05); overflow: hidden; }
.panel-heading { min-height: 52px; padding: 15px 18px; border-bottom: 1px solid #e7edf4; }
.panel-heading .panel-title { font-size: 17px; font-weight: 700; }
.panel-heading .btn-filter { min-height: 30px; }
.panel-body { padding: 12px; }
.table-responsive { border: 0; }
.filterable .table { margin: 0; }
.filterable .table th { border-bottom: 1px solid #dbe5f0; background: #f6f9fc; white-space: nowrap; }
.filterable .table td { vertical-align: middle; overflow-wrap: anywhere; }
.filterable .table tbody tr:not(.no-result):hover { background-color: #edf5ff; }
.filterable .table tbody tr[style*="red"] { background: #fff0ee !important; }
.filterable .table tbody tr[style*="red"] td:first-child { border-left: 4px solid #d54b42; }
.filterable .table td a { display: inline-flex; justify-content: center; align-items: center; min-width: 32px; min-height: 34px; border-radius: 7px; text-decoration: none; }
.filterable .table td a:hover, .filterable .table td a:focus { background: #e2edff; }
.filterable .table td a[class^="mod"] { color: #1358b5; }
.filterable .table td a[class^="dis"] { color: #b42336; }
.filterable .table input, .filterable .table select { max-width: 100%; min-width: 105px; min-height: 36px; border: 1px solid #cad6e4; border-radius: 7px; padding: 5px 8px; }
.filterable .table .filters input { min-width: 92px; }
.filterable .table button { min-height: 36px; border: 1px solid #cbd8e7; background: #fff; border-radius: 8px; padding: 5px 10px; }
.filterable .table .salvamod, .filterable .table .salvanew { background: #125cc4; color: white; border-color: #125cc4; }

@media (max-width: 767px) {
  .app-navbar .app-navbar-inner { gap: 10px; padding: 0 12px; }
  .app-navbar .app-brand img { width: 120px; }
  .app-notice { display: none; }
  .app-greeting { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .app-user-toggle { gap: 6px; padding: 3px 6px; }
  .app-menu-panel { max-width: calc(100vw - 18px); }
  #page-wrapper { padding: 18px 14px 12px; }
  .page-header { font-size: 24px; }
  .page-header small { display: block; margin-top: 6px; font-size: 13px; }
  .panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .panel-heading .pull-right { float: none !important; }
  .panel-body { padding: 10px; }
  .filterable .table-responsive { overflow: visible; }
  .filterable .table, .filterable .table tbody, .filterable .table tr, .filterable .table td { display: block; width: 100%; }
  .filterable .table thead { display: none; }
  .filterable .table tbody tr { margin: 0 0 12px; padding: 11px 13px; background: white; border: 1px solid #dce5ef; border-radius: 11px; box-shadow: 0 3px 9px rgba(23,38,60,.04); }
  .filterable .table tbody tr td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border: 0; text-align: right; }
  .filterable .table tbody tr td::before { flex: 0 0 100px; content: ""; color: #64748b; font-size: 12px; font-weight: 600; text-align: left; }
  .filterable .table tbody tr td:nth-child(1) { font-weight: 700; color: #17263c; font-size: 16px; text-align: left; }
  .filterable .table tbody tr td:nth-child(1)::before { display: none; }
  .filterable .table tbody tr td:nth-child(2)::before { content: "Tipo"; }
  .filterable .table tbody tr td:nth-child(3)::before { content: "Descrizione"; }
  .filterable .table tbody tr td:nth-child(4)::before { content: "Scadenza"; }
  .filterable .table tbody tr td:nth-child(5)::before { content: "Prezzo"; }
  .filterable .table tbody tr td:nth-child(6)::before { content: "Email"; }
  .filterable .table tbody tr td:nth-child(7)::before { content: "Email CCN"; }
  .filterable .table tbody tr td:nth-child(8)::before { content: "Durata (mesi)"; }
  .filterable .table tbody tr td:nth-child(n+9) { display: inline-flex; width: auto; margin: 5px 5px 0 0; padding: 0; }
  .filterable .table tbody tr td:nth-child(n+9)::before { display: none; }
  .filterable .table tbody tr td a { min-height: 40px; padding: 0 11px; background: #eef4fb; font-weight: 700; font-size: 13px; }
  .filterable .table tbody tr td a .fa { margin-right: 5px; }
  .filterable .table tbody tr td a.modscaduto::after, .filterable .table tbody tr td a.modascadere::after,
  .filterable .table tbody tr td a.modattivi::after, .filterable .table tbody tr td a.modnonattivi::after { content: "Modifica"; }
  .filterable .table tbody tr.no-result td::before { display: none; }
}

/* Maschera unica per inserimento e modifica. */
.scadenza-modal .modal-dialog { width: min(760px, calc(100% - 24px)); margin: 28px auto; }
.scadenza-modal .modal-content { border: 0; border-radius: 15px; box-shadow: 0 18px 65px rgba(15, 35, 65, .22); overflow: hidden; }
.scadenza-modal .modal-header { padding: 20px 24px; border-bottom: 1px solid #e4ebf4; }
.scadenza-modal .modal-title { font-size: 22px; font-weight: 700; }
.scadenza-modal .modal-body { padding: 22px 24px 8px; }
.scadenza-modal .modal-body .row { margin-left: -8px; margin-right: -8px; }
.scadenza-modal .form-group { padding-left: 8px; padding-right: 8px; margin-bottom: 17px; }
.scadenza-modal label { display: block; margin-bottom: 6px; color: #34455a; font-weight: 700; }
.scadenza-modal .form-control { min-height: 42px; border: 1px solid #bfccdb; border-radius: 8px; box-shadow: none; }
.scadenza-modal .form-control:focus { border-color: #125cc4; box-shadow: 0 0 0 3px rgba(18, 92, 196, .14); }
.scadenza-modal .modal-footer { padding: 14px 24px 20px; border-top: 1px solid #e4ebf4; }
.scadenza-modal .modal-footer .btn { min-height: 40px; border-radius: 8px; padding: 8px 16px; }
.scadenza-modal .modal-footer .btn-primary { background: #125cc4; border-color: #125cc4; }
@media (max-width: 767px) {
  .scadenza-modal .modal-dialog { width: calc(100% - 18px); margin: 9px auto; }
  .scadenza-modal .modal-header { padding: 16px; }
  .scadenza-modal .modal-body { padding: 17px 16px 0; max-height: calc(100vh - 155px); overflow-y: auto; }
  .scadenza-modal .modal-footer { padding: 12px 16px; }
  .scadenza-modal .modal-footer .btn { width: calc(50% - 5px); }
}
