/* Variables */
:root {
    --base-font-size: 17px;
    --base-font-family: roboto;

    --body-background-color-light: #BBDDFF;
    --body-background-color-dark: #88AACC;
    --body-foreground-color: #262425;

    --default-padding-horizontal: 25px;
    --default-padding-vertical: 15px;

    --primary-color: #446688;
    --primary-contrast-color: #FFF;
    --primary-highlight-color: #6688AA;
    
    --sub-header-color: #BBDDFF;
    --hover-color-light: #DDDDFF;
    --zebra-color-light: #EEEEFF;
    --selected-foreground-color-light: #BBDDFF;
    --selected-background-color-light: #262425;

    --panel-background-color1: #F0EADF;
    --panel-background-color2: #F0EADF;
    --panel-foreground-color: #37474F;
    --panel-header-foreground-color: #ffffff;
    --panel-header-background-color: #000;
    --panel-header-background-filter: blur(40px);
    --panel-border-radius: 8px;

    --field-background-color: #FFFFFF;
    --field-foreground-color: #37474F;
    --field-border-color: #446688;
    --field-border-radius: 3px;
    --field-padding: 10px 8px;
    --field-select-padding: 8px 4px;
    --field-font-size: 15px;
    --field-invalid-color: #FFCCCC;

    --button-padding: 8px 20px;
    --button-border-radius: 5px;
    --button-min-width: 145px;
    --button-outline-background-color: transparent;
    --button-outline-hover-color: #EEEEFF;

    --dialog-background-color: #FFF;
    --dialog-background-filter: blur(40px);
    --dialog-foreground-color: black;
    --dialog-header-foreground-color: #ffffff;
    --dialog-header-background-color: #446688;
    --dialog-header-background-filter: blur(40px);

    --shade-10: rgba(0,0,0,0.1);
    --shade-20: rgba(0,0,0,0.2);
    --shade-30: rgba(0,0,0,0.3);
    --shade-40: rgba(0,0,0,0.4);
    --shade-50: rgba(0,0,0,0.5);
    --shade-60: rgba(0,0,0,0.6);
    --shade-70: rgba(0,0,0,0.7);
    --shade-80: rgba(0,0,0,0.8);
    --shade-90: rgba(0,0,0,0.9);

    --glass-10: rgba(127,127,200,0.1);
    --glass-20: rgba(127,127,200,0.2);
    --glass-30: rgba(127,127,200,0.3);
    --glass-40: rgba(127,127,200,0.4);
    --glass-50: rgba(127,127,200,0.5);
    --glass-60: rgba(127,127,200,0.6);
    --glass-70: rgba(127,127,200,0.7);
    --glass-80: rgba(127,127,200,0.8);
    --glass-90: rgba(127,127,200,0.9);

    --highlight-10: rgba(255,255,255, 0.1);
    --highlight-20: rgba(255,255,255, 0.2);
    --highlight-30: rgba(255,255,255, 0.3);
    --highlight-40: rgba(255,255,255, 0.4);
    --highlight-50: rgba(255,255,255, 0.5);
    --highlight-60: rgba(255,255,255, 0.6);
    --highlight-70: rgba(255,255,255, 0.7);
    --highlight-80: rgba(255,255,255, 0.8);
    --highlight-90: rgba(255,255,255, 0.9);
}

html {
    min-height: 100%;
    font-size: var(--base-font-size);
    background-color: var(--body-background-color-dark);
    background: linear-gradient(0deg, var(--body-background-color-dark), var(--body-background-color-light));
    color: var(--body-foreground-color);
    font-family: var(--base-font-family);
}

body {
    min-height: 100vh;
    background: transparent;
    margin: 0;
}

    body.size-xs {
        font-size: 14px;
    }

.size-xs .outlet-border {
    padding: 0;
}

#screen-outlet {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.size-xs #screen-outlet {
    padding: 10px;
}


/*
    Scrollbars
*/

::-webkit-scrollbar {
    width: 15px;
    height: 15px;
}

::-webkit-scrollbar-track {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border: 5px solid transparent;  /* creates spacing */
    background-clip: padding-box;   /* keep thumb inside */
    border-radius: 15px;
}

/* 
    Text
*/

