/* ==================================================
   MODERN DARK DASHBOARD
   ================================================== */

:root {
    --bg: #0f172a;
    --surface: #111827;
    --surface-hover: #1f2937;

    --border: #263244;

    --text: #f8fafc;
    --muted: #94a3b8;

    --primary: #3b82f6;
    --primary-hover: #2563eb;

    --danger: #ef4444;
    --danger-hover: #dc2626;

    --radius: 14px;
}

/* ==================================================
   BASE
   ================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    min-height: 100vh;
}

/* ==================================================
   TOPBAR
   ================================================== */

.topbar {
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 28px;

    background: rgba(17, 24, 39, 0.9);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(12px);

    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left,
.topbar-center,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
}

.date-label {
    color: var(--muted);
}

/* ==================================================
   MAIN CONTENT
   ================================================== */

.main-content {
    display: flex;
    gap: 24px;
    padding: 24px;
    flex-wrap: wrap;
}

.workspace {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 24px;

    padding: 24px;

    height: calc(100vh - 72px);
    overflow: hidden;
}

/* ==================================================
   PANELS
   ================================================== */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);

    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.panel-header h2 {
    margin: 0;
    font-size: 16px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
}

/* ==================================================
   LAYOUT
   ================================================== */

.layout,
.main-content {
    padding: 24px;
}

.section {
    background: var(--surface);
    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 20px;
}

/* ==================================================
   HEADINGS
   ================================================== */

h1,
h2,
h3 {
    margin-top: 0;
    font-weight: 600;
}

h3 {
    margin-bottom: 16px;
}

/* ==================================================
   CARDS
   ================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    overflow: hidden;

    margin-bottom: 10px;

    transition: transform 0.2s ease, background 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);

    background: var(--surface-hover);

    border-color: #3b4b63;
}

.card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.thumb {
    width: 100%;
    aspect-ratio: 16/9;

    object-fit: cover;

    display: block;

    background: #222;
}

.title {
    padding: 10px 12px 4px;

    font-size: 14px;
    font-weight: 600;

    line-height: 1.4;

    min-height: 44px;
}

.titleText {
    display: -webkit-box;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

.meta {
    padding: 0 12px 12px;

    color: var(--muted);

    font-size: 12px;

    line-height: 1.5;
}

/* ==================================================
   SCHEDULE ROWS
   ================================================== */

.onair-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: #0b0f14;
    border: 1px solid #1f2a36;
    margin-bottom: 12px;
    font-family: system-ui, sans-serif;
}

.onair-row {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: #111826;
    border: 1px solid #1a2430;
    animation: pulseOnAir 2s infinite;
}

