body {
    font-family: Arial, sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 20px;
    color: #111827;
}

h1 {
    margin: 0 0 10px 0;
    font-size: 30px;
    line-height: 1.1;
}

.page-subtitle {
    margin: 8px 0 0 0;
    color: #64748b;
    font-size: 14px;
}

.container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #1677ee;
    color: white;
    padding: 14px 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

tr:hover {
    background: #f8fbff;
}

img {
    border-radius: 6px;
}

button:hover {
    opacity: 0.9;
}

.alert {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid transparent;
}

.alert.error {
    background: #ffe5e5;
    color: #a30000;
    border-color: #ff4d4d;
}

.alert.success {
    background: #e6ffed;
    color: #0f7a2f;
    border-color: #4dff88;
}

.alert.info {
    background: #eef6ff;
    color: #0f4c81;
    border-color: #b9d8ff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    transition: all .18s ease;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #1677ee;
    color: #fff;
    border-color: #1677ee;
}

.btn-primary:hover {
    background: #0f67d4;
    border-color: #0f67d4;
}

.btn-danger {
    background: #e5484d;
    color: #fff;
    border-color: #e5484d;
}

.btn-danger:hover {
    background: #cf3d42;
    border-color: #cf3d42;
}

.btn-edit {
    background: #f4f6fb;
    color: #1f2937;
    border-color: #d9e0ee;
}

.btn-edit:hover {
    background: #e9eef8;
}

.btn-danger-outline {
    background: #fff5f5;
    color: #c62828;
    border-color: #f0b4b4;
}

.btn-danger-outline:hover {
    background: #ffe8e8;
}

.btn-secondary {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background: #eef2f7;
}

.btn-dark {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.btn-dark:hover {
    background: #1e293b;
    border-color: #1e293b;
}

.inline-form {
    margin: 0;
    display: inline-block;
}

.actions-cell .btn {
    margin: 0;
}

/* Toggle */
.toggle-switch-form {
    display: inline-block;
    margin: 0;
}

.toggle-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.toggle-switch-track {
    position: relative;
    width: 50px;
    height: 28px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background .2s ease;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.toggle-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: left .2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
}

.toggle-switch-btn.is-on .toggle-switch-track {
    background: #22c55e;
}

.toggle-switch-btn.is-on .toggle-switch-thumb {
    left: 25px;
}

.toggle-switch-btn.is-off .toggle-switch-track {
    background: #d1d5db;
}

.toggle-switch-label {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

/* Dashboard drag */
.drag-handle {
    cursor: grab;
    text-align: center;
    font-size: 18px;
    user-select: none;
    color: #666;
}

.drag-handle.drag-disabled {
    cursor: not-allowed;
    color: #b0b7c3;
}

#poster-sortable tr.dragging {
    opacity: 0.45;
    background: #eef6ff;
}

#poster-sortable tr {
    transition: background .12s ease;
}

.order-cell {
    text-align: center;
}

.order-badge {
    display: inline-block;
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    font-weight: 700;
    text-align: center;
}

.drag-actions {
    margin-top: 14px;
}

.drag-status {
    margin-top: 12px;
}

/* Filters / bulk */
.filters-bar {
    margin-bottom: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e3e9f4;
    border-radius: 14px;
}

.filters-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.filter-group input,
.filter-group select,
.bulk-action-form select,
.login-form input,
.login-form select {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d9e0ee;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.bulk-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.bulk-action-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-action-form.hidden,
.bulk-delete-form.hidden,
.select-col.hidden {
    display: none !important;
}

.selected-count {
    font-weight: 700;
    color: #334155;
    background: #eef2ff;
    padding: 8px 12px;
    border-radius: 999px;
}

#select-all-posters,
.poster-check {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#poster-sortable tr.row-selected {
    background: #eef6ff !important;
}

#poster-sortable tr.row-selected:hover {
    background: #e3f0ff !important;
}

/* Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-always {
    background: #eef6ff;
    color: #0f4c81;
    border-color: #b9d8ff;
}

.badge-scheduled {
    background: #fff7e6;
    color: #9a6700;
    border-color: #f3d18b;
}

.badge-live {
    background: #e6ffed;
    color: #0f7a2f;
    border-color: #97e0ad;
}

.badge-future {
    background: #fff8db;
    color: #8a6d00;
    border-color: #ead67a;
}

.badge-expired {
    background: #ffe5e5;
    color: #a30000;
    border-color: #ffb3b3;
}

.badge-inactive {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

/* Sort */
.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.sort-btn .sort-label {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(255,255,255,0.45);
}

