/* Luminous College — admin panel */
:root {
  --sea-900: #123D29; --sea-800: #1B5C3C; --sea-700: #2A7F50; --sea-600: #2E8B57; --sea-500: #3CB371; --sea-100: #D5EFDF; --sea-50: #EDF7F1; --sea-600-rgb: 46,139,87;
  --slate-900: #26313A; --slate-700: #3D4A54; --slate-500: #5F6C76; --slate-300: #B7C0C6;
  --mist: #F3F5F6; --line: #DDE3E6; --white: #fff; --r: 8px;
  --font: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-weight: 400; font-size: 15px; line-height: 1.55; color: var(--slate-900); background: var(--mist); }
a { color: var(--sea-700); }
h1, h2, h3 { font-weight: 600; margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--sea-500); outline-offset: 2px; }
.muted { color: var(--slate-500); }
.nowrap { white-space: nowrap; }
.empty { color: var(--slate-500); padding: 8px 0; }

/* Layout */
.adm { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.adm-side { background: var(--sea-900); color: var(--sea-50); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; font-weight: 600; color: var(--white); text-decoration: none; }
.adm-brand span { width: 34px; height: 34px; border-radius: 50%; background: var(--sea-500); display: grid; place-items: center; font-weight: 700; color: var(--white); }
.adm-side nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.adm-side a:not(.adm-brand) { color: var(--sea-100); text-decoration: none; padding: 9px 12px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.adm-side a:not(.adm-brand):hover { background: rgba(255,255,255,.07); color: var(--white); }
.adm-side a[aria-current="page"] { background: var(--sea-700); color: var(--white); font-weight: 500; }
.adm-side-foot { margin-top: auto; padding: 12px 10px 18px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 2px; }
.badge { background: #F2A541; color: var(--sea-900); font-size: .75rem; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.adm-main { min-width: 0; }
.adm-top { display: flex; align-items: center; gap: 16px; padding: 18px 28px; background: var(--white); border-bottom: 1px solid var(--line); }
.adm-top h1 { font-size: 1.3rem; flex: 1; }
.adm-user { font-weight: 500; }
.adm-user small { color: var(--slate-500); font-weight: 400; margin-left: 4px; }
.adm-menu { display: none; }
.adm-content { padding: 24px 28px 60px; max-width: 1200px; }

/* Panels */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.narrow-panel { max-width: 520px; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.quick form { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; text-decoration: none; color: var(--slate-900); }
.stat:hover { border-color: var(--sea-500); }
.stat b { display: block; font-size: 1.9rem; font-weight: 600; color: var(--sea-700); line-height: 1.1; }
.stat span { color: var(--slate-500); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 500; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); color: var(--slate-900); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--sea-500); color: var(--sea-800); }
.btn-primary { background: var(--sea-700); border-color: var(--sea-700); color: var(--white); }
.btn-primary:hover { background: var(--sea-800); color: var(--white); }
.btn-danger { color: #A1261E; }
.btn-danger:hover { background: #A1261E; color: var(--white); border-color: #A1261E; }
.btn-small { padding: 5px 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--slate-500); font-size: .85rem; }
tr.unread td { font-weight: 500; background: var(--sea-50); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }
td.thumb { width: 64px; }
td.thumb img { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--mist); color: var(--slate-700); }
.tag-ok { background: var(--sea-50); color: var(--sea-800); }
.tag-warn { background: #FFF1DC; color: #8A4B00; }

/* Forms */
.form { display: grid; gap: 14px; }
.form label, .panel label { display: grid; gap: 5px; font-weight: 500; font-size: .9rem; }
.opt { color: var(--slate-500); font-weight: 400; }
input, select, textarea { font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--slate-300); border-radius: 6px; background: var(--white); width: 100%; color: var(--slate-900); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea-500); box-shadow: 0 0 0 3px rgba(var(--sea-600-rgb),.2); }
input[type=checkbox] { width: auto; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check-inline { align-self: end; padding-bottom: 10px; }
.checks { display: flex; gap: 24px; flex-wrap: wrap; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.hint { color: var(--slate-500); font-size: .88rem; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.preview { display: flex; gap: 8px; flex-wrap: wrap; }
.preview img { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; }
.img-field { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: end; padding: 6px 0; }
.img-field img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.img-field label:not(.check) { grid-column: 2; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--mist) 30%); padding: 20px 0 10px; }

/* Flash */
.flash { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash-ok { background: var(--sea-50); color: var(--sea-900); border: 1px solid var(--sea-100); }
.flash-err { background: #FDECEA; color: #8C1D18; border: 1px solid #F5C6C2; }

/* Gallery admin */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: .85rem; }
.chips a[aria-current] { background: var(--sea-700); color: var(--white); border-color: var(--sea-700); }
.adm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.adm-photo { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.adm-photo-img { position: relative; display: block !important; cursor: pointer; }
.adm-photo-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.adm-photo-img input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: #A1261E; }
.adm-photo-img:has(input:checked) img { opacity: .5; }
.adm-photo-form { display: grid; gap: 6px; padding: 8px; }
.adm-photo-form input, .adm-photo-form select { padding: 6px 8px; font-size: .85rem; }

/* Inquiries */
.inq { border-bottom: 1px solid var(--line); padding: 16px 0; }
.inq:first-child { padding-top: 0; }
.inq.unread { border-left: 4px solid var(--sea-500); padding-left: 14px; }
.inq-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inq-head h3 { font-size: 1rem; }
.inq-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.inq-msg { background: var(--mist); border-radius: 6px; padding: 10px 12px; margin: 8px 0; }
.inq-msg p { margin: 0 0 6px; }
.inq .actions { justify-content: flex-start; }
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pager span { background: var(--sea-700); color: var(--white); border-color: var(--sea-700); }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, var(--sea-800), var(--sea-900)); padding: 20px; }
.login-card { background: var(--white); border-radius: 12px; padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.login-card .adm-brand { padding: 0; color: var(--slate-900); margin: 0 0 20px; }
.login-card h1 { font-size: 1.4rem; margin-bottom: 18px; }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 5px; font-weight: 500; font-size: .9rem; }
.login-back { display: block; text-align: center; margin-top: 18px; font-size: .9rem; }

/* Mobile */
@media (max-width: 860px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .adm-side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .adm-menu { display: inline-flex; font: inherit; font-weight: 500; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); cursor: pointer; }
  .adm-top { padding: 14px 16px; }
  .adm-user { display: none; }
  .adm-content { padding: 16px; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .img-field { grid-template-columns: auto 1fr; }
}

/* Slider + poster admin */
.hint { margin: 0 0 16px; }
.inline-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.inline-form label { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.inline-form input { width: 70px; }
.preview-wide img { width: 320px; height: 140px; }
.slide-list { display: grid; gap: 14px; }
.slide-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.slide-row img { width: 220px; height: 96px; object-fit: cover; border-radius: 6px; }
.slide-row p { margin: 4px 0 0; }
.slide-row.is-off img { opacity: .45; }
.poster-edit { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.poster-preview { border: 2px dashed var(--line); border-radius: var(--r); min-height: 300px; display: grid; place-items: center; background: var(--mist); overflow: hidden; }
.poster-preview img { width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.poster-preview span { color: var(--slate-500); }
.switch { font-weight: 600 !important; }
@media (max-width: 860px) {
  .slide-row, .poster-edit { grid-template-columns: 1fr; }
  .slide-row img { width: 100%; height: 140px; }
}

/* Theme picker */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.swatch { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px 5px 6px; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 1px; }
.swatch span { width: 24px; height: 24px; border-radius: 50%; }
.swatch:has(input:checked) { border-color: var(--slate-900); box-shadow: 0 0 0 2px var(--slate-900) inset; }
.swatch:has(input:focus-visible) { outline: 3px solid var(--sea-500); }
.theme-custom { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.theme-custom input[type=color] { width: 64px; height: 42px; padding: 3px; }
.theme-custom input[name=theme_color] { width: 130px; font-family: monospace; }
.palette { display: flex; margin-top: 14px; border-radius: 6px; overflow: hidden; max-width: 460px; }
.palette span { flex: 1; height: 30px; }