@keyframes pulseOnAir {
    0% { border-color: #2b6cff; }
    50% { border-color: #4da3ff; }
    100% { border-color: #2b6cff; }
}

.onair-row .label {
    font-size: 11px;
    letter-spacing: 1px;
    color: #7f8ea3;
    font-weight: 600;
}

.onair-row .value {
    font-size: 14px;
    color: #d7e2f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.onair-row.now {
    border: 1px solid #2b6cff;
    background: linear-gradient(90deg, #0d1b33, #111826);
}

.onair-row.now .label {
    color: #4da3ff;
}

.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #2b6cff;
    color: white;
    letter-spacing: 0.5px;
}

.schedule-row {
    width: 100%;

    display: grid;
    grid-template-columns: 90px 1fr 99px 80px;

    align-items: center;
    gap: 12px;

    padding: 14px 16px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    transition: 0.15s ease;

    font-size: 13px;
}

.schedule-row:hover {
    transform: translateY(-1px);
    border-color: #3b82f6;
}

.schedule-title {
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.schedule-duration {
    text-align: right;
    color: var(--muted);
    font-size: 14px;   /* 👈 slightly bigger */
    font-weight: 600;
}

.schedule-delete {
    display: flex;
    justify-content: flex-end;
}

.schedule-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 12px;
    margin-bottom: 15px;

    background: rgba(17, 24, 39, 0.95);
    border-radius: 8px;
    border: 1px solid #444;
}

/* LEFT SIDE (date + label) */
.schedule-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.schedule-left input[type="date"] {
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #111;
    color: white;
}

/* RIGHT SIDE (buttons) */
.schedule-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.schedule-actions button {
    padding: 6px 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

/* Optional visual distinction */
#fillDay {
    background: #2d6cdf;
    color: white;
}

#clearDay {
    background: #b83a3a;
    color: white;
}

/* GAP or OVERLAP distinction */
.schedule-gap {
    background: #382f00;
    border-left: 6px solid #f0b400;
}

.schedule-overlap {
    background: #440000;
    border-left: 6px solid #d32f2f;
}

.schedule-warning {
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

.schedule-warning.gap {
    color: #d0b06e;
}

.schedule-warning.overlap {
    color: #af7781;
}

.time-modal {
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.5);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 10000;
}

.time-modal-content {
    background: white;

    padding: 20px;

    border-radius: 8px;

    min-width: 320px;
}

.time-modal-content h3 {
    margin-top: 0;
}

.time-modal-buttons {
    margin-top: 15px;

    display: flex;
    justify-content: flex-end;

    gap: 10px;
}

.time-edit-btn {
    min-width: 70px;
    font-size: 16px;
    cursor: pointer;
}

.schedule-list {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==================================================
   LIBRARY
   ================================================== */

.library-row .thumb {
    width: 160px;
    height: 90px;

    object-fit: cover;
}

.library-grid {
    display: grid;

    grid-template-columns: repeat(auto-fill, 180px);

    gap: 14px;

    padding: 20px;

    align-items: start;
}

.library-grid .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

    overflow: hidden;

    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.library-grid .card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--surface-hover);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.library-grid .thumb {
    width: 100%;
    aspect-ratio: 16 / 9;

    object-fit: cover;

    display: block;
}

.library-grid .title {
    padding: 10px 12px 4px;
    font-size: 14px;
    font-weight: 600;
}

.library-grid .meta {
    padding: 0 12px 12px;
    font-size: 12px;
    color: var(--muted);
}

.library-grid .delete-btn {
    margin: 8px;
    align-self: flex-end;
    width: fit-content;
    padding: 6px 10px;

    font-size: 14px;

    background: var(--danger);
}

.library-grid .delete-btn:hover {
    background: var(--danger-hover);
}

.owner-select {
    margin-top: 6px;
    width: 100%;
    background: #111;
    color: white;
    border: 1px solid #333;
    padding: 6px;
    border-radius: 6px;
}

.ownerLink {
    cursor: pointer;
    color: #7ab7ff;
    transition: color 0.15s ease;
}

.ownerLink:hover {
    color: #9ccaff;
    text-decoration: underline;
}

#ownerForm {
    display: none;
}

.stream-badge {
    background: #b30000;
    color: white;
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
}

.stream-url {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
}

.library-panel {
    display: flex;
    flex-direction: column;
}

.library-panel input {
    margin: 12px;
    padding: 10px 12px;
    border-radius: 10px;
}

#ScheduleLibraryResults {
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==================================================
   LIBRARY TOOLBAR
   ================================================== */

.library-toolbar {
    max-width: 1400px;
    margin: 20px auto;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 18px 22px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;

    flex-wrap: nowrap;   /* never wrap */
}

.date-label-pagination {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 170px;
    text-align: center;
}

.search-group {
    min-width: 300px;
}

.search-group input {
    width: 320px;
}

.filter-group {
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

.paging-group {
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

.status-group {
    margin-left: auto;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

/* ==================================================
   BUTTONS
   ================================================== */

button {
    border: none;

    background: var(--primary);

    color: white;

    padding: 10px 16px;

    border-radius: 10px;

    cursor: pointer;

    font-weight: 600;

    transition: 0.2s;
}

button:hover {
    background: var(--primary-hover);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.schedule-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px;
    background: #1e1e1e;
    border-radius: 6px;
}

.schedule-actions button {
    white-space: nowrap;
}

/* ==================================================
   DELETE BUTTONS
   ================================================== */

.delete-btn {
    background: var(--danger);
}

.delete-btn:hover {
    background: var(--danger-hover);
}

/* ==================================================
   INPUTS
   ================================================== */

input,
select,
textarea {
    width: 100%;

    background: #0b1220;

    color: white;

    border: 1px solid var(--border);

    border-radius: 10px;

    padding: 10px 12px;

    font-size: 14px;

    transition: border-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

input[type="time"],
input[type="date"] {
    width: auto;
}

/* ==================================================
   MENU
   ================================================== */

.menu-container {
    position: relative;
}

.menu-btn {
    background: transparent;
    color: var(--text);

    font-size: 24px;

    padding: 8px 12px;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.08);
}

.menu {
    display: none;

    position: absolute;

    left: 0;
    top: calc(100% + 8px);

    min-width: 220px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    overflow: hidden;

    box-shadow:
        0 10px 25px rgba(0,0,0,.35);
}

.menu.show {
    display: block;
}

.menu a {
    display: block;

    padding: 14px 16px;

    color: var(--text);

    text-decoration: none;

    transition: background .2s;
}

.menu a:hover {
    background: var(--surface-hover);
}

/* ==================================================
   LIBRARY CONTROL BAR (DARK DASHBOARD STYLE)
   ================================================== */

.library-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 16px;

    padding: 14px 18px;
    margin: 18px 20px 10px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    backdrop-filter: blur(8px);

    position: sticky;
    top: 80px;
    z-index: 50;
}

.library-controls-left {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.library-controls-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.library-controls input,
.library-controls select {
    height: 36px;
    padding: 6px 10px;
    font-size: 13px;

    background: #0b1220;
    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--text);

    min-width: 140px;
}

.library-controls input:focus,
.library-controls select:focus {
    border-color: var(--primary);
    outline: none;
}

.library-count {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

/* subtle reset button */
.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);

    padding: 6px 12px;
    border-radius: 8px;

    cursor: pointer;

    transition: 0.2s;
}

.secondary-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

/* ==================================================
   SCHEDULE ITEMS
   ================================================== */

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg);
}

