:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #1a2740;
  background: #f5f7fb;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
a {
  color: #2463ca;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.7rem, 2.2vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin-bottom: 0.4rem;
}
h2 {
  font-size: 1.08rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.3rem;
}
h3 {
  font-size: 0.94rem;
  margin: 1.4rem 0 0.65rem;
}
p {
  color: #718098;
  line-height: 1.5;
}
small {
  font-size: 0.78rem;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: #111b2d;
  color: #eaf0fa;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 20px;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 1.06rem;
  font-weight: 600;
  padding: 0 10px 38px;
  line-height: 1.15;
}
.brand:hover {
  text-decoration: none;
}
.brand strong {
  color: #92b8ff;
}
.brand small {
  display: block;
  color: #8192ad;
  font-weight: 500;
  margin-top: 4px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #3478eb;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 7px 16px #071a3650;
}
.nav-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #65748d;
  font-weight: 800;
  padding: 0 13px 12px;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #aab7cb;
  padding: 11px 13px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.9rem;
}
.sidebar nav a:hover,
.sidebar nav a.selected {
  background: #24344d;
  color: #fff;
  text-decoration: none;
}
.sidebar nav a.selected {
  box-shadow: inset 3px 0 #5c9cff;
}
.nav-icon {
  width: 20px;
  font-size: 1.1rem;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #29374c;
  padding: 20px 12px 0;
}
.signed-in {
  display: block;
  color: #8d9cb3;
  font-size: 0.74rem;
  margin-bottom: 7px;
}
.sidebar-logout {
  border: 0;
  background: none;
  color: #d2dded;
  padding: 0;
  font-weight: 600;
}
.main-content {
  margin-left: 248px;
  min-height: 100vh;
}
.topbar {
  height: 64px;
  background: white;
  border-bottom: 1px solid #e9edf3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 35px;
  color: #66758c;
  font-size: 0.83rem;
}
.topbar-domain {
  color: #9aa6b8;
}
.content-wrap {
  max-width: 1490px;
  margin: 0 auto;
  padding: 35px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 25px;
}
.page-heading p {
  margin: 0;
}
.eyebrow {
  font-size: 0.69rem;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: #477be0;
  margin-bottom: 9px;
}
.back-link {
  display: inline-block;
  font-size: 0.83rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.card,
.stat-card,
.media-card {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  box-shadow: 0 5px 20px #26395308;
}
.card {
  padding: 25px;
  margin-bottom: 20px;
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 21px;
}
.section-heading p {
  margin: 0;
  font-size: 0.88rem;
}
.section-heading a {
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 21px 22px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}
.stat-card span {
  font-size: 0.82rem;
  color: #64748d;
  font-weight: 650;
}
.stat-card strong {
  font-size: 2.2rem;
  letter-spacing: -0.05em;
  margin: 10px 0 3px;
  line-height: 1;
}
.stat-card small {
  color: #99a5b6;
}
.stat-card.online strong {
  color: #1b9b69;
}
.stat-card.offline strong {
  color: #d37c4a;
}
.page-grid {
  display: grid;
  grid-template-columns: minmax(270px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.device-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.subsection {
  border-top: 1px solid #e9edf3;
  margin: 22px 0;
  padding-top: 23px;
}
.subsection p {
  font-size: 0.86rem;
}
.subsection h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
label {
  display: block;
  font-size: 0.81rem;
  font-weight: 700;
  color: #4c5a70;
  margin-bottom: 17px;
}
input:not([type="checkbox"]):not([type="color"]),
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #fff;
  color: #1a2740;
  padding: 10px 12px;
  margin-top: 7px;
  min-height: 42px;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #548cea;
  box-shadow: 0 0 0 3px #dfeaff;
}
textarea {
  min-height: 88px;
  resize: vertical;
}
input[type="color"] {
  display: block;
  width: 100%;
  height: 42px;
  padding: 3px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  margin-top: 7px;
  background: white;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  margin-bottom: 18px;
}
.check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #3478eb;
}
.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #3478eb;
  background: #3478eb;
  color: white;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.84rem;
  min-height: 40px;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover {
  background: #2367d7;
  text-decoration: none;
}
.button.secondary {
  background: #edf3fc;
  border-color: #edf3fc;
  color: #28538b;
}
.button.secondary:hover {
  background: #dfeafb;
}
.button.danger {
  background: #fff1f1;
  border-color: #ffe2e2;
  color: #c54a50;
}
.button.danger:hover {
  background: #ffe8e9;
}
.button.small {
  padding: 7px 10px;
  min-height: 34px;
}
.full-width {
  width: 100%;
}
.actions,
.upload-form {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.upload-form input[type="file"] {
  margin: 0;
  flex: 1;
  min-width: 200px;
}
.upload-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.upload-card p {
  font-size: 0.85rem;
  margin: 0;
}
.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  border-radius: 99px;
  background: #eef3fa;
  color: #657a9b;
  font-size: 0.72rem;
  vertical-align: middle;
  margin-left: 4px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 620px;
}
th {
  text-align: left;
  color: #8a98ac;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 12px 10px;
  border-bottom: 1px solid #edf0f5;
}
td {
  padding: 15px 10px;
  border-bottom: 1px solid #f0f2f6;
  color: #516077;
  font-size: 0.86rem;
}
tr:last-child td {
  border-bottom: none;
}
td strong {
  color: #1a2740;
}
.table-link {
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.8rem;
}
.table-description {
  display: block;
  color: #95a2b3;
  margin-top: 3px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.identity strong,
.identity small {
  display: block;
}
.identity small {
  color: #9aa6b7;
  margin-top: 3px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  background: #eaf1ff;
  color: #477be0;
  border-radius: 9px;
  font-size: 0.71rem;
  font-weight: 800;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge:before {
  content: "";
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
}
.badge-online {
  background: #e8f8ef;
  color: #168458;
}
.badge-offline {
  background: #fff0ec;
  color: #ce6545;
}
.badge-neutral {
  background: #eef1f5;
  color: #798598;
}
.badge.large {
  font-size: 0.82rem;
  padding: 8px 13px;
}
.empty {
  text-align: center;
  color: #9aa6b8;
  padding: 32px !important;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.media-card {
  overflow: hidden;
  min-width: 0;
}
.media-thumb {
  border: 0;
  background: #e7ecf3;
  padding: 0;
  width: 100%;
  height: 154px;
  position: relative;
  display: block;
}
.thumb-frame,
.thumb-frame img,
.thumb-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #10213aaa;
  color: #fff;
}
.media-card-body {
  padding: 15px;
}
.media-card-body strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.86rem;
  margin-bottom: 9px;
}
.media-meta {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  color: #8a98aa;
  font-size: 0.75rem;
  margin: 5px 0;
}
.media-meta code {
  font-size: 0.73rem;
}
.text-danger {
  border: 0;
  background: none;
  color: #c64e55;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 9px 0 0;
}
.media-empty {
  grid-column: 1/-1;
}
.playlist-items {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.playlist-items > li {
  border: 1px solid #e9edf3;
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
}
.playlist-items > li.dragging {
  opacity: 0.5;
  border-color: #4e8beb;
}
.item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.drag-handle {
  color: #9aa6b6;
  cursor: grab;
  letter-spacing: -4px;
  padding: 7px;
  font-weight: 900;
}
.item-thumbnail {
  display: block;
  width: 70px;
  height: 48px;
  border: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #e9eef5;
  flex: none;
}
.item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: #5374a8;
}
.item-name {
  min-width: 0;
}
.item-name strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
}
.item-name small {
  display: block;
  color: #8a98aa;
  margin-top: 3px;
}
.item-actions,
.item-actions form,
.move-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.item-actions form {
  flex-wrap: wrap;
}
.item-actions .check {
  margin: 0;
}
.compact-label {
  margin: 0;
  white-space: nowrap;
  font-size: 0.68rem;
}
.compact-label input:not([type="checkbox"]) {
  width: 69px;
  min-height: 32px;
  padding: 5px;
  margin-top: 2px;
}
.icon-button {
  border: 1px solid #dfe5ed;
  border-radius: 6px;
  background: white;
  color: #4c678a;
  font-weight: 800;
  width: 30px;
  height: 30px;
}
.preview-dialog {
  border: 0;
  border-radius: 14px;
  padding: 18px;
  background: #111a28;
  color: white;
  max-width: min(90vw, 900px);
  max-height: 90vh;
  box-shadow: 0 20px 80px #0008;
}
.preview-dialog::backdrop {
  background: #101827bb;
}
.preview-body img,
.preview-body video {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  margin: auto;
}
.preview-close {
  position: absolute;
  right: 8px;
  top: 4px;
  border: 0;
  background: none;
  color: white;
  font-size: 1.7rem;
}
.preview-title {
  color: #d9e3f2;
  text-align: center;
  margin: 12px 0 0;
}
.logo-current {
  border: 0;
  background: none;
  padding: 0;
  margin: -6px 0 12px;
}
.logo-current img {
  height: 70px;
  max-width: 160px;
  object-fit: contain;
}
.command-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.command-grid .button {
  width: 100%;
  white-space: normal;
}
.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f5;
  font-size: 0.83rem;
}
.detail-list span {
  color: #8a98a9;
}
.detail-list strong {
  text-align: right;
}
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #edf1f5;
  padding: 9px 0;
  font-size: 0.75rem;
  color: #8996a8;
}
.activity-list strong {
  color: #455672;
}
.flash-stack {
  position: fixed;
  right: 25px;
  top: 20px;
  z-index: 50;
  max-width: 420px;
  width: calc(100% - 50px);
}
.alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #bce4cb;
  background: #ebf9f0;
  color: #236a43;
  padding: 12px 15px;
  border-radius: 9px;
  box-shadow: 0 12px 35px #273c4720;
  margin-bottom: 8px;
  font-size: 0.83rem;
  font-weight: 650;
}
.alert.danger {
  background: #fff1f1;
  border-color: #f5caca;
  color: #ab4040;
}
.alert button {
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.2rem;
}
.mobile-menu,
.sidebar-backdrop {
  display: none;
}
.login-page {
  background: linear-gradient(135deg, #101a2c 0%, #1e385e 100%);
}
.login-page .main-content {
  margin: 0;
}
.login-page .content-wrap {
  padding: 0 20px;
}
.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-brand {
  text-align: center;
  color: white;
  margin-bottom: 28px;
}
.login-brand .brand-mark {
  width: 54px;
  height: 54px;
  margin-bottom: 15px;
}
.login-brand h1 {
  margin: 0 0 5px;
}
.login-brand p {
  color: #b5c6e1;
  margin: 0;
}
.login-card {
  width: min(100%, 410px);
  padding: 32px;
}
.login-card h2 {
  font-size: 1.4rem;
}
.login-card p {
  font-size: 0.85rem;
  margin-bottom: 22px;
}
@media (max-width: 1200px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .page-grid,
  .device-grid {
    grid-template-columns: 1fr;
  }
  .upload-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .upload-form {
    width: 100%;
  }
}
@media (max-width: 800px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .menu-open .sidebar {
    transform: translateX(0);
  }
  .menu-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #06132299;
    z-index: 19;
  }
  .mobile-menu {
    display: grid;
    place-items: center;
    position: fixed;
    right: 16px;
    top: 10px;
    z-index: 18;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 9px;
    background: #253d63;
    color: white;
    font-size: 1.25rem;
  }
  .main-content {
    margin-left: 0;
  }
  .topbar {
    height: 62px;
    padding: 0 70px 0 19px;
    background: #111b2d;
    color: white;
  }
  .topbar-domain {
    display: none;
  }
  .content-wrap {
    padding: 24px 16px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .two-column {
    grid-template-columns: 1fr;
  }
  .playlist-items > li {
    align-items: flex-start;
    flex-direction: column;
  }
  .item-actions {
    width: 100%;
    justify-content: space-between;
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .stats {
    gap: 10px;
  }
  .stat-card {
    padding: 15px;
    min-height: 118px;
  }
  .stat-card strong {
    font-size: 1.85rem;
  }
  .stat-card small {
    font-size: 0.69rem;
  }
  .card {
    padding: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .media-grid {
    gap: 10px;
  }
  .media-thumb {
    height: 110px;
  }
  .media-card-body {
    padding: 10px;
  }
  .media-meta {
    font-size: 0.68rem;
  }
  .upload-form {
    align-items: stretch;
    flex-direction: column;
  }
  .upload-form input[type="file"] {
    min-width: 0;
    width: 100%;
  }
  .item-actions,
  .item-actions form {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .page-heading .actions {
    width: 100%;
  }
  .page-heading .actions .button {
    flex: 1;
  }
}

.media-sizes {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #78869a;
  font-size: .72rem;
  margin: 10px 0 5px;
}
.media-sizes b { color: #243450; display: block; font-size: .8rem; }
.saving { display: inline-block; color: #17825b; background: #e8f8ef; border-radius: 6px; padding: 4px 7px; font-size: .72rem; font-weight: 800; }
.form-hint { margin: 12px 0 0; font-size: .77rem; }
.section-action { margin-top: 18px; }
