/* Víkingur Digital Signage — Admin Theme */
:root {
    /* Club colors: Red & Black */
    --color-bg:             #0c0c0e;
    --color-surface:        #161618;
    --color-surface-alt:    #1e1e22;
    --color-border:         #2a2a30;
    --color-primary:        #ba0000;
    --color-primary-light:  #d41a1a;
    --color-accent:         #b46528;
    --color-success:        #22c55e;
    --color-warning:        #f59e0b;
    --color-danger:         #ef4444;
    --color-text:           #f0f0f5;
    --color-text-secondary: #a0a0b5;
    --color-text-muted:     #606070;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    --text-4xl: 36px;

    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;

    /* Spacing */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Components */
    --card-radius: 12px;
    --card-padding: 24px;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 68px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow);
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    min-height: 44px;
}

.sidebar-crest {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-extrabold);
    color: var(--color-primary-light);
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-sm) 0;
}

.nav-section {
    margin-bottom: var(--space-xs);
}

.nav-section-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: var(--space-md) var(--space-md) var(--space-xs);
    white-space: nowrap;
}

.nav-list {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 9px var(--space-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-sans);
    position: relative;
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--color-surface-alt);
}

.nav-link.active {
    color: var(--color-primary-light);
    background: rgba(186, 0, 0, 0.1);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--color-primary);
    border-radius: 0 3px 3px 0;
}


.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-label {
    overflow: hidden;
}

/* Tooltip on hover when collapsed */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 9px 0;
}

.sidebar.collapsed .nav-section-label {
    display: none;
}

.sidebar.collapsed .nav-link[data-tooltip] {
    position: relative;
}

.sidebar.collapsed .nav-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) - 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-surface-alt);
    color: var(--color-text);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: var(--text-sm);
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
    pointer-events: none;
}

.sidebar-footer {
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

.sidebar-toggle .nav-icon {
    transition: transform var(--transition-normal);
}

.sidebar-logout:hover {
    color: var(--color-danger);
}

/* Content */
.content {
    flex: 1;
    padding: var(--space-2xl);
    overflow-y: auto;
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h2 {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
}

.page-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-normal);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: var(--weight-extrabold);
    color: var(--color-text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-select {
    padding: 4px 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 13px;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Preview */
.preview-container {
    background: var(--color-bg);
    border-radius: 8px;
    overflow: hidden;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg);
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    padding: var(--space-2xl);
    width: 380px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-header h1 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: var(--weight-extrabold);
    color: var(--color-primary-light);
}

.login-header p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.login-error {
    color: var(--color-danger);
    font-size: 13px;
    text-align: center;
    margin-bottom: var(--space-md);
}

/* Toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    cursor: pointer;
    transition: all 200ms ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--color-text-muted);
    border-radius: 50%;
    transition: all 200ms ease;
}

.toggle input:checked + .toggle-slider {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* Page header row */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Config field */
.config-field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

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

.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    padding: var(--space-xl);
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.modal h3 {
    margin-bottom: var(--space-lg);
}

.modal-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* Danger ghost button */
.btn-danger-ghost {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Widget type badge */
.widget-type-badge {
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-surface-alt);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Buckets */
.buckets-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.bucket-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.bucket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bucket-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.bucket-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.bucket-count {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Upload area */
.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: var(--space-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    transition: all 200ms ease;
}

.upload-area.drag-active {
    border-color: var(--color-primary);
    background: rgba(196, 30, 58, 0.05);
}

.upload-progress {
    text-align: center;
    color: var(--color-primary-light);
    font-size: 14px;
    padding: var(--space-sm);
}

/* Image grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.image-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-bg);
}

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

.image-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    opacity: 0;
    transition: opacity 200ms ease;
}

.image-thumb:hover .image-thumb-overlay {
    opacity: 1;
}

.image-thumb-name {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-align: center;
    padding: 0 var(--space-sm);
    word-break: break-all;
}

/* Players grid */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}

.player-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    display: flex;
    overflow: hidden;
}

.player-photo {
    width: 100px;
    height: 130px;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    background: var(--color-bg);
}

.player-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 200ms ease;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.player-photo:hover .player-photo-overlay {
    opacity: 1;
}

.player-info {
    flex: 1;
    display: flex;
    align-items: center;
    padding: var(--space-md);
    gap: var(--space-md);
}

.player-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    min-width: 40px;
    text-align: center;
}

.player-details {
    flex: 1;
}

.player-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}

.player-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.player-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.player-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    align-items: flex-end;
}

