* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "segoe ui", roboto, oxygen, ubuntu, cantarell, "fira sans", "droid sans", "helvetica neue", Arial, sans-serif;
    font-size: 16px;
}

body {
    height: 100vh !important;
    display: flex;
    flex-direction: column;
}

/* MODALS OVERRIDE */
@media (min-width: 576px) {
    .modal-dialog-lg{
        max-width: 90% !important;
     }
}
@media (min-width: 768px) {
    .modal-dialog-lg{
        max-width: 60% !important;
     }
}
@media (min-width: 1200px) {
    .modal-dialog-lg{
        max-width: 50% !important;
     }
}


/* FILTER/SEARCH FORM */
@media (min-width: 576px) {
    #search-container {
        width: 100%;
    }
}
@media (min-width: 768px) {
    #search-container {
        width: 75%;
    }
}
@media (min-width: 1200px) {
    #search-container {
        width: 50%;
    }
}

/* ANIMATED BUTTONS W/ ICONS */
.btn-anim-icon span {
    font-weight: bold;
}
.btn-anim-icon i {
    opacity: 0;
    padding-right: 2px;
    transition: all 0.3s ease-in-out;
}
.btn-anim-icon:hover i {
    opacity: 1;
    padding-right: 10px;
    transition: all 0.3s ease-in-out;
}

/* DEVICES - EXPAND GRID*/
#expandGrid.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
#expandGrid .detail-grid-item {
    border: solid 1px black;
    padding: 5px;
}
#expandGrid .detail-grid-label {
    background-color: #17A2B8;
    font-weight: bold;
    color: white;
}
#expandGrid .detail-grid-value {
    background-color: #f8f9fa;
    font-style: italic;
}
#expandGrid .detail-grid-title {
    background-color: #095bb9;
    font-weight: bold;
    color: white;
}
#expandGrid .detail-grid-spacer {
    padding: .5rem;
    background-color: #5b6574;
}
#expandGrid .detail-grid-subgrid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
#expandGrid .detail-grid-col1 { grid-column: auto / span 1; }
#expandGrid .detail-grid-col2 { grid-column: auto / span 2; }
#expandGrid .detail-grid-col3 { grid-column: auto / span 3; }
#expandGrid .detail-grid-col4 { grid-column: auto / span 4; }

/* DEVICES - EDIT FORM + BULK EDIT FORM */
#editForm .card-body .container-fluid > .row > .col, #bulkEditForm .card-body .container-fluid > .row > .col {
    border-left: solid 1px black;
    border-right: solid 1px black;
    border-top: solid 2px black;
}
#editForm #overridePanel > .row > .col, #bulkEditForm #bulkOverridePanel > .row > .col {
    border-left: solid 1px black;
    border-right: solid 1px black;
    border-bottom: solid 1px black;
}
#editForm #editTecContainer > .col, #bulkEditForm #bulkEditTecContainer > .col {
    border-bottom: solid 1px black;
}
#editForm .field-title, #bulkEditForm .field-title  {
    background-color: #095bb9;
    font-weight: bold;
    color: white;
    text-align: center;
}
#editForm .field-label, #editForm .field-label2, #bulkEditForm .field-label, #bulkEditForm .field-label2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #17A2B8;
    font-weight: bold;
    color: white;
}
#editForm .field-value, #editForm .field-value2, #bulkEditForm .field-value, #bulkEditForm .field-value2 {
    background-color: #f8f9fa;
    font-style: italic;
    justify-content: center;
    padding: 5px;
}
#editForm .field-label2, #bulkEditForm .field-label2 {
    background-color: #6c757d;
    font-weight: bold;
    color: white;
}
#editForm .field-value2, #bulkEditForm .field-value2 {
    background-color: #e2e4e6;
    font-style: italic;
}

/* DEVICES - LOG */
#logModal .modal-body {
    overflow-x: hidden;
}
#logModal #logContainer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
}
#logModal .btn-delete-entry, #logModal .btn-recover-entry {
    color: white;
    background-color: #1b2399;
    border-color: #1b2399;
}
#logModal .btn-delete-entry:hover, #logModal .btn-recover-entry:hover {
    background-color: #040950;
    border-color: #040950;
}
#logModal .log-entry {
    /*background: linear-gradient(to bottom, #0070cc, #50E7FF);*/
    background-color: #50E7FF;
    border-radius: 8px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
    padding: 5px;
    display: flex;
    flex-direction: column;
}
#logModal .log-entry.log-removed {
    background: linear-gradient(to bottom, #e83e2d, #ffcb5b) !important;
}
#logModal .log-entry.log-new {
    /*background: linear-gradient(to bottom, #007531, #66f59c) !important;*/
    background-color: #66f59c;
}
#logModal .log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: #000000;
    font-size: 0.9em;
}
#logModal .log-body {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 15px;
}
#logModal .log-title {
    font-size: 1em;
    margin: 0;
    color: white;
}
#logModal .log-subtitle {
    font-size: 1em;
    margin: 5px 0;
    color: #202020;
}
#logModal .log-notes {
    font-size: 1em;
    margin: 5px 0;
    color: rgb(65, 65, 65);
}
#logModal .log-title, #logModal .log-date, #logModal .log-author {
    font-weight: bold;
}
#logModal .modal-footer {
    overflow-x: hidden;
}