.sort-btn .sort-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
    color: #ffffff;
    opacity: 1;
}

.sort-btn:hover {
    color: #ffffff;
    opacity: 0.95;
}

.sort-btn:hover .sort-label {
    text-decoration-color: rgba(255,255,255,0.95);
}

.sort-btn.active {
    color: #ffffff;
}

.sort-btn.active .sort-icon {
    color: #1677ee;
    background: #ffffff;
    border-radius: 999px;
    padding: 2px 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.table-help {
    margin: 10px 0 14px 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: #eef6ff;
    border: 1px solid #b9d8ff;
    color: #0f4c81;
    font-size: 14px;
    font-weight: 600;
}

/* Table polish */
.table-card {
	width: 100%;
    max-width: 100%;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.table-responsive {
    /*width: 100%;*/
    overflow-x: auto;
}

.modern-table {
    width: 100%;
     table-layout: auto;
	/*min-width: 860px;*/
    border-collapse: collapse;
}

.modern-table th {
    font-size: 13px;
    color: #ffffff;
    white-space: nowrap;
}
table th {
    color: #ffffff;
    white-space: nowrap;
}

.modern-table td,
table td {
	word-wrap: break-word;
    font-size: 14px;
}

.modern-table thead {
    display: table-header-group;
}

.modern-table tbody {
    display: table-row-group;
}

.modern-table tr {
    display: table-row;
}

.modern-table th,
.modern-table td {
    display: table-cell;
}

.table-title-cell {
    font-weight: 700;
    color: #0f172a;
}

.empty-state {
    padding: 28px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fbff;
}

.empty-state h3 {
    margin: 0 0 8px 0;
}

.empty-state p {
    margin: 0;
    color: #64748b;
}

/* Dashboard specific overflow fix */
.dashboard-table-wrap,
.table-scroll-wrap {
    width: 100%;
    overflow-x: auto;
}

/* Login */
.login-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at top left, rgba(22,119,238,0.15), transparent 30%),
        radial-gradient(circle at bottom right, rgba(34,197,94,0.12), transparent 25%),
        #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell {
    width: 100%;
    max-width: 460px;
    padding: 24px;
    box-sizing: border-box;
}

.login-card {
    background: #fff;
    border-radius: 22px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.login-brand {
    margin-bottom: 24px;
}

.login-brand h1 {
    margin: 0 0 8px 0;
    font-size: 34px;
}

.login-brand p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-block label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.login-submit {
    width: 100%;
    margin-top: 8px;
}

/* Preview grid */
.preview-shell {
    max-width: 1400px;
}

.preview-info-bar {
    margin: 14px 0 18px 0;
}

.poster-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.poster-preview-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.poster-preview-image {
    background: #f8fafc;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.poster-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-preview-empty {
    color: #64748b;
    font-weight: 600;
}

.poster-preview-body {
    padding: 14px;
}

.poster-preview-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

.poster-preview-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Simulator */
.simulator-shell {
    max-width: 1500px;
}

.simulator-topbar {
    margin-bottom: 18px;
}

.simulator-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.simulator-status,
.simulator-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.simulator-stage {
    position: relative;
    background: #0f172a;
    border-radius: 18px;
    overflow: hidden;
    min-height: 620px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
}

.sim-progress-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    z-index: 20;
}

.sim-progress-bar {
    width: 0%;
    height: 100%;
    background: #22c55e;
}

.sim-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.sim-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.sim-image-wrap {
    width: 100%;
    height: 620px;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sim-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.sim-empty {
    color: #cbd5e1;
    font-size: 18px;
    font-weight: 700;
}

.sim-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 18px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.25));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 3;
}

.sim-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
}

.sim-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.simulator-shell.is-fullscreen {
    max-width: none;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    padding: 18px;
    box-sizing: border-box;
    background: #0b1220;
}

.simulator-shell.is-fullscreen .simulator-topbar h1,
.simulator-shell.is-fullscreen .simulator-topbar p {
    color: #fff;
}

