body,
main.main-auth {
    min-height: 100vh;
    background: #f1f1f1;
    position: relative;
    /* background-image: url('/images/bg-pattern.jpg');
    backdrop-filter: brightness(85%) blur(3px); */
}

#gif-loader {
    opacity: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('/gifs/paw-loader.gif');
    position: fixed;
    z-index: -1;
    background-repeat: no-repeat;
    background-size: 15%;
    background-color: white;
    background-position: center;
    top: 0;
    transition: .3s;
}

#gif-loader.shown {
    opacity: 1;
    z-index: 999;
}

.card-login,
.main-col,
.navbar > .container {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    position: relative;
    padding: 20px;
}

.navbar {
    position: sticky;
    z-index: 99;
    top: 0;
}

.navbar > .container {
    background: rgba(255, 255, 255, 0.75);
    padding: 10px 20px;
}

.main-col {
    background: rgba(255, 255, 255, 0.75);
    padding: 20px;
}

a.nav-link:not(.dropdown-toggle) {
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

a.nav-link:not(.dropdown-toggle)::before,
a.nav-link:not(.dropdown-toggle)::after {
    content: "";
    position: absolute;
    background-color: #609d63;
    width: 100%;
    height: 2px;
    transform: scaleX(0);
    transition: transform 0.4s;
}

a.nav-link:not(.dropdown-toggle)::before {
    top: 0;
    left: 0;
    transform-origin: left;
}

a.nav-link:not(.dropdown-toggle)::after {
    bottom: 0;
    right: 0;
    transform-origin: right;
}

a.nav-link:not(.dropdown-toggle).active::before,
a.nav-link:not(.dropdown-toggle).active::after,
a.nav-link:not(.dropdown-toggle):hover::before,
a.nav-link:not(.dropdown-toggle):hover::after {
    transform: scaleX(1);
}

.btn-pet {
    background: none;
    border: 1px solid lightgray;
    border-radius: 5px;
    padding: 5px 10px;
    color: #2e3047;
    transition: .3s;
}

.btn-pet:not(.active):hover {
    background: lightgray;
}

.btn-pet.active {
    color: white;
    background: #2e3047;
}

.home-chart {
    height: auto !important;
    width: 100% !important;
}

.home-card p {
    font-weight: 500;
    text-decoration: underline dotted 3px lightgray;
    margin-bottom: 7px;
}

/* Card con drill-down: il totale si apre sulle voci che lo compongono. */
.home-card-clickable {
    cursor: pointer;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.home-card-clickable:hover,
.home-card-clickable:focus-visible {
    border-color: #078d4e !important;
    box-shadow: 0 2px 10px rgba(7, 141, 78, .15);
}

.home-card-clickable .drilldown-hint {
    font-size: 11px;
    color: #9aa0a6;
    vertical-align: middle;
}

.home-card-clickable:hover .drilldown-hint,
.home-card-clickable:focus-visible .drilldown-hint {
    color: #078d4e;
}

.home-card-loading {
    opacity: .6;
    pointer-events: none;
}

.home-card span {
    display: inline-block;
    font-weight: 600;
}

.home-card span.percent {
    color: #078d4e;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    font-size: 13px;
}

.home-card span.percent i {
    font-size: 10px;
}

.home-card span.num {
    font-size: 50px;
    color: #078d4e;
    margin-right: 6px;
}

.home-card span.text {
    font-weight: normal;
}

.product-info p {
    text-decoration: underline solid 1px lightgray;
    margin: 0;
}

.product-info span {
    color: #078d4e;
    font-size: 25px;
}

.order-image-container,
.product-image-container,
.breed-image-container {
    width: 25%;
    position: relative;
    cursor: pointer;
}

.breed-image-container.not-editable {
    cursor: default;
}

#order-image,
#product-image,
#breed-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    transition: .3s;
    object-fit: cover;
}

.product-image-container .icons-container,
.breed-image-container .icons-container {
    display: none;
}

.product-image-container:hover .icons-container,
.breed-image-container:hover .icons-container {
    display: flex;
    gap: 1em;
    font-size: 25px;
    color: white;
}

.product-image-container .icons-container,
.breed-image-container .icons-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.product-image-container:hover,
.breed-image-container:not(.not-editable):hover img {
    filter: brightness(.5);
}

.product-image-container,
.product-image-container .icons-container i,
.breed-image-container .icons-container i {
    transition: .15s;
}

.product-format i:hover,
.product-ingredient i:hover,
.product-image-container .icons-container i:hover,
.breed-image-container .icons-container i:hover {
    transform: scale(1.25);
}

.tox-statusbar {
    display: none !important;
}

.product-format,
.product-ingredient,
.product-ingredient div {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-format i,
.product-ingredient i {
    cursor: pointer;
    transition: .3s;
}

.select2 .selection,
.select2-container .select2-results {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: unset !important;
    padding: 1rem .75rem !important;
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    display: block !important; /* Sovrascrive Bootstrap */
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1000;
}

/* Hover dropdown activation */
.dropdown:hover > .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Menu aperti al click da Bootstrap (data-bs-toggle="dropdown", es. il
   pulsante diviso "Nuovo preventivo"): Bootstrap mette .show, ma qui sopra
   il menu è sempre display:block e reso visibile solo dall'hover. */
.dropdown-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Le card .main-col hanno backdrop-filter, che crea un livello a sé: un menu
   aperto dentro resta sotto la card successiva, qualunque z-index abbia.
   Finché il menu è aperto, la sua card sale sopra le altre. */
.main-col:has(.dropdown-menu.show) {
    position: relative;
    z-index: 1050;
}

/* Mantieni aperto quando hover sul dropdown stesso */
.dropdown-menu:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.dropdown-menu .dropdown-item {
    color: #374151;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.dropdown-menu .dropdown-item:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #1e293b;
    transform: translateX(2px);
}

.dropdown-menu .dropdown-menu {
    left: calc(100% + .7rem) !important;
    top: 0 !important;
    margin-top: 0 !important;
}

.made-by-syrus {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translate(-50%);
    font-size: 10px;
    font-weight: 500;
}

.order-image-container::after {
    content: attr(data-dog-name);
    background: #076d41;
    color: white;
    position: absolute;
    left: 50%;
    bottom: -1em;
    transform: translate(-50%);
    font-size: 10px;
    padding: 2px 9px;
    white-space: nowrap;
    font-weight: bold;
}

.order-image-container::before {
    font-family: "FontAwesome";
    font-weight: 900;
    background: white;
    position: absolute;
    aspect-ratio: 1;
    border-radius: 100%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    top: -10px;
    left: -12px;
}

.order-image-container.female::before {
    color: #ffa5b4;
    content: "\f221";
}

.order-image-container.male::before {
    color: cornflowerblue;
    content: "\f222";
}

/* ================================
   Dashboard Sidebar
   ================================ */

.dashboard-sidebar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 10px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 20px;
    min-height: calc(100vh - 2rem);
}

/* Logo */
.sidebar-logo {
    display: flex;
    justify-content: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

/* Nav container */
.dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

/* Nav items */
.dashboard-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.dashboard-nav-item i {
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.dashboard-nav-item:hover {
    background: rgba(96, 157, 99, 0.1);
    color: #078d4e;
    transform: translateX(3px);
}

.dashboard-nav-item.active {
    background: linear-gradient(135deg, rgba(96, 157, 99, 0.15) 0%, rgba(7, 141, 78, 0.1) 100%);
    color: #078d4e;
    font-weight: 600;
}

.dashboard-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: #609d63;
    border-radius: 0 3px 3px 0;
}

/* Logout item */
.dashboard-nav-item.logout {
    color: #dc3545;
}

.dashboard-nav-item.logout:hover {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

/* Divider */
.nav-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.07);
    margin: 0.4rem 0;
}

/* Badge (e.g. unread notifications) */
.dashboard-nav-item .badge {
    margin-left: auto;
    font-size: 0.7rem;
}

/* Collapsible toggle — reset <button> defaults */
.dashboard-nav-toggle {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

/* Arrow icon */
.dashboard-nav-toggle .nav-arrow {
    width: auto;
    font-size: 0.7rem;
    transition: transform 0.25s ease;
    color: #9ca3af;
    flex-shrink: 0;
}

.dashboard-nav-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
}

/* Children container */
.dashboard-nav-children {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(96, 157, 99, 0.2);
    margin-left: 1rem;
    margin-top: 2px;
    margin-bottom: 2px;
}

/* Child items — slightly smaller */
.dashboard-nav-child {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
}

.dashboard-nav-child.active {
  background: none;
}

/* Grandchild items — nested one level deeper */
.dashboard-nav-grandchild {
    font-size: 0.8rem;
}

/* User info block (bottom) */
.dashboard-sidebar .user-info {
    text-align: left;
    width: 100%;
}

.user-details {
    width: calc(100% - 1.75rem - 54px);
}

.dashboard-sidebar .user-avatar {
    display: flex;
    justify-content: left;
}

.dashboard-sidebar .profile-picture {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #609d63, #078d4e);
    color: white;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.dashboard-sidebar .user-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.1rem;
}

.dashboard-sidebar .user-email {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0;
}

.table-hover tr {
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 3.75rem 1rem;
}

.empty-state p {
    color: var(--muted);
    margin: .85rem 0 0;
    font-size: .9rem;
}

#tableDevices {
    --bs-table-hover-bg: #f8fafc;
    margin-bottom: 0;
    color: #334155;
    
}
#tableDevices thead th{
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #edf1f6;
    padding: .75rem 1.25rem;
    white-space: nowrap;
}

.recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .625rem;
}

.badge-soft-emerald {
    background: #ecfdf5;
    color: #059669;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .01em;
    padding: .32rem .62rem;
    border-radius: 999px;
    line-height: 1;
}

.step-list {
    margin: 0 0 1.35rem;
    padding-left: 1.15rem;
    font-size: .84rem;
    color: var(--muted);
}

.step-list li + li { margin-top: .3rem; }

.qr-frame {
    display: flex;
    justify-content: center;
    padding: 1rem;
    margin-bottom: 1.35rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: .625rem;
}

.secret-key {
    padding: .6rem .75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .88rem;
    letter-spacing: .08em;
    color: #334155;
    text-align: center;
    user-select: all;
}

.s-new-cont{
    background-color: #0068ffde;
    color: white;
    width: 28px;
    text-align: center;
    border-radius: 27px;
}

.dot {
    height: 15px;
    width: 15px;
    background-color: #0068ffde;
    border-radius: 50%;
    display: inline-block;
}

/* Switch verde da acceso: Bootstrap di default lo colora di blu.
   Da spento resta grigio, come gli altri form-check-input. */
.switch-input:checked {
    background-color: #349558;
    border-color: #349558;
}

.switch-input:focus {
    border-color: #349558;
    box-shadow: 0 0 0 .25rem rgba(52, 149, 88, .25);
}

.product_count {
    position: relative;
    left: 78%;
    bottom: 70%;
    width: 30px;
    background: #4cae462b;
    display: flex;
    justify-content: center;
    border-radius: 20px;
    color: #1e293b;
    font-weight: bold;
}