/* DEVICES - STATUS */
.progress-bar-title {
    margin-top: 10px;
}
/* Progress Circle Wrapper */
.progress-circle {
    width: 150px;
    height: 150px;
    position: relative;
    left: calc(50% - 75px);
    background: none;
}
.progress-circle:after {
    content: "";
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 12px solid #fff;
    position: absolute;
    top: 0;
    left: 0;
}
.progress-circle > span {
    width: 50%;
    height: 100%;
    overflow: hidden;
    position: absolute;
    top: 0;
    z-index: 1;
}
/* Bar style */
.progress-circle .progress-bar {
    width: 100%;
    height: 100%;
    background: none;
    border-width: 12px;
    border-style: solid;
    position: absolute;
    top: 0;
}
/* Right circle */
.progress-circle .progress-right {
    right: 0;
    clip-path: polygon(-100% 0%, 100% 0%, 100% 100%); /* Triangle cut at -45° */
    overflow: hidden;
}
.progress-circle .progress-right .progress-bar {
    left: -100%;
    border-top-left-radius: 80px;
    border-bottom-left-radius: 80px;
    border-right: 0;
    transform-origin: center right;
    transform: rotate(0deg);
}
/* Left circle */
.progress-circle .progress-left {
    left: 0;
    clip-path: polygon(200% 0%, 0% 0%, 0% 100%); /* Triangle cut at -135° */
    overflow: hidden;
}
.progress-circle .progress-left .progress-bar {
    left: 100%;
    border-top-right-radius: 80px;
    border-bottom-right-radius: 80px;
    border-left: 0;
    transform-origin: center left;
    transform: rotate(45deg);
}
/* Fixed bar / mask */
.progress-circle .progress-fixed {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    clip-path: polygon(50% 50%, 0% 100%, 100% 100%);
}
.progress-circle .progress-fixed .progress-bar {
    width: 100%;
    height: 100%;
    left: 0;
    border-bottom-left-radius: 80px;
    border-bottom-right-radius: 80px;
    border-top: 0;
    transform-origin: bottom center;
    top: 0;
    transform: rotate(0deg); /* Fissa */
    border-color: #b0b0b0 !important;
}
/* Center Value */
.progress-value {
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: #e9ecef;
    font-size: 24px;
    color: #000;
    line-height: 135px;
    text-align: center;
    position: absolute;
    top: 5%;
    left: 5%;
}
/* Color Variants */
.progress-circle .progress-bar.circle-info {
    border-color: #17a2b8 !important;
}
.progress-circle .progress-bar.circle-warning {
    border-color: #ffc107 !important;
}
.progress-circle .progress-bar.circle-danger {
    border-color: #dc3545 !important;
}

/* SETTINGS - USER SETTINGS */
#userSettings .card-body .container-fluid > .row {
    border: solid 1px black;
}
#userSettings .field-title {
    background-color: #095bb9;
    font-weight: bold;
    color: white;
    text-align: center;
}
#userSettings .field-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #17A2B8;
    font-weight: bold;
    color: white;
}
#userSettings .field-value {
    background-color: #f8f9fa;
    font-style: italic;
    justify-content: center;
    padding: 5px;
}

/* SETTINGS - FILTER SETTINGS */
#filterButtons {
    flex-direction: column;
    gap: 1em;
}
#filterButtons  .btn-lg {
    width: 100% !important;
    display: block !important;
}
@media (min-width: 768px) {
    #filterButtons {
        flex-direction: row;
    }
}
#filterButtons .dt-buttons {
    width: 100% !important;
    flex-grow: 1;
    margin: 0;
}
#filterButtons .dt-buttons span {
    font-size: 1.25rem;
    line-height: 1.5;
}


/* LOGIN */
.login {
    width: 400px;
    background-color: #ffffff;
    box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.3);
    margin: 100px auto;
}
.login h1 {
    text-align: center;
    color: #5b6574;
    font-size: 24px;
    padding: 20px 0 20px 0;
    border-bottom: 1px solid #dee0e4;
}
.login form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 20px;
}
.login form label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: #3274d6;
    color: #ffffff;
}
.login form input[type="password"], .login form input[type="text"] {
    width: 310px;
    height: 50px;
    border: 1px solid #dee0e4;
    margin-bottom: 20px;
    padding: 0 15px;
}
.login form input[type="submit"] {
    width: 100%;
    padding: 15px;
   margin-top: 20px;
    background-color: #3274d6;
    border: 0;
    cursor: pointer;
    font-weight: bold;
    color: #ffffff;
    transition: background-color 0.2s;
}
.login form input[type="submit"]:hover {
  background-color: #2868c7;
    transition: background-color 0.2s;
}