* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #eef1f4; color: #1f2933; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #16242b; color: #fff; padding: 24px 18px; }
.brand { font-size: 30px; font-weight: 800; margin-bottom: 30px; letter-spacing: .3px; }
.admin-block { margin-bottom: 32px; color: #dce5e9; }
.admin-block span { display: block; margin-top: 4px; color: #9fb1ba; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar a { padding: 12px 14px; border-radius: 6px; color: #e8f0f3; }
.sidebar a:hover { background: #243943; }
.main { min-width: 0; }
.topbar { height: 70px; background: #5965d8; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.topbar h1 { margin: 0; font-size: 26px; }
.logout { font-weight: 700; }
.content { padding: 30px; }
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: #fff; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.12); padding: 22px; }
.stat { font-size: 34px; font-weight: 800; margin-top: 8px; }
.muted { color: #667785; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; border-bottom: 1px solid #e3e7eb; padding: 13px 14px; vertical-align: middle; }
th { font-size: 14px; color: #36454f; background: #f9fbfc; }
.badge { display: inline-block; padding: 5px 8px; border-radius: 4px; color: #fff; font-size: 12px; font-weight: 700; }
.green { background: #25a55f; }
.red { background: #d64255; }
.yellow { background: #d99c18; }
.blue { background: #3779d7; }
.gray { background: #6b7780; }
form.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #cfd6dc; border-radius: 5px; font: inherit; background: #fff; }
textarea { min-height: 96px; resize: vertical; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
.add-box-panel { margin-bottom: 18px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.connected-card h2 { font-size: 28px; margin: 4px 0 22px; }
.connected-table th, .connected-table td { border: 1px solid #e0e5ea; padding: 16px; font-size: 16px; }
.connected-table th { background: #fff; color: #25313a; font-size: 17px; }
.connected-table td strong { font-size: 16px; }
.assign-channel-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; align-items: center; }
.assign-channel-form select { min-height: 40px; }
.assign-channel-form .btn { min-height: 40px; padding: 9px 16px; }
.player-playing { color: #25a55f; font-weight: 800; }
.player-buffering { color: #d99c18; font-weight: 800; }
.player-stopped { color: #d99c18; font-weight: 800; }
.mini { padding: 7px 10px; font-size: 12px; }
.status-line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 12px 0 18px; }
.danger-zone { border: 1px solid #f1bdc6; background: #fff8f9; }
.brand-preview { min-height: 160px; display: grid; place-items: center; background: #101820; border-radius: 6px; padding: 20px; margin: 14px 0; }
.brand-preview img { max-width: 260px; max-height: 120px; object-fit: contain; }
.current-asset { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; background: #f7f9fb; border: 1px solid #e3e7eb; border-radius: 6px; padding: 10px; }
.current-asset span { color: #667785; font-weight: 700; }
.current-asset img { max-width: 180px; max-height: 72px; object-fit: contain; background: #101820; border-radius: 4px; padding: 8px; }
.current-asset.wide img { max-width: 260px; max-height: 110px; }
.advanced-box { border: 1px solid #d9e0e6; border-radius: 6px; padding: 12px; background: #fbfcfd; }
.advanced-box summary { cursor: pointer; font-weight: 800; }
.advanced-box label { margin-top: 12px; }
.receiver-preview {
    width: min(100%, 420px);
    aspect-ratio: 16 / 9;
    background: #101820 center/cover no-repeat;
    border-radius: 6px;
    overflow: hidden;
    margin: 14px 0;
    border: 1px solid #d9e0e6;
}
.receiver-preview-shade {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 18px;
    background: rgba(0,0,0,.45);
    color: #fff;
    text-align: center;
}
.receiver-preview img { max-width: 220px; max-height: 76px; object-fit: contain; }
.preview-name { font-size: 22px; font-weight: 800; }
.preview-message { font-size: 13px; line-height: 1.4; max-width: 340px; }
.btn { border: 0; border-radius: 5px; padding: 10px 14px; font-weight: 700; cursor: pointer; background: #5965d8; color: #fff; display: inline-block; }
.btn.secondary { background: #63717b; }
.btn.danger { background: #d64255; }
.btn.ok { background: #25a55f; }
.alert { padding: 12px 14px; border-radius: 5px; margin-bottom: 18px; background: #e8f6ef; color: #12683b; }
.alert.error { background: #fdecef; color: #9f2234; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: #16242b; padding: 24px; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 8px; padding: 28px; }
.login-card h1 { margin-top: 0; }
.code { font-family: Consolas, monospace; background: #f3f5f7; padding: 12px; border-radius: 5px; overflow-x: auto; }
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
    .content { padding: 18px; }
    .topbar { padding: 0 18px; }
}