.text-verylarge {
    font-size: 32px;
}

    .size-xs .text-verylarge {
        font-size: 26px;
    }

.text-large {
    font-size: 20px;
}

    .size-xs .text-large {
        font-size: 16px;
    }

.text-bold {
    font-weight: 600;
}


/* 
    Colors 
*/

.color-green {
    color: #44AA44;
}

.color-orange {
    color: orange;
}

.color-red {
    color: red;
}

/* 
    Icons 
*/

.indicator .material-symbols-outlined {
    font-size: 128px;
    font-weight: 900;
}


/* 
    Headers
*/

.outlet-panel header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: calc(2 * var(--default-padding-vertical)) calc(2 * var(--default-padding-horizontal));
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

    .size-vertical-short .outlet-panel header {
        padding: calc(var(--default-padding-vertical)) calc(2 * var(--default-padding-horizontal));
    }

    .size-xs .outlet-panel header {
        padding: var(--default-padding-vertical) var(--default-padding-horizontal);
    }

    .outlet-panel header .caption {
        display: inline-flex;
        align-items: center;
        text-transform: uppercase;
        font-size: 24px;
    }

    .outlet-panel header .controls {
        display: flex;
        gap: 10px;
    }

.outlet-panel header.entity {
    position: relative;
    display: block;
    background: linear-gradient(145deg, var(--primary-color), var(--primary-highlight-color));
    color: white;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

    .outlet-panel header.entity.with-controls {
        padding-bottom: 80px;
    }

    .outlet-panel header.entity .controls {
        border-radius: 0 0 15px 15px;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--shade-10);
        padding: 10px 30px;
    }

    .outlet-panel header.entity .controls button {
        background-color: transparent;
        color: white;
        border: none;
        cursor: pointer;
    }

        .outlet-panel header.entity .controls button:hover {
            color: yellow;
        }


/* 
    Panels
*/

.panel {
    background: linear-gradient(145deg, var(--panel-background-color1), var(--panel-background-color2));
    padding: calc(2 * var(--default-padding-vertical)) calc(2 * var(--default-padding-horizontal));
    border-radius: var(--panel-border-radius);
}

    .size-vertical-short .panel {
        padding: calc(var(--default-padding-vertical)) calc(2 * var(--default-padding-horizontal));
    }

    .panel .panel-header {
        font-size: 28px;
        padding-bottom: 15px;
    }

.outlet-panel {
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
}


/* 
    Boxes and Frames
*/

.button-box {
    padding-top: 30px;
    display: flex;
    gap: 15px;
}

    .size-xs .button-box button {
        width: 100%;
        justify-content: center;
    }

section {
    margin-top: 30px;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--primary-color);

    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
}

    section.plain {
        box-shadow: none;
        border: none;
        border-radius: 0;
        overflow: unset;
    }

    section .section-header {
        background-color: var(--primary-color);
        padding: var(--default-padding-vertical) var(--default-padding-horizontal);
        color: white;
        text-transform: uppercase;
        border-radius: 15px 15px 0 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 18px;
        flex: 0 0 auto;
    }

        .size-vertical-short section .section-header {
            padding: 10px var(--default-padding-horizontal);
        }

        .size-xs section .section-header {
            padding: 10px 15px;
            font-size: 16px;
        }

        section .section-header .material-symbols-outlined {
            margin-right: 10px;
        }

        section .section-header .section-header-caption {
            display: flex;
            align-items: center;
        }

        section .section-header .section-header-controls {
            text-align: right;
        }

            section .section-header .section-header-controls button {
                background-color: transparent;
                color: white;
                border: none;
                cursor: pointer;
                padding: 0;
            }

                section .section-header .section-header-controls button:hover {
                    color: yellow;
                }

    section .section-contents {
        background-color: white;
        flex: 1 1 auto;
        min-height: 0;
    }


        section .section-contents .section-content-item {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            padding: var(--default-padding-vertical) var(--default-padding-horizontal);
            border-bottom: 1px solid #DDD;
        }

            section .section-contents .section-content-item.clickable {
                cursor: pointer;
            }

            section .section-contents .section-content-item.clickable:hover {
                background-color: var(--hover-color-light);
            }

            section .section-contents .section-content-item.selected {
                background-color: var(--selected-background-color-light);
                color: var(--selected-foreground-color-light);
            }

            section .section-contents .section-content-item:last-child {
                border-bottom: none;
            }

            section .section-contents .section-content-item .item-icon { 
                margin-right: 10px;
            }

            section .section-contents .section-content-item .item-caption { 
                flex: 1;
                margin-right: 10px;
            }

            section .section-contents .section-content-item .item-controls .item-control { 
                cursor: pointer;
            }

            section .section-contents .section-content-item .item-controls .item-control:hover { 
                color: var(--primary-color);
            }


