/* TelaSync ? Design System */

:root {
    --color-primary: #0B1F3A;
    --color-accent: #00B8D9;
    --color-bg: #F8FAFC;
    --color-surface: #ffffff;
    --color-border: #E2E8F0;
    --color-text: #1E293B;
    --color-text-muted: #64748B;
    --color-online: #22C55E;
    --color-offline: #94A3B8;
    --color-warning: #F97316;
    --color-danger: #EF4444;
    --color-success: #22C55E;
    --sidebar-width: 240px;
    --mobile-topbar-height: 56px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.5;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-tap-highlight-color: rgba(0, 184, 217, 0.15);
}

/* Layout */

.app-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

.mobile-topbar,
.nav-backdrop,
.sidebar-close {
    display: none;
}

.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
}

.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    margin-left: var(--sidebar-width);
}

/* Sidebar */

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
    gap: 8px;
}

.sidebar-brand__logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    box-sizing: border-box;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.15s;
    font-size: 14px;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(0,184,217,0.15);
    color: var(--color-accent);
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.user-name { font-weight: 600; color: #fff; font-size: 13px; }
.user-role { color: rgba(255,255,255,0.5); font-size: 12px; }

.btn-logout {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    width: 100%;
    font-size: 13px;
    transition: all 0.15s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Page Header */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header__left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.page-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.back-link {
    font-size: 13px;
    color: var(--color-text-muted);
    text-decoration: none;
    width: fit-content;
}

.back-link:hover {
    color: var(--color-accent);
}

.content-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.content-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.content-order-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.content-order {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.content-order-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.content-order-btn {
    width: 32px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: 6px;
    color: var(--color-text);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.content-order-btn:hover:not(:disabled) {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.content-order-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.content-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.schedule-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.schedule-badge--always {
    background: #eef2ff;
    color: #3730a3;
}

.schedule-badge--scheduled {
    background: #fef3c7;
    color: #92400e;
}

.schedule-badge--live {
    background: #dcfce7;
    color: #166534;
}

.schedule-badge--ended {
    background: #fee2e2;
    color: #991b1b;
}

.schedule-panel,
.schedule-editor {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 16px 0;
}

.schedule-panel h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--color-primary);
}

.schedule-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.content-list-intro {
    margin: 0 0 12px;
}

.content-list-intro h2 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--color-primary);
}

.settings-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.settings-panel h2 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--color-primary);
}

