@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --bg: #07090e;
    --surface: rgba(18, 25, 41, 0.65);
    --surface-hover: rgba(28, 38, 62, 0.75);
    --surface-strong: rgba(10, 14, 23, 0.85);
    --text: #f8fafc;
    --muted: #94a3b8;
    --primary: #10b981;
    --primary-strong: #059669;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #07090e;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    background: var(--bg);
}
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Outfit', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 50% 0%, #161e31 0%, #07090e 100%);
    background-attachment: fixed;
    line-height: 1.5;
}
a {
    color: inherit;
    text-decoration: none;
}

/* Base Button Redesign */
button.button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    min-height: 48px;
    padding: 0 22px;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
button.button:hover,
a.button:hover {
    transform: translateY(-2px);
}
.button-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}
.button-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.35);
}
.button-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}
.button-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}
.button-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}
.button-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.35);
}

/* Shell & Workspace Layout */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
.app-shell.app-simple {
    grid-template-columns: 1fr;
}
.app-shell.app-simple .main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 40px;
    padding-bottom: 40px;
    width: 100%;
}

/* Sidebar Overhaul */
.sidebar {
    background: rgba(10, 14, 24, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    color: var(--text);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.brand {
    display: flex;
    gap: 14px;
    align-items: center;
}
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
}
.brand-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.brand-subtitle {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}
.sidebar-nav {
    display: grid;
    gap: 8px;
}
.sidebar-nav a {
    padding: 12px 14px 12px 46px;
    border-radius: 10px;
    color: var(--muted);
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.92rem;
}
.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.5;
    transition: opacity 0.25s, filter 0.25s;
}

/* Navigation Icons */
.sidebar-nav a[href="index.php"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5fff1'><path d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/></svg>"); }
.sidebar-nav a[href="adicionar.php"]::before,
.sidebar-nav a[href="conteudo.php"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5fff1'><path d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/></svg>"); }
.sidebar-nav a[href="perfis.php"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5fff1'><path d='M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z'/></svg>"); }
.sidebar-nav a[href="atualizacao.php"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5fff1'><path d='M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z'/></svg>"); }
.sidebar-nav a[href="top_semana.php"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5fff1'><path d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/></svg>"); }
.sidebar-nav a[href="api_doc.php"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5fff1'><path d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h6v2zm0-4H8v-2h6v2zm-3-5V3.5L18.5 9H13z'/></svg>"); }
.sidebar-nav a[href="api/channels"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5fff1'><path d='M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9H9V9h10v2zm-4 4H9v-2h6v2zm4-8H9V5h10v2z'/></svg>"); }

.sidebar-nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}
.sidebar-nav a:hover::before {
    opacity: 0.95;
}
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.01) 100%);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-nav a.active::before {
    opacity: 1;
    filter: drop-shadow(0 0 4px var(--primary));
}
.sidebar-nav a.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 3px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px var(--primary);
}
.sidebar-note {
    padding: 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--muted);
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.user-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.user-name {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text);
    font-weight: 500;
}
.sidebar-footer .button-secondary {
    width: 100%;
    min-height: 38px;
    font-size: 0.88rem;
    border-radius: 8px;
}

/* Page Contents & Layout Headers */
.main-content {
    padding: 32px;
}
.page-header,
.page-header-small {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 700;
}
.page-header h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}
.page-description,
.panel-description {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 600px;
    font-size: 0.92rem;
    line-height: 1.6;
}
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Summary Grid & Neon Glow Metric Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.card,
.panel {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.card {
    padding: 20px;
    display: block;
}
.summary-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 130px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
}
.summary-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}
.summary-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.1;
    pointer-events: none;
    transition: opacity 0.3s;
}
.summary-card:hover::after {
    opacity: 0.18;
}

.summary-title {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.summary-card strong {
    display: block;
    font-size: 2.2rem;
    margin-top: 2px;
    font-weight: 800;
}
.summary-value {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem) !important;
    line-height: 1.1;
    font-weight: 800;
}
.summary-value-text {
    font-size: clamp(1.05rem, 1.5vw, 1.3rem) !important;
    line-height: 1.3;
    font-weight: 700;
    word-break: break-word;
}
.summary-card.summary-doramas {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
}