#scheduleList .card {
    display: grid;

    grid-template-columns:
        120px
        1fr
        120px
        100px;

    gap: 15px;

    align-items: center;
}

/* ==================================================
   LIBRARY RESULTS
   ================================================== */

#libraryResults {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, 180px);

    gap: 12px;

    justify-content: start;
}

#libraryResults .card {
    width: 180px;
    min-height: 120px;
}

.library-title {
    font-weight: 600;
    font-size: 14px;

    overflow: hidden;
    display: -webkit-box;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    min-height: 40px;
}

.library-duration {
    color: var(--muted);
    font-size: 12px;
    margin: 8px 0;
}

/* ==================================================
   SCROLLBAR
   ================================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

/* ==================================================
   DASHBOARD LAYOUT
================================================== */

.dashboard-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 24px;
    padding: 24px;
}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   DASHBOARD - UPLOAD MOSAIC
================================================== */

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

/* override card ONLY inside dashboard uploads */
.upload-grid .card {
    width: auto;
}

/* Keep Recent Uploads titles compact */
.upload-grid .card .title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.4;
    max-height: calc(2 * 1.4em);
}

/* ==================================================
   DASHBOARD - SCHEDULE TIMELINE
================================================== */

.schedule-timeline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}



/* ==================================================
   DASHBOARD - OWNERS
================================================== */


.page-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    padding: 20px;
}

/* CARD STYLE */
.card {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 16px;
}

/* FORM */
.form-card h2,
.list-card h2 {
    margin-top: 0;
    font-size: 16px;
    color: #fff;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.form-grid input {
    background: #111;
    border: 1px solid #333;
    color: white;
    padding: 10px;
    border-radius: 6px;
}

