:root {
    color-scheme: light;
    font-family: Inter, Arial, sans-serif;
    color: #24234a;
    background: #f5f6fb;
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f5f6fb; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { color: #28255f; font: 800 30px/1.2 Manrope, Inter, sans-serif; letter-spacing: -.7px; }
h2 { color: #312c78; font: 800 19px/1.3 Manrope, Inter, sans-serif; }

.admin-layout { min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; width: 252px; flex-direction: column; padding: 27px 18px 18px; background: #211e5b; color: #fff; }
.admin-brand { display: flex; align-items: center; gap: 11px; margin: 0 0 52px 7px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: #f46a05; color: #fff; font: 800 20px Manrope, sans-serif; }
.brand-name { font-size: 13px; font-weight: 800; letter-spacing: 1.1px; }
.brand-name small { display: block; margin-top: 3px; color: #b7b6d2; font-size: 9px; letter-spacing: 2px; }
.sidebar-label { padding: 0 12px; color: #9c9bb9; font-size: 9px; font-weight: 800; letter-spacing: 1.6px; }
.sidebar-nav { display: grid; gap: 5px; margin-top: 12px; }
.sidebar-link { display: flex; min-height: 45px; align-items: center; gap: 13px; padding: 0 12px; border-radius: 8px; color: #d3d2e6; font-size: 13px; font-weight: 600; text-decoration: none; transition: background .18s ease, color .18s ease; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: #373377; color: #fff; box-shadow: inset 3px 0 #f46a05; }
.nav-icon { display: inline-grid; width: 20px; place-items: center; color: #b8b7d4; font-size: 19px; line-height: 1; }
.sidebar-link.active .nav-icon { color: #ff9a4f; }
.nav-count { display: grid; min-width: 22px; height: 22px; place-items: center; margin-left: auto; border-radius: 7px; background: rgba(255,255,255,.1); color: #e8e7f2; font-size: 10px; }
.account-label { margin-top: 35px; }
.sidebar-bottom { margin-top: auto; }
.public-link { display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 0 10px; border-bottom: 1px solid rgba(255,255,255,.13); color: #d3d2e6; font-size: 12px; text-decoration: none; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 18px 2px 0; }
.user-avatar { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 50%; background: #f4e3d6; color: #7a3a12; font-size: 14px; font-weight: 800; }
.user-details { display: grid; min-width: 0; gap: 4px; }
.user-details strong { overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; }
.user-details small { color: #aaa9c4; font-size: 10px; }
.sidebar-user form { margin-left: auto; }
.logout-button { width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: #bbb9d4; cursor: pointer; font-size: 20px; }
.logout-button:hover { background: rgba(255,255,255,.1); color: #fff; }

.admin-main { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; height: 68px; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid #e8e9f1; background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
.breadcrumb { color: #77788d; font-size: 12px; }
.breadcrumb span { padding: 0 9px; color: #c1c2d0; }
.topbar-date { color: #77788d; font-size: 12px; }
.page-content { width: min(1200px, 100%); margin: 0 auto; padding: 34px 42px 60px; }
.eyebrow, .item-category { color: #f46a05; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 24px; }
.page-heading h1 { margin: 7px 0; }
.page-heading p { margin: 0; color: #77788d; font-size: 13px; line-height: 1.6; }
.welcome-banner { position: relative; display: flex; min-height: 220px; align-items: center; justify-content: space-between; overflow: hidden; padding: 34px 42px; border-radius: 15px; background: linear-gradient(115deg, #302b79, #4a43a2); color: #fff; box-shadow: 0 12px 25px rgba(49,44,120,.16); }
.welcome-banner .eyebrow { color: #ffb479; }
.welcome-banner h1 { margin: 12px 0 9px; color: #fff; font-size: 29px; }
.welcome-banner p { max-width: 520px; margin-bottom: 22px; color: #dfdef1; font-size: 13px; line-height: 1.65; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; border: 0; border-radius: 7px; cursor: pointer; font: 700 12px Inter, Arial, sans-serif; text-decoration: none; white-space: nowrap; transition: transform .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: #312c78; color: #fff; }
.button-primary:hover { background: #25215f; }
.button-secondary { border: 1px solid #dedff0; background: #fff; color: #312c78; }
.button-danger { background: #fff0ed; color: #a83122; }
.button-light { background: #fff; color: #312c78; }
.welcome-art { position: relative; display: grid; width: 185px; height: 150px; flex: 0 0 185px; place-items: center; margin-right: 35px; border: 1px solid rgba(255,255,255,.14); border-radius: 25px; background: rgba(255,255,255,.08); transform: rotate(-7deg); }
.art-frame { display: grid; width: 105px; height: 85px; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 13px; color: #ffb479; font-size: 58px; }
.art-spark { position: absolute; top: 8px; right: 12px; color: #ffb479; font-size: 28px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.stat-card, .panel { border: 1px solid #e8e9f2; border-radius: 12px; background: #fff; box-shadow: 0 6px 22px rgba(34,32,90,.035); }
.stat-card { display: flex; min-height: 115px; align-items: flex-start; gap: 15px; padding: 20px; }
.stat-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; font-size: 18px; }
.stat-icon.purple { background: #efedff; color: #514ca0; }
.stat-icon.orange { background: #fff2e8; color: #ed6a0a; }
.stat-icon.blue { background: #eaf5ff; color: #3483bf; }
.stat-card > div { display: grid; gap: 5px; }
.stat-label { color: #77788d; font-size: 11px; font-weight: 600; }
.stat-card strong { color: #28255f; font: 800 25px Manrope, Inter, sans-serif; }
.stat-card small { color: #9b9cad; font-size: 10px; }
.panel { padding: 24px; }
.recent-panel { min-height: 245px; }
.section-heading, .items-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .items-heading h2 { margin: 0 0 5px; }
.section-heading p { margin: 0; color: #8a8b9d; font-size: 11px; }
.text-link { color: #514ca0; font-size: 11px; font-weight: 700; text-decoration: none; }
.text-link:hover { color: #f46a05; }
.text-link span { padding-left: 4px; font-size: 15px; }
.recent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.recent-card { min-width: 0; overflow: hidden; border: 1px solid #ededf3; border-radius: 9px; }
.recent-thumb { position: relative; display: block; height: 125px; overflow: hidden; background: #eeeef5; }
.recent-thumb img, .recent-thumb video { width: 100%; height: 100%; object-fit: cover; }
.play-badge { position: absolute; top: 50%; left: 50%; display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: rgba(33,30,91,.83); color: #fff; font-size: 11px; transform: translate(-50%, -50%); }
.recent-copy { padding: 12px; }
.recent-copy .item-category { font-size: 8px; letter-spacing: 1px; }
.recent-copy h3 { overflow: hidden; margin: 6px 0 5px; color: #302d67; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.recent-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: #85869a; font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.empty-state { display: grid; justify-items: center; padding: 32px 15px; color: #77788d; text-align: center; }
.empty-icon { display: grid; width: 47px; height: 47px; place-items: center; margin-bottom: 13px; border-radius: 13px; background: #f1f0fc; color: #514ca0; font-size: 24px; }
.empty-state strong { color: #33315f; font-size: 13px; }
.empty-state p { margin: 7px 0 15px; font-size: 11px; }
.items-panel { padding-top: 21px; }
.items-heading { margin-bottom: 8px; }
.items-heading span { color: #85869a; font-size: 11px; }
.item-list { display: grid; }
.item-row { display: flex; min-width: 0; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid #eeeef4; }
.item-preview { width: 92px; height: 72px; flex: 0 0 92px; overflow: hidden; border-radius: 7px; background: #f0f0f6; }
.item-preview img, .item-preview video { width: 100%; height: 100%; object-fit: cover; }
.item-copy { min-width: 0; flex: 1; }
.item-copy h3 { overflow: hidden; margin: 5px 0; color: #302d67; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.item-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: #77788d; font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item-category { font-size: 8px; letter-spacing: 1px; }
.item-actions { display: flex; align-items: center; gap: 7px; }
.item-actions form { margin: 0; }
.form-panel { width: min(760px, 100%); }
.form-panel h2 { margin-bottom: 22px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(230px, .7fr); gap: 18px; align-items: start; }
.settings-grid .panel { padding: 26px; }
.settings-grid h2 { margin-bottom: 8px; }
.panel-intro { margin-bottom: 20px; color: #85869a; font-size: 12px; line-height: 1.6; }
.account-card { display: grid; justify-items: start; gap: 10px; }
.account-card .large { width: 54px; height: 54px; margin-bottom: 8px; font-size: 21px; }
.account-card h2 { margin: 0; }
.account-card p { margin: 0; color: #85869a; font-size: 12px; }
.account-divider { width: 100%; margin: 10px 0 2px; border-top: 1px solid #eeeef4; }
.admin-form { display: grid; gap: 10px; }
.admin-form label { margin-top: 8px; color: #38385c; font-size: 12px; font-weight: 700; }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; padding: 11px 12px; border: 1px solid #dfe1ed; border-radius: 7px; background: #fff; color: #292845; font: 13px Inter, Arial, sans-serif; }
.admin-form input[type="file"] { padding: 9px; }
.admin-form textarea { resize: vertical; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { outline: 2px solid rgba(81,76,160,.18); border-color: #514ca0; }
.form-actions { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.form-hint, .login-hint { margin: 4px 0 0; color: #85869a; font-size: 11px; line-height: 1.6; }
.notice { margin: 0 0 18px; padding: 12px 15px; border-radius: 7px; font-size: 12px; line-height: 1.5; }
.notice-error { background: #fff0ed; color: #982c20; }
.notice-success { background: #eaf8ef; color: #23613a; }

.login-shell { width: min(500px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 25px 0; }
.login-header { display: flex; align-items: center; justify-content: space-between; }
.login-header .admin-brand { margin: 0; color: #312c78; }
.login-header .brand-name small { color: #77788d; }
.back-link { color: #514ca0; font-size: 12px; font-weight: 700; text-decoration: none; }
.login-panel { margin: 100px auto 0; padding: 34px; border: 1px solid #e8e9f2; border-radius: 14px; background: #fff; box-shadow: 0 12px 35px rgba(34,32,90,.07); }
.login-panel h1 { margin: 9px 0; }
.login-panel > p { color: #77788d; font-size: 13px; line-height: 1.6; }
.login-panel .login-hint { margin-top: 18px; font-size: 10px; }
.login-panel .button { margin-top: 9px; }

@media (max-width: 1050px) {
    .page-content { padding-right: 26px; padding-left: 26px; }
    .topbar { padding-right: 26px; padding-left: 26px; }
    .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .admin-sidebar { position: relative; width: 100%; min-height: auto; padding: 14px 16px; }
    .admin-sidebar .admin-brand { margin: 0 0 13px; }
    .sidebar-label, .sidebar-bottom { display: none; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 0; }
    .sidebar-link { min-height: 38px; gap: 7px; padding: 0 10px; font-size: 11px; }
    .nav-icon { width: 16px; font-size: 16px; }
    .nav-count { min-width: 18px; height: 18px; }
    .account-label + .sidebar-nav { margin-top: 5px; }
    .admin-main { margin-left: 0; }
    .topbar { position: static; height: 54px; }
    .page-content { padding: 24px 18px 40px; }
    .welcome-banner { min-height: 185px; padding: 26px; }
    .welcome-banner h1 { font-size: 24px; }
    .welcome-art { width: 120px; height: 110px; flex-basis: 120px; margin-right: 8px; }
    .art-frame { width: 75px; height: 65px; font-size: 40px; }
    .stats-grid { gap: 9px; }
    .stat-card { gap: 10px; padding: 14px 10px; }
    .stat-icon { width: 31px; height: 31px; flex-basis: 31px; }
    .stat-label { font-size: 9px; }
    .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .topbar { padding: 0 16px; }
    .topbar-date { font-size: 10px; }
    .breadcrumb { font-size: 10px; }
    .welcome-art { display: none; }
    .welcome-banner { min-height: auto; padding: 24px; }
    .welcome-banner h1 { font-size: 22px; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 83px; align-items: center; padding: 12px; }
    .stat-card strong { font-size: 21px; }
    .recent-grid { grid-template-columns: 1fr; }
    .recent-thumb { height: 175px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading h1 { font-size: 26px; }
    .panel { padding: 18px; }
    .item-row { flex-wrap: wrap; gap: 10px; }
    .item-preview { width: 68px; height: 58px; flex-basis: 68px; }
    .item-copy { flex-basis: calc(100% - 80px); }
    .item-actions { width: 100%; margin-left: 78px; }
    .login-panel { margin-top: 68px; padding: 25px; }
}