/* Lineup Editor */
.lineup-editor-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
    align-items: start;
}

.editor-pitch-container {
    position: sticky;
    top: var(--space-lg);
}

.editor-pitch {
    position: relative;
    width: 100%;
    aspect-ratio: 1.5;
    background: #1a6b37;
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    overflow: visible;
}

.editor-pitch::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        #1a6b37 0%, #1a6b37 9%,
        #1d7a3e 9%, #1d7a3e 18%
    );
    opacity: 0.6;
}

.editor-pitch .pitch-center-line {
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
}

.editor-pitch .pitch-center-circle {
    position: absolute;
    top: 50%; left: 50%;
    width: 18%; aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.editor-pitch .pitch-penalty-area {
    position: absolute;
    left: 50%; width: 44%; height: 18%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transform: translateX(-50%);
}

.editor-pitch .pitch-penalty-area.top { top: 0; border-top: none; }
.editor-pitch .pitch-penalty-area.bottom { bottom: 0; border-bottom: none; }

.editor-pitch .pitch-goal-area {
    position: absolute;
    left: 50%; width: 20%; height: 7%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transform: translateX(-50%);
}

.editor-pitch .pitch-goal-area.top { top: 0; border-top: none; }
.editor-pitch .pitch-goal-area.bottom { bottom: 0; border-bottom: none; }

/* Position markers */
.editor-position {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    transition: transform 150ms ease, filter 150ms ease;
}

.editor-position:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.editor-position.selected {
    transform: translate(-50%, -50%) scale(1.15);
}

.editor-position-empty {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.editor-position.selected .editor-position-empty {
    border-color: var(--color-primary-light);
    background: rgba(196, 30, 58, 0.3);
}

/* Drag & drop states */
.editor-position.drop-target-active {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 20;
}

.editor-position.drop-target-active .editor-position-empty {
    border-color: var(--color-success);
    border-style: solid;
    background: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.4);
}

.editor-position.drop-target-active .editor-position-photo {
    border-color: var(--color-warning);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.editor-position-filled {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
}

.editor-position-filled:active {
    cursor: grabbing;
}

.editor-position-filled[draggable="true"]:hover {
    filter: brightness(1.1);
}

/* Draggable player items in panel */
.editor-player-item[draggable="true"] {
    cursor: grab;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.editor-player-item[draggable="true"]:active {
    cursor: grabbing;
    transform: scale(0.97);
}

.editor-position-role {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.editor-position-filled {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.editor-position-photo {
    width: 50px;
    height: 62px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.editor-position.selected .editor-position-photo {
    border-color: var(--color-primary-light);
}

.editor-position-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    margin-top: -6px;
    white-space: nowrap;
}

.editor-position-number {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-primary-light);
}

.editor-position-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text);
}

/* Players panel */
.editor-players-panel {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.editor-player-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 500px;
    overflow-y: auto;
}

.editor-player-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: 8px;
    transition: background 150ms ease;
}

.editor-player-item.selectable {
    cursor: pointer;
}

.editor-player-item.selectable:hover {
    background: var(--color-surface-alt);
}

.editor-player-thumb {
    width: 40px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Clubs grid */
.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-md);
}

.club-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
}

.club-logo-container {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.club-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.club-info { flex: 1; }

.club-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}

.club-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
    display: flex;
    gap: var(--space-sm);
}

/* ================================================
   Dashboard — Command Center
   ================================================ */

.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.dash-stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    padding: var(--space-lg);
    display: flex;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.dash-stat-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-1px);
}
.dash-stat-card:hover .dash-stat-label {
    font-weight: var(--weight-semibold);
    color: var(--color-text);
}

.dash-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(186, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat-icon svg {
    width: 22px;
    height: 22px;
    color: var(--color-primary-light);
}

.dash-stat-icon--screens {
    background: rgba(34, 197, 94, 0.12);
}
.dash-stat-icon--screens svg { color: var(--color-success); }

.dash-stat-icon--players {
    background: rgba(180, 101, 40, 0.12);
}
.dash-stat-icon--players svg { color: var(--color-accent); }

.dash-stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dash-stat-number {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--weight-extrabold);
    color: var(--color-text);
    line-height: 1;
}

.dash-stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
}


/* Main grid */
.dash-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

/* Match Card */
.dash-match-active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.dash-match-competition {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: var(--space-md);
}

.dash-match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
}

.dash-match-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    min-width: 120px;
}

.dash-match-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.dash-match-logo-placeholder {
    background: var(--color-surface-alt);
    border-radius: 8px;
}

