:root {
    --bg: #eef6ff;
    --surface: #ffffff;
    --surface-alt: #f6fbff;
    --line: #d4e5f8;
    --text: #1b3655;
    --muted: #6a86a5;
    --primary: #4ea3ff;
    --primary-dark: #2776ca;
    --danger: #d95165;
    --success: #2c9c7d;
    --shadow: 0 20px 45px rgba(66, 121, 181, 0.12);
    --radius: 5px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: radial-gradient(circle at top left, rgba(78, 163, 255, 0.25), transparent 28%), linear-gradient(180deg, #f5fbff 0%, #eaf3fb 100%);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { padding: 24px; border-right: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); display: flex; flex-direction: column; justify-content: space-between; }
.brand-card, .table-card, .form-card, .welcome-card, .content-page, .category-card, .category-editor, .richtext-card, .client-topbar { background: var(--surface); border: 1px solid rgba(212,229,248,.9); box-shadow: var(--shadow); border-radius: var(--radius); }
.brand-card { padding: 20px; margin-bottom: 24px; }
.nav-links { display: grid; gap: 10px; }
.nav-links a { padding: 12px 14px; border-radius: 4px; color: var(--muted); }
.nav-links a.active, .nav-links a:hover { background: var(--surface-alt); color: var(--primary-dark); }
.sidebar-footer { padding-top: 16px; color: rgba(27, 54, 85, 0.52); font-size: 0.82rem; }
.sidebar-footer p { margin: 10px 0 0; }
.sidebar-credit { color: rgba(27, 54, 85, 0.48); }
.sidebar-credit:hover { color: rgba(27, 54, 85, 0.72); }
.sidebar-divider { height: 1px; background: rgba(212, 229, 248, 0.95); }
.content { padding: 28px; }
.page-header, .client-topbar, .language-head, .category-editor-head, .form-actions, .page-title-block { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-header { margin-bottom: 24px; }
.eyebrow, .subtle { color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 4px; padding: 12px 18px; cursor: pointer; font-weight: 600; }
.button.primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }
.button.secondary { background: var(--surface-alt); color: var(--primary-dark); }
.button.danger { background: #ffe8ec; color: var(--danger); }
.button.small { padding: 8px 12px; font-size: .9rem; }
.button.large { padding: 14px 28px; }
.table-card, .form-card { padding: 22px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.thumb, .preview { width: 88px; height: 88px; object-fit: cover; border-radius: 5px; }
.field-grid { display: grid; gap: 18px; margin-bottom: 20px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 8px; }
input[type="text"], input[type="number"], input[type="file"], textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 12px 14px; color: var(--text); }
textarea { resize: vertical; }
.language-panel, .alert, .tabs, .category-selector, .gallery-grid { margin-bottom: 20px; }
.room-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 0; }
.language-panel { padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-alt); }
.language-badge, .lang-pill, .guest-pill, .chip span { border-radius: 4px; background: #e1f0ff; color: var(--primary-dark); padding: 6px 12px; }
.alert { padding: 14px 16px; border-radius: 5px; }
.alert.error { background: #ffe8ec; color: #9a3548; }
.alert.success { background: #e5f7f1; color: #1c7f63; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab { padding: 10px 16px; border: 0; border-radius: 4px; background: rgba(255,255,255,.7); color: var(--muted); cursor: pointer; }
.tab.active { background: #dff0ff; color: var(--primary-dark); }
.tab-panel { display: none; }
.tab-panel.show { display: block; }
.chip { display: inline-flex; margin: 0 10px 10px 0; }
.chip input { display: none; }
.chip input:checked + span { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }
.category-editor, .richtext-card { padding: 18px; margin-bottom: 18px; }
.richtext-card.inner { padding: 14px; margin-bottom: 0; }
.editor-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.editor-toolbar button { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 8px 10px; cursor: pointer; }
.rich-editor { min-height: 180px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.rich-editor-input { display: none; }
.gallery-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.category-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
.category-grid-client { grid-template-columns: 1fr; align-items: stretch; }
.gallery-item { display: grid; gap: 12px; }
.gallery-item img, .category-card img, .detail-banner { width: 100%; border-radius: 5px; object-fit: cover; }
.client-app { min-height: 100vh; padding: 20px; display: grid; grid-template-rows: auto 1fr auto; gap: 20px; }
.welcome-screen { grid-template-rows: 1fr auto; }
.client-topbar { margin-bottom: 0; padding: 18px; }
.client-logo { width: 52px; height: 52px; object-fit: cover; border-radius: 5px; }
.welcome-card { overflow: hidden; }
.welcome-hero {
    min-height: calc(100vh - 96px);
    background-color: #dfeaf6;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: stretch;
    justify-content: center;
    border: 0;
    position: relative;
}
.welcome-hero-topbar {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
}
.welcome-hero-topbar .language-switcher {
    margin-bottom: 0;
}
.welcome-hero-topbar .lang-pill {
    background: rgba(255, 255, 255, 0.82);
}
.welcome-content-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}
.welcome-content-panel {
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    padding: 18px;
    width: min(100%, 760px);
}
.welcome-content { padding: 26px; display: grid; gap: 16px; justify-items: center; text-align: center; background: rgba(255, 255, 255, 0.38); border-radius: 5px; }
.welcome-content h1 { margin: 0; text-align: center; font-size: clamp(2rem, 4vw, 3rem); }
.welcome-content .eyebrow { color: #173657; font-weight: 600; }
.guest-pill { display: inline-flex; align-items: center; justify-content: center; text-align: center; font-size: 1.15rem; padding: 10px 18px; background: rgba(233, 242, 255, 0.88); }
.content-page { padding: 24px; }
.detail-title-block { margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.detail-title-block h1 { margin: 0; text-align: left; }
.category-card { padding: 16px; display: grid; gap: 14px; transition: transform .2s ease; min-height: 100%; }
.category-card:hover { transform: translateY(-3px); }
.rich-content { line-height: 1.7; }
.lang-pill.active { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }
.client-footer { padding: 0 4px; color: var(--muted); }
code { background: #edf6ff; padding: 3px 7px; border-radius: 4px; }
.translatable-box { display: grid; gap: 14px; }
.lang-selector { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
.lang-selector-btn { min-width: 48px; padding: 9px 12px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font-weight: 700; }
.lang-selector-btn:last-child { border-right: 0; }
.lang-selector-btn.active { background: #dff0ff; color: var(--primary-dark); }
.lang-pane { display: none; gap: 12px; }
.lang-pane.active { display: grid; }
.lang-pane-head { display: flex; justify-content: flex-start; }
.language-head.compact { margin-bottom: 0; }
.empty-state { padding: 18px; border: 1px dashed var(--line); border-radius: 5px; background: #f9fcff; color: var(--muted); margin-bottom: 20px; }
.hidden { display: none !important; }
@media (min-width: 901px) {
    .category-grid-client { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .field-grid.two { grid-template-columns: 1fr; }
    .language-head { align-items: flex-start; flex-direction: column; }
    .client-topbar { align-items: center; }
    .welcome-hero { min-height: calc(100vh - 116px); }
    .welcome-content-wrap { padding: 16px; }
    .welcome-content-panel { width: 100%; }
    .welcome-hero-topbar { top: 14px; right: 14px; }
}
body .note-editor.note-frame,
body .note-editor.note-airframe {
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

body .note-toolbar {
    background: #f8fbff;
    border-bottom: 1px solid var(--line);
}

body .note-btn {
    border-radius: 4px;
}

body .note-editing-area .note-editable {
    min-height: 220px;
    color: var(--text);
}

body .note-modal-content,
body .note-popover {
    border-radius: 5px;
}

