:root {
    --bg-dark: #0f172a;
    --panel-dark: #111827;
    --panel-dark-2: #1e293b;
    --text-dark: #f1f5f9;
    --muted-dark: #cbd5e1;
    --border-dark: #334155;

    --bg-light: #d7e0ea;
    --panel-light: #ffffff;
    --text-light: #111827;
    --muted-light: #475569;
}

/* GLOBAL DARK MODE */
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-dark) !important;
    color: var(--text-dark) !important;
    font-family: Arial, sans-serif;
}

.ukola-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #020617;
    border-bottom: 1px solid var(--border-dark);
}

.ukola-navbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
}

.ukola-logo img {
    height: 54px;
}

.ukola-menu {
    display: flex;
    gap: 18px;
    align-items: center;
    flex: 1;
}

.ukola-menu a {
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 500;
}

.ukola-menu a:hover {
    color: #60a5fa;
}

.ukola-main {
    min-height: 80vh;
    padding: 24px;
}

.ukola-footer {
    background: #020617;
    color: #94a3b8;
    padding: 18px 24px;
}

/* BOOTSTRAP OVERRIDES DARK */
.card,
.table,
.modal-content {
    background: var(--panel-dark) !important;
    color: var(--text-dark) !important;
    border: 1px solid var(--border-dark) !important;
}

.card-header {
    background: var(--panel-dark-2) !important;
    color: var(--text-dark) !important;
    border-bottom: 1px solid var(--border-dark) !important;
}

.table th {
    background: #020617 !important;
    color: var(--text-dark) !important;
}

.table td {
    color: var(--text-dark) !important;
    border-color: var(--border-dark) !important;
}

.text-muted {
    color: var(--muted-dark) !important;
}

input,
textarea,
select {
    background: #020617 !important;
    color: var(--text-dark) !important;
    border: 1px solid #475569 !important;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8 !important;
}

a {
    color: #60a5fa;
}

a:hover {
    color: #93c5fd;
}

.btn {
    border-radius: 8px;
}

.status-live {
    color: #f87171;
    font-weight: bold;
}

.status-ok {
    color: #22c55e;
    font-weight: bold;
}

/* LOCK POPUP */
.ukola-lock {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.82);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ukola-lock-box {
    background: #111827;
    color: white;
    padding: 26px;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55);
    text-align: center;
    border: 1px solid #334155;
}

.ukola-lock-box input {
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    margin-bottom: 12px;
}

#ukola-erro {
    color: #f87171;
    margin-top: 10px;
    display: none;
}

/* LIGHT MODE */
body.light-mode {
    background: var(--bg-light) !important;
    color: var(--text-light) !important;
}

body.light-mode .ukola-main {
    background: var(--bg-light) !important;
}

body.light-mode .card,
body.light-mode .table,
body.light-mode .modal-content {
    background: var(--panel-light) !important;
    color: var(--text-light) !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .card-header {
    background: #f8fafc !important;
    color: var(--text-light) !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .table th {
    background: #111827 !important;
    color: white !important;
}

body.light-mode .table td {
    color: var(--text-light) !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .text-muted {
    color: var(--muted-light) !important;
}

body.light-mode input,
body.light-mode textarea,
body.light-mode select {
    background: white !important;
    color: var(--text-light) !important;
    border: 1px solid #94a3b8 !important;
}

body.light-mode .ukola-footer {
    background: #111827;
    color: #cbd5e1;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .ukola-navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .ukola-menu {
        flex-wrap: wrap;
        gap: 12px;
    }

    .ukola-logo img {
        height: 48px;
    }
}


.ukola-burger {
    display: none;
    background: transparent;
    border: 1px solid #475569;
    color: white;
    font-size: 26px;
    border-radius: 8px;
    padding: 4px 10px;
}

@media (max-width: 768px) {
    .ukola-navbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .ukola-burger {
        display: block;
    }

    .ukola-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: #020617;
        padding: 12px;
        border-radius: 10px;
        margin-top: 10px;
    }

    .ukola-menu.show {
        display: flex;
    }

    #theme-btn {
        margin-left: auto;
    }

    .ukola-main {
        padding: 14px;
    }
}


/* Correction visibilité dark mode */
body:not(.light-mode) .table,
body:not(.light-mode) .table tbody,
body:not(.light-mode) .table tr,
body:not(.light-mode) .table td,
body:not(.light-mode) .table td a,
body:not(.light-mode) .table td strong {
    color: #f1f5f9 !important;
    background-color: #111827 !important;
}

body:not(.light-mode) .table-hover tbody tr:hover td {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

body:not(.light-mode) .btn-outline-dark {
    color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

body:not(.light-mode) .btn-outline-dark:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

@media (max-width: 768px) {

    .ukola-navbar {
        padding: 12px 14px;
    }

    .ukola-logo img {
        height: 42px;
    }

    .ukola-burger {
        font-size: 30px;
        padding: 6px 12px;
        margin-left: auto;
    }

    #theme-btn {
        width: 100%;
        margin-top: 10px;
        font-size: 16px;
        padding: 10px;
    }

    .ukola-main {
        padding: 12px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 21px;
    }

    .card {
        padding: 14px;
        margin-bottom: 14px;
    }

    .container-fluid {
        padding-left: 4px;
        padding-right: 4px;
    }

    .btn {
        width: 100%;
        margin-bottom: 8px;
        font-size: 16px;
        padding: 11px;
    }

    table {
        font-size: 14px;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    #palco-live {
        min-height: 260px !important;
        max-height: 60vh !important;
    }

    #controle-video input {
        width: 100%;
        margin-bottom: 8px;
        font-size: 16px;
        padding: 10px;
    }

    #botoes-sala button {
        width: 100%;
        margin-bottom: 8px;
        font-size: 16px;
        padding: 10px;
    }
}




@media (max-width: 768px) {
    .ukola-navbar {
        padding: 14px;
        gap: 12px;
    }

    .ukola-logo img {
        height: 46px;
    }

    .ukola-burger {
        display: block;
        font-size: 32px;
        margin-left: auto;
    }

    .ukola-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 14px;
        padding: 16px;
        font-size: 18px;
    }

    .ukola-menu.show {
        display: flex;
    }

    .ukola-main {
        padding: 16px;
    }

    h1 {
        font-size: 30px !important;
    }

    h2 {
        font-size: 24px !important;
    }

    p, a, td, th, label, input, button {
        font-size: 17px !important;
    }

    .container-fluid {
        padding: 0 !important;
    }

    .card {
        margin-bottom: 18px;
    }

    .btn {
        padding: 12px 16px !important;
        font-size: 17px !important;
    }

    .row > [class*="col-"] {
        margin-bottom: 12px;
    }
}
