:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #10233f;
  background: #f4f7fb;
}

* { box-sizing: border-box; }

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

.topbar {
  min-height: 82px;
  padding: 12px 4.5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid #e5edf7;
  box-shadow: 0 2px 12px rgb(20 50 90 / 4%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -1px;
  border-radius: 13px;
  background: linear-gradient(135deg, #08a8ff, #0759e8);
  box-shadow: 0 7px 20px rgb(0 111 255 / 22%);
}

.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 21px; letter-spacing: -.5px; }

.eyebrow {
  margin: 0 0 6px;
  color: #087cf0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.container {
  width: min(1540px, 96%);
  margin: 0 auto;
  padding: 28px 0 45px;
}

.app-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.sidebar {
  position: sticky;
  top: 20px;
  min-height: 690px;
  display: flex;
  flex-direction: column;
  padding: 25px 17px;
  background: #fff;
  border: 1px solid #e4edf8;
  border-radius: 15px;
  box-shadow: 0 8px 28px rgb(20 60 110 / 5%);
}

.sidebar-label {
  margin: 0 10px 16px;
  color: #91a1b5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 7px; }

.nav-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  color: #536984;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}

.nav-link.active {
  color: #087cf0;
  background: #eaf4ff;
  box-shadow: inset 3px 0 #087cf0;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 19px;
}

.nav-link.upcoming {
  flex-wrap: wrap;
  opacity: .68;
}

.nav-link.upcoming small {
  width: 100%;
  padding-left: 34px;
  margin-top: -7px;
  color: #9aa9ba;
  font-size: 10px;
  font-weight: 500;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 25px;
}

.sidebar-help {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px;
  background: #f5f9ff;
  border-radius: 10px;
  color: #29415f;
  font-size: 12px;
}

.sidebar-help span { color: #8393a8; }

.sidebar-logout {
  width: 100%;
  margin-top: 12px !important;
  text-align: left;
}

.main-content { min-width: 0; }

.page-heading {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 19px;
}

h1 {
  margin: 0;
  color: #10233f;
  font-size: clamp(27px, 3vw, 35px);
  letter-spacing: -1px;
}

h2 { margin: 0; color: #10233f; font-size: 20px; }

.muted, footer {
  color: #657892;
  line-height: 1.6;
}

.page-heading .muted { margin: 7px 0 0; }

.panel {
  min-width: 0;
  margin: 0 0 20px;
  padding: 24px;
  background: #fff;
  border: 1px solid #e1eaf5;
  border-radius: 13px;
  box-shadow: 0 7px 24px rgb(20 60 110 / 4%);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.section-note { color: #8a9bb0; font-size: 12px; }

.account-panel { padding: 22px 25px; }
.account-panel .muted { margin: 8px 0 0; }

.status-dot {
  padding: 7px 11px;
  color: #087b4c;
  background: #e9fbf2;
  border: 1px solid #c8f0dc;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.playlist-table {
  width: 100%;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #e3ebf5;
  border-radius: 10px;
}

.playlist-table-heading,
.playlist-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr) minmax(170px, .8fr);
  align-items: center;
  gap: 15px;
}

.playlist-table-heading {
  min-height: 54px;
  padding: 12px 20px;
  color: #fff;
  background: linear-gradient(105deg, #087cf0, #0759d8);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .7px;
}

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

.playlist-row {
  min-height: 88px;
  padding: 15px 20px;
  background: #fff;
}

.table-playlist-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.playlist-icon, .form-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  border-radius: 11px;
  background: linear-gradient(135deg, #08a8ff, #0759e8);
}

.playlist-icon.m3u-icon { font-size: 10px; }

.playlist-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.playlist-details strong {
  color: #102d50;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.small-label {
  color: #91a1b5;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .8px;
}

.protection-label {
  color: #087b75;
  font-size: 12px;
  font-weight: 700;
}

.playlist-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.form-panel { height: 100%; }
.form-panel .muted { min-height: 48px; }
.form-icon { background: #eaf4ff; color: #087cf0; }

form { display: flex; flex-direction: column; gap: 10px; }

label {
  margin-top: 7px;
  color: #29415f;
  font-size: 13px;
  font-weight: 700;
}

input:not([type="checkbox"]) {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  color: #10233f;
  background: #f9fbfe;
  border: 1px solid #d2deed;
  border-radius: 8px;
  font: inherit;
}

input:focus {
  outline: 2px solid #69baff;
  outline-offset: 1px;
  border-color: #087cf0;
}

.button {
  min-height: 42px;
  margin-top: 12px;
  padding: 10px 17px;
  color: #fff;
  background: #087cf0;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.button:hover { background: #0565d1; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .6; }
.button.primary { background: linear-gradient(110deg, #079cf5, #075ee9); }
.button.primary:hover { background: linear-gradient(110deg, #0788df, #064fc9); }
.button.secondary { margin: 0; color: #31506f; background: #eaf2fc; }
.button.secondary:hover { background: #dceaff; }
.button.danger { margin: 0; color: #d52e42; background: #fff0f1; }
.button.danger:hover { background: #ffe0e3; }
.button.small { min-height: 36px; margin: 0; padding: 8px 15px; }

.login-panel {
  width: min(480px, 100%);
  margin: 55px auto;
  padding: 35px;
}

.login-brand { margin-bottom: 22px; }
.login-brand .brand-mark { margin-bottom: 18px; }

.message {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #cbdcf1;
  border-radius: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.message.success { color: #087344; background: #eafbf2; border-color: #bcebd2; }
.message.error { color: #a51d30; background: #fff0f1; border-color: #ffcbd1; }

.hidden { display: none !important; }

.pin-option {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid #d8e9fc;
  border-radius: 12px;
  background: #f5faff;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}

.checkbox-label input { width: 18px; height: 18px; accent-color: #087cf0; }

.hint { margin: 7px 0 0; color: #7186a0; font-size: 12px; line-height: 1.5; }

.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 20px;
  background: rgb(7 25 49 / 58%);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  background: #fff;
  border: 1px solid #d8e9fc;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgb(0 25 70 / 25%);
}

.modal-card.compact { width: min(410px, 100%); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 15px;
  width: 34px;
  height: 34px;
  color: #58708c;
  background: #edf5ff;
  border: 0;
  border-radius: 50%;
  font-size: 23px;
  cursor: pointer;
}

.modal-card h2 { padding-right: 28px; }

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

.modal-actions .button { margin-top: 4px; }

footer {
  margin-top: 20px;
  padding: 12px 4px;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 1050px) {
  .container { width: 96%; }
  .app-layout { grid-template-columns: 205px minmax(0, 1fr); gap: 18px; }
  .sidebar { padding: 20px 12px; }
  .panel { padding: 20px; }
  .playlist-table-heading,
  .playlist-row {
    grid-template-columns: minmax(150px, 1.2fr) minmax(130px, 1fr) minmax(150px, .8fr);
  }
}

@media (max-width: 760px) {
  .topbar { min-height: 72px; padding: 10px 4%; }
  .container { width: 94%; padding-top: 18px; }
  .app-layout { grid-template-columns: 1fr; gap: 15px; }
  .sidebar {
    position: static;
    min-height: 0;
    padding: 12px;
  }
  .sidebar-label, .sidebar-bottom { display: none; }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 3px;
  }
  .nav-link {
    min-height: 42px;
    flex: 0 0 auto;
    padding: 9px 12px;
    font-size: 12px;
  }
  .nav-link.upcoming small { display: none; }
  .nav-icon { width: auto; font-size: 16px; }
  .page-heading { min-height: 75px; }
  .forms-grid { grid-template-columns: 1fr; gap: 0; }
  .form-panel .muted { min-height: 0; }
}

@media (max-width: 560px) {
  .container { width: 94%; padding-bottom: 28px; }
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; }
  .brand-copy strong { font-size: 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .panel { padding: 17px; margin-bottom: 14px; }
  .account-panel { padding: 18px; }
  .playlist-table-heading { display: none; }
  .playlist-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  .playlist-actions { justify-content: flex-start; }
  .playlist-actions .button { flex: 1; }
  .table-security { padding-left: 55px; }
  .login-panel { margin: 25px auto; padding: 24px; }
  .modal-card { padding: 22px 18px; }
}


/* ===== ONE PLAYER visual refinement ===== */
:root {
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: #172b49;
  background: #f2f6fc;
  letter-spacing: .05px;
}

.topbar {
  min-height: 84px;
  padding-left: max(4.5%, calc((100% - 1600px) / 2));
  padding-right: max(4.5%, calc((100% - 1600px) / 2));
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  color: #245078;
  background: #f1f6fd;
  border: 1px solid #e0eaf6;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}

.theme-toggle:hover {
  background: #e5f0ff;
  border-color: #b9d6fa;
  transform: translateY(-1px);
}

#themeIcon { font-size: 18px; line-height: 1; }

h1, h2, h3 {
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: -.65px;
}

h1 { font-weight: 750; }
h2 { font-weight: 720; }

.panel, .sidebar {
  border-color: #e3ebf6;
  border-radius: 17px;
  box-shadow: 0 8px 28px rgb(25 55 95 / 5%);
}

.panel { padding: 25px; }

input, select, textarea {
  font-family: inherit;
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #1685f8;
  box-shadow: 0 0 0 3px rgb(22 133 248 / 13%);
}

.button {
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  transition: transform .18s, box-shadow .18s, filter .18s;
}

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

.playlist-row {
  transition: background .2s;
}

.playlist-row:hover {
  background: #f8fbff;
}

/* ===== Dark theme ===== */
body[data-theme="dark"] {
  color: #e5edf9;
  background: #0b1220;
  color-scheme: dark;
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .modal-card {
  color: #e5edf9;
  background: #141f31;
  border-color: #293950;
  box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
}

body[data-theme="dark"] .brand,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] label,
body[data-theme="dark"] strong {
  color: #edf4ff;
}

body[data-theme="dark"] .muted,
body[data-theme="dark"] .page-heading p,
body[data-theme="dark"] .sidebar-help span {
  color: #a8bad2;
}

body[data-theme="dark"] .nav-link {
  color: #b5c5da;
}

body[data-theme="dark"] .nav-link.active {
  color: #65b4ff;
  background: #1b3656;
}

body[data-theme="dark"] .sidebar-help,
body[data-theme="dark"] .theme-toggle {
  color: #dceaff;
  background: #1c2b40;
  border-color: #344962;
}

body[data-theme="dark"] .theme-toggle:hover {
  background: #263c58;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  color: #edf4ff;
  background: #0e1929;
  border-color: #354963;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #8095b1;
}

body[data-theme="dark"] .playlist-row {
  background: #17253a;
  border-color: #344963;
}

body[data-theme="dark"] .playlist-row:hover {
  background: #1c2e47;
}

body[data-theme="dark"] .playlist-table {
  border-color: #344963;
}

body[data-theme="dark"] .playlist-table-heading {
  color: #fff;
}

body[data-theme="dark"] .nav-link.upcoming small,
body[data-theme="dark"] .sidebar-label {
  color: #849ab5;
}

body[data-theme="dark"] .button.secondary {
  color: #e4efff;
  background: #263b56;
  border-color: #3a5270;
}

body[data-theme="dark"] .button.danger {
  color: #ffb4bb;
  background: #48252f;
  border-color: #66313e;
}

body[data-theme="dark"] .message {
  color: #e5edf9;
}

body[data-theme="dark"] footer {
  color: #91a5bf;
}

@media (max-width: 560px) {
  .topbar-actions { gap: 7px; }
  .theme-toggle { min-height: 39px; padding: 0 10px; }
  .theme-label { display: none; }
  .topbar { padding-left: 3%; padding-right: 3%; }
}

/* Dark mode notification readability fix */
body[data-theme="dark"] .message.success {
  color: #a7f3c8;
  background: #123b2d;
  border-color: #236b4b;
}

body[data-theme="dark"] .message.error {
  color: #ffb4bb;
  background: #48252f;
  border-color: #82404d;
}

/* ===== Customer portal pages ===== */
.nav-link {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-link:focus-visible {
  outline: 3px solid rgb(8 124 240 / 25%);
  outline-offset: 2px;
}

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

.plan-card {
  padding: 28px;
}

.plan-card h2 {
  margin-top: 8px;
}

.plan-price {
  margin: 18px 0 8px;
  color: #087cf0;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1.5px;
}

.plan-price span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.plan-card .button {
  width: 100%;
  margin-top: 14px;
}

.plan-card .button:disabled {
  cursor: not-allowed;
  opacity: .65;
  transform: none;
  filter: none;
}

.status-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.status-details > div {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 17px;
  background: #f5f9ff;
  border: 1px solid #e4edf8;
  border-radius: 11px;
}

.status-details strong {
  overflow-wrap: anywhere;
  color: #17365d;
  font-size: 15px;
}

body[data-theme="dark"] .status-details > div {
  background: #1c2b40;
  border-color: #344962;
}

body[data-theme="dark"] .status-details strong {
  color: #edf4ff;
}

body[data-theme="dark"] .plan-price {
  color: #65b4ff;
}

@media (max-width: 760px) {
  .plans-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .status-details {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