.settings-help {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.power-enable {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

.power-times {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.power-times label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.day-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.day-picker label {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
}

.weather-current-box {
    background: #0b1f3a;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    display: grid;
    gap: 4px;
}

.weather-current-box strong {
    font-size: 20px;
    color: #7dd3fc;
}

.city-search-row {
    display: flex;
    gap: 8px;
}

.city-search-row .form-control {
    flex: 1;
}

.city-result-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 16px;
}

.city-result {
    text-align: left;
    background: #f8fafc;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
}

.city-result:hover {
    background: #e0f2fe;
    border-color: #00b8d9;
}

.city-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.duration-editor {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.duration-editor label {
    font-size: 12px;
    color: var(--color-text-muted);
}

.duration-input {
    width: 88px;
    padding: 6px 10px;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-primary);
    font-weight: 600;
}

.btn-primary:hover { background: #00a3c4; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover { background: var(--color-bg); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover { background: var(--color-bg); }

.btn-danger {
    background: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.btn-danger:hover { background: var(--color-danger); color: white; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* Cards de dispositivo */

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.device-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.device-card:hover { box-shadow: var(--shadow-md); }

.device-card.online { border-left: 3px solid var(--color-online); }
.device-card.offline { border-left: 3px solid var(--color-offline); }
.device-card.pending { border-left: 3px solid #d97706; }

.device-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}

.device-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-primary);
}

.device-card-body {
    padding: 0 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.device-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.info-label { color: var(--color-text-muted); }
.info-value { font-weight: 500; }

.device-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--color-border);
}

/* Status badges */

.status-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 20px;
}

.badge-online { background: #dcfce7; color: #15803d; }
.badge-offline { background: #f1f5f9; color: #64748b; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-syncing { background: #dbeafe; color: #1d4ed8; }
.badge-revoked { background: #fee2e2; color: #dc2626; }

/* M?dias grid */

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.media-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0;
}

.media-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    margin-bottom: -1px;
}

.media-tab:hover { color: var(--color-primary); }

.media-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-accent, #2563eb);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 9px;
    background: #d97706;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.media-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.media-preview {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    width: 100%;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.media-preview:hover .media-preview-hint {
    opacity: 1;
}

.media-preview-hint {
    position: absolute;
    inset: auto 0 0 0;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 12px;
    padding: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}

.media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview { background: #1e1b4b; color: #818cf8; }
.image-preview { background: #f0fdf4; color: #16a34a; }
.news-preview { background: #0b1f3a; color: #00b8d9; }
.weather-preview { background: #0c4a6e; color: #7dd3fc; }
.lottery-preview { background: #14532d; color: #86efac; }
.media-type-muted { opacity: 0.55; font-size: 22px; }

.app-modal-grid {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}

.app-modal-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.news-preview-panel {
    background: #0b1f3a;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 16px 18px;
}

.news-preview-lead {
    margin: 0 0 12px;
    color: #94a3b8;
    font-size: 14px;
}

.news-headline-list {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    font-size: 14px;
}

.news-headline-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    align-items: center;
}

.news-headline-thumb {
    width: 112px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    background: #1e3a5f;
}

.news-headline-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00b8d9;
    font-weight: 700;
}

.weather-preview-now {
    display: flex;
    gap: 10px;
    align-items: baseline;
    flex-wrap: wrap;
    margin: 0 0 12px;
    font-size: 16px;
}

.weather-preview-days {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.weather-preview-day {
    background: #1e3a5f;
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    font-size: 12px;
    display: grid;
    gap: 4px;
}

.lottery-preview-list {
    display: grid;
    gap: 10px;
}

.lottery-preview-card {
    background: #1e3a5f;
    border-radius: 8px;
    padding: 10px 12px;
    display: grid;
    gap: 6px;
    font-size: 13px;
}

.lottery-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lottery-balls span {
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #14532d;
    color: #bbf7d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.media-card-body {
    padding: 12px 16px;
    flex: 1;
}

.media-name {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.btn-link-rename {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-accent, #2563eb);
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 6px;
}

.btn-link-rename:hover { text-decoration: underline; }

.name-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.name-editor-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.media-meta {
    display: flex;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.media-status.archived {
    color: #a16207;
}

.media-card-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 12px;
}

.media-card-actions .btn-sm {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
    white-space: nowrap;
    justify-content: center;
    text-align: center;
}

.media-card-actions a.btn-sm {
    display: inline-flex;
    align-items: center;
}

.modal-preview {
    width: min(920px, 96vw);
    max-height: 92vh;
    overflow: auto;
}

.modal-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-preview-header h2 {
    font-size: 16px;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-preview-image,
.media-preview-player {
    width: 100%;
    max-height: 60vh;
    border-radius: var(--radius);
    background: #0f172a;
    object-fit: contain;
}

.media-preview-player {
    min-height: 240px;
}

/* Alertas */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.alert-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

/* Formul?rios */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--color-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.15s;
    background: var(--color-surface);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0,184,217,0.1);
}

.orientation-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.orientation-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    cursor: pointer;
    color: var(--color-text);
    text-align: center;
}

.orientation-option span:last-child {
    font-size: 12px;
    color: var(--color-text-muted);
}

.orientation-option:hover {
    border-color: var(--color-accent);
}

.orientation-option.selected {
    border-color: var(--color-accent);
    background: rgba(0, 184, 217, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 184, 217, 0.12);
}

.orientation-shape {
    display: block;
    border: 2px solid currentColor;
    border-radius: 4px;
    background: #0B1F3A;
}

.orientation-shape.landscape {
    width: 64px;
    height: 36px;
}

.orientation-option.selected .orientation-shape {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.orientation-shape.portrait {
    width: 36px;
    height: 64px;
}

.badge-orientation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 20px;
    background: #e0f2fe;
    color: #0369a1;
}

.badge-muted {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    background: #fef3c7;
    color: #92400e;
}

.orientation-mini {
    display: inline-block;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.orientation-mini.landscape {
    width: 14px;
    height: 8px;
}

.orientation-mini.portrait {
    width: 8px;
    height: 14px;
}

/* Login */

.login-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand__logo {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto 12px;
}

.login-header p {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.login-card--wide {
    max-width: 440px;
}

.login-signup-btn {
    margin-top: 12px;
}

.login-footer-link {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
}

.login-footer-link a {
    color: var(--color-accent, #00b8d9);
    font-weight: 500;
    text-decoration: none;
    margin-left: 4px;
}

.login-footer-link a:hover {
    text-decoration: underline;
}

/* Modal */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-box h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--color-primary);
}

.modal-box p {
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.code-input {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    letter-spacing: 6px;
    text-align: center;
    text-transform: uppercase;
}

/* Empty state */

.empty-state {
    text-align: center;
    padding: 64px 32px;
    color: var(--color-text-muted);
}

.empty-state p { margin-bottom: 8px; }
.empty-state .btn { margin-top: 16px; }

/* Loading */

.loading {
    text-align: center;
    padding: 48px;
    color: var(--color-text-muted);
}

/* Wizard */

.send-wizard {
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.wizard-steps {
    display: flex;
    align-items: center;
    padding: 24px 32px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
}

.wizard-step.active { color: var(--color-primary); }

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.wizard-step.active .step-number {
    background: var(--color-accent);
    color: var(--color-primary);
}

.wizard-step-divider {
    flex: 1;
    height: 1px;
    background: var(--color-border);
    margin: 0 16px;
}

.wizard-content {
    padding: 32px;
}

.wizard-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-primary);
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.wizard-upload-row {
    margin: 0 0 16px;
}

/* Selectable list */

.select-all-row {
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.selectable-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.selectable-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    background: var(--color-surface);
}

.selectable-item:hover { border-color: var(--color-accent); }
.selectable-item.selected { border-color: var(--color-accent); background: rgba(0,184,217,0.05); }

.item-icon { font-size: 18px; }

.item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.item-name { font-weight: 500; font-size: 14px; }
.item-meta { font-size: 12px; color: var(--color-text-muted); }

/* Summary */

.summary-box {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.summary-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.summary-item {
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

/* Text helpers */

.text-success { color: var(--color-online); }
.text-warning { color: #b45309; }
.text-muted { color: var(--color-text-muted); }

/* Upload progress */

.upload-progress {
    background: #dbeafe;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #1d4ed8;
}

.upload-progress-track {
    height: 8px;
    width: 100%;
    background: rgba(29, 78, 216, 0.15);
    border-radius: 99px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 99px;
    transition: width 0.2s ease;
}

label.btn.is-disabled,
label.btn[aria-disabled="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* Usu?rios */

.users-table-wrap {
    overflow-x: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.users-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.users-table tr:last-child td { border-bottom: none; }
.users-table tr.row-inactive { opacity: 0.65; }

.user-cell-name {
    font-weight: 500;
    color: var(--color-primary);
}

.user-you-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
}

.role-badge {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-primary);
}

.status-pill {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 999px;
}

.status-active { background: #dcfce7; color: #15803d; }
.status-inactive { background: #f1f5f9; color: #64748b; }

.users-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.playlist-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) 1fr;
    gap: 20px;
    align-items: start;
}

.playlist-sidebar-list {
    max-height: none;
}

.playlist-media-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.playlist-media-toolbar .settings-help {
    margin: 0;
}

.mode-cards {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.mode-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--color-surface);
}

.mode-card input {
    margin-top: 3px;
}

.mode-card strong {
    display: block;
    font-size: 14px;
}

.mode-card span {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.mode-card.selected {
    border-color: var(--color-accent);
    background: rgba(0,184,217,0.05);
}

/* Mobile / phones (Android e iOS) */

@media (max-width: 799.98px) {
    .app-shell {
        display: block;
        overflow-x: hidden;
    }

    .app-shell.nav-open {
        overflow: hidden;
        height: 100dvh;
    }

    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 300;
        height: calc(var(--mobile-topbar-height) + env(safe-area-inset-top, 0px));
        padding: env(safe-area-inset-top, 0px) 12px 0 12px;
        background: var(--color-primary);
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .mobile-topbar__logo {
        height: 32px;
        width: auto;
        max-width: 148px;
        background: #fff;
        border-radius: 10px;
        padding: 4px 8px;
        object-fit: contain;
    }

    .menu-toggle {
        appearance: none;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 10px;
        background: rgba(255,255,255,0.08);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .menu-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.2s, opacity 0.2s;
    }

    .nav-open .menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
    .nav-open .menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 350;
        border: 0;
        padding: 0;
        margin: 0;
        background: rgba(11, 31, 58, 0.55);
        cursor: pointer;
    }

    .nav-open .nav-backdrop { display: block; }

    .sidebar {
        width: min(240px, 82vw);
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        z-index: 400;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: none;
    }

    .nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,0.28);
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 8px;
        background: rgba(255,255,255,0.08);
        color: #fff;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
    }

    .nav-item {
        min-height: 48px;
        padding: 14px 20px;
    }

    .btn {
        min-height: 44px;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    .page-header h1 { font-size: 22px; }

    .page-header-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .orientation-picker {
        grid-template-columns: 1fr;
    }

    .page-header .btn,
    .page-header-actions .btn,
    .page-header-actions label.btn {
        width: 100%;
        justify-content: center;
    }

    .device-grid,
    .media-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .device-card-header,
    .device-card-body,
    .device-card-actions {
        padding-left: 14px;
        padding-right: 14px;
    }

    .device-card-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .device-card-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .media-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .media-tab {
        flex: 0 0 auto;
        padding: 10px 12px;
    }

    .media-card-actions {
        flex-wrap: wrap;
    }

    .media-card-actions .btn-sm {
        flex: 1 1 calc(50% - 6px);
    }

    .news-headline-card {
        grid-template-columns: 72px 1fr;
        gap: 10px;
    }

    .news-headline-thumb {
        width: 72px;
        height: 52px;
    }

    .login-shell,
    .login-container {
        align-items: flex-start;
        padding: 24px 16px;
        padding-top: max(24px, env(safe-area-inset-top, 0px));
        padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 12px;
    }

    .form-control,
    .form-control.duration-input {
        font-size: 16px;
    }

    .code-input {
        font-size: 20px;
        letter-spacing: 4px;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .modal-box,
    .modal-preview {
        width: 100%;
        max-width: 100%;
        max-height: min(92dvh, 100%);
        margin: 0;
        border-radius: 16px 16px 0 0;
        padding: 20px 16px 24px;
        overflow: auto;
    }

    .modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-preview-header {
        flex-direction: column;
    }

    .modal-preview-header h2 {
        white-space: normal;
    }

    .send-wizard { border-radius: 10px; }

    .wizard-steps {
        padding: 14px 12px;
        gap: 0;
        overflow-x: auto;
    }

    .wizard-step {
        font-size: 12px;
        gap: 6px;
        white-space: nowrap;
    }

    .wizard-step-divider { margin: 0 8px; min-width: 12px; }

    .wizard-content {
        padding: 16px 14px 20px;
    }

    .wizard-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .wizard-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .wizard-upload-row .btn {
        width: 100%;
        justify-content: center;
    }

    .summary-box {
        grid-template-columns: 1fr;
    }

    .settings-panel { padding: 14px; }

    .city-search-row {
        flex-direction: column;
    }

    .duration-editor { width: 100%; }
    .duration-editor .form-control { flex: 1; width: auto; min-width: 72px; }

    .content-row {
        flex-wrap: wrap;
        padding: 12px;
    }

    .content-row-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }

    .schedule-fields {
        grid-template-columns: 1fr;
    }

    .content-order-btn {
        width: 44px;
        height: 28px;
        font-size: 16px;
    }

    .playlist-layout {
        grid-template-columns: 1fr;
    }

    .playlist-media-toolbar {
        flex-wrap: wrap;
    }

    .empty-state { padding: 40px 16px; }

    .users-table {
        min-width: 640px;
        font-size: 13px;
    }

    .users-table th,
    .users-table td {
        padding: 10px 12px;
    }
}

.ticket-board {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ticket-now {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 24px;
    border-radius: 16px;
    background: #0B1F3A;
    color: #fff;
}

.ticket-now__number {
    font-size: 72px;
    line-height: 1;
    letter-spacing: 1px;
    color: #00B8D9;
}

.ticket-now__number.is-priority { color: #F59E0B; }

.ticket-now__room {
    font-size: 22px;
    color: #CBD5E1;
}

.ticket-next-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    color: var(--color-text-muted);
}

.ticket-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ticket-call-btn {
    min-height: 92px;
    border: none;
    border-radius: 16px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

.ticket-call-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.ticket-call-btn--normal { background: #00B8D9; color: #0B1F3A; }
.ticket-call-btn--priority { background: #F59E0B; color: #1C1403; }
.ticket-call-btn--recall { background: #1E3A5F; color: #fff; }
.ticket-call-btn--reset { background: transparent; color: #EF4444; border: 1px solid #EF4444; }

.ticket-recent ul {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-recent li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--color-bg);
}

@media (max-width: 720px) {
    .ticket-now__number { font-size: 56px; }
    .ticket-actions { grid-template-columns: 1fr; }
    .ticket-call-btn { min-height: 76px; font-size: 20px; }
}