/* BUTTONS */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

button.secondary {
    background: #333;
}

/* LIST */
.owner-list div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #2a2a2a;
}

.owner-list b {
    color: white;
}

.owner {
    display: inline-block;
    font-size: 11px;
    background: transparent;
    color: #ccc;
    padding: 3px 8px;
    border: 1px solid #333;
    border-radius: 3px;
    margin-top: 6px;
}

.owner::before {
    content: "";
}

/* ==================================================
   OTHER
================================================== */

.schedule-library-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 8px;
    border-bottom: 1px solid #222;
    gap: 12px;
}

.schedule-library-row:hover {
    background: #1a1a1a;
}

.schedule-lib-title {
    flex: 1;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.schedule-lib-duration {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
}

.schedule-lib-action {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.schedule-lib-right {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}




#libraryPagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.page-btn {
    background: #222;
    border: 1px solid #333;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
}

.page-btn:hover {
    background: #333;
}

.page-btn.active {
    background: #444;
    font-weight: bold;
}

.controls-bar,
.pagination-bar {
    position: sticky;
    background: #0f172a;
    z-index: 10;
}

/* ================================
   WEEKLT SLOTS
================================ */

.week-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: auto;
}

.week-header,
.week-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    align-items: stretch;
}

.week-time-label {
    font-size: 11px;
    padding: 4px;
    border-right: 1px solid #333;
    opacity: 0.6;
}

.week-day-header {
    text-align: center;
    padding: 8px;
    font-weight: bold;
    border-bottom: 1px solid #333;
}

.week-cell {
    border: 1px solid #222;
    min-height: 28px;
    padding: 2px;
    font-size: 11px;
}

.grid-item {
    background: #2b2b2b;
    margin: 1px 0;
    padding: 2px;
    border-radius: 3px;
}

.slot-type {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 2px;
    text-transform: uppercase;
}

.clickable-slot {
    cursor: pointer;
}

