body {
background-color: #0a0a0a;
color: #ffffff;
margin: 0;
padding: 0;
min-height: 100%;
height: auto;
font-family: Arial, Helvetica, sans-serif;
}
img {
border: medium none;
max-width: 100%;
height: auto;
}
a {
color: #1090DF;
}

hr {
margin: 0;
padding: 0;
border-color: #333;
}

div#data {
    position: relative;
    padding: 0px 10px 10px 10px;
}

div#page {
    background-color: #111;
    max-width: 976px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    border-left: 3px solid #333;
    border-right: 3px solid #333;
    overflow: hidden;
}

div#formdiv {
    display: none;
    background-color: #111;
    position: fixed;
    padding: 10px;
    margin: 0;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid #333;
    border-radius: 10px;
    z-index: 9999;
}

div.mainbody {
    position: relative;
    padding: 0;
    margin: 0;
    width: 100%;
    min-height: 600px;
}

table td {
    vertical-align: top;
    font-size: 14px;
}

font.label {
    color: #22BB22;
    font-weight: bold;
}

div.search {
    display: none;
    float: right;
}
input.search {
    background-color: #222;
    color: #ffffff;
    border: 1px solid #555;
}

.suggestionsBox {
    position: relative;
    margin: 0;
    width: 220px;
    background-color: #222;
    border-radius: 7px;
    border: 2px solid #555;
    color: #fff;
}

.suggestionList {
    margin: 0;
    padding: 0;
}

.suggestionList ul {
    font-size: 12px;
    list-style: none;
    padding: 0;
    margin: 4px;
    text-align: left;
}

.suggestionList li {
    margin: 0;
    padding: 2px;
}

.suggestionList li:hover {
    background-color: #1090DF;
    color: #fff;
}

div#page_loading {
    display: none;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 16px;
    height: 16px;
    background: transparent url(/src/images/tableload.gif) no-repeat 0 0;
}

/* menu bar */
#menu {
    position: sticky;
    top: 0;
    z-index: 400;
    background-color: #1a1a2e;
    margin: 0;
    padding: 0;
    min-height: 38px;
}

.nav h2, .nav hr {
    display: none;
}

ul.menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

ul.menu > li {
    position: relative;
}

ul.menu > li > a {
    display: block;
    padding: 10px 14px;
    color: #99AAAA;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: Arial, Helvetica, sans-serif;
}

ul.menu > li > a:hover,
ul.menu > li > a.active {
    color: #ffffff;
}

/* first right-aligned item pushes everything after it to the right */
li.menu-right {
    margin-left: auto;
}
li.menu-right ~ li.menu-right {
    margin-left: 0;
}

/* submenus — show on hover */
.submenu, .subsubmenu, .subsubsubmenu {
    display: none;
    position: absolute;
    left: 0;
    z-index: 100;
    list-style: none;
    padding: 4px 0;
    margin: 0;
    min-width: 160px;
    background-color: #1a1a2e;
    border: 1px solid #333;
    border-top: none;
}

ul.menu > li:hover > .submenu,
ul.menu > li:hover > .submenu-right,
.submenu li:hover > .subsubmenu,
.subsubmenu li:hover > .subsubsubmenu {
    display: block;
}

/* right-aligned dropdown (profile menu) */
.submenu-right {
    right: 0;
    left: auto;
}

.menu-divider {
    border-top: 1px solid #333;
    margin: 4px 0;
}

/* nested submenus position to the right */
.subsubmenu, .subsubsubmenu {
    position: absolute;
    left: 100%;
    top: 0;
}

.submenu li, .subsubmenu li, .subsubsubmenu li {
    display: block;
    position: relative;
}

.submenu a, .subsubmenu a, .subsubsubmenu a {
    display: block;
    padding: 6px 16px;
    color: #7799AA;
    text-decoration: none;
    font-size: 12px;
    font-weight: normal;
    text-transform: none;
    font-family: Arial, Helvetica, sans-serif;
    white-space: nowrap;
}

.submenu a:hover, .subsubmenu a:hover, .subsubsubmenu a:hover,
.submenu a.active, .subsubmenu a.active, .subsubsubmenu a.active {
    color: #ffffff;
    background-color: #2a2a4e;
}

div#footer {
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 10px 0;
    border: 0;
    color: #555;
    text-align: center;
    font-size: 12px;
}

/* forms */
input {
    color: #000;
    background: #c8cbc8;
    border: 2px solid #444;
}

.button {
    background-color: #1a1a2e;
    color: #FFF;
    border-radius: 6px;
    border: 2px outset #333;
    padding: 4px 8px;
    cursor: pointer;
}

.button:hover {
    background-color: #2a2a4e;
}

.button option {
    background-color: #111;
    color: #FFF;
}