/* 
    Position and Alignment
*/

.center-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* 
    Padding
*/

.padded {
    padding: var(--default-padding-vertical) var(--default-padding-horizontal);
}

.padded-double {
    padding: 30px;
}

.padded-half {
    padding: 8px;
}

/* 
    Sizing
*/

.min-form-width {
    min-width: 450px;
}

    .size-xs .min-form-width {
        min-width: auto;
    }

.fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}


/* Backgrounds */

.modal-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0, 0.5);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
}


/* 
    Chips
*/

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #DDD;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: #444;
}

    .chip .material-symbols-outlined {
        margin-right: 10px;
        font-size: 24px;
    }

    .chip.neutral {
        color: white;
        background-color: #8888FF;
    }

    .chip.safe {
        background-color: #88FF88;
    }

    .chip.danger {
        background-color: #FFCCCC;
    }

    .chip.large {
        padding: 6px 20px;
        font-size: 16px;
    }

/* 
    Buttons
*/

.btn-primary {
    display: flex;
    align-items: center;
    border-radius: var(--button-border-radius);
    border: 1px solid black;
    background-color: var(--primary-color);
    color: var(--primary-contrast-color);
    padding: var(--button-padding);
    cursor: pointer;
}

    .btn-primary:hover {
        background-color: var(--primary-highlight-color);
    }

    .btn-primary .material-symbols-outlined {
        margin-left: -8px;
        margin-right: 10px;;
    }

    .btn-primary.full-width {
        width: 100%;
        justify-content: center;
    }

.btn-secondary {
    display: flex;
    align-items: center;
    border-radius: var(--button-border-radius);
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    padding: var(--button-padding);
    cursor: pointer;
}

    .btn-secondary:hover {
        background-color: var(--hover-color-light);
    }

    .btn-secondary .material-symbols-outlined {
        margin-left: -8px;
        margin-right: 10px;;
    }

.btn-link {
    display: flex;
    align-items: center;
    background-color: transparent;
    color: var(--primary-color);
    font-weight: 600;
    border: none;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
}

    .size-xs .btn-link {
        font-size: 14px;
    }

    .btn-link:hover {
        color: var(--primary-highlight-color);
    }

    .btn-link:disabled {
        cursor: default;
        color: #DDD;
    }

    .btn-link .material-symbols-outlined {
        margin-left: -8px;
        margin-right: 10px;;
    }


.btn-tile {
    transition: 0.5s;
    background-color: white;
    border: 1px solid #CCC;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    min-height: 120px;
    box-shadow: 2px 2px 5px rgba(0,0,0, 0.15);
    cursor: pointer;
}

    .btn-tile:hover {
        background-color: var(--highlight-color);
        box-shadow: none;
    }

    .btn-tile .material-symbols-outlined {
        font-size: 48px;
        margin-bottom: 15px;
    }

    .btn-tile .caption {
        font-size: 12px;
    }

    .btn-tile.danger {
        color: red;
    }

        .btn-tile.danger:hover {
            background-color: #FFDDDD;
        }
    
    .btn-tile.success {
        color: green;
    }

        .btn-tile.success:hover {
            background-color: #CCFFCC;
        }


    .btn-icon {
        background-color: transparent;
        border: none;
        cursor: pointer;
    }

        .btn-icon .material-symbols-outlined {
            font-size: 38px;
        }

        .btn-icon.light {
            color: white;
        }

        .btn-icon:hover {
            color: white;
        }

        .btn-icon.light:hover {
            color: var(--primary-color);
        }


/*
    Tiles
*/