.clickable-slot:hover {
    background: rgba(255,255,255,0.05);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-box {
    background: #1e1e1e;
    color: white;
    padding: 18px;
    border-radius: 10px;
    width: 320px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.modal-box label {
    display:block;
    margin-top:10px;
    font-size: 12px;
    opacity: 0.8;
}

.modal-box select {
    width: 100%;
    padding: 6px;
    margin-top: 4px;
}

.modal-box button {
    padding: 8px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #4caf50;
    color: white;
}

.btn-danger {
    background: #e53935;
    color: white;
}

.grid-item {
    font-size: 12px;
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    transition: 0.15s;
}

.grid-item:hover {
    filter: brightness(0.9);
    transform: scale(1.02);
}

.slot-type {
    font-size: 10px;
    opacity: 0.8;
}

/* ================================
   OWNERS TABLE ROW LAYOUT
================================ */

#ownerList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* each owner row */
.owner-row {
    display: grid;

    grid-template-columns:
        1.2fr   /* name */
        1.5fr   /* email */
        1fr     /* phone */
        2fr     /* notes */
        auto;   /* actions */

    gap: 12px;

    align-items: center;

    padding: 10px 12px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    font-size: 13px;
}

/* columns */
.owner-name {
    font-weight: 600;
    color: var(--text);
}

.owner-email,
.owner-phone {
    color: var(--muted);
}

.owner-notes {
    color: var(--muted);

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* actions on far right */
.owner-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

/* buttons slightly tighter inside table rows */
.owner-row button {
    padding: 6px 10px;
    font-size: 12px;
}


/* ==================================================
   VIDEO PLAYER
   ================================================== */

.player-panel {
    margin-top: 20px;
    padding: 10px;
    background: #111;
    border-radius: 10px;
    color: #fff;
}

/* ==================================================
   MOBILE
   ================================================== */

@media (max-width: 900px) {

    .topbar {
        height: auto;
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    #scheduleList .card {
        grid-template-columns: 1fr;
    }

    body > div[style*="display:flex"] {
        flex-direction: column;
    }
}

        .control-content {
            max-width: 900px;
            margin: 32px auto;
            padding: 0 20px 40px;
        }

        .control-heading {
            margin-bottom: 8px;
        }

        .control-description {
            opacity: .75;
            margin-bottom: 28px;
        }

        .control-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 18px;
        }

        .control-card {
            padding: 24px;
            border-radius: 12px;
            background: rgba(30, 40, 55, .85);
            border: 1px solid rgba(150, 180, 210, .22);
        }

        .control-card h3 {
            margin: 0 0 12px;
        }

        .control-card p {
            min-height: 44px;
            opacity: .8;
            line-height: 1.5;
        }

        .control-action {
            width: 100%;
            padding: 13px 16px;
            border: 0;
            border-radius: 7px;
            color: white;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
        }

        .control-action:disabled {
            opacity: .55;
            cursor: wait;
        }

        .bug-button { background: #1677c8; }
        .clock-button { background: #16845b; }
        .power-button { background: #a65d12; }

        #controlStatus {
            margin-top: 22px;
            padding: 14px 16px;
            border-radius: 8px;
            background: rgba(30, 40, 55, .85);
            overflow-wrap: anywhere;
        }

        #controlStatus:empty {
            display: none;
        }

/* ---------------- CONTROL PAGE LIVE PLAYER ---------------- */

.control-live-panel {
    margin: 24px 0;
    padding: 18px;
    border-radius: 12px;
    background: rgba(30, 40, 55, .85);
    border: 1px solid rgba(150, 180, 210, .22);
}

.control-live-panel h3 {
    margin-top: 0;
}

#controlLiveWrapper {
    width: 100%;
    max-width: 960px;
    margin-top: 14px;
}

#controlLivePlayer {
    display: block;
    width: 100%;
    max-height: 540px;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
}

#controlLiveStatus {
    margin-top: 8px;
    opacity: .8;
    font-size: .9rem;
}

.control-live-button {
    padding: 10px 16px;
    border: 0;
    border-radius: 7px;
    color: white;
    background: #16845b;
    font-weight: 700;
    cursor: pointer;
}



/* ---------------- KILOVIEW STATUS PANEL ---------------- */

.kiloview-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.kiloview-status-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(150, 180, 210, .22);
    border-radius: 8px;
    background: rgba(10, 18, 30, .35);
}

.kiloview-status-item span,
.kiloview-refresh-note {
    opacity: .75;
    font-size: .9rem;
}

.kiloview-status-item strong {
    overflow-wrap: anywhere;
}

.kiloview-status-item strong[data-state="active"],
.kiloview-status-item strong[data-state="recording"] {
    color: #55d99a;
}

.kiloview-status-item strong[data-state="inactive"],
.kiloview-status-item strong[data-state="stopped"] {
    color: #ffb45e;
}

.kiloview-refresh-note {
    margin-bottom: 0;
}


.kiloview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.kiloview-actions .control-action {
    width: auto;
    min-width: 145px;
    min-height: 44px;
}

.kiloview-start-button {
    background: #16845b;
}

.kiloview-stop-button {
    background: #b83b3b;
}

.kiloview-toggle-button {
    min-width: 180px;
}

.kiloview-actions .control-action:disabled {
    opacity: .55;
    cursor: wait;
}

#kiloviewActionStatus {
    margin: 12px 0 0;
    overflow-wrap: anywhere;
}

#kiloviewActionStatus:empty {
    display: none;
}


/* Lindy outlet 2: state reflects the encoder's reported outlet status. */
.power-button.lindy-power-on {
    background: #16845b;
}

.power-button.lindy-power-off {
    background: #b83b3b;
}

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

#lindyPowerStatus {
    margin: 10px 0 0;
    overflow-wrap: anywhere;
}
