.admin-page { display: grid; gap: 20px; max-width: 1180px; margin: 0 auto; }
.admin-heading { padding: 8px 0; align-items: center; }
.admin-heading h1 { margin: 0 0 6px; }
.admin-badge { background: #ecfdf5; color: #166534; border-color: #86efac; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 5px; width: 100%; box-sizing: border-box; padding: 6px; background: #fff; border: 1px solid var(--anki-line); box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.admin-tabs a { flex: 0 0 auto; padding: 10px 17px; color: #526176; }
.admin-tabs a.active { background: #2563eb; color: #fff; }
.admin-metrics { gap: 14px; }
.metric { min-height: 120px; box-sizing: border-box; padding: 20px; }
.metric span { color: var(--anki-muted); }
.metric strong { color: var(--anki-ink); }
.admin-panel { border-radius: 9px; background: #fff; border: 1px solid var(--anki-line); box-shadow: 0 3px 12px rgba(15,23,42,.05); }
.panel-title { min-height: 58px; box-sizing: border-box; padding: 16px 20px; border-color: var(--anki-line); }
.panel-title h2 { color: var(--anki-ink); }
.table-wrap { width: 100%; }
.table-wrap table { min-width: 760px; }
.table-wrap th { padding: 12px 16px; background: #f7f9fc; color: #526176; border-color: #e3e9f1; }
.table-wrap td { padding: 14px 16px; color: var(--anki-ink); border-color: #e3e9f1; vertical-align: middle; }
.table-wrap tbody tr:hover { background: #f8fafc; }
.inline-form button { min-height: 32px; margin: 2px 4px 2px 0; padding: 0 10px; }
.admin-user-filter { gap: 10px; padding: 15px 18px; background: #fff; border-color: var(--anki-line); box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.admin-user-filter input, .admin-user-filter select, .admin-user-filter button, .admin-user-filter .button-link { min-height: 42px; box-sizing: border-box; margin: 0; }
.admin-user-filter .button-link { display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; }
.daily-limit-panel .admin-user-filter { border: 0; border-radius: 0; box-shadow: none; }
.admin-pagination { align-items: center; min-height: 58px; box-sizing: border-box; padding: 12px 18px; }
.admin-pagination a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border: 1px solid var(--anki-line); border-radius: 6px; background: #fff; color: #2563eb; }
.share-admin-list { padding: 8px 20px; }
.share-admin-row { min-height: 54px; padding: 13px 0; border-color: var(--anki-line); }
.sponsor-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sponsor-admin-form { display: grid; gap: 14px; padding: 22px; }
.sponsor-admin-form label { gap: 7px; color: var(--anki-ink); font-weight: 600; }
.sponsor-admin-form input, .sponsor-admin-form textarea { width: 100%; box-sizing: border-box; margin: 0; }
.sponsor-admin-form button { min-height: 44px; margin: 0; }
.account-content-panel { max-width:820px; }
.account-content-form { display:grid; gap:16px; padding:22px; }
.account-content-form label { display:grid; gap:7px; color:var(--anki-ink); font-weight:600; }
.account-content-form input,.account-content-form textarea { width:100%; box-sizing:border-box; margin:0; }
.account-content-form textarea { min-height:82px; resize:vertical; line-height:1.6; }
.account-content-form small { color:var(--anki-muted); font-weight:400; }
.account-content-form button { justify-self:start; min-width:150px; min-height:44px; margin:0; }
.admin-qr-preview { display:block; width:132px; height:132px; object-fit:contain; padding:6px; border:1px solid var(--anki-line); border-radius:6px; background:#fff; }
.admin-log-table td:nth-child(1), .admin-log-table td:nth-child(6) { color: var(--anki-muted); font-size: 12px; }
.admin-log-table td:nth-child(5) { min-width: 220px; white-space: normal; line-height: 1.5; }
.log-action { display: inline-flex; padding: 5px 8px; border-radius: 5px; background: #eaf2ff; color: #1d4ed8; font-size: 12px; font-weight: 700; }
.empty-table { padding: 36px !important; text-align: center !important; color: var(--anki-muted) !important; }
.announcement-admin-panel { max-width: 760px; }
.announcement-admin-form { display: grid; gap: 18px; padding: 22px; }
.announcement-admin-form label { gap: 8px; color: var(--anki-ink); font-weight: 600; }
.announcement-admin-form input:not([type="checkbox"]), .announcement-admin-form textarea { width: 100%; box-sizing: border-box; margin: 0; }
.announcement-admin-form textarea { min-height: 150px; resize: vertical; line-height: 1.65; }
.announcement-admin-form label > small { color: var(--anki-muted); font-weight: 400; text-align: right; }
.announcement-switch { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px !important; width: fit-content; cursor: pointer; }
.announcement-switch input { width: 18px; height: 18px; margin: 0; accent-color: #2563eb; }
.announcement-form-actions { display: flex; align-items: center; gap: 14px; padding-top: 2px; }
.announcement-form-actions button { min-width: 112px; min-height: 44px; margin: 0; }
.announcement-form-actions span { color: var(--anki-muted); font-size: 12px; }
.announcement-history-panel { overflow: hidden; }
.announcement-history-list { display: grid; padding: 0 20px; }
.announcement-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 18px 0; border-top: 1px solid var(--anki-line); }
.announcement-history-item:first-child { border-top: 0; }
.announcement-history-meta { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.announcement-history-meta strong { color: var(--anki-ink); }
.announcement-state { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border: 1px solid var(--anki-line); border-radius: 5px; color: var(--anki-muted); font-size: 11px; font-weight: 700; }
.announcement-state.is-live { border-color: #86efac; background: #f0fdf4; color: #166534; }
.announcement-history-copy p { display: -webkit-box; margin: 7px 0; overflow: hidden; color: var(--anki-muted); line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.announcement-history-copy small { color: var(--anki-muted); }
.announcement-history-actions { display: flex; gap: 8px; align-items: center; }
.announcement-history-actions form { margin: 0; }
.announcement-history-actions a, .announcement-history-actions button { display: inline-flex; align-items: center; justify-content: center; min-width: 62px; min-height: 38px; box-sizing: border-box; margin: 0; padding: 0 12px; }
.announcement-history-empty { margin: 0; padding: 28px 0; color: var(--anki-muted); text-align: center; }
html[data-theme="night"] .announcement-state.is-live { border-color: #22c55e; background: #14532d; color: #bbf7d0; }
.admin-login { max-width: 430px; margin: 8vh auto 0; padding: 30px; }
.admin-login h1 { margin: 0 0 6px; }
.admin-login form { gap: 15px; margin-top: 22px; }
.admin-login label { gap: 7px; color: var(--anki-ink); font-weight: 600; }
.admin-login input { width: 100%; box-sizing: border-box; margin: 0; }
.admin-login button { min-height: 44px; margin: 4px 0 0; }
html[data-theme="night"] .admin-tabs, html[data-theme="night"] .admin-panel, html[data-theme="night"] .admin-user-filter { background: #172033; }
html[data-theme="night"] .admin-badge { background: #14532d; color: #bbf7d0; border-color: #22c55e; }
html[data-theme="night"] .table-wrap th { background: #1e293b; color: #a8b4c5; border-color: #334155; }
html[data-theme="night"] .table-wrap td, html[data-theme="night"] .share-admin-row { border-color: #334155; }
html[data-theme="night"] .table-wrap tbody tr:hover { background: #1e293b; }
html[data-theme="night"] .admin-pagination a { background: #1e293b; color: #93c5fd; }
html[data-theme="night"] .log-action { background: #1e3a8a; color: #bfdbfe; }
@media (max-width: 800px) { .sponsor-admin-grid { grid-template-columns: 1fr; } .admin-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .admin-heading { align-items: flex-start; } .admin-tabs a { flex: 1 1 calc(50% - 5px); text-align: center; } .admin-metrics { grid-template-columns: 1fr 1fr; } .metric { min-height: 105px; padding: 16px; } .admin-user-filter { flex-direction: column; } }
@media (max-width: 560px) { .announcement-admin-form { padding: 18px; } .announcement-form-actions { align-items: stretch; flex-direction: column; } .announcement-form-actions button { width: 100%; } .announcement-history-list { padding: 0 16px; } .announcement-history-item { grid-template-columns: 1fr; gap: 12px; } .announcement-history-actions a, .announcement-history-actions form, .announcement-history-actions button { flex: 1; width: 100%; } }