.simulator-shell.is-fullscreen .simulator-toolbar {
    margin-bottom: 14px;
}

.simulator-shell.is-fullscreen .simulator-stage {
    height: calc(100vh - 190px);
    min-height: 0;
}

.simulator-shell.is-fullscreen .sim-image-wrap {
    height: 100%;
}

.simulator-shell.is-fullscreen .sim-caption {
    padding: 18px 22px;
}

.simulator-shell.is-fullscreen .sim-title {
    font-size: 24px;
}

.simulator-shell.is-fullscreen .sim-meta .status-badge {
    font-size: 13px;
}

/* Player mode */
.player-mode-body {
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
}

.player-mode-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
}

.player-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.player-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-progress-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 20;
}

.player-progress-bar {
    width: 0%;
    height: 100%;
    background: #22c55e;
}

.player-overlay-info {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: end;
    z-index: 30;
    flex-wrap: wrap;
}

.player-overlay-left,
.player-overlay-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.player-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

.player-empty,
.player-empty-full {
    color: #cbd5e1;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    padding: 40px;
}

.player-empty-full {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */

.players-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin: 0 0 18px 0;
}

.summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
	text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.summary-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}

.summary-value {
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    color: #0f172a;
}

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

.summary-card.active {
    border: 2px solid #1677ee;
    box-shadow: 0 10px 26px rgba(22, 119, 238, 0.18);
}

.summary-online {
    border-left: 6px solid #22c55e;
}

.summary-offline {
    border-left: 6px solid #ef4444;
}

.summary-warning {
    border-left: 6px solid #f59e0b;
}

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

    body {
        padding: 12px;
    }

    .container {
		
        padding: 20px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .actions {
        justify-content: flex-start;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: auto;
    }

    .actions-cell {
        white-space: normal;
    }
}

.actions-cell .btn,
.inline-form button.btn {
    min-height: 42px;
}

.date-cell {
    min-width: 95px;
}

.date-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
}