/* Neon Glow Theme Variations */
.summary-total { border-left: 4px solid #3b82f6; }
.summary-total::after { background: #3b82f6; }
.summary-total strong { color: #60a5fa; text-shadow: 0 0 12px rgba(59, 130, 246, 0.3); }

.summary-updated { border-left: 4px solid #10b981; }
.summary-updated::after { background: #10b981; }
.summary-updated strong { color: #34d399; text-shadow: 0 0 12px rgba(16, 185, 129, 0.3); }

.summary-mode { border-left: 4px solid #a78bfa; }
.summary-mode::after { background: #a78bfa; }
.summary-mode strong { color: #c084fc; text-shadow: 0 0 12px rgba(167, 139, 250, 0.3); }

.summary-slider { border-left: 4px solid #22d3ee; }
.summary-slider::after { background: #22d3ee; }
.summary-slider strong { color: #67e8f9; text-shadow: 0 0 12px rgba(34, 211, 238, 0.3); }

.summary-episodes { border-left: 4px solid #fb923c; }
.summary-episodes::after { background: #fb923c; }
.summary-episodes strong { color: #fdba74; text-shadow: 0 0 12px rgba(251, 146, 60, 0.3); }

.summary-movies { border-left: 4px solid #f87171; }
.summary-movies::after { background: #f87171; }
.summary-movies strong { color: #fca5a5; text-shadow: 0 0 12px rgba(248, 113, 113, 0.3); }

.summary-reports { border-left: 4px solid #ef4444; }
.summary-reports::after { background: #ef4444; }
.summary-reports strong { color: #fca5a5; text-shadow: 0 0 12px rgba(239, 68, 68, 0.35); }

.summary-doramas { border-left: 4px solid #f472b6; }
.summary-doramas::after { background: #f472b6; }
.summary-doramas strong { color: #f9a8d4; text-shadow: 0 0 12px rgba(244, 114, 182, 0.3); }

.summary-status { border-left: 4px solid #34d399; }
.summary-status::after { background: #34d399; }
.summary-status strong { color: #6ee7b7; text-shadow: 0 0 12px rgba(52, 211, 153, 0.3); }

.summary-route { border-left: 4px solid #8b5cf6; }
.summary-route::after { background: #8b5cf6; }
.summary-route strong { color: #a78bfa; text-shadow: 0 0 12px rgba(139, 92, 246, 0.3); }

/* Panels and Containers */
.panel {
    padding: 24px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
}
.panel-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

/* Beautiful Floating Rows Tables */
.table-responsive {
    overflow-x: auto;
    padding: 10px;
    background: rgba(11, 16, 27, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border);
}
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    min-width: 900px;
}
.table th,
.table td {
    text-align: left;
    padding: 14px 18px;
    vertical-align: middle;
}
.table th {
    background: transparent;
}
.table thead th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}
.table tbody tr {
    background: rgba(18, 25, 41, 0.45);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.table tbody tr:hover {
    transform: translateY(-2px);
    background: rgba(28, 38, 62, 0.55);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.table tbody tr td {
    color: var(--text);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.table tbody tr td:first-child {
    border-left: 1px solid var(--border);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.table tbody tr td:last-child {
    border-right: 1px solid var(--border);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Custom Table Code View styling */
code {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(8, 12, 20, 0.55);
    border: 1px solid var(--border);
    color: #34d399;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
}
.table td code {
    display: block;
    max-width: 280px;
    overflow-x: auto;
    white-space: nowrap;
    color: #06b6d4;
    background: rgba(8, 12, 20, 0.65);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

/* Image Thumbnails */
.logo-thumb {
    max-width: 100px;
    max-height: 52px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}
.poster-thumb {
    width: 44px !important;
    height: 66px !important;
    max-width: 44px !important;
    max-height: 66px !important;
    min-width: 44px !important;
    min-height: 66px !important;
    object-fit: cover !important;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    display: block;
    transition: transform 0.2s;
}
.poster-thumb:hover {
    transform: scale(1.08);
}

/* Status Badges */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    color: var(--muted);
}
.tag-row:last-child {
    margin-bottom: 0;
}
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Table Row Actions */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 0;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}
.action-button.edit {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}
.action-button.edit:hover {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}
.action-button.delete {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
}
.action-button.delete:hover {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}
.action-button.disabled {
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* Empty states, alerts & popups */
.empty-state {
    padding: 32px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}
.toast,
.alert,
.success {
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    font-size: 0.92rem;
}
.toast-success,
.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}
.toast-danger,
.alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Glassmorphic Form Fields & Outlines */
.main-form {
    max-width: 900px;
    margin: 0 auto;
}
.panel-form {
    padding: 28px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.panel-form h2 {
    color: #ffffff;
    font-weight: 800;
    margin-bottom: 8px;
}
.panel-form h4 {
    margin: 24px 0 12px 0 !important;
    color: var(--primary) !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    border-bottom: 1px dashed var(--border) !important;
    padding-bottom: 6px !important;
    font-weight: 700 !important;
}
.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wide-field {
    grid-column: span 2;
}
label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.88rem;
    letter-spacing: 0.01em;
}
input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(8, 12, 20, 0.5);
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
input::placeholder {
    color: var(--muted);
    opacity: 0.45;
}
textarea {
    min-height: 120px;
    resize: vertical;
}
input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(8, 12, 20, 0.65);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.form-actions {
    margin-top: 20px;
}

/* Custom Interactive Switches/Toggles Override (No PHP rewrite) */
#dubladoToggleBtn,
#visivelToggleBtn {
    background: rgba(8, 12, 20, 0.5) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    color: var(--muted) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
#dubladoToggleBtn:hover,
#visivelToggleBtn:hover {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}
#dubladoToggleBtn[style*="var(--primary)"],
#visivelToggleBtn[style*="var(--primary)"] {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1.5px solid var(--primary) !important;
    color: var(--primary) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.12) !important;
}
#dubladoText,
#toggleText {
    color: var(--muted) !important;
    font-weight: 600 !important;
}
#dubladoToggleBtn[style*="var(--primary)"] #dubladoText,
#visivelToggleBtn[style*="var(--primary)"] #toggleText {
    color: var(--primary) !important;
}

/* Setup & Login Box Override */
.box {
    max-width: 380px;
    margin: 120px auto;
    padding: 30px;
    background: var(--surface);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.box h1 {
    font-size: 1.6rem;
    margin: 0 0 20px;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Metric / Logs updates blocks */
.update-summary-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 24px;
}
.update-metric {
    background: rgba(18, 25, 41, 0.45);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}
.update-metric span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.update-metric strong {
    display: block;
    font-size: 1.25rem;
    color: var(--text);
    font-weight: 700;
}
.update-message {
    padding: 18px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 14px;
    border: 1px solid rgba(16, 185, 129, 0.1);
}
.update-message p {
    margin: 0;
    line-height: 1.7;
    color: var(--text);
}

/* Player Cards UI */
.section-title {
    margin-top: 36px;
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.player-card {
    background: rgba(18, 25, 41, 0.45);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
}
.player-card:hover {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(18, 25, 41, 0.6);
}
.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.player-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.player-card-title::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'><path d='M8 5v14l11-7z'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
}
.remove-player-btn {
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.15);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.remove-player-btn:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.25);
}
.add-player-wrapper {
    display: flex;
    justify-content: center;
    padding: 8px 0 20px;
}
.btn-add-player {
    background: rgba(255, 255, 255, 0.01);
    border: 2px dashed rgba(16, 185, 129, 0.25);
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-add-player:hover {
    background: rgba(16, 185, 129, 0.06);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Doodstream processing dialog glass style */
#playersDialog > div {
    background: var(--surface-strong) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow) !important;
}
#playersDialog h3 {
    color: #ffffff !important;
    font-weight: 700 !important;
}
#playersDialog p {
    color: var(--muted) !important;
}
#playersProgressBar {
    background: linear-gradient(90deg, var(--primary) 0%, #059669 100%) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3) !important;
}
#playersLogs {
    background: rgba(5, 8, 15, 0.8) !important;
    border: 1px solid var(--border) !important;
    color: #34d399 !important;
    border-radius: 8px !important;
}

/* Dorama Catalog Cards Grid style */
.media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.media-grid-slider {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.media-card,
.slider-card {
    background: rgba(18, 25, 41, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.media-card:hover,
.slider-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}
.media-card img,
.slider-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.media-card:hover img,
.slider-card:hover img {
    transform: scale(1.04);
}
.media-card-body,
.slider-card-body {
    padding: 12px;
}
.media-card h3,
.slider-card h3 {
    margin: 0 0 4px;
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.media-card p,
.slider-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Visibility button overlay style in cards */
.media-card .visibility-toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(10, 14, 24, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid var(--border) !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
    z-index: 10 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}
.media-card .visibility-toggle-btn:hover {
    transform: scale(1.1) !important;
    background: rgba(10, 14, 24, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* View/Hide logic styles for overlay icons */
.media-card .visibility-toggle-btn svg {
    width: 18px !important;
    height: 18px !important;
    transition: color 0.2s;
}

/* Screen widths adjustments & Media queries */
@media (max-width: 1100px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .media-grid-slider {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .app-shell.app-simple {
        grid-template-columns: 1fr;
    }
    .sidebar {
        padding: 20px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 16px;
    }
    .sidebar-nav {
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .sidebar-note {
        display: none; /* Hide note on tablets to make less cluttered */
    }
    .page-header,
    .page-header-small {
        flex-direction: column;
        align-items: stretch;
    }
    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }
    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    .form-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .table {
        min-width: 100%;
    }
}
@media (max-width: 600px) {
    .media-grid {
        grid-template-columns: 1fr;
    }
}

/* Desktop optimization across all widescreen devices */
@media (min-width: 1280px) {
    .app-shell {
        grid-template-columns: 280px 1fr;
    }
    .sidebar {
        padding: 36px 22px;
    }
    .main-content {
        padding: 40px 48px;
    }
    .app-shell.app-simple .main-content {
        max-width: min(1600px, calc(100vw - 64px));
        padding-top: 32px;
        padding-bottom: 32px;
    }
    .main-content.main-form {
        max-width: min(1600px, calc(100vw - 360px)) !important;
        width: 100%;
    }
    .form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px 20px;
    }
    .field.wide-field {
        grid-column: span 3;
    }
    .table-responsive {
        padding: 14px;
    }
    .table {
        min-width: 100%;
        border-spacing: 0 6px;
    }
    .table th,
    .table td {
        padding: 14px 18px;
    }
    .media-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
    }
    .media-grid-slider {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
