body {
    background: #EEE;
    color: #222;

    --hilight-color: #83b6d6;
    --color-false: #b31515;
    --color-true: #10801a;
}

:root {
    --ps-ink: #1f1f1f;
    --ps-muted: #555;
    --ps-dark: #222;
    --ps-line: #cfcfcf;
    --ps-line-soft: #e2e2e2;
    --ps-tile: #f6f6f6;
    --ps-bar: #bdbdbd;
    --ps-danger: #a3302a;
    --ps-ok: #4a6b3a;
    --ps-warn: #8a5a00;
    --ps-radius: 6px;
}

html, body { padding: 0; margin: 0; height: 100%; font-family: sans-serif; }
a { text-decoration: none; color:inherit; }
h1 { padding: 0; margin: 0 0 20px 0; font-size: 20px;  }

button, .btn {
    padding:4px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    user-select: none; cursor: pointer;
    display: inline-flex;
    align-items: center;
    background: #EEE; font-weight: bold;
    font-size: 14px; box-shadow: 1px 1px 5px rgba(0,0,0,0.05);
    gap:10px;
    line-height: 23px;
}
button.subtle, .btn.subtle {
    align-self: flex-start;
    border: 1px dashed #b5b5b5;
    background: #fff;
    color: #333;
}
button > *, .btn > * { vertical-align: middle; display: inline-block; }
button.saved .icon {
    background-image:url('/assets/images/cloud_saved.svg') !important;
}
button.loading .icon {
    background-image:url('/assets/images/spinner.svg') !important;
    animation: spin 0.75s linear infinite;
    transform-origin: center center;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.icon { display: inline-block; cursor: pointer; width: 24px; height: 24px; background-position: center center; background-size: contain; background-repeat: no-repeat; }
.icon.gear { background-image:url('/assets/images/gear.svg'); }
.icon.plus { background-image:url('/assets/images/plus.svg'); }
.icon.search { background-image:url('/assets/images/search.svg'); }
.icon.arrowup { background-image:url('/assets/images/up.svg'); }
.icon.arrowdown { background-image:url('/assets/images/down.svg'); }
.icon.update { background-image:url('/assets/images/update.svg'); }
.icon.cancel { background-image:url('/assets/images/cancel.svg'); }
.icon.delete { background-image:url('/assets/images/delete.svg'); }
.icon.cloud_save { background-image:url('/assets/images/cloud_save.svg'); }
.icon.cloud_saved { background-image:url('/assets/images/cloud_saved.svg'); }
.icon.spinner { background-image:url('/assets/images/spinner.svg'); animation: spin 0.75s linear infinite; transform-origin: center center; }
.icon.copy { background-image:url('/assets/images/copy.svg'); }

.hidden { display: none !important; }
.empty { opacity: 0.6; font-style: italic; font-size: 90%; }

input, textarea { display: block; width: 100%; resize:none; padding: 8px; box-sizing: border-box; border:1px solid #EEE; border-radius: 4px; }
textarea { min-height:100px; }


header { display: block; padding: 12px 20px; color: #222; border-bottom: 1px solid #BBB; background: #FFF; }
header .logo { display: flex; gap: 10px; font-size: 16px; font-weight: bold; color: #666; align-items: center; }
header .logo svg { width: 24px; height: 24px; vertical-align: top; }

.main { display: flex; width: 100%; min-height: 100%; align-items: stretch; }
.main > div:first-child { width: 200px; padding: 20px; border-right: 1px solid #BBB; background: #FFF; }
.main > div:last-child { flex:1; padding: 20px; }
.main .menu a { box-sizing: border-box; display: flex; align-items: center; gap:8px; width: 100%; margin-bottom: 10px; font-size: 15px; }
.main .menu > a > *:first-child { width:24px; }
.main .menu a img { width: 100%; vertical-align: top; }
.main .menu .title { margin-top: 20px; font-weight: bold; }
.main .menu .title:first-child { margin-top: 0; }
.main .menu .sub { padding: 8px; background: #EEE; border-radius: 10px; box-sizing: border-box; }
.menu .submenu, .menu .submenuitems { padding-left: 30px; margin-bottom: 20px; }
.menu .submenuitems > a { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding:8px; margin-bottom: 5px; font-size: 14px; opacity: 0.9; }
.menu .submenuitems > a > span:last-child { opacity: 0.7; font-size: 12px; }
.menu .submenuitems > a.selected { opacity: 1; border-radius: 6px;
    background: rgb(238, 237, 251);
    color: rgb(59, 48, 184);
    font-weight: 600; }
.menu .submenu > a {
    display: flex; align-items: center; gap: 10px; padding:10px; border-radius: 8px; background: rgb(238, 237, 251); color: rgb(59, 48, 184); text-decoration: none;
}

.pageheader { display: flex; width: 100%; align-items: center; padding: 0 0 20px 0; }
.pageheader > * { flex: 1; }
.pageheader > *:last-child { text-align: right; }
.pageheader button, .pageheader .btn { background: #FFF; margin-left: 10px; }

.breadcrumb { list-style: none; padding: 0; margin: 0; }
.breadcrumb li { margin-right: 5px; display: inline-block; }
.breadcrumb li:after { content:'>'; padding-left: 10px; font-size: 70%; margin-right: 5px; display: inline-block; }
.breadcrumb li:last-child:after { display: none; }

.projectsdiv {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
}

.projectsdiv > * {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid transparent;
    background: #FFF;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
    position: relative;
    text-align: center;
    max-width: 200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.projectsdiv .title { display: block; position: absolute; padding: 15px; text-align: center; left: 0; right: 0; bottom: 0; font-size: 14px; }
.projectsdiv .amount { position: absolute; right:15px; bottom: 15px; padding:3px 5px; font-size: 12px; color: #FFF; font-weight: bold; background: blue; border-radius: 2px; min-width: 16px; text-align: center; }
.projectsdiv .icon { position: absolute; left:15px; bottom: 15px; z-index: 5; }
.projectsdiv .img { position:absolute; top: 20px; left: 20px; right: 20px; bottom: 55px; background-position: center center; background-size: contain; background-repeat: no-repeat; }
.projectsdiv > .newproject { border-style: dashed; }
.projectsdiv > .newproject img { display: block; width:80px; margin: auto; }


.collectiondata .cell { background:#FFF; margin-bottom: 30px; }
.collectiondata .head { padding:10px; border-bottom: 1px solid #EEE; display: flex; align-items: center; }
.collectiondata .head > * { flex: 1; text-align: left; }
.collectiondata .head > *:last-child { text-align: right; }
.collectiondata .head:last-child { border:none; }
.collectiondata .head .name { font-weight: bold; }
.collectiondata .head .type { font-size: 90%; padding: 2px 5px; background-color: #EEE; border-radius: 2px; margin-left:10px; }
.collectiondata .head .type a { color: #0f85b4; }
.collectiondata .head .required { float: right; font-size: 90%; color:var(--color-false); }
.collectiondata .body { padding: 10px; }

.collectionentriestbl { background: #FFF; border: 0; border-collapse: collapse; width: 100%; table-layout: fixed; }
.collectionentriestbl td, .collectionentriestbl th { padding: 10px 14px; border-bottom: 1px solid #CCC; text-align: left; }
.collectionentriestbl th { border-bottom-width: 3px; font-weight: bold; }
.collectionentriestbl tr:last-child td { border-bottom: none; }
.collectionentriestbl .action { width:30px; text-align: right; }

.collectionentry { background:#FFF; padding:30px; }
.collectionentry .cell { padding: 5px 15px; margin-bottom: 30px; display: flex; width: 100%; flex-direction: column; gap:10px; border-left: 2px solid #CCC; }
.collectionentry .cell > *:first-child { font-weight: bold; }
.collectionentry .cell > *:last-child { flex:1; }
.collectionentry .cell:last-child { margin:0; }
.collectionentry input, .collectionentry textarea { border:none; border-bottom: 1px solid #CCC; border-radius: 0; }


.checkbox { display: block; margin-top: 2px; }
.checkbox input { display: none; }
.checkbox label { cursor: pointer; position: relative; display: inline-block; width: 100%; max-width: 70px; height: 14px; border-radius: 10px; background: #EEE; }
.checkbox .handle { position: absolute; display: inline-block; left:0; top:50%; transform:translate(-50%,-50%); transition: all 300ms; width: 20px; height: 20px; border-radius: 50%; background:var(--color-false); box-shadow: 0 0 5px rgba(0,0,0,0.2); }
.checkbox input:checked + label .handle { left:100%; background:var(--color-true); }

.linkitemrow { display: block; }
.linkitemrow .btn { margin-right: 20px; }
.itemlist .item { display: flex; align-items: center; margin-bottom: 10px; gap: 20px; width: 100%; }
.itemlist .item > *:first-child { flex: 1; }
.itemlist .item > *:last-child { width:20px; text-align: right; }
.itemlist .item:first-child .arrowup { opacity: 0.2; }
.itemlist .item:last-child .arrowdown { opacity: 0.2; }


.searchfield { display: block; position: relative; }
.searchfield .icon { position: absolute; left:10px; top: 50%; transform: translate(0, -50%); }
.searchfield input { text-indent: 30px; }
.searchfield:after { content: ''; position: absolute; top: 50%; right: 10px; width:8px; height:8px; margin-top: -6px; transform: rotateZ(45deg); border-right:2px solid #222;border-bottom:2px solid #222; }
.searchfield .dropdown { user-select: none; position: absolute; z-index: 100; left: 0; top:100%; right:0; background: #FFF; border-radius: 0 0 5px 5px; box-shadow: 1px 1px 10px rgba(0,0,0,0.2); }
.searchfield .dropdown > * { cursor: pointer; padding: 10px; display: block; border-bottom: 1px solid #CCC; }
.searchfield .dropdown > *:hover { background: var(--hilight-color); }
.searchfield .dropdown > *:last-child { border-bottom: none; }

.imageupload { display: flex; gap: 30px; width: 100%; user-select: none; align-items: center; }
.imageupload input { display: none; }
.imageupload > *:first-child { width: 160px; max-width: 160px; }
.imageupload > *:last-child { flex: 1; }
.imageupload .container { cursor: pointer; display: block; width: 100%; text-align: center; padding: 40px; box-sizing: border-box; border:1px dashed #AAA; background-size: contain; background-position: center center; background-repeat: no-repeat; }
.imageupload button { cursor: pointer; display: block; width: 120px; text-align: center; background: #EEE; padding: 8px 10px; border:none; border-radius: 4px; margin:10px 0; }


.pagecontent { display: block; margin-bottom: 20px; }
.pagecontent .header { display: flex; gap:20px; margin-bottom:10px; align-items: center; width: 100%; box-sizing: border-box;  }
.pagecontent .header > * { flex: 1; }
.pagecontent .header > *:first-child { width: 60px; flex: none; }
.pagecontent .header > *:first-child .icon:first-child { margin-right:5px; }
.pagecontent:first-child .header .arrowup { opacity: 0.3; }
.pagecontent:last-child .header .arrowdown { opacity: 0.3; }
.pagecontent .header > *:last-child { width: 20px; flex: none; text-align: right; padding-right: 5px; }
.pagecontent .content { cursor: pointer; background: #EEE; border-radius: 4px; display: flex; gap:10px; padding: 5px; width: 100%; box-sizing: border-box; min-width: 0; contain: inline-size; }
.pagecontent .content > * { box-sizing: border-box; padding: 10px; min-height: 200px; flex: 1; background: #FFF; border-radius: 4px; position: relative; min-width: 0; }
.pagecontent .content .icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.pagecontent .content textarea { border:none; box-sizing: border-box; outline: none; min-height: 0; }
.pagecontent .imageupload { height: 100%; align-items: stretch; }
.pagecontent .imageupload > *:first-child { max-width: none; flex: 1; }
.pagecontent .imageupload > *:last-child { position: absolute; text-align: right; bottom:0; }

.prop { display: inline-block; overflow: hidden; white-space: nowrap; width: 100%; text-overflow: ellipsis; }
.prop.date { font-size: 80%; color: #444; border:1px solid #91BBCF; border-radius:2px; padding: 5px; width: 100%; text-align: center; box-sizing: border-box; }
.prop.status { width: 12px; height: 12px; border-radius: 50%; background:var(--color-false); }
.prop.status.active { background: var(--color-true); }
.prop.img { border:1px solid #91BBCF; border-radius:2px; width:50px; height: 50px; background-image: var(--image); background-position: center center; background-size: contain; background-repeat: no-repeat; }


/* Dialog */
.blackbox { position: fixed; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index:99; }
.dialog { box-shadow: 3px 3px 15px rgba(0,0,0,0.4); overflow: hidden; z-index: 100; display: none; position: fixed; width: 95%; max-width:600px; transform: translate(-50%,-50%); top:50%; left: 50%; background: #FFF; border-radius:5px; }
.dialog .title { background: #222; color: #FFF; padding: 10px; display: block; position: relative; }
.dialog .title .image, .dialog .title svg { width: 14px; height: 14px; position: absolute; right: 10px; top: 50%; transform: translate(0,-50%); cursor: pointer; }
.dialog .buttons { display: block; padding: 10px; border-top: 1px solid #EEE; overflow: hidden; text-align: right; }
.dialog .buttons > * { margin-right: 20px;  }
.dialog .buttons > *:first-child { float: left; }
.dialog .buttons > *:last-child { margin-right: 0; }
.dialog .tabs { text-align: center; margin: 10px; display: flex; gap: 10px; align-content: stretch; user-select:none; }
.dialog .tabs label { display: inline-block; padding: 6px 20px; border: 1px solid #AAA; flex:1; border-radius: 5px; cursor: pointer;  }
.dialog .tabs input { display: none; }
.dialog .tabs input:checked + label { border-color: #00A; background:#2E6BB5; color: #FFF; }
.dialog .dialogcontent { display: flex; flex-direction: column; gap: 20px; padding:20px 20px; overflow-y: auto; border-top: 1px solid #EEE;  position:relative; }
.dialog .description { line-height: 1.6; font-size: 15px; display:flex; align-items: center; padding:20px;
    background: #CEF; }
.dialog .description > * { flex:1; padding:5px; }
.dialog .description > *:first-child { flex: 0.12; padding:0 10px 0 0; }
.dialog .description img, .dialog .description svg { width: 100%; vertical-align: top; opacity: 0.8; }
.dialog .description svg:hover .controller { transform: translate(-15%,30%) rotateZ(-90deg); transform-origin: center center; transition: all 200ms; }
.dialog .dialogcontent [data-tab] { display: none; }
.dialog.filepicker { max-width:1200px; }
.dialog.filepicker .fileselect { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap:20px; }
.dialog.filepicker [data-tab] { height: inherit; }
.dialog.filepicker .splitwindow { display: flex; width: 100%; align-items: start; gap:20px; height: inherit; }
.dialog.filepicker .splitwindow > *:first-child { flex: 1; overflow-y: scroll;height: 100%;padding-right: 20px;}
.dialog.filepicker .splitwindow > *:last-child { width:300px; }
.dialog.filepicker .splitwindow .imagepreview { display: block; margin-bottom: 15px; width: 100%; aspect-ratio: 16/9; background-position: center center; background-repeat: no-repeat; background-size:contain; background-color:#CCC; }
.dialog.filepicker .splitwindow .btn { margin-top: 15px; }
.dialog.filepicker .inputrow { display: flex; gap:10px; align-items: center; width: 100%; }
.dialog.filepicker .inputrow > *:first-child { flex: 1; }
.dialog.filepicker .row { font-size: 90%; opacity: 0.8; margin-top: 15px; display: block; }
.dialog.filepicker input[type="file"] { display: none; }
.dialog .directory { display:inline-block; width:100%; background:#FFF; cursor:pointer; }
.dialog .directory .dirgrid { display: grid; grid-template-columns:1fr 1fr; }
.dialog .directory .image { display:block; width:100%; border:1px solid #444; height:0; padding-bottom:80%; background-position:center center; background-size:contain; background-repeat:no-repeat; background-color:#CCC; }
.dialog .directory .name { padding:10px 10px 0 10px; text-align:center; display:block; font-size: 90%; }
.dialog .directory.selected { color:#2E6BB5; }
.dialog .directory.selected .image { outline:4px solid #2E6BB5; }
.dialog .dbreadcrumb { display:block; margin-bottom:15px; cursor:pointer; font-size: 90%; }
.dialog .dbreadcrumb .dir:before { margin:0 5px; content:'-'; }
.dialog .upload { font-size:20px; text-align:center; display:block; position:absolute; top:0; right:0; left:0; bottom:0; cursor:pointer; }
.dialog .upload > span { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:90%; }
.dialog input, .dialog select { width: 100%; box-sizing: border-box; padding: 6px; border: 1px solid #CCC; border-radius: 5px; }

/* Upload UI */
.upload { display: flex; align-items: center; gap:20px; }
.upload > * { width: 100%; }
.upload > *:first-child { width: 100px; }
.upload .uploadbox { width: 100px; height: 100px; border: 2px solid #DDD; display: inline-block; cursor: pointer; background-color:#F0F0F0; background-size: contain; background-repeat: no-repeat; background-position: 50% 50%; vertical-align: top; }
.upload button { display: block; margin: 10px 0; width:160px; }
.upload input { display: none; }

.itemrow { display: flex; align-items: center; gap:20px; width: 100%; }
.itemrow > * { position: relative; }
.itemrow > *:first-child {  }
.itemrow > *:nth-child(2) { width: 80px; }
.itemrow > *:nth-child(3) { flex: 1; }
.itemrow > *:last-child { text-align: right; }
.itemrow .percent { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); user-select: none; opacity: 0.7; }

.abtn_warning { color: #f46060; background: none; border:none; font-weight: normal; box-shadow: none; }
.abtn_warning .icon { fill: #f46060; }


/* Layout presets */
.ps-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.ps-preset {
    height: 60px;
    padding: 10px;
    display: flex;
    gap: 4px;
    background: var(--ps-tile);
    border: 2px solid var(--ps-line-soft);
    border-radius: 8px;
    cursor: pointer;
}
.ps-preset span {
    display: block;
    flex-basis: 0;
    min-width: 0;
    height: 100%;
    background: var(--ps-bar);
    border-radius: 3px;
}
.ps-preset:hover { border-color: var(--ps-bar); }
.ps-preset.is-active { border-color: var(--ps-dark); }
.ps-preset.is-active span { background: var(--ps-dark); }

.ps-preset--custom {
    flex-direction: column; align-items: center; justify-content: center;
    padding: 6px; color: #666; font-size: 12px; font-weight: 600;
}
.ps-columns { display: flex; flex-direction: column; gap: 10px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.ps-label {
    font-size: 13px; font-weight: 600; color: var(--ps-muted);
    text-transform: uppercase; letter-spacing: .04em;
}body {
    background: #EEE;
    color: #222;

    --hilight-color: #83b6d6;
    --color-false: #b31515;
    --color-true: #10801a;
}