.dash-match-team-name {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--color-text);
    text-align: center;
}

.dash-match-score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.dash-match-score {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: var(--weight-extrabold);
    color: var(--color-text);
}

.dash-match-score-sep {
    color: var(--color-text-muted);
}

.dash-match-kickoff {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dash-match-vs {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--weight-extrabold);
    color: var(--color-text-muted);
}

.dash-match-kickoff-time {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.dash-phase-badge {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 20px;
}

.dash-phase-badge--pre {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
}

.dash-phase-badge--live {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
    animation: live-pulse 2s ease-in-out infinite;
}

.dash-phase-badge--post {
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.dash-match-venue {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-align: center;
    margin-top: var(--space-md);
}

.dash-match-inactive {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
}

.dash-match-inactive-icon {
    width: 48px;
    height: 48px;
    color: var(--color-text-muted);
    opacity: 0.5;
}

.dash-match-inactive p {
    color: var(--color-text-muted);
    font-size: var(--text-base);
}

/* Screens Status Card */
.dash-screens-summary {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.dash-screen-counter {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot--online {
    background: var(--color-success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.status-dot--offline {
    background: var(--color-danger);
}

.status-dot--disabled {
    background: var(--color-text-muted);
}

.dash-screen-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.dash-screen-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: 8px;
    background: var(--color-bg);
}

.dash-screen-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dash-screen-name {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text);
}

.dash-screen-location {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.dash-screen-seen {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Quick Actions */
.dash-actions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.dash-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    transition: all var(--transition-fast);
}

.dash-action-btn:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-primary);
}

.dash-action-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Activity Feed */
.dash-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dash-activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.dash-activity-item:last-child {
    border-bottom: none;
}

.dash-activity-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.dash-activity-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dash-activity-label {
    font-size: var(--text-sm);
    color: var(--color-text);
}

.dash-activity-meta {
    display: flex;
    gap: var(--space-sm);
    margin-top: 2px;
}

.dash-activity-type {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    background: var(--color-surface-alt);
    padding: 1px 6px;
    border-radius: 4px;
}

.dash-activity-time {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .dash-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-main-grid {
        grid-template-columns: 1fr;
    }
}

/* Status badge */
.status-badge {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    padding: 3px 12px;
    border-radius: 12px;
}

.status-badge--online {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
}

.status-badge--offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

/* ================================================
   Toast Notifications
   ================================================ */

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-size: var(--text-sm);
    color: var(--color-text);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(40px);
    transition: all var(--transition-normal);
    max-width: 360px;
}

.toast--visible {
    opacity: 1;
    transform: translateX(0);
}

.toast--success { border-left: 3px solid var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-danger); }
.toast--info    { border-left: 3px solid var(--color-accent); }

.toast-msg { flex: 1; }

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 2px;
}

/* ================================================
   Zone Editor (Multi-sponsor)
   ================================================ */

.zone-editor-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
    align-items: start;
}

.zone-editor-canvas-wrap {
    position: sticky;
    top: var(--space-lg);
}

.zone-editor-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #0a0a0c;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background-image: repeating-linear-gradient(
        90deg,
        rgba(186, 0, 0, 0.06) 0px, rgba(186, 0, 0, 0.06) 30px,
        transparent 30px, transparent 60px
    );
}

.zone-editor-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px;
    z-index: 5;
    pointer-events: none;
}

.zone-editor-zone {
    position: absolute;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.zone-editor-zone:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
}

.zone-editor-zone.zone-selected {
    border-color: var(--color-accent);
    border-style: solid;
    background: rgba(180, 101, 40, 0.1);
}

.zone-editor-zone.zone-drop-active {
    border-color: var(--color-success);
    border-style: solid;
    background: rgba(34, 197, 94, 0.12);
    box-shadow: inset 0 0 20px rgba(34, 197, 94, 0.1);
}

