:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #162230;
  background: #f4f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 268px;
  flex: 0 0 268px;
  background: #14283e;
  color: #eef6ff;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: margin-left .2s ease;
}
.sidebar.is-collapsed { margin-left: -268px; }
.brand { padding: 5px 10px 22px; border-bottom: 1px solid #ffffff24; }
.brand a { display: block; color: #fff; text-decoration: none; font-size: 20px; font-weight: 800; }
.brand span { display: block; margin-top: 5px; color: #b9cadc; font-size: 12px; }
.menu { display: flex; flex-direction: column; gap: 4px; padding: 18px 3px; }
.menu a { border-radius: 8px; color: #dcecff; text-decoration: none; padding: 10px; }
.menu a:hover { background: #254561; color: #fff; }
.menu-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #91a8be; padding: 17px 10px 5px; }
.project-name { font-size: 14px; font-weight: 700; color: #fff; padding: 0 10px 7px; overflow-wrap: anywhere; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #ffffff24; padding: 15px 10px 2px; }
.sidebar-bottom a { color: #dcecff; text-decoration: none; }
.sidebar-bottom form { margin: 0; }
.sidebar-bottom .menu-logout { margin: 0; padding: 0; border: 0; background: transparent; color: #dcecff; cursor: pointer; font: inherit; }

.app-main { min-width: 0; flex: 1; }
.desktop-header {
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  padding-left: 14px;
  background: #f4f7fb;
}
.sidebar-collapse { position: static; margin: 0; background: #64748b; padding: 7px 10px; font-size: 13px; }
.mobile-header { display: none; }
.wrap { max-width: 1280px; margin: 0 auto 28px; padding: 0 26px; }
.auth-wrap { max-width: 1120px; margin: 28px auto; padding: 0 18px; }

.card, details.card { background: #fff; border-radius: 12px; padding: 22px; margin: 16px 0; box-shadow: 0 2px 12px #17324a12; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
h1 { font-size: 28px; margin: 0 0 18px; }
h2 { font-size: 21px; margin-top: 0; }
label { display: block; font-weight: 600; margin-top: 13px; }
input, select, textarea { box-sizing: border-box; width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #c7d2df; border-radius: 7px; font: inherit; }
input[type=checkbox] { width: auto; }
textarea { min-height: 150px; }
button, .button { display: inline-block; border: 0; border-radius: 7px; padding: 10px 14px; margin: 12px 7px 0 0; background: #1769aa; color: #fff; font: inherit; cursor: pointer; text-decoration: none; }
button:disabled { opacity: .55; cursor: not-allowed; }
.muted { background: #64748b; }
.danger { background: #bd2d2d; }
.ok { background: #198754; }
.warn { color: #a05a00; }
.error { color: #b42318; font-weight: 600; }
.status { display: inline-block; padding: 4px 9px; border-radius: 99px; background: #e5edf6; font-size: 13px; }
.status.published, .status.active { background: #d9f7e5; }
.status.error, .status.unknown, .status.draft, .status.blocked, .status.archived { background: #ffe5e5; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 10px; border-bottom: 1px solid #e5eaf0; vertical-align: top; }
.flash { padding: 12px; border-radius: 7px; background: #dceeff; margin: 12px 0; }
.small { font-size: 13px; color: #526477; }
form.inline { display: inline; }
summary { cursor: pointer; }
#channels, #queue { scroll-margin-top: 18px; }

@media (max-width: 850px) {
  .sidebar { position: fixed; z-index: 20; left: -290px; margin-left: 0 !important; transition: left .2s ease; box-shadow: 3px 0 20px #0d1a2855; }
  .sidebar.is-open { left: 0; }
  .desktop-header { display: none; }
  .mobile-header { background: #14283e; color: #fff; padding: 12px 16px; display: flex; gap: 13px; align-items: center; position: sticky; top: 0; z-index: 10; }
  .mobile-header a { color: #fff; text-decoration: none; font-weight: 700; }
  .menu-toggle { background: #254561; margin: 0; padding: 8px 10px; }
  .wrap { margin: 18px auto; padding: 0 14px; }
  h1 { font-size: 25px; }
  .card, details.card { padding: 16px; }
  table { font-size: 13px; }
  .hide-mobile { display: none; }
}

@media (max-width: 430px) {
  button, .button { width: 100%; text-align: center; margin-right: 0; }
  .inline { display: block !important; }
  .inline button { width: auto; }
  .grid { grid-template-columns: 1fr; }
}