.tile-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

    .tile-container .tile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-direction: column;
        padding: 30px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        width: 150px;
        text-align: center;
        border-radius: 15px;
        background-color: white;
        box-shadow: 3px 3px 15px rgba(0,0,0, 0.4);
    }

        .tile-container .tile:hover {
            background-color: var(--hover-color-light);
        }

        .tile-container .tile .material-symbols-outlined {
            font-size: 64px;
            color: var(--primary-color);
            margin-bottom: 15px;
        }

        .tile-container .tile .tile-caption {
            min-height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }


/* 
    Forms and Fields
*/

input[type=checkbox] {
    box-shadow: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
}

.field {
    padding: 10px 0;
    min-width: 130px;
    position: relative;
}

    .size-xs .field {
        min-width: 50px;
    }

    .field label {
        display: flex;
        margin-bottom: 3px;
        font-size: var(--field-font-size);
        font-weight: 600;
        align-items: center;
    }

        .field label.caption-label input {
            margin-top: 3px;
        }

        .field label.caption-label span {
            display: flex;
            font-weight: 400;
            align-items: center;
        }

    .field input {
        background-color: var(--field-background-color);
        color: var(--field-foreground-color);
        border: 1px solid var(--field-border-color);
        padding: var(--field-padding);
        font-size: var(--base-font-size);
        border-radius: var(--field-border-radius);
        font-size: var(--field-font-size);
        width: 100%;
    }

        .field input.invalid {
            background-color: var(--field-invalid-color);
        }

        .field input.password {
            padding-right: 30px;
        }

        .field input.color  {
            padding: 2px 4px;
            max-width: 200px;
            height: 50px;
        }

    .field textarea {
        background-color: var(--field-background-color);
        color: var(--field-foreground-color);
        border: 1px solid var(--field-border-color);
        padding: var(--field-padding);
        font-size: var(--base-font-size);
        border-radius: var(--field-border-radius);
        font-size: var(--field-font-size);
        width: 100%;
    }

        .field textarea.invalid {
            background-color: var(--field-invalid-color);
        }

    .field input[type=checkbox] {
        box-shadow: none;
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        margin-left: 0;
        margin-right: 10px;
    }

    .field input[type=radio] {
        box-shadow: none;
        width: 20px;
        height: 20px;
        min-height: 20px;
        min-width: 20px;
        margin: 0;
        margin-right: 5px;
    }

    .field select {
        background-color: var(--field-background-color);
        color: var(--field-foreground-color);
        border: 1px solid var(--field-border-color);
        padding: var(--field-select-padding);
        font-size: var(--base-font-size);
        border-radius: var(--field-border-radius);
        width: 100%;
        box-sizing: border-box;
    }

        .field select.invalid {
            background-color: var(--field-invalid-color);
        }

    .field.single-image-field {
        display: inline-block;
        width: 100%;
        text-align: center;
    }

    .field.single-image-field .image-field-container {
        height: 250px;
        width: 100%;
        border: 5px solid #CCC;
        background-color: #FFF;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

        .field.single-image-field .image-field-container:hover {
            border: 5px solid #888;
        }

        .field.single-image-field .image-field-container .material-symbols-outlined {
            font-size: 96px;
            color: #CCC;
        }

        .field.single-image-field .image-field-container:hover .material-symbols-outlined {
            color: #888;
        }

        .field.single-image-field .image-field-container .image-field-image {
            max-width: 95%;
            max-height: 95%;
        }

    .field.date-field select {
        width: 70px;
        padding-left: 2px;
        padding-right: 2px;
        text-align: center;
    }

        .field.date-field select.day {
            width: 70px;
            margin-right: 10px;
        }

        .field.date-field select.month {
            width: 120px;
            margin-right: 10px;
            text-align: left;
        }

        .field.date-field select.hours {
            width: 60px;
            margin-left: 10px;
        }

        .field.date-field select.minutes {
            width: 60px;
        }

    .field.choice-field .choices label {
        display: flex;
        align-items: center;
        font-weight: 100;
    }

    .field.choice-field .choices.invalid {
        background-color: var(--field-invalid-color);
    }

    .field.choice-field .scrollbox {
        background-color: var(--highlight-50);
        border: 1px solid var(--glass-30);
        border-radius: 3px;
        padding: 10px;
        max-height: 120px;
        overflow-y: auto;

    }

    .field.choice-field .dropdown {
        position: absolute;
        width: 100%;
        z-index: 1;
        background-color: white;
    }

    .field .field-icon {
        position: absolute;
        bottom: 17px;
        right: 5px;
        cursor: pointer;
    }


/* 
    Navigation
*/

.sidebar {
    background-color: white;
    height: 100%;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
}

    .sidebar header {
        height: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .sidebar header img {
            height: 100px;
        }


    .sidebar nav {
        overflow-y: auto;
        height: 100%;
    }

    .sidebar nav a {
        display: flex;
        padding: 13px 30px;
        border-top: 1px solid #CCC;
        text-decoration: none;
        color: var(--primary-color);
        font-size: 18px;
        align-items: center;
        cursor: pointer;
    }

        .sidebar nav a .material-symbols-outlined {
            margin-right: 30px;
            font-size: 32px;
            color: black;
        }

        .sidebar nav a:hover {
            color: #000;
        }

.size-xs .sidebar-border {
    padding: 0;
}

.size-xs .sidebar {
    border-radius: 0;
}


.mobile-navbar {
    display: none;
    align-items: center;
    justify-content: space-evenly;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: var(--primary-color);
}

    .mobile-navbar button {
        background-color: transparent;
        color: white;
        border: none;
    }

        .mobile-navbar button .material-symbols-outlined { 
            font-size: 30px;
        }

.size-xs .mobile-navbar, .size-sm .mobile-navbar {
    display: flex;
}


.size-xs .mobile-sidebar, .size-sm .mobile-sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 2;
}

.size-xs .mobile-sidebar.open, .size-sm .mobile-sidebar.open {
    bottom: 50px;
    display: block;
}


/* 
    Tables
*/

table {
    border-collapse: collapse;
}

table tr td {
    border-bottom: 1px solid var(--glass-50);
    padding: 10px 0;
}

.size-xs table tr td {
    font-size: 14px;
}

table tr:last-child td {
    border-bottom: none;
}

table tr td:first-child {
    font-weight: 600;
}



/* UI Table */
ui-table { display:block; }
ui-table[hidden] { display:none; }

.table {
    border-radius: 15px;
    background: #fff;
    overflow: hidden;
    font-size: 15px;
}

    .size-xs .table {
        font-size: 13px;
    }

.table-scroll{
    max-height: var(--ui-table-height, 60vh);  /* or set via element's height attr */
    overflow: auto;
}

.table-header, .row {
    display: grid;
    align-items: center;
    column-gap: 10px;
    padding: 3px 30px;
    min-height: 44px;
}

.table-header {
    position: sticky;
    top: 0;
    inset-inline: 0;
    z-index: 1;
    background: var(--primary-color, #0b6efd);
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    user-select: none;
}

.table-header .cell[sortable]{
cursor: pointer;
}

.table-body{
    display:block;
}

.table-header,
.table-body .row{
    min-width: max-content;   /* header background grows with the scroll width */
}

.row{
    border-top: 1px solid var(--glass-50, rgba(0,0,0,.08));
    background: transparent;
}

ui-table[clickable] .row {
    transition: background-color 0.4s ease-in-out;
    cursor: pointer;
}

ui-table[zebra] .row:nth-child(even){
    background: var(--zebra-color-light, #fafafa);
}

ui-table[clickable] .row:hover{
    background: var(--hover-color-light, #f3f6ff) !important;
}

.cell{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.cell.select, .cell.icon { display:flex; align-items:center; gap:8px; }
.cell.center { justify-content:center; text-align:center; }
.cell.right { justify-content:end; text-align:right; }


.cell[sortable]::after{
    content: var(--sort-indicator, "");
    margin-left: 6px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
    font-size: 10px;
    opacity: .85;
}
.cell[sortable][data-sort="asc"]::after { content: "▲"; }
.cell[sortable][data-sort="desc"]::after{ content: "▼"; }


.section-contents .table {
    border: none;
    border-radius: 0;
}

.section-contents .table-header {
    background-color: var(--sub-header-color);
    color: black;
    font-weight: 600;
}

.table-action {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    padding: 5px 15px 5px 0;
}

    .table-action .material-symbols-outlined {
        margin-right: 5px;
    }

    .table-action:hover {
        color: var(--primary-color);
    }

/* 
    Collapsible panel
*/

.collapsible-panel-header {
    position: relative;
    cursor: pointer;
    height: 36px;
}

    .collapsible-panel-header:hover {
        background-color: var(--glass-20);
    }



    .collapsible-panel-header .collapsible-panel-header-line {
        position: absolute;
        top: 18px;
        left: 0;
        right: 0;
        height: 2px;
        border-top: 1px solid var(--glass-50);
    }

    .collapsible-panel-header .collapsible-panel-header-label {
        background-color: #EEEEEE;
        padding: 2px 10px;
        padding-right: 20px;
        position: absolute;
        left: 15px;
        border: 1px solid var(--glass-50);
        border-radius: 3px;
        font-size: 14px;
        font-weight: 600;
        margin-top: 2px;
        display: flex;
        align-items: center;
        
    }

    .collapsible-panel-header .collapsible-panel-header-label .material-symbols-outlined {
        margin-right: 5px;
    }

.collapsible-panel-content {
    padding-top: 5px;
    padding-bottom: 30px;
}


/* 
    Tab control
*/

.tab-control {
    position: relative;
}

    .tab-control .tab-control-bar {
        display: flex;
        margin-top: 35px;
        margin-bottom: 30px;
        margin-left: 15px;
    }

        .tab-control .tab-control-bar .tab-control-bar-button { 
            display: none;
        }


        .size-xxs .tab-control .tab-control-bar,
        .size-xs .tab-control .tab-control-bar,
        .size-sm .tab-control .tab-control-bar {
            display: flex;
            background-color: var(--panel-background-color1);
            margin: 0;
            border: 1px solid #CCC;
            margin-top: 20px;
            margin-bottom: 20px;
            height: 50px;
            border-radius: 15px;
        }


        .size-xxs .tab-control .tab-control-bar .tab-control-bar-button,
        .size-xs .tab-control .tab-control-bar .tab-control-bar-button,
        .size-sm .tab-control .tab-control-bar .tab-control-bar-button { 
            display: block;
            flex: 1;
            border: none;
            background-color: transparent;
        }


    .tab-control .tab-control-header {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 45px;

    }

        .size-xxs .tab-control .tab-control-header,
        .size-xs .tab-control .tab-control-header,
        .size-sm .tab-control .tab-control-header {
            gap: 0;
            flex: 1;
            justify-content: center;
        }



        .tab-control .tab-control-header .tab-control-header-item {
            color: var(--body-foreground-color);
            transition: 0.25s;
            font-weight: 600;
            font-size: 18px;
            border-bottom: 3px solid transparent;
            cursor: pointer;
        }

            .size-xxs .tab-control .tab-control-header .tab-control-header-item,
            .size-xs .tab-control .tab-control-header .tab-control-header-item,
            .size-sm .tab-control .tab-control-header .tab-control-header-item {
                display: none;
            }
            

        .tab-control .tab-control-header .tab-control-header-item:hover {
            border-bottom: 3px solid var(--primary-color);
        }

        .tab-control .tab-control-header .tab-control-header-item.selected {
            color: var(--primary-color);
        }

        .size-xxs .tab-control .tab-control-header .tab-control-header-item.selected, 
        .size-xs .tab-control .tab-control-header .tab-control-header-item.selected,
        .size-sm .tab-control .tab-control-header .tab-control-header-item.selected {
            display: inline-block;
            color: black;
            font-size: 15px;
            border-bottom: none;
        }


/* 
    Phone simulator
*/

.phone-simulator {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: antiquewhite;
    padding: 30px;
}

    .phone-simulator .phone {
        position: relative;
    }

    .phone-simulator .phone .phone-screen {
        position: absolute;
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        background-color: #222;
        border-radius: 50px;
        overflow: hidden;
        z-index: 1;
        box-shadow: 15px 15px 30px rgba(0,0,0, 0.5);
    }

    .phone-simulator .phone img {
        position: relative;
        z-index: 2; /* sits in front */
        display: block;
        pointer-events: none;
    }



/* 
    User Info
*/
.user-info {
    display: flex;
    padding: 10px 16px;
    align-items: center;
    gap: 16px;
    background-color: var(--primary-color);
    color: white;
    box-sizing: border-box;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 1s ease-in-out;
}

    .user-info:hover {
        background-color: var(--primary-highlight-color);
    }

    .user-info .user-info-photo {
        width: 56px;
        height: 56px;
        border-radius: 30px;
        overflow: hidden;
        border: 2px solid white;
    }

    .user-info .user-info-photo img {
        width: 56px;
    }


/* 
    Photos
*/
.profile-photo {
    display: inline-block;
    width: 150px;
    height: 150px;
    border-radius: 80px;
    overflow: hidden;
    border: 3px solid white;
    background-size: cover;
    background-position: center center;
    box-shadow: inset 2px 2px 30px rgba(0,0,0,1), 
                inset -2px -2px 30px rgba(255,255,255,1), 
                0px 0px 10px rgba(0,0,0,0.5); 

    
}

    .profile-photo img {
        width: 150px;
        height: 150px;
        
    }


/* 
    Popout Panel
*/
.popout-panel {
    background: #fff;
    border: 1px solid var(--glass-30);
    border-radius: 3px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    transform-origin: top left;
    transition: opacity 120ms ease, transform 120ms ease;
    overflow: hidden;
}

.popout-panel[data-open="true"] {
  opacity: 1;
  transform: scale(1);
}
.popout-panel:not([data-open]) {
  opacity: 0;
  transform: scale(0.98);
}

/* Optional: directional nudge */
.popout-panel[data-placement="below"] { transform-origin: top left; }
.popout-panel[data-placement="above"] { transform-origin: bottom left; }
.popout-panel[data-placement="right"] { transform-origin: left top; }
.popout-panel[data-placement="left"]  { transform-origin: right top; }




/* 
    Dialogs 
*/

.dialogs-content {
    
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0, 0.3);
    backdrop-filter: blur(20px);

    justify-content: center;
    align-items: center;

    z-index: 100;
}

.app-body .dialogs-content {
    background-color: rgba(0,0,0, 0.8);
    backdrop-filter: none;

    z-index: 200;
}

.dialog-body {
    color: var(--panel-foreground-color);
    background-color: var(--dialog-background-color);
    background: linear-gradient(145deg, #EEEEEF, #EEEEFF);
}

.dialog-body.dark {
    background: none;
    background-color: #444444DD;
    color: #DDDDDD;
}

.dialog-div-body {
    width: 100%;
    color: var(--panel-foreground-color);
}

.dark .dialog-div-body {
    background: none;
    background-color: #444444DD;
    color: #DDDDDD;
}

dialog-frame {
    flex: 1;
    
    position: fixed;
    min-height: 200px;
    min-width: 300px;
    max-width: 100%;
    max-height: 100%;
    border: 1px solid var(--dialog--header-background-color);

    border-radius: 15px;

    box-shadow: 0px 0px 40px rgba(0,0,0, 0.7);
    overflow: hidden;
}

    .dialog-frame-header {
        position: relative;
        background-color: var(--dialog-header-background-color);

        backdrop-filter: var(--dialog-header-background-filter);
        -webkit-backdrop-filter: var(--dialog-header-background-filter);

        padding: 12px 15px;
        color: var(--dialog-header-foreground-color);
        font-weight: 600;
        height: 50px;
        box-sizing: border-box;

    }

    .dialog-frame-header .dialog-frame-header-controls {
        position: absolute;
        top: 0;
        right: 10px;
        bottom: 0;
    }

            .dialog-frame-header .dialog-frame-header-controls ion-icon {
                margin-left: 8px;
                margin-top: 7px;
                font-size: 24px;
                vertical-align: middle;
            }

    .dialog-frame-content-div {
        display: flex;
        top: 50px;
        left: 0;
        right: 0;
        bottom: 0;

        overflow: auto;
    }


    .dialog-frame-content {
        display: flex;
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .dialog-frame-content .dialog-frame-iframe {
        border: none;
        flex: 1;
    }


    .dialog-loading {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: white;

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }


.soft-dialog {
    background-color: white;
    padding: 50px 50px;
    border-radius: 25px;
    text-align: center;
    max-width: 500px;
}

    .soft-dialog .soft-dialog-icon {
        margin-bottom: 30px
    }

        .soft-dialog .soft-dialog-icon.orange {
            color: orange;
        }

        .soft-dialog .soft-dialog-icon.red {
            color: red;
        }

        .soft-dialog .soft-dialog-icon.green {
            color: green;
        }

        .soft-dialog .soft-dialog-icon .material-symbols-outlined {
            font-size: 128px;
        }

    .soft-dialog .soft-dialog-caption {
        font-weight: 600;
        font-size: 20px;
    }

    .soft-dialog .soft-dialog-text {
        margin-top: 5px;
    }

    .soft-dialog .soft-dialog-buttons {
        margin-top: 30px;
    }

    .soft-dialog button {
        border: none;
        font-size: 18px;
        padding: 15px 0 15px 0;
        text-transform: uppercase;
        font-weight: 600;
        background-color: transparent;
        cursor: pointer;
    }

        .soft-dialog button.danger {
            color: red;
        }

        .soft-dialog button.success {
            color: green;
        }

        .soft-dialog button:hover {
            background-color: transparent;
            color: var(--primary-color);
        }

    .size-xs .soft-dialog button {
        text-align: center;
        margin-right: 0 !important;
        display: block;
        width: 100%;
    }


    .loading-indicator {
        background-color: var(--primary-color);
        background: linear-gradient(145deg, var(--body-background-color-light), var(--body-background-color-dark));
        color: var(--body-foreground-color);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 50px;
        border-radius: 25px;
        box-shadow: 5px 5px 15px rgba(0,0,0, 0.4);
        gap: 15px;
    }

        .loading-indicator .material-symbols-outlined {
            font-size: 64px;
        }

        .loading-indicator .loading-indicator-message {
            font-weight: 600;
        }



/* 
    Toast notifications 
*/

#toast-area {
    position: fixed;
    bottom: 100px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 100000;
}

.toast-notification-row {
    margin-bottom: 10px;
}

.toast-notification {
    display: inline-block;
    max-width: 60vw;
    padding: 10px 30px;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 3px 3px 9px rgba(0,0,0, 0.3);
}

    .toast-notification.warning {
        background-color: yellow;
        color: black
    }

    .toast-notification.error {
        background-color: #CC4444;
    }

    .toast-notification.success {
        background-color: #1fad1f;
    }

    .toast-notification .material-symbols-outlined {
        margin-right: 10px;
        font-size: 32px;
    }




/* 
    Animations
*/

.anim-spin {
    animation: spin 4s linear infinite;
}

.anim-start-on-visible {
    opacity: 0;
}

    .anim-start-on-visible.anim-start-slide-left {
        animation: slideInLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

    .anim-start-on-visible.anim-start-slide-right {
        animation: slideInRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

    .anim-start-on-visible.anim-start-grow-vertical {
        animation: growVertical 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

.anim-appear {  
    animation: appear 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.anim-disappear {  
    animation: disappear 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.anim-slide-up {  
    animation: slideInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.anim-slide-down {  
    animation: slideInDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.anim-slide-left {  
    animation: slideInLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.anim-slide-right {  
    animation: slideInRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.anim-grow-vertical {  
    animation: growVertical 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform: scaleY(0);
}

.anim-shrink-vertical {  
    animation: shrinkVertical 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform: scaleY(1);
}

.anim-order-1 {
    animation-delay: 0.1s;
}

.anim-order-2 {
    animation-delay: 0.2s;
}

.anim-order-3 {
    animation-delay: 0.3s;
}

.anim-order-4 {
    animation-delay: 0.4s;
}

.anim-order-5 {
    animation-delay: 0.5s;
}

.anim-order-6 {
    animation-delay: 0.6s;
}

.anim-order-7 {
    animation-delay: 0.7s;
}

@keyframes spin { 
    100% { 
        transform: rotate(360deg); 
    } 
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes growVertical {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

@keyframes shrinkVertical {
    from {
        transform: scaleY(1);
    }
    to {
        transform: scaleY(0);
    }
}

@keyframes appear {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes disappear {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}