.date-value {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

/* ===== PLAYLIST ACTIONS: CLEAN & FINAL ===== */

.actions-cell {
    vertical-align: top;
    width: 320px;
    min-width: 320px;
}

.actions-main,
.actions-more-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.actions-more {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.actions-cell .inline-form,
.actions-cell .action-form {
    display: inline-block;
    margin: 0;
}

.actions-cell .btn,
.actions-cell .action-btn,
.actions-cell .inline-form .btn,
.actions-cell .action-form .btn,
.actions-cell .more-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    height: 40px;
    padding: 0 14px;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
    width: auto !important;
}

.actions-cell .btn:hover {
    transform: translateY(-1px);
}

.btn-player {
    background: #0f172a;
    color: #fff;
    border: 1px solid #0f172a;
}

.btn-light {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    color: #334155;
}

.btn-ghost {
    background: #ffffff;
    border: 1px solid #dbeafe;
    color: #475569;
}

.btn-danger-soft {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.hidden {
    display: none !important;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.dot-online {
    background: #22c55e;
}

.dot-offline {
    background: #ef4444;
}

.dot-warning {
    background: #f59e0b;
}

.status-dot-before {
    margin-right: 6px;
    margin-left: 0;
}

.dot-red {
    background: #e02424;
}

.dot-green {
    background: #22c55e;
}

.dot-gray {
    background: #9ca3af;
}

.publish-btn {
    position: relative;
}

.publish-btn .status-dot {
    margin-left: 6px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 2;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 10px;
}

.modal-content p {
    font-size: 14px;
    color: #555;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

.modal-actions .btn {
    flex: 1;
}

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

.btn-tooltip-wrap {
    display: inline-block;
}

.btn-tooltip-wrap > button:disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== PLAYER ACTIONS UNIFORMI ===== */

.action-stack {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.action-stack .btn,
.action-stack .action-btn,
.action-stack a.btn,
.action-stack button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    height: 40px;
    padding: 0 14px;
    box-sizing: border-box;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
}

.action-stack button.btn {
    border: 1px solid transparent;
    margin: 0;
}

.action-stack .btn-secondary {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.action-stack .btn-secondary:hover {
    background: #eef2f7;
}

.action-stack .btn-danger {
    background: #e5484d;
    color: #fff;
    border: 1px solid #e5484d;
}

.action-stack .btn-danger:hover {
    background: #cf3d42;
    border-color: #cf3d42;
}

.player-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    max-width: 320px;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-online {
    background: #22c55e;
}

.dot-offline {
    background: #ef4444;
}

.info-block {
    margin-bottom: 14px;
}

.label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
}

.value {
    font-size: 14px;
    color: #111827;
}

.value small {
    color: #64748b;
    font-size: 11px;
}

.row-offline {
    background: rgba(239, 68, 68, 0.06);
}

.row-warning {
    background: rgba(245, 158, 11, 0.08);
}

.btn-link {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.btn-link.secondary {
    background: #e5e7eb;
    color: #111827;
}

.order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #1d4ed8;
    font-weight: 700;
}

.form-section {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #f8fbff;
}

.form-section h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #0f172a;
}

.helper-text {
    color: #5c6470;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
}

.poster-advanced-box {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.form-group {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 6px;
    font-weight: 600;
    min-height: 32px;
    line-height: 1.2;
}

.form-group small {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.custom-schedule-box {
    border: 1px solid #e3e9f4;
    border-radius: 12px;
    padding: 12px;
    background: #fafcff;
    margin-bottom: 10px;
}

.section-title {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 12px;
    color: #0f172a;
}

.custom-date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.custom-date-grid.three-cols {
    grid-template-columns: 1fr 1fr 1fr;
}

.custom-schedule-box label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #475569;
}

@media (max-width: 760px) {
    .custom-date-grid.three-cols {
        grid-template-columns: 1fr;
    }
}

.custom-schedule-box input {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #d9e0ee;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.custom-schedule-box small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.3;
}

.custom-date-grid > div {
    display: flex;
    flex-direction: column;
}

/* ===== MODERN FORMS ===== */

.form-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 32px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-card .field-block input,
.form-card .field-block select {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d9e0ee;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
}

.field-help {
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 30px;
    flex: 0 0 auto;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    background-color: #d1d5db;
	position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: .2s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.switch input:checked + .slider {
    background-color: #22c55e; /* verde come dashboard */
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
    background-color: white;
}

@media (max-width: 800px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

.compact-toggle-row {
    justify-content: flex-start;
    background: transparent;
    border: 0;
    padding: 4px 0;
}

.compact-toggle-row strong {
    font-size: 15px;
    color: #0f172a;
}

.status-toggle {
    transition: all 0.2s ease;
    border-radius: 14px;
    padding: 14px;
}

.status-toggle.active {
    background: #e6ffed;
    border: 1px solid #97e0ad;
}

.status-toggle.inactive {
    background: #fff5f5;
    border: 1px solid #fecaca;
}

/* ===== FIX PLAYER SUMMARY ===== */

.players-summary {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(180px, 1fr)) !important;
    gap: 16px !important;
    margin: 18px 0 22px 0 !important;
    align-items: stretch !important;
}

.players-summary .summary-card {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    box-sizing: border-box;
}

.players-summary .summary-card.active {
    border: 2px solid #1677ee;
}

.players-summary .summary-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.players-summary .summary-value {
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    color: #0f172a;
}

@media (max-width: 1100px) {
    .players-summary {
        grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .players-summary {
        grid-template-columns: 1fr !important;
    }
}

.players-summary .summary-online {
    border-left: 6px solid #22c55e !important;
}

.players-summary .summary-offline {
    border-left: 6px solid #ef4444 !important;
}

.players-summary .summary-warning {
    border-left: 6px solid #f59e0b !important;
}

.players-summary .summary-all {
    border-left: 6px solid #1677ee !important;
}

.feature-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feature-toggle-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-toggle {
    width: 46px;
    height: 24px;
    border-radius: 999px;
    border: 0;
    background: #cbd5e1;
    padding: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s ease;
}

.mini-toggle span {
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    display: block;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.mini-toggle.is-on {
    background: #22c55e;
}

.mini-toggle.is-on span {
    transform: translateX(22px);
}

/* ===== MANUAL CONTENTS ===== */

.manual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.manual-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    transition: all .18s ease;
}

.manual-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.manual-card-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.manual-card-meta {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.manual-category-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 0;
    border-bottom: 1px solid #e5e7eb;
}

.manual-category-row:last-child {
    border-bottom: 0;
}

.manual-category-main {
    min-width: 0;
}

.manual-category-title {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.manual-category-slug {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.manual-category-desc {
    margin-top: 6px;
    color: #475569;
    font-size: 14px;
}

.manual-category-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.manual-form-grid {
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 20px;
    align-items: flex-start;
}

.manual-side-card {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 18px;
}

.manual-image-current {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
}

.manual-image-current img {
    width: 100%;
    max-height: 230px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}

.media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.media-picker-card {
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 8px;
    cursor: pointer;
    background: #fff;
    transition: all .15s ease;
}

.media-picker-card:hover {
    border-color: #1677ee;
    transform: translateY(-1px);
}

.media-picker-card.is-selected {
    border-color: #1677ee;
    box-shadow: 0 0 0 3px rgba(22, 119, 238, 0.14);
}

.media-picker-card img {
    width: 100%;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    background: #f1f5f9;
}

.media-picker-title {
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.25;
    color: #334155;
    font-weight: 700;
}

.manual-thumb {
    width: 110px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
}

.manual-title-block strong {
    display: block;
    font-size: 15px;
    color: #0f172a;
    margin-bottom: 5px;
}

.manual-title-block .small {
    color: #64748b;
    line-height: 1.35;
}

.form-card textarea,
.form-card input[type="text"],
.form-card input[type="date"],
.form-card input[type="file"],
.form-card select,
.form-control {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d9e0ee;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
}

.form-card textarea {
    min-height: 130px;
    resize: vertical;
}

@media (max-width: 950px) {
    .manual-form-grid {
        grid-template-columns: 1fr;
    }

    .manual-category-row {
        grid-template-columns: 28px 1fr;
    }

    .manual-category-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

/* ===== RSS MANAGEMENT ===== */

/* Nuova sorgente */
.rss-create-grid {
    display: grid;
    grid-template-columns:
        minmax(180px, 1fr)
        minmax(420px, 3fr)
        minmax(150px, 0.8fr)
        minmax(190px, 0.9fr)
        minmax(90px, 0.5fr)
        auto;
    gap: 14px;
    align-items: end;
    margin-top: 22px;
}

.rss-create-grid .filter-group {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.rss-create-grid .filter-group > label:first-child {
    min-height: 18px;
    margin-bottom: 6px;
}

.rss-create-grid input[type="text"],
.rss-create-grid input[type="url"],
.rss-create-grid input[type="number"] {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
}

.rss-create-grid .small {
    margin-top: 6px;
    line-height: 1.2;
}

.rss-create-grid .filter-actions {
    align-self: end;
    padding-bottom: 0;
}

/* Tabella sorgenti */
.rss-sources-table {
    width: 100%;
    table-layout: fixed;
}

.rss-sources-table th,
.rss-sources-table td {
    box-sizing: border-box;
}

.rss-sources-table th:nth-child(3),
.rss-sources-table th:nth-child(4),
.rss-sources-table th:nth-child(5),
.rss-source-row td:nth-child(3),
.rss-source-row td:nth-child(4),
.rss-source-row td:nth-child(5) {
    text-align: center;
}

.rss-source-row td {
    vertical-align: top;
    padding-top: 18px;
    padding-bottom: 18px;
}

.rss-source-row td:nth-child(3),
.rss-source-row td:nth-child(5) {
    padding-left: 12px;
    padding-right: 12px;
}

.rss-source-row td:nth-child(4) {
    padding-left: 18px;
    padding-right: 18px;
}

/* Campi modifica sorgente */
.rss-input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #d6deeb;
    border-radius: 8px;
    box-sizing: border-box;
    background: #fff;
}

.rss-settings-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.rss-settings-row label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #46536a;
}

.rss-inline-number {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rss-number-input {
    width: 85px;
    min-height: 34px;
    padding: 5px 8px;
    border: 1px solid #d6deeb;
    border-radius: 7px;
}

.rss-save-button {
    margin-top: 12px;
}

/* Contenuti e stato */
.rss-center-cell {
    text-align: center;
}

.rss-count {
    margin: 0 auto;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.rss-date {
    max-width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.45;
}

.rss-error {
    max-width: 320px;
    margin-top: 7px;
    color: #b91c1c;
    font-size: 12px;
    word-break: break-word;
}

.rss-status-text {
    margin-top: 7px;
}

/* Pulsanti azioni */
.rss-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 8px;
    min-width: 240px;
}

.rss-actions form {
    margin: 0;
}

.rss-actions button {
    width: 100%;
    min-height: 40px;
}

.rss-actions form:last-child {
    grid-column: 1 / -1;
}
.rss-sources-table thead {
    display: table-header-group;
    width: auto;
}

.rss-sources-table tbody {
    display: table-row-group;
    width: auto;
}

.rss-sources-table tr {
    display: table-row;
}

.rss-sources-table th,
.rss-sources-table td {
    display: table-cell;
}

/* Responsive */
@media (max-width: 1200px) {
    .rss-create-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .rss-create-grid .filter-actions {
        grid-column: 1 / -1;
    }
}

.portal-global-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;

    margin-bottom: 24px;
    padding: 14px 16px;

    background: #ffffff;
    border: 1px solid #dbe3f0;
    border-radius: 16px;

    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.portal-nav-links,
.portal-nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-organization-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-organization-selector label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.portal-organization-selector select {
    min-height: 40px;
    padding: 8px 12px;

    border: 1px solid #cfd8ea;
    border-radius: 10px;

    background: #fff;
    color: #0f172a;

    font-weight: 600;
}


/* ICONNECT_FASE11_2_2_GLOBAL_FILE_UPLOAD */
input[type="file"]{
  min-height:42px;
  line-height:40px;
  color:#64748b;
  font-size:13px;
  vertical-align:middle;
}
input[type="file"]::file-selector-button{
  min-width:126px;
  height:40px;
  margin:0 10px 0 0;
  padding:0 14px;
  border:1px solid #cfd8ea;
  border-radius:10px;
  background:#fff;
  color:#0f172a;
  font-weight:800;
  text-align:center;
  line-height:38px;
  cursor:pointer;
  box-shadow:0 2px 6px rgba(15,23,42,.04);
  transition:.15s ease;
}
input[type="file"]::file-selector-button:hover{
  border-color:var(--brand-primary,#1677ff);
  box-shadow:0 4px 12px rgba(15,23,42,.08);
}
.file-upload-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  line-height:1!important;
  min-width:126px;
}



/* ==========================================================
   ICONNECT_SECURITY_V1 - 2FA + session timeout
   ========================================================== */
.security-login-shell{max-width:520px}.security-card h1{margin:10px 0 8px;font-size:28px}.security-lead{margin:0 0 20px;color:#64748b;line-height:1.5}.security-icon{width:54px;height:54px;border-radius:16px;display:grid;place-items:center;background:#eaf3ff;color:#1677ee;font-weight:900;font-size:15px}.security-icon.success{background:#e8fff0;color:#15803d;font-size:26px}.qr-wrap{display:flex;justify-content:center;margin:18px 0}.qr-wrap img{width:220px;height:220px;object-fit:contain;border:1px solid #e2e8f0;border-radius:16px;padding:10px;background:#fff}.security-help{font-size:12px;color:#64748b;text-align:center}.security-secret-box{display:flex;flex-direction:column;gap:8px;margin:16px 0;padding:14px;border:1px solid #dbe3ef;border-radius:12px;background:#f8fafc}.security-secret-box span{font-size:11px;font-weight:800;text-transform:uppercase;color:#64748b}.security-secret-box code{font-size:15px;font-weight:800;letter-spacing:.08em;word-break:break-all;color:#0f172a}.security-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.recovery-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:18px 0}.recovery-grid code{padding:10px 12px;border:1px solid #dbe3ef;border-radius:10px;background:#f8fafc;text-align:center;font-weight:800;letter-spacing:.04em}.recovery-details{margin-top:8px;padding:12px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}.recovery-details summary{cursor:pointer;font-weight:800;color:#475569}.recovery-field{margin-top:12px}.security-settings-page{max-width:1100px}.security-settings-card{max-width:780px}.security-2fa-admin{margin-top:18px}.security-2fa-status{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px}.security-2fa-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
@media(max-width:600px){.recovery-grid{grid-template-columns:1fr}}
