/* Var */
:root {
    --bs-dark-rgb: 33, 33, 33;
}

/* General */
html, body {
    height: 100%;
    margin: 0;
    background: #fafafa;
    overflow: hidden;
}
footer {
    text-align: center;
    background-color: #f8f9fa;
    padding: 10px 0;
    border-top: 1px solid #e9ecef;
}
footer p {
    margin-bottom: 0;
}
#content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    display: flex;
    flex: 1;
    padding: 0.5rem 0;
    max-height: calc(100vh - 54px - 41px);
    overflow: auto;
}
main .container {
    max-width: 800px;
}
main .container-fluid {
    flex: 1;
    overflow: auto;
}
main aside.sidebar {
    display: none;
}
main aside.sidebar.show {
    display: block;
    overflow: auto;
}
@media print {
    main {
        overflow: visible;
    }
}

@media (min-width: 768px) {
    main aside.sidebar.show {
        border-left: 1px solid #212121;
        width: 40vw;
        max-height: calc(100vh - 54px - 41px);
    }
}
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    main aside.sidebar.show {
        width: 100vw;
        height: 100vh;
        border-top: 1px solid #212121;
    }
}

[data-url] {
    cursor: pointer;
}
[data-url] td {
    transition: background-color 0.3s ease;
}
[data-url]:hover td {
    background-color: #e9ecef;
}
.actions {
    text-align: right !important;
}

/* Tickets */
.tickets {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.tickets .col-lg-3 {
    min-width: 250px;
}
.tickets.board > div.empty  {
    min-width: 4rem;
    width: 4rem;
}
.tickets.board > div {
    max-width: 95%;
    min-width: 320px;
    width: 16%;
}
.tickets.board > div.vr {
    min-width: auto;
    width: var(--bs-border-width);
    padding-right: 0;
    padding-left: 0;
    margin-right: calc(var(--bs-gutter-x) * .5);
    margin-left: calc(var(--bs-gutter-x) * .5);
}
.tickets.board .card {
    border: 1px solid #ddd;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}
.tickets.board .card-header {
    font-weight: bold;
    text-align: center;
}
.tickets.board .card-body {
    overflow-y: auto;
    max-height: calc(100vh - 56px - 41px - 155px);
}
.tickets.board > div.empty .card-footer {
    display: none;
}
.tickets.board .list-group-item div {
    max-height: 150px;
    overflow: hidden;
}
@media (min-width: 1200px) {
    .h1, h1 {
        font-size: 1.65rem;
    }
    .h1, h2 {
        font-size: 1.5rem;
    }
    .h1, h3 {
        font-size: 1.35rem;
    }
    .h1, h4 {
        font-size: 1.2rem;
    }
    .h1, h5 {
        font-size: 1.05rem;
    }
    p {
        font-size: 0.9rem;
    }
}

.empty .card {
    display: flex;
    flex-direction: row;
    min-height: 100%;
}

.empty .card-header {
    writing-mode: vertical-rl;
    width: 2.5rem;
    padding: .5rem;
    border-bottom: none;
}

.empty .card-header > * {
    transform: rotate(180deg);
}

.empty .card-body {
    flex: 1;
    padding: .5rem;
}

.empty .card-footer {
    width: 2.5rem;
}

.empty .card {
    width: 2.5rem;
}

.empty .card .card-body {
    display: none;
}

.assigned-to-me,
.not-assigned,
.assigned-not-to-me {
    border-left-width: 5px !important;
    border-left-style: solid;
}
.assigned-to-me {
    border-left-color: green;
}
.not-assigned {
    border-left-color: yellow;
}
.assigned-not-to-me {
    border-left-color: red;
}

/* Form */
form .form-label {
    font-weight: bold;
}

textarea {
    resize: none;
}

a.btn-secondary {
    display: block;
    width: fit-content;
}

/* Commenti */
.commentsList li.mine {
    border-left: 4px solid #007bff !important;
}

.commentsList li.internal {
    background-color: #FFF59D !important;
}

/* Full card */
.full:has(.card):before {
    content: '';
    position: fixed;
    background: #00000080;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.full .card {
    position: absolute;
    width: calc(100% - 4rem);
    height: calc(100% - 4rem);
    top: 2rem;
    left: 2rem;
}

.full .card-body {
    max-height: calc(100% - 3rem);
}

@keyframes flashing {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.flashing-icon {
    animation: flashing 1s infinite;
}

/* Calendar */
.table-calendar td {
    height: 150px;
}
.table-calendar th {
    background-color: #d6d8db;
}
.table-calendar tr:nth-child(even) td,
.table-calendar tr:nth-child(odd) td {
    background-color: #f8f9fa;
}
.table-calendar tr:nth-child(even) td:nth-child(odd),
.table-calendar tr:nth-child(odd) td:nth-child(even) {
    background-color: #e9ecef;
}
.table-calendar .today {
    background-color: rgba(var(--bs-info-rgb),var(--bs-bg-opacity, 1)) !important;
}

/* Table */
@media (max-width: 768px) {
    .table-card-responsive thead {
        display: none;
    }

    .table-card-responsive, 
    .table-card-responsive tbody, 
    .table-card-responsive tr, 
    .table-card-responsive td {
        display: block;
        width: 100%;
    }

    .table-card-responsive tr {
        margin-bottom: 0.5rem;
        border: var(--bs-card-border-width) solid var(--bs-card-border-color);
        border-radius: var(--bs-card-inner-border-radius);
        overflow: hidden;
    }

    .table-card-responsive td {
        position: relative;
        border: none;
        padding-left: 50%;
        padding-top: 0.4rem;
        padding-right: 0.6rem;
        padding-bottom: 0;
    }

    .table-card-responsive td:last-child {
        padding-bottom: 0.4rem;
    }

    .table-card-responsive td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.6rem;
        font-weight: bold;
        white-space: nowrap;
    }
}
