* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #F4F7FB; color: #182337; font-size: 14px; line-height: 1.5; }
a { color: #2D76DF; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

.login { position: fixed; inset: 0; background: #0B1B2E; display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-card { background: #fff; border-radius: 16px; padding: 32px 30px 26px; width: 340px; display: flex; flex-direction: column; gap: 12px; }
.login-card p { margin: 0; color: #78869A; font-size: 13px; }
.login-card input { border: 1px solid #E7EDF5; border-radius: 9px; padding: 11px 12px; font-size: 15px; }
.login-card button { border: 0; border-radius: 9px; background: #2D76DF; color: #fff; font-size: 15px; font-weight: 700; padding: 12px; }
.login-err { color: #c0392b; font-size: 13px; }
.brand-big { font-size: 26px; font-weight: 800; color: #142A45; display: flex; align-items: center; gap: 8px; }
.gold { color: #E6BB79; }
.brand-mark { color: #E6BB79; font-size: 22px; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 225px; background: #0B1B2E; color: #c8d4e0; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; transition: width .2s; }
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .nav-heading, .sidebar.collapsed .nav-item span { display: none; }
.brand { display: flex; align-items: center; gap: 8px; padding: 20px 18px; font-size: 22px; font-weight: 800; color: #fff; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.08); }
.nav-scroll { flex: 1; overflow-y: auto; padding: 10px 10px; }
.nav-group { margin-bottom: 8px; }
.nav-heading { font-size: 11px; color: #7d93aa; padding: 10px 10px 4px; letter-spacing: .5px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: #c8d4e0; padding: 9px 10px; border-radius: 9px; font-size: 14px; text-align: left; }
.nav-item i { font-style: normal; width: 18px; text-align: center; font-size: 15px; color: #9fb2c7; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on { background: #2D76DF; color: #fff; }
.nav-item.on i { color: #fff; }
.sidebar-bottom { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 65px; background: #fff; border-bottom: 1px solid #E7EDF5; display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.icon-btn { border: 0; background: none; font-size: 20px; color: #78869A; width: 34px; height: 34px; border-radius: 9px; }
.icon-btn:hover { background: #F4F7FB; color: #182337; }
#menu_btn { display: none; }
.search-box { display: flex; align-items: center; gap: 8px; background: #F4F7FB; border: 1px solid #E7EDF5; border-radius: 9px; padding: 0 12px; width: 300px; height: 38px; color: #78869A; }
.search-box input { border: 0; background: none; flex: 1; font-size: 13px; outline: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.days-sel { border: 1px solid #E7EDF5; border-radius: 9px; padding: 7px 10px; font-size: 13px; background: #fff; color: #182337; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #142A45; color: #E6BB79; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.admin-name { font-size: 13px; }

.content { padding: 24px 28px 40px; }
.loading { color: #78869A; font-size: 13px; padding: 8px 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-heading h1 { margin: 0; font-size: 24px; font-weight: 700; }
.page-heading p { margin: 4px 0 0; color: #78869A; font-size: 13px; }
.btn { border: 1px solid #E7EDF5; background: #fff; border-radius: 9px; padding: 8px 14px; font-size: 13px; color: #182337; }
.btn.primary { background: #2D76DF; border-color: #2D76DF; color: #fff; font-weight: 600; }

.panel { background: #fff; border: 1px solid #E7EDF5; border-radius: 13px; box-shadow: 0 1px 2px rgba(20,42,69,.04); }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 14px; }
.metric { display: flex; gap: 12px; padding: 16px; align-items: center; }
.metric-icon { width: 46px; height: 46px; border-radius: 12px; background: #EAF2FD; color: #2D76DF; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.metric-icon.orange { background: #FDF3E4; color: #C68120; }
.metric-icon.green { background: #E6F6EE; color: #209764; }
.metric-icon.purple { background: #F0ECFB; color: #7B5FD6; }
.metric-label { font-size: 12px; color: #78869A; }
.metric-value { font-size: 23px; font-weight: 750; line-height: 1.2; margin: 2px 0; }
.metric-extra { font-size: 11px; color: #78869A; }
.metric-extra b { color: #209764; font-weight: 600; }

.charts { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.chart-panel { padding: 16px; min-width: 0; }
.panel-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.panel-title .subtle { font-size: 12px; color: #78869A; font-weight: 400; }
.legend { font-size: 12px; color: #78869A; font-weight: 400; display: flex; gap: 10px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.chart-wrap { position: relative; height: 230px; }
.pie-layout { display: flex; align-items: center; gap: 10px; }
.pie-layout .chart-wrap { width: 52%; height: 210px; }
.pie-legend { flex: 1; font-size: 12px; color: #182337; }
.pie-legend div { display: flex; align-items: center; margin-bottom: 7px; }
.pie-legend strong { margin-left: auto; }

.quick { padding: 16px; margin-bottom: 14px; }
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.quick-card { display: flex; align-items: center; gap: 10px; border: 1px solid #E7EDF5; border-radius: 11px; background: #fff; padding: 12px; text-align: left; }
.quick-card:hover { border-color: #2D76DF; }
.quick-icon { width: 40px; height: 40px; border-radius: 10px; background: #EAF2FD; color: #2D76DF; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.quick-card b { display: block; font-size: 14px; }
.quick-card small { display: block; font-size: 11px; color: #78869A; }

.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bottom-grid .panel { padding: 16px; min-width: 0; }
.text-link { border: 0; background: none; color: #2D76DF; font-size: 12px; }
.recent-works { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.recent-item { cursor: pointer; }
.artwork { aspect-ratio: 3 / 4; border-radius: 10px; background: #EAF2FD; overflow: hidden; margin-bottom: 6px; }
.artwork img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-item b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item small { color: #78869A; font-size: 11px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: #78869A; background: #F8FAFD; padding: 10px 10px; border-bottom: 1px solid #E7EDF5; white-space: nowrap; font-size: 12px; }
td { padding: 11px 10px; border-bottom: 1px solid #F0F3F8; vertical-align: middle; }
tr:hover td { background: #FAFCFF; }
td small { display: block; color: #78869A; font-size: 11px; }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status.success { background: #E6F6EE; color: #209764; }
.status.warning { background: #FDF3E4; color: #C68120; }
.status.muted { background: #EEF1F5; color: #78869A; }
.status.info { background: #EAF2FD; color: #2D76DF; }
.table-action { border: 1px solid #E7EDF5; background: #fff; border-radius: 7px; padding: 4px 10px; font-size: 12px; color: #2D76DF; }
.empty { padding: 30px; text-align: center; color: #78869A; font-size: 13px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.table-panel { padding: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .search-box { width: 300px; }
.toolbar select { border: 1px solid #E7EDF5; border-radius: 9px; padding: 8px 10px; font-size: 13px; background: #fff; }
.toolbar label { font-size: 12px; color: #78869A; display: flex; align-items: center; gap: 4px; }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.work-card { border: 1px solid #E7EDF5; border-radius: 11px; background: #fff; padding: 0; overflow: hidden; text-align: left; }
.work-card .artwork { border-radius: 0; margin: 0; }
.work-card-body { padding: 9px 10px 11px; }
.work-card-body b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-card-body p { margin: 4px 0 2px; font-size: 11px; color: #78869A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-card-body small { font-size: 11px; color: #78869A; }

.placeholder { padding: 48px 20px; text-align: center; color: #78869A; }
.placeholder h2 { margin: 10px 0 6px; color: #182337; font-size: 18px; }
.placeholder p { margin: 0 auto 16px; max-width: 460px; font-size: 13px; }

.overlay { position: fixed; inset: 0; background: rgba(11,27,46,.5); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #E7EDF5; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px 20px; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid #F0F3F8; font-size: 13px; }
.detail-row span { color: #78869A; flex-shrink: 0; }
.detail-row b { font-weight: 600; text-align: right; word-break: break-all; }
.modal-img { width: 100%; border-radius: 10px; margin-bottom: 12px; display: block; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #142A45; color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 13px; z-index: 60; }

@media (max-width: 1350px) { .metrics { grid-template-columns: repeat(3, 1fr); } .charts { grid-template-columns: 1fr 1fr; } .quick-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 850px) { .sidebar { position: fixed; left: -240px; z-index: 40; } .sidebar.mobile-open { left: 0; } #menu_btn { display: block; } .search-box { display: none; } .content { padding: 16px; } .metrics, .charts, .bottom-grid, .stats-row { grid-template-columns: 1fr; } .quick-grid { grid-template-columns: repeat(2, 1fr); } .recent-works { grid-template-columns: repeat(2, 1fr); } }
