/* App chrome for the editor/admin screens. */

* { box-sizing: border-box; }
body {
    margin: 0; background: #f2f0ec; color: #231F20;
    font-family: Helvetica, Arial, 'Nimbus Sans', sans-serif; font-size: 14px;
}

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #1c1d1f; color: #eee; padding: 0 18px; height: 50px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #eee; text-decoration: none; font-weight: 700; }
.topbar .brand img { height: 30px; filter: invert(1); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right a { color: #E2D4B5; text-decoration: none; }
.whoami { color: #9a9da1; }
.linklike { background: none; border: none; color: #eee; cursor: pointer; font-size: 14px; text-decoration: underline; }

.flash {
    background: #E2D4B5; padding: 10px 18px; font-weight: 600;
}

main { padding: 20px; max-width: 1500px; margin: 0 auto; }

h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
h4 { font-size: 12px; margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.muted { color: #8a8d91; }
.hint { color: #8a8d91; font-size: 12.5px; margin: 4px 0; }
.warn { color: #a33; font-size: 12.5px; }
.empty { color: #8a8d91; padding: 30px 0; }

label { display: block; margin: 10px 0 0; font-weight: 600; font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input:not([type]), textarea, select {
    display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
    border: 1px solid #c9c6c0; border-radius: 4px; font-size: 14px;
    font-family: inherit; background: #fff;
}
textarea { resize: vertical; }
button, .primary {
    border: 1px solid #c9c6c0; background: #fff; color: #231F20;
    border-radius: 4px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
button.primary, a.primary {
    background: #231F20; color: #fff; border-color: #231F20;
    text-decoration: none; display: inline-block; font-weight: 600;
}
button.danger { color: #a33; border-color: #d5b3b3; }
button.add { margin-top: 8px; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* home */
.new-setup { display: flex; gap: 10px; align-items: center; margin: 10px 0 6px; }
.new-setup input { flex: 1; margin: 0; }
table.listing { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3e0da; }
table.listing th, table.listing td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eceae5; font-size: 13.5px; }
table.listing a { color: #231F20; font-weight: 600; }
.row-actions { display: flex; gap: 10px; align-items: center; }
.row-actions form { display: inline; }

/* login */
.login-card { max-width: 360px; margin: 80px auto; background: #fff; padding: 28px; border-radius: 8px; border: 1px solid #e3e0da; }
.login-card button { margin-top: 16px; width: 100%; }

/* admin */
.admin-card { background: #fff; border: 1px solid #e3e0da; border-radius: 8px; padding: 18px; margin-bottom: 18px; max-width: 760px; }
.inline-add { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.inline-add input { margin: 0; }
.checkline { display: flex; align-items: center; gap: 6px; white-space: nowrap; margin: 0; }
.checkline input { width: auto; margin: 0; }

/* editor split view */
.editor-split { display: flex; gap: 18px; align-items: flex-start; }
.form-panel { flex: 0 0 460px; max-width: 460px; }
.panel-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-head h1 { margin-bottom: 2px; }

/* preview collapse/expand chevron, in the preview toolbar */
#toggle-preview {
    width: 30px; padding: 3px 0; flex: 0 0 auto;
    font-size: 15px; line-height: 1; color: #8a8d91;
}
#toggle-preview:hover { color: #231F20; }

/* preview hidden: form gets the screen, chevron hugs its right edge */
.editor-split.no-preview .form-panel { flex: 1; max-width: 1100px; }
.editor-split.no-preview .preview-panel { flex: 0 0 34px; }
.editor-split.no-preview #preview,
.editor-split.no-preview #save-status,
.editor-split.no-preview .tool-link { display: none; }
.preview-panel {
    flex: 1; position: sticky; top: 12px;
    height: calc(100vh - 90px); display: flex; flex-direction: column;
}
.preview-tools { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
#save-status { color: #8a8d91; font-size: 12.5px; flex: 1; }
#save-status.saving { color: #b58900; }
#save-status.error { color: #a33; }
#preview { flex: 1; width: 100%; border: 1px solid #c9c6c0; border-radius: 6px; background: #4a4d52; }

.section {
    background: #fff; border: 1px solid #e3e0da; border-radius: 8px;
    padding: 4px 16px 16px; margin-bottom: 12px;
}
.section summary {
    cursor: pointer; font-weight: 700; font-size: 14px; padding: 10px 0;
}
.inline-form { margin: 10px 0; display: flex; gap: 10px; align-items: center; }

/* dynamic rows */
.kvrow { display: flex; gap: 6px; margin-top: 6px; }
.kvrow .ov-label { flex: 0 0 45%; text-transform: uppercase; }
.kvrow input { margin: 0; }
.rowbtn { padding: 4px 8px; flex: 0 0 auto; }

.rr-head { display: flex; gap: 6px; font-size: 11px; font-weight: 700; color: #8a8d91; margin-top: 6px; }
.rr-head span { flex: 1; }
.rrrow { display: flex; gap: 6px; margin-top: 6px; align-items: stretch; }
.rrrow textarea, .rrrow input { flex: 1; margin: 0; font-size: 12.5px; padding: 6px; }

/* photos */
.photo-block { margin-top: 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 130px; }
.thumb-wide { width: 100%; max-width: 300px; }
.thumb img { width: 100%; border-radius: 4px; border: 1px solid #e3e0da; }
.thumb .badge {
    position: absolute; top: 6px; left: 6px; background: rgba(28,29,31,.85);
    color: #E2D4B5; font-size: 10.5px; padding: 2px 7px; border-radius: 3px;
}
.thumb-actions { display: flex; gap: 4px; margin-top: 4px; }
.thumb-actions form { display: inline; }
.thumb-actions button { padding: 3px 9px; font-size: 12px; }
.filelabel { font-weight: 600; }
.filelabel input[type=file] {
    display: block; margin-top: 6px; width: 100%;
    font-size: 12.5px; border: none; padding: 0; background: none;
}

.sv-controls { border-top: 1px dashed #e3e0da; margin-top: 12px; padding-top: 8px; }
.sv-buttons { display: flex; gap: 8px; align-items: center; }
#sv-pano { display: none; height: 340px; border-radius: 6px; margin-top: 10px; background: #ddd; }
#sv-pano.open { display: block; }
#sv-save-form { display: none; margin-top: 8px; }
#sv-save-form.open { display: block; }