.zone-editor-empty {
    color: rgba(255, 255, 255, 0.2);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.zone-editor-filled {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    position: relative;
    padding: 8px;
}

.zone-editor-filled:active { cursor: grabbing; }

.zone-editor-thumb {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.zone-editor-color-tag {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.ztag-gold { background: rgba(180, 101, 40, 0.3); color: var(--color-accent); }
.ztag-original { background: rgba(255, 255, 255, 0.1); color: var(--color-text-muted); }

/* Panel */
.zone-editor-panel {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.zone-editor-logo-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 400px;
    overflow-y: auto;
}

.zone-editor-logo-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: 8px;
    cursor: grab;
    transition: background var(--transition-fast);
}

.zone-editor-logo-item:hover {
    background: var(--color-surface-alt);
}

.zone-editor-logo-item:active { cursor: grabbing; }

.zone-editor-logo-thumb {
    width: 44px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--color-bg);
    padding: 4px;
    flex-shrink: 0;
}

/* Logo sort items */
.logo-sort-item.sortable-ghost {
    opacity: 0.4;
    border-color: var(--color-primary) !important;
}

.logo-sort-item.sortable-chosen {
    box-shadow: 0 4px 20px rgba(186, 0, 0, 0.2);
    border-color: var(--color-primary) !important;
}

.logo-drag-handle:active {
    cursor: grabbing;
}

/* ================================================
   Loading Skeleton
   ================================================ */

.skeleton {
    background: linear-gradient(90deg, var(--color-surface-alt) 25%, var(--color-border) 50%, var(--color-surface-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; width: 60%; }
.skeleton-number { height: 36px; width: 80px; }
.skeleton-card { height: 80px; width: 100%; }

/* ================================================
   Playlist Drag & Drop
   ================================================ */

.playlist-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.playlist-item-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.playlist-item-drag {
    cursor: grab;
    color: var(--color-text-muted);
    padding: var(--space-xs);
    display: flex;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.playlist-item-drag:hover { color: var(--color-text); }
.playlist-item-drag:active { cursor: grabbing; }

.playlist-item-drag svg {
    width: 16px;
    height: 16px;
}

.playlist-item.sortable-ghost {
    opacity: 0.4;
    border-color: var(--color-primary);
}

.playlist-item.sortable-chosen {
    box-shadow: 0 8px 40px rgba(186, 0, 0, 0.2);
    border-color: var(--color-primary);
}

.playlist-item-order {
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    color: var(--color-text-muted);
    min-width: 28px;
}

.playlist-item-controls {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border-radius: 8px;
    align-items: flex-end;
}

.playlist-item-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-item-control-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

/* ================================================
   Slide Editor
   ================================================ */

.slide-editor-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-lg);
    align-items: start;
}

.slide-editor-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.slide-preview-panel {
    position: sticky;
    top: var(--space-lg);
}

.slide-preview-frame {
    width: 100%;
    aspect-ratio: 16/9;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: #000;
    overflow: hidden;
}

.slide-preview-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.slide-preview-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

/* ================================================
   Match Day Console
   ================================================ */

.matchday-console {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-lg);
    align-items: start;
}

.matchday-scoreboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3xl);
    padding: var(--space-xl) 0;
}

.matchday-team {
    text-align: center;
    min-width: 140px;
}

.matchday-team-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    margin-bottom: var(--space-sm);
}

.matchday-team-name {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--color-text);
}

.matchday-score-center {
    text-align: center;
}

.matchday-score {
    font-family: var(--font-heading);
    font-size: 80px;
    font-weight: var(--weight-extrabold);
    color: var(--color-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
}

.matchday-score-sep {
    color: var(--color-text-muted);
    margin: 0 var(--space-xs);
}

.matchday-phase {
    margin-top: var(--space-sm);
}

.matchday-competition {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 4px;
}

.matchday-controls {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.matchday-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.matchday-event-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    background: var(--color-bg);
    border-radius: 8px;
}

.matchday-event-minute {
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    color: var(--color-accent);
    min-width: 36px;
}

.matchday-event-player {
    font-size: var(--text-base);
    color: var(--color-text);
    flex: 1;
}

.matchday-inactive {
    text-align: center;
    padding: var(--space-3xl);
}

.matchday-inactive-icon {
    width: 80px;
    height: 80px;
    color: var(--color-text-muted);
    opacity: 0.3;
    margin-bottom: var(--space-lg);
}

/* ================================================
   Schedule System
   ================================================ */

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: 8px;
}

.schedule-item-time {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--color-text);
    min-width: 100px;
}

.schedule-item-action {
    flex: 1;
}

.schedule-item-action-title {
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    color: var(--color-text);
}

.schedule-item-action-desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.schedule-timeline {
    position: relative;
    padding-left: var(--space-xl);
}

.schedule-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.schedule-timeline-item {
    position: relative;
    padding-bottom: var(--space-lg);
}

.schedule-timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-xl) + 7px);
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid var(--color-surface);
}

.schedule-timeline-item.schedule-past::before {
    background: var(--color-text-muted);
}

.schedule-timeline-time {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-text-muted);
    margin-bottom: 4px;
}
