:root {
  color-scheme: light;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #17212b;
  background: #f4f6f8;
  font-synthesis: none;
  letter-spacing: 0;
  --blue: #229ed9;
  --blue-dark: #1686bd;
  --blue-soft: #e9f6fc;
  --ink: #17212b;
  --muted: #6e7d8d;
  --line: #dfe5ea;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --sidebar: #17212b;
  --green: #2d9c6b;
  --green-soft: #eaf7f0;
  --red: #cf4d55;
  --red-soft: #fbeef0;
  --amber: #b7791f;
  --amber-soft: #fff6df;
  --violet: #7367a8;
  --violet-soft: #f1eff8;
  --shadow: 0 18px 55px rgba(23, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f6f8;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
  height: 20px;
  width: 20px;
  stroke-width: 2;
}

.brand-mark svg {
  fill: #ffffff;
  stroke: none;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 9px;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary {
  background: var(--blue);
  color: #ffffff;
}

.button-primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button-quiet {
  background: #ffffff;
  border-color: var(--line);
  color: #43515f;
}

.button-quiet:hover:not(:disabled) {
  background: #f5f7f8;
  border-color: #cbd4dc;
}

.button-danger {
  background: var(--red);
  color: #ffffff;
}

.button-danger:hover:not(:disabled) {
  background: #b83e47;
}

.button-large {
  min-height: 50px;
  width: 100%;
}

.button-full {
  margin-top: 10px;
  width: 100%;
}

.icon-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 38px;
  height: 38px;
  justify-content: center;
  padding: 0;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
  width: 38px;
}

.icon-button:hover {
  background: var(--blue-soft);
  border-color: #bcdff0;
  color: var(--blue-dark);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.icon-button svg {
  height: 18px;
  width: 18px;
}

.icon-button-dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: #b8c6d1;
}

.icon-button-dark:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.section-kicker {
  color: var(--blue-dark);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 7px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span:first-child {
  color: #475563;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.number-field,
.search-box {
  background: #ffffff;
  border: 1px solid #cfd8df;
  border-radius: 7px;
  min-height: 44px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input {
  min-width: 0;
  outline: 0;
  padding: 0 13px;
  width: 100%;
}

.field input:focus,
.number-field:focus-within,
.search-box:focus-within,
.input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(34, 158, 217, 0.12);
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-error {
  color: var(--red);
  font-size: 13px;
  line-height: 1.4;
  margin: -5px 0 0;
  min-height: 18px;
}

.login-consent {
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #53616d;
  font-size: 11px;
  line-height: 1.65;
  padding: 12px;
}

.login-consent strong {
  color: #30404c;
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.login-consent ol {
  margin: 0 0 12px 18px;
  padding: 0;
}

.login-consent .choice-row {
  background: #ffffff;
  min-height: 54px;
}

/* Login */
.login-page {
  background: #ffffff;
  display: grid;
  grid-template-columns: minmax(420px, 48%) 1fr;
  min-height: 100vh;
}

.login-visual {
  background: #229ed9;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.visual-grid {
  border: 1px solid rgba(255, 255, 255, 0.08);
  inset: 11%;
  opacity: 0.8;
  position: absolute;
}

.brand-lockup {
  color: #ffffff;
  left: 12%;
  position: absolute;
  top: 14%;
  z-index: 2;
}

.brand-mark {
  align-items: center;
  background: var(--blue);
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 42px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand-mark-large {
  background: #ffffff;
  box-shadow: 0 16px 35px rgba(11, 84, 119, 0.22);
  height: 74px;
  width: 74px;
}

.brand-mark-large svg {
  fill: var(--blue);
  height: 39px;
  width: 39px;
}

.brand-lockup p {
  font-size: 34px;
  font-weight: 800;
  margin: 18px 0 3px;
}

.brand-lockup > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.visual-file {
  align-items: center;
  animation: file-float 5s ease-in-out infinite;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 20px 45px rgba(9, 69, 99, 0.2);
  display: flex;
  gap: 12px;
  min-width: 210px;
  padding: 14px;
  position: absolute;
}

.visual-file span {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 6px;
  color: var(--blue-dark);
  display: flex;
  font-size: 11px;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.visual-file b {
  font-size: 13px;
}

.visual-file-one {
  left: 15%;
  top: 50%;
}

.visual-file-two {
  animation-delay: -1.4s;
  right: 10%;
  top: 63%;
}

.visual-file-three {
  animation-delay: -2.8s;
  left: 25%;
  top: 77%;
}

@keyframes file-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.login-main {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 44px;
}

.login-box {
  max-width: 390px;
  width: 100%;
}

.brand-mobile {
  align-items: center;
  display: none;
  font-size: 18px;
  font-weight: 800;
  gap: 10px;
  text-decoration: none;
}

.login-heading {
  margin-bottom: 31px;
}

.login-heading h1 {
  color: var(--ink);
  font-size: 30px;
  line-height: 1.25;
  margin: 0;
}

.login-heading p {
  color: var(--muted);
  font-size: 14px;
  margin: 9px 0 0;
}

.input-wrap {
  align-items: center;
  background: #ffffff;
  border: 1px solid #cfd8df;
  border-radius: 7px;
  display: flex;
  min-height: 48px;
  padding-left: 13px;
}

.input-wrap > svg,
.input-wrap > i + svg {
  color: #8a98a5;
  flex: 0 0 auto;
}

.input-wrap input {
  border: 0;
  box-shadow: none;
  min-height: 46px;
  padding-left: 11px;
}

.input-wrap input:focus {
  box-shadow: none;
}

.input-icon {
  align-items: center;
  align-self: stretch;
  background: transparent;
  border: 0;
  color: #7b8996;
  cursor: pointer;
  display: flex;
  justify-content: center;
  width: 46px;
}

.portal-switch {
  font-size: 13px;
  margin: 25px 0 0;
  text-align: center;
}

.portal-switch a {
  color: var(--blue-dark);
  font-weight: 700;
  text-decoration: none;
}

/* Shared application shell */
.app-page {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: var(--sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 30;
}

.sidebar-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-height: 82px;
  padding: 0 20px;
}

.sidebar-brand > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-brand b {
  font-size: 17px;
  max-width: 155px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand small {
  color: #8293a1;
  font-size: 11px;
}

.side-nav {
  display: grid;
  gap: 5px;
  padding: 14px 12px;
}

.side-nav a,
.side-nav button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #9fb0bd;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 650;
  gap: 12px;
  min-height: 44px;
  padding: 0 13px;
  text-align: left;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
  width: 100%;
}

.side-nav a:hover,
.side-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.side-nav a.active,
.side-nav button.active {
  background: var(--blue);
  color: #ffffff;
}

.side-nav svg {
  flex: 0 0 auto;
  height: 19px;
  width: 19px;
}

.sidebar-account {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  margin-top: auto;
  min-height: 78px;
  padding: 13px 14px;
}

.avatar {
  align-items: center;
  background: #43b581;
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 40px;
  font-size: 14px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  text-transform: uppercase;
  width: 40px;
}

.avatar-admin {
  background: #7367a8;
}

.account-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-copy b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  color: #8394a1;
  font-size: 11px;
}

.sidebar-account .icon-button {
  margin-left: auto;
}

.workspace {
  background: #f4f6f8;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 15px;
  min-width: 0;
  padding: 0 28px;
  position: relative;
  z-index: 10;
}

.topbar > div:nth-child(2),
.topbar > div:first-child:not(.topbar-actions) {
  min-width: 0;
}

.topbar h1 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
}

.topbar p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.limit-pill,
.status-live {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #5d6b78;
  display: inline-flex;
  font-size: 12px;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  white-space: nowrap;
}

.limit-pill svg {
  height: 16px;
  width: 16px;
}

.limit-pill b {
  color: var(--ink);
}

.status-live span {
  animation: status-pulse 2s infinite;
  background: var(--green);
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 156, 107, 0.25); }
  50% { box-shadow: 0 0 0 5px rgba(45, 156, 107, 0); }
}

.mobile-menu,
.sidebar-scrim {
  display: none;
}

.workspace-scroll {
  overflow-y: auto;
  padding: 28px;
}

/* User upload */
.upload-band,
.files-section {
  margin: 0 auto;
  max-width: 1040px;
}

.upload-intro h2,
.section-header h2,
.toolbar-copy h2 {
  font-size: 22px;
  margin: 0;
}

.upload-intro p,
.toolbar-copy p {
  color: var(--muted);
  font-size: 13px;
  margin: 7px 0 0;
}

.upload-composer {
  align-items: center;
  background: #ffffff;
  border: 1px dashed #abc8d8;
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 18px;
  min-height: 126px;
  padding: 24px 28px;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.upload-composer.dragging {
  background: var(--blue-soft);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.drop-visual {
  align-items: center;
  display: flex;
  gap: 16px;
}

.drop-visual > div {
  display: grid;
  gap: 5px;
}

.drop-visual b {
  font-size: 15px;
}

.drop-visual small {
  color: var(--muted);
  font-size: 12px;
}

.drop-icon {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 50%;
  color: var(--blue);
  display: flex;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.drop-icon svg {
  height: 27px;
  width: 27px;
}

.upload-queue {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.queue-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 13px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 68px;
  padding: 11px 14px;
}

.file-type-icon {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 6px;
  color: var(--blue-dark);
  display: flex;
  flex: 0 0 42px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.file-type-icon svg {
  height: 21px;
  width: 21px;
}

.queue-info {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.queue-info-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.queue-info-row b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-info-row span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
}

.progress-track {
  background: #edf1f3;
  border-radius: 3px;
  height: 5px;
  overflow: hidden;
}

.progress-bar {
  background: var(--blue);
  border-radius: 3px;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.queue-item.done .file-type-icon {
  background: var(--green-soft);
  color: var(--green);
}

.queue-item.done .progress-bar {
  background: var(--green);
}

.queue-item.failed .file-type-icon {
  background: var(--red-soft);
  color: var(--red);
}

.files-section {
  margin-top: 38px;
}

.section-header {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.file-list {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.file-row {
  align-items: center;
  border-bottom: 1px solid #edf0f2;
  display: grid;
  gap: 14px;
  grid-template-columns: 42px minmax(0, 1.6fr) minmax(130px, 1fr) 110px auto;
  min-height: 70px;
  padding: 10px 15px;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-main,
.file-link-copy {
  min-width: 0;
}

.file-main b {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-main small,
.file-meta {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 5px;
}

.file-link-copy {
  color: var(--blue-dark);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.empty-state,
.loading-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
  padding: 30px;
  text-align: center;
}

.empty-state svg {
  color: #aebac3;
  height: 34px;
  margin-bottom: 11px;
  width: 34px;
}

.empty-state b {
  color: #4d5b68;
  font-size: 14px;
}

.empty-state p,
.loading-state p {
  font-size: 12px;
  margin: 7px 0 0;
}

.loading-state.compact {
  min-height: 90px;
}

.spinner {
  animation: spin 800ms linear infinite;
  border: 2px solid #dce4e9;
  border-radius: 50%;
  border-top-color: var(--blue);
  height: 24px;
  width: 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Admin */
.admin-scroll {
  padding: 26px 30px 50px;
}

.admin-view {
  display: none;
  margin: 0 auto;
  max-width: 1280px;
}

.admin-view.active {
  animation: view-in 180ms ease;
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-block {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 15px;
  min-height: 126px;
  padding: 20px;
}

.stat-block > span {
  align-items: center;
  border-radius: 7px;
  display: flex;
  flex: 0 0 47px;
  height: 47px;
  justify-content: center;
  width: 47px;
}

.stat-block > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.stat-block small {
  color: var(--muted);
  font-size: 11px;
}

.stat-block b {
  font-size: 23px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-block em {
  color: #8a97a3;
  font-size: 10px;
  font-style: normal;
}

.stat-blue > span { background: var(--blue-soft); color: var(--blue-dark); }
.stat-green > span { background: var(--green-soft); color: var(--green); }
.stat-amber > span { background: var(--amber-soft); color: var(--amber); }
.stat-violet > span { background: var(--violet-soft); color: var(--violet); }

.overview-actions {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  margin-top: 20px;
}

.overview-actions button {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 78px;
  padding: 13px 18px;
  text-align: left;
}

.overview-actions button:last-child {
  border-bottom: 0;
}

.overview-actions button:hover {
  background: #f8fafb;
}

.overview-actions button > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.overview-actions b {
  font-size: 13px;
}

.overview-actions small {
  color: var(--muted);
  font-size: 11px;
}

.action-icon {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 7px;
  color: var(--blue-dark);
  display: flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.view-toolbar {
  align-items: flex-end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 17px;
}

.file-toolbar {
  align-items: center;
}

.toolbar-controls {
  align-items: center;
  display: flex;
  gap: 9px;
}

.search-box {
  align-items: center;
  display: flex;
  min-height: 42px;
  padding-left: 12px;
  width: 310px;
}

.search-box > svg {
  color: #8997a3;
  flex: 0 0 auto;
  height: 17px;
  width: 17px;
}

.search-box input {
  background: transparent;
  border: 0;
  min-width: 0;
  outline: 0;
  padding: 0 9px;
  width: 100%;
}

.search-box button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #8b98a4;
  cursor: pointer;
  display: flex;
  height: 40px;
  justify-content: center;
  width: 38px;
}

.search-box button svg {
  height: 15px;
  width: 15px;
}

.button-danger b {
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  display: flex;
  font-size: 10px;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
}

.data-surface {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 780px;
  width: 100%;
}

th {
  background: #f7f9fa;
  border-bottom: 1px solid var(--line);
  color: #6f7d89;
  font-size: 10px;
  font-weight: 800;
  height: 43px;
  padding: 0 14px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid #edf0f2;
  height: 62px;
  padding: 8px 14px;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfcfc;
}

.align-right {
  text-align: right;
}

.checkbox-cell {
  text-align: center;
  width: 48px;
}

input[type="checkbox"] {
  accent-color: var(--blue);
  cursor: pointer;
  height: 17px;
  width: 17px;
}

.table-user,
.table-file {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 180px;
}

.table-avatar {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 50%;
  color: var(--blue-dark);
  display: flex;
  flex: 0 0 34px;
  font-size: 11px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  text-transform: uppercase;
  width: 34px;
}

.table-file-icon {
  align-items: center;
  background: #f1f4f6;
  border-radius: 6px;
  color: #657482;
  display: flex;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.table-user > span,
.table-file > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.table-user b,
.table-file b {
  font-size: 12px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-user small,
.table-file small {
  color: #84919d;
  font-size: 10px;
}

.status-badge {
  align-items: center;
  border-radius: 5px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  min-height: 25px;
  padding: 0 8px;
}

.status-active {
  background: var(--green-soft);
  color: var(--green);
}

.status-disabled {
  background: var(--red-soft);
  color: var(--red);
}

.orphan-label {
  color: var(--amber);
  font-size: 10px;
}

.table-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  white-space: nowrap;
}

.table-actions .icon-button {
  height: 34px;
  width: 34px;
}

.table-actions .danger:hover {
  background: var(--red-soft);
  border-color: #f1c8cc;
  color: var(--red);
}

.pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  min-height: 56px;
  padding: 8px 14px;
}

.pagination > div {
  display: flex;
  gap: 6px;
}

.settings-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-section {
  align-content: start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 17px;
  padding: 23px;
}

.setting-heading {
  align-items: center;
  display: flex;
  gap: 13px;
}

.setting-heading > div {
  display: grid;
  gap: 5px;
}

.setting-heading h3 {
  font-size: 14px;
  margin: 0;
}

.setting-heading p,
.setting-note {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

.setting-icon {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 7px;
  color: var(--blue-dark);
  display: flex;
  flex: 0 0 42px;
  height: 42px;
  justify-content: center;
}

.setting-icon-dark { background: #edf0f3; color: #44515e; }
.setting-icon-gold { background: var(--amber-soft); color: var(--amber); }

.number-field {
  align-items: center;
  display: flex;
  max-width: 230px;
  overflow: hidden;
}

.number-field input {
  border: 0;
  box-shadow: none;
  min-height: 42px;
  min-width: 0;
  outline: 0;
  padding: 0 13px;
  width: 100%;
}

.number-field > span {
  align-items: center;
  align-self: stretch;
  background: #f1f4f6;
  border-left: 1px solid var(--line);
  color: #6b7986;
  display: flex;
  font-size: 11px;
  padding: 0 13px;
}

.settings-fields {
  display: grid;
  gap: 14px;
}

/* Modals */
.modal-backdrop {
  align-items: center;
  background: rgba(13, 22, 30, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 100;
}

.modal {
  animation: modal-in 180ms ease;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 40px);
  max-width: 500px;
  overflow-y: auto;
  padding: 24px;
  width: 100%;
}

.modal-small {
  max-width: 420px;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-header h2,
.credential-success h2,
.confirm-icon + h2 {
  font-size: 20px;
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 4px;
}

.choice-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  justify-content: space-between;
  min-height: 62px;
  padding: 10px 13px;
}

.choice-row > span {
  display: grid;
  gap: 4px;
}

.choice-row b {
  font-size: 13px;
}

.choice-row small {
  color: var(--muted);
  font-size: 10px;
}

.credential-success {
  align-items: center;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.credential-success > span,
.confirm-icon {
  align-items: center;
  background: var(--green-soft);
  border-radius: 50%;
  color: var(--green);
  display: flex;
  height: 52px;
  justify-content: center;
  margin-bottom: 13px;
  width: 52px;
}

.credential-success > span svg,
.confirm-icon svg {
  height: 25px;
  width: 25px;
}

.credential-success p {
  color: var(--muted);
  font-size: 12px;
  margin: 7px 0 20px;
}

.credential-box {
  background: #f5f7f8;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 7px;
  padding: 14px;
}

.credential-box label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.credential-box > div {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 7px;
}

.credential-box > div:last-child {
  margin-bottom: 0;
}

.credential-box code {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
  flex: 1;
  font-family: Consolas, monospace;
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 9px;
}

.confirm-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.confirm-icon + h2 {
  text-align: center;
}

#confirmModal .modal > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

#confirmModal .modal-actions {
  justify-content: center;
  margin-top: 20px;
}

.preview-backdrop {
  padding: 16px;
}

.preview-modal,
.archive-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: min(820px, calc(100vh - 32px));
  max-width: 1120px;
  overflow: hidden;
}

.preview-stage {
  align-items: center;
  background: #eef1f3;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  justify-content: center;
  min-height: 0;
  overflow: auto;
}

.preview-stage iframe,
.preview-stage video,
.preview-stage audio,
.preview-stage img {
  border: 0;
  max-height: 100%;
  max-width: 100%;
}

.preview-stage iframe {
  height: 100%;
  width: 100%;
}

.preview-stage pre {
  align-self: stretch;
  background: #ffffff;
  color: #293744;
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  overflow: auto;
  padding: 18px;
  white-space: pre-wrap;
  width: 100%;
}

.archive-password {
  align-content: center;
  display: grid;
  gap: 18px;
  margin: auto;
  max-width: 430px;
  width: 100%;
}

.archive-hero {
  align-items: center;
  display: flex;
  gap: 14px;
}

.archive-hero > span {
  align-items: center;
  background: var(--amber-soft);
  border-radius: 7px;
  color: var(--amber);
  display: flex;
  flex: 0 0 52px;
  height: 52px;
  justify-content: center;
}

.archive-hero > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.archive-hero b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-hero small {
  color: var(--muted);
  font-size: 11px;
}

.archive-browser {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 0;
  overflow: hidden;
}

.archive-browser-bar {
  align-items: center;
  background: #f5f7f8;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px 12px;
}

.archive-browser-bar > div {
  align-items: center;
  color: #51606d;
  display: flex;
  font-size: 12px;
  gap: 8px;
  min-width: 0;
}

.archive-browser-bar > div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-entries {
  background: #ffffff;
  height: calc(100% - 58px);
  overflow-y: auto;
}

.archive-entry {
  align-items: center;
  border-bottom: 1px solid #edf0f2;
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr) 90px auto;
  min-height: 55px;
  padding: 8px 11px;
}

.archive-entry:hover {
  background: #f9fafb;
}

.archive-entry > span:first-child {
  align-items: center;
  background: #f0f3f5;
  border-radius: 5px;
  color: #63727f;
  display: flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.archive-entry b {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-entry small {
  color: var(--muted);
  font-size: 10px;
}

/* Toasts and error */
.toast-region {
  bottom: 22px;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 28px));
  position: fixed;
  right: 22px;
  z-index: 200;
}

.toast {
  align-items: center;
  animation: toast-in 180ms ease;
  background: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(10, 18, 25, 0.24);
  color: #ffffff;
  display: flex;
  font-size: 12px;
  gap: 10px;
  min-height: 48px;
  padding: 10px 13px;
}

.toast.success > svg { color: #58d19a; }
.toast.error > svg { color: #f27d85; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-page {
  align-items: center;
  background: #f4f6f8;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
}

.error-page main {
  max-width: 420px;
}

.error-code {
  color: var(--blue);
  font-size: 74px;
  font-weight: 900;
}

.error-page h1 {
  font-size: 24px;
  margin: 8px 0;
}

.error-page p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 22px;
}

@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .file-row {
    grid-template-columns: 42px minmax(0, 1fr) 100px auto;
  }

  .file-link-copy {
    display: none;
  }
}

@media (max-width: 820px) {
  .login-page {
    display: block;
  }

  .login-visual {
    display: none;
  }

  .login-main {
    padding: 28px 20px;
  }

  .brand-mobile {
    display: flex;
    margin-bottom: 52px;
  }

  .app-page {
    display: block;
  }

  .sidebar {
    left: 0;
    position: fixed;
    top: 0;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    width: 258px;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    background: rgba(10, 18, 25, 0.48);
    inset: 0;
    position: fixed;
    z-index: 20;
  }

  body.sidebar-open .sidebar-scrim {
    display: block;
  }

  .workspace {
    height: 100vh;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .workspace-scroll,
  .admin-scroll {
    padding: 22px 16px 40px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .file-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-controls,
  .search-box {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .topbar p,
  .limit-pill,
  .status-live,
  .topbar .button span {
    display: none;
  }

  .topbar .button {
    min-height: 38px;
    padding: 0 10px;
  }

  .upload-composer {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .upload-composer .button {
    width: 100%;
  }

  .file-row {
    gap: 10px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 10px;
  }

  .file-meta {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .view-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .view-toolbar > .button {
    width: 100%;
  }

  .toolbar-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 92vh;
    max-width: none;
    padding: 20px;
  }

  .preview-backdrop {
    align-items: center;
    padding: 8px;
  }

  .preview-modal,
  .archive-modal {
    border-radius: 8px;
    height: calc(100vh - 16px);
    padding: 14px;
  }

  .archive-browser-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .archive-entries {
    height: calc(100% - 98px);
  }

  .archive-entry {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .archive-entry > small {
    display: none;
  }

  .toast-region {
    bottom: 14px;
    right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
