:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1d2735;
  background: #f4f6fa;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
.admin-topbar {
  padding: 22px clamp(18px, 4vw, 60px);
  background: #172033;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.admin-topbar h1 { margin: 0 0 5px; font-size: clamp(1.45rem, 3vw, 2rem); }
.admin-topbar p { margin: 0; color: #cbd3e1; }
.top-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.admin-shell { width: min(1320px, calc(100% - 28px)); margin: 24px auto 60px; }
.btn {
  border: 1px solid #c9d2df;
  border-radius: 9px;
  padding: 9px 12px;
  background: #f2f5f9;
  color: #26364d;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}
.btn:hover { background: #e8edf4; }
.btn.primary { background: #172033; border-color: #172033; color: white; }
.btn.ghost { background: rgba(255,255,255,.1); color: white; border-color: rgba(255,255,255,.28); }
.btn.danger { background: #fff2f2; color: #a12626; border-color: #ddb0b0; }
.btn.small { padding: 7px 9px; font-size: .82rem; }
.btn:disabled { opacity: .6; cursor: wait; }
.login-card {
  width: min(460px, 100%);
  margin: 50px auto;
  background: white;
  border: 1px solid #dfe5ee;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 15px 40px rgba(22,33,52,.09);
}
.login-card h2 { margin: 0 0 5px; }
.login-card p { color: #68778b; line-height: 1.45; }
.login-card label { display: grid; gap: 6px; margin: 14px 0; font-weight: 700; }
.login-card input, .dashboard-tools input {
  border: 1px solid #c7d1de;
  border-radius: 9px;
  padding: 10px 11px;
  outline: none;
  background: white;
}
.login-card input:focus, .dashboard-tools input:focus { border-color: #526d94; box-shadow: 0 0 0 3px rgba(82,109,148,.12); }
.message { min-height: 22px; margin: 8px 0; color: #a12626; }
.dashboard-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.dashboard-bar h2 { margin: 0 0 4px; }
.dashboard-tools { display: flex; gap: 9px; min-width: min(460px, 48vw); }
.dashboard-tools input { min-width: 0; flex: 1; }
.muted { color: #66768a; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats-grid article { background: white; border: 1px solid #dfe5ee; border-radius: 13px; padding: 17px; display: grid; gap: 4px; }
.stats-grid strong { font-size: 1.45rem; }
.stats-grid span { color: #6d7b8d; font-size: .87rem; }
.panel { background: white; border: 1px solid #dfe5ee; border-radius: 15px; margin: 16px 0; overflow: hidden; }
.panel-heading { padding: 16px 18px; border-bottom: 1px solid #e5eaf1; }
.panel-heading h3 { margin: 0 0 4px; }
.panel-heading p { margin: 0; color: #6a788b; font-size: .9rem; }
.danger-panel { border-color: #e7c8c8; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
th { background: #f8fafc; color: #526176; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
td { font-size: .9rem; }
.file-name { font-weight: 750; overflow-wrap: anywhere; }
.subtext { color: #758397; font-size: .78rem; margin-top: 3px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-row { text-align: center; color: #748296; padding: 25px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 7px; font-size: .74rem; font-weight: 800; background: #edf2f8; color: #3f536f; }
@media (max-width: 780px) {
  .admin-topbar, .dashboard-bar { align-items: stretch; flex-direction: column; }
  .top-actions { width: 100%; }
  .top-actions .btn { flex: 1; text-align: center; }
  .dashboard-tools { min-width: 0; width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .dashboard-tools { flex-direction: column; }
}


.admin-dialog {
  width: min(470px, calc(100% - 28px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  color: #1d2735;
  box-shadow: 0 24px 70px rgba(16, 27, 45, .28);
}
.admin-dialog::backdrop { background: rgba(14, 21, 33, .58); }
.admin-dialog form { padding: 22px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.dialog-heading h3 { margin: 0 0 4px; font-size: 1.2rem; }
.dialog-heading p { margin: 0; }
.dialog-close { border: 0; background: transparent; font-size: 1.65rem; line-height: 1; cursor: pointer; color: #607086; padding: 0 3px; }
.admin-dialog label { display: grid; gap: 6px; margin: 13px 0; font-weight: 750; }
.admin-dialog input { border: 1px solid #c7d1de; border-radius: 9px; padding: 10px 11px; outline: none; }
.admin-dialog input:focus { border-color: #526d94; box-shadow: 0 0 0 3px rgba(82,109,148,.12); }
.dialog-note { color: #68778b; font-size: .87rem; line-height: 1.45; margin: 12px 0 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.support-panel { border-color: #f0c99d; }
.support-panel-heading { background: linear-gradient(135deg, #fffaf4, #fff5e8); }
.support-panel-heading h3 { color: #8f3516; }
.supporters-admin-table { min-width: 720px; }
.support-amount { color: #128536; font-weight: 850; white-space: nowrap; }
.support-order { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; overflow-wrap: anywhere; }


/* Keep long admin datasets compact and independently scrollable. */
.admin-scroll-table {
  max-height: 360px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.admin-scroll-table table {
  margin: 0;
}
.admin-scroll-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: 0 1px 0 #e5eaf1;
}
@media (max-width: 780px) {
  .admin-scroll-table { max-height: 320px; }
}
@media (max-width: 480px) {
  .admin-scroll-table { max-height: 280px; }
}

/* Administrator announcement composer */
.admin-message-panel { border-color: #c9d7ee; }
.admin-message-heading { background: linear-gradient(135deg, #f7faff, #eef4ff); }
.admin-message-compose { padding: 16px 18px; display: grid; gap: 12px; }
.admin-message-compose label { display: grid; gap: 6px; font-weight: 750; color: #2b3850; }
.admin-message-compose input,
.admin-message-compose textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c7d1de;
  border-radius: 10px;
  padding: 10px 11px;
  color: #1d2735;
  background: #fff;
  font: inherit;
  outline: none;
}
.admin-message-compose textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.admin-message-compose input:focus,
.admin-message-compose textarea:focus { border-color: #526d94; box-shadow: 0 0 0 3px rgba(82,109,148,.12); }
.admin-message-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-message-actions .message { flex: 1 1 260px; min-height: 1.2em; }
.admin-message-history { border-top: 1px solid #e5eaf1; padding: 14px 18px 18px; }
.admin-message-history-title { font-weight: 850; margin-bottom: 9px; color: #32415a; }
.admin-message-history-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.admin-message-history-item { position: relative; border: 1px solid #e0e6ef; border-radius: 11px; padding: 11px 12px; background: #fafbfd; }
.admin-message-history-item.active { border-color: #9db9e3; background: #f4f8ff; }
.admin-message-history-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.badge.active-message { background: #dfeaff; color: #24508a; }
.admin-message-history-body { margin-top: 7px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-message-history-meta { margin-top: 7px; color: #758397; font-size: .78rem; }
.admin-message-stop { margin-top: 9px; }
.admin-message-empty { color: #748296; padding: 10px 2px; }

.admin-message-history-item.revoked { border-color: #e2caca; background: #fff8f8; opacity: .92; }
.badge.revoked-message { background: #fde7e7; color: #9b2626; }
/* Consolidated administrator content manager. */
.admin-content-panel { border-color: #b9d0e8; }
.admin-content-heading { background: linear-gradient(135deg, #f8fbff, #edf6ff); }
.admin-content-heading h3 { color: #244f7d; }
.admin-content-scroll { max-height: 430px; }
.admin-content-table { min-width: 1120px; }
.free-content-badge { background: #e5f6ec; color: #1d6a42; }
.paid-content-badge { background: #fff0d5; color: #8a5710; }
.content-access-dialog { width: min(720px, calc(100% - 24px)); }
.content-access-shell { padding: 22px; }
.content-access-list {
  margin-top: 14px;
  max-height: 420px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid #e0e6ef;
  border-radius: 12px;
  background: #fafbfd;
}
.content-access-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border-bottom: 1px solid #e7ebf1;
}
.content-access-item:last-child { border-bottom: 0; }
.content-access-info { display: grid; gap: 4px; min-width: 0; }
.content-access-info strong { overflow-wrap: anywhere; }
.content-access-info span { color: #6e7c8f; font-size: .8rem; overflow-wrap: anywhere; }
.content-access-empty { padding: 24px; text-align: center; color: #748296; }
@media (max-width: 780px) {
  .admin-content-scroll { max-height: 360px; }
  .content-access-list { max-height: 340px; }
  .content-access-item { align-items: stretch; flex-direction: column; }
  .content-access-item .btn { width: 100%; }
}
/* Global document stars, controlled only from the administrator dashboard. */
.admin-important-badge { display: inline-block; margin-top: 6px; padding: 3px 7px; background: #fff0bc; color: #63440a; border-radius: 7px; font-size: .76rem; font-weight: 800; }
.btn.admin-important-action { border-color: #dbc57f; background: #fff9e7; color: #68490e; }
.btn.admin-important-action.is-marked { background: #ffebad; color: #5b4005; }