.button-close {
    background-color: #1a1a2e;
    color: #666;
    border-radius: 6px;
    border: 2px outset #333;
    padding: 4px 8px;
    cursor: pointer;
}
.button-close:hover {
    background-color: #2a2a4e;
    color: #fff;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 38px;
    z-index: 100;
    background-color: #111;
    padding: 2px 10px;
    margin: 0 -10px;
    border-bottom: 1px solid #333;
}

div.fileinputs {
    position: relative;
}

div.fakefile {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

input.file {
    position: relative;
    text-align: right;
    opacity: 0;
    z-index: 2;
}

/* map (VO-specific, loaded by app themes) */
div#map {
    display: none;
    position: absolute;
    right: 0;
    background-color: #000000;
}
div#mapfloat {
    position: relative;
    float: right;
    max-width: 404px;
    width: 100%;
    z-index: 300;
}

/* admin form selects */
select {
    color: #000;
    background: #c8cbc8;
    border: 2px solid #444;
    padding: 2px 4px;
}

/* admin group checkboxes */
.admin-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 4px 0;
}
.admin-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
}
.admin-checkbox-label input[type="checkbox"] {
    accent-color: #1090DF;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* structured model editor */
.model-layout {
    width: 100%;
}
.model-layout > tbody > tr > td:first-child {
    width: 100%;
}
#model-editor-wrapper {
    margin-top: 8px;
}
.model-section {
    position: relative;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.model-section h3 {
    margin: 0 0 6px 0;
    font-size: 14px;
    text-transform: uppercase;
    color: #99AAAA;
}
.model-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.model-field-row label {
    white-space: nowrap;
    min-width: 80px;
    margin: 0;
}
.model-input {
    flex: 1;
    box-sizing: border-box;
}
.model-op-body {
    padding-left: 8px;
}
.model-op-body label {
    display: block;
    margin: 6px 0 2px;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
}
textarea.model-query,
textarea#model-raw-json {
    width: 100%;
    min-height: 80px;
    font-family: monospace;
    font-size: 13px;
    color: #ddd;
    background: #111;
    border: 1px solid #444;
    padding: 6px;
    resize: vertical;
    box-sizing: border-box;
}
table.model-options {
    margin: 4px 0;
}
table.model-options td {
    padding: 2px 4px;
}
table.model-options input.opt-key,
table.model-options input.opt-val {
    background: #181818;
    color: #ddd;
    border: 1px solid #444;
    padding: 3px 6px;
    font-size: 13px;
}
.model-add-option,
.model-remove-option {
    font-size: 12px;
    padding: 2px 8px;
}

/* CRUD tab bar — tabs use .button base class with overrides */
.model-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}
.model-tab {
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 12px;
    letter-spacing: 1px;
    margin-right: 2px;
}
.model-tab.active {
    background: #0d0d0d;
    color: #fff;
    border-color: #555;
    border-bottom: 2px solid #1090DF;
}
.model-tabs + .model-crud-section {
    border-top-left-radius: 0;
}
/* Analytics tab bar */
.analytics-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
}
.analytics-tab {
    border-radius: 4px 4px 0 0;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    letter-spacing: 1px;
}
.analytics-tab.active {
    background: #0d0d0d;
    border-bottom: 2px solid #1090DF;
}

.model-view-toggle {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border-radius: 0;
    border-bottom: none;
    letter-spacing: 1px;
    font-size: 12px;
}
.model-op-actions {
    margin-top: 8px;
}

/* results panel — shared output area below tabs (inherits .model-section base) */
.model-results-panel:empty {
    display: none;
    border: none;
    padding: 0;
    margin: 0;
}
.model-results-panel pre {
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ccc;
    font-size: 12px;
    max-height: 400px;
    overflow: auto;
    padding: 8px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}
.model-results-loading {
    color: #666;
    font-style: italic;
    font-size: 12px;
}
.model-results-error {
    color: #c66;
    font-size: 12px;
}
.model-results-empty {
    color: #666;
    font-size: 12px;
}
.model-preview-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* inline edit forms (groups, DSNs, API tokens) */
.inline-edit-form {
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
}
.inline-edit-form input[type="text"] {
    background: #181818;
    color: #ddd;
    border: 1px solid #444;
    padding: 3px 6px;
    font-size: 13px;
}
.inline-edit-form td {
    padding: 2px 4px;
    font-size: 13px;
}

/* mobile breakpoint */
@media (max-width: 640px) {
    div#page {
        border-left: none;
        border-right: none;
    }
    ul.menu > li > a {
        padding: 8px 10px;
        font-size: 12px;
    }
    .submenu a, .subsubmenu a, .subsubsubmenu a {
        padding: 8px 14px;
    }
    div#mapfloat {
        float: none;
        margin: 0 auto;
    }
    div#data {
        padding: 6px;
    }
}
