:root {
    --bg-dark: #003399;
    --bg-light: #002266;
    --text-main: #ffffff;
    --text-highlight: #38bdf8;
    --accent: #2563eb;
    --accent-glow: rgba(255, 255, 255, 0.4);
    --glass: rgba(0, 0, 0, 0.2);
    --glass-border: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    font-size: 1vw; /* Fluid base for TVs */
}

@media (max-aspect-ratio: 1/1) {
    html { font-size: 1.5vh; }
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 0, 0, 0.3) 0px, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Panel Layout */
.panel-container {
    display: flex;
    flex-direction: row;
    height: calc(100% - 7vh);
    gap: 2vh;
    padding: 2vh;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .panel-container {
        flex-direction: column;
        overflow-y: auto;
        height: calc(100% - 7vh);
    }
}

/* Main Display Area */
.main-display {
    flex: 3.5;
    background: var(--glass);
    backdrop-filter: blur(15px);
    border-radius: 3vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-shadow: 0 3vh 6vh rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    position: relative;
    padding: 2vh;
    min-height: 60vh;
}

.display-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1vh 2vh;
    margin-bottom: auto;
    flex-wrap: wrap;
    gap: 2vh;
}

@media (max-width: 768px) {
    .display-header {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    .clock-display {
        align-items: center;
    }
}

.brand-logo {
    height: clamp(6vh, 10vh, 12vh);
    max-width: 40vw;
    object-fit: contain;
    filter: drop-shadow(0 0.5vh 1.5vh rgba(0,0,0,0.3));
}

.clock-display {
    font-size: clamp(1.5rem, 3vw, 3rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
}

.clock-date {
    font-size: clamp(0.7rem, 1vw, 1.2rem);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    opacity: 0.6;
}

.password-label {
    font-size: clamp(1.5rem, 3.5vh, 3.5rem);
    text-transform: uppercase;
    letter-spacing: 0.8rem;
    color: #ffffff;
    margin-top: 2vh;
    margin-bottom: 1vh;
    font-weight: 800;
    opacity: 1;
    text-align: center;
}

.password-number {
    font-size: clamp(6rem, 20vh, 22rem);
    font-weight: 900;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1vh 4vh rgba(0,0,0,0.3);
    letter-spacing: -0.3rem;
    margin-bottom: auto;
}

.guiche-info {
    font-size: clamp(2.5rem, 6vh, 6rem);
    margin-top: 2vh;
    margin-bottom: 2vh;
    font-weight: 800;
    color: #ffffff;
    background: rgba(255,255,255,0.1);
    padding: 1vh 5vh;
    border-radius: 2vh;
    text-align: center;
}

/* Sidebar History */
.sidebar {
    flex: 1.2;
    background: var(--glass);
    backdrop-filter: blur(15px);
    border-radius: 3vh;
    padding: 2vh;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .sidebar {
        flex: none;
        max-height: none;
    }
}

.sidebar h2 {
    font-size: clamp(1.2rem, 1.8vw, 2rem);
    margin-bottom: 2vh;
    text-align: center;
    color: #fff;
    border-bottom: 0.2vh solid rgba(255,255,255,0.1);
    padding-bottom: 1.5vh;
    font-weight: 900;
}

.history-list {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5vh;
}

/* Custom Scrollbar for sidebar */
.history-list::-webkit-scrollbar {
    width: 0.5vh;
}
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 1vh;
}

.queue-card {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid var(--accent);
    transition: all 0.2s;
}

.priority-card {
    border-left: 5px solid #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.queue-info {
    display: flex;
    flex-direction: column;
}

.queue-info strong {
    font-size: 1.4rem;
    color: white;
}

.queue-info span {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-highlight);
    font-weight: bold;
}

.queue-info small {
    color: rgba(255,255,255,0.5);
}

.queue-card button {
    width: auto !important;
    padding: 8px 15px !important;
    font-size: 0.9rem !important;
    background: var(--accent) !important;
}

.priority-card button {
    background: #d97706 !important;
}

.history-item {
    background: rgba(255,255,255,0.08);
    margin-bottom: 1.5vh;
    padding: 2vh;
    border-radius: 1.5vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
    animation: slideIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    gap: 1vh;
}

.history-password {
    font-size: clamp(1.8rem, 2.8vw, 3rem);
    font-weight: 900;
    color: #fff;
    white-space: nowrap;
}

.history-guiche {
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
}

/* Footer Ticker */
.footer-ticker {
    height: 7vh;
    min-height: 50px;
    background: #002266;
    border-top: 0.4vh solid #ffd700;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 100;
}

.ticker-label {
    background: #ffd700;
    color: #003399;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 3vh;
    font-weight: 900;
    font-size: clamp(1rem, 1.2vw, 1.5rem);
    text-transform: uppercase;
    z-index: 110;
    box-shadow: 1vh 0 2vh rgba(0,0,0,0.5);
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 120s linear infinite; /* Even slower for comfort */
    font-size: clamp(1.1rem, 1.5vw, 1.8rem);
    color: #fff;
    font-weight: 600;
}

.ticker-item {
    display: inline-block;
    padding: 0 8vh;
    position: relative;
}


.ticker-item::after {
    content: "•";
    position: absolute;
    right: 0;
    color: #ffd700;
}

/* ... rest of the styles remain same for admin ... */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes flash {
    0% { background: var(--glass); }
    50% { background: #fff; }
    100% { background: var(--glass); }
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.flashing {
    animation: flash 0.5s ease-in-out 3;
}

/* Novo Estilo de Destaque Premium */
.highlight-active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.05) 100%) !important;
    border-left: 8px solid #2563eb !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2) !important;
    transform: scale(1.01);
    transition: all 0.3s ease;
}

.highlight-active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer-effect 2.5s infinite;
}

@keyframes shimmer-effect {
    0% { left: -100%; }
    100% { left: 100%; }
}

.pulse-glow {
    animation: glow-pulse 2s infinite ease-in-out;
}

@keyframes glow-pulse {
    0% { box-shadow: 0 0 5px rgba(56, 189, 248, 0.2); }
    50% { box-shadow: 0 0 25px rgba(56, 189, 248, 0.5); }
    100% { box-shadow: 0 0 5px rgba(56, 189, 248, 0.2); }
}

@keyframes glow-pulse-priority {
    0% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.5); }
    100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
}


/* Admin Dashboard - Synchronized with Index Style */
body.admin-body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 0, 0, 0.3) 0px, transparent 50%);
    overflow-y: auto;
    display: block;
    min-height: 100vh;
}

.admin-container {
    max-width: 850px;
    margin: 6vh auto;
    background: var(--glass);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 60px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 50px 100px -20px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.admin-header {
    text-align: center;
    margin-bottom: 60px;
}

.admin-logo {
    height: 9vh;
    margin-bottom: 20px;
    filter: drop-shadow(0 0.5vh 1vh rgba(0,0,0,0.5));
}

.header-text h1 {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -1.5px;
    margin-bottom: 5px;
}

.header-text p {
    color: #38bdf8;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

/* Form Controls */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 900;
    color: rgba(255,255,255,0.4);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.select-group, .add-group {
    display: flex;
    gap: 12px;
    width: 100%;
}

.counter-manager select, #serviceType, .add-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 22px;
    color: #fff;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.counter-manager select:hover, #serviceType:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.add-toggle-btn, .confirm-btn, .cancel-btn, .delete-btn {
    width: 58px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 900;
    transition: all 0.2s;
}

.delete-btn {
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.delete-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    transform: scale(1.05);
}

.remove-confirm-group {
    display: none;
    gap: 10px;
    width: 100%;
    align-items: center;
    background: rgba(220, 38, 38, 0.1);
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.remove-confirm-group span {
    font-size: 0.8rem;
    font-weight: 900;
    color: #ef4444;
    text-transform: uppercase;
    flex: 1;
}

.confirm-del-btn {
    background: #ef4444;
    color: #fff;
    padding: 8px 15px;
    border-radius: 12px;
    font-weight: 900;
    border: none;
    cursor: pointer;
}

.cancel-del-btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 15px;
    border-radius: 12px;
    font-weight: 900;
    border: none;
    cursor: pointer;
}

.add-toggle-btn { background: #2563eb; color: #fff; font-size: 1.8rem; }
.confirm-btn { background: #10b981; color: #fff; font-size: 1rem; flex: 0.3; }
.cancel-btn { background: rgba(255,255,255,0.1); color: #fff; font-size: 1rem; flex: 0.2; }

.add-toggle-btn:hover { background: #3b82f6; transform: scale(1.05); }

/* Buttons Grid */
.button-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 50px;
}

.call-btn-main {
    background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
    padding: 30px !important;
    font-size: 1.4rem !important;
    font-weight: 900 !important;
    border-radius: 25px !important;
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.call-secondary, .recall-btn {
    padding: 22px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}

.reset-btn {
    background: rgba(220, 38, 38, 0.1) !important;
    border: 1px solid rgba(220, 38, 38, 0.3) !important;
    color: #ef4444 !important;
    padding: 18px !important;
    font-size: 0.9rem !important;
    border-radius: 20px !important;
    margin-top: 5px;
}

/* Modernized Buttons and Layout Flow */
.admin-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.button-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.call-btn-main {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    padding: 35px !important;
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    border-radius: 25px !important;
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.call-btn-main:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.5);
    filter: brightness(1.1);
}

.secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.call-secondary, .recall-btn {
    padding: 22px !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    transition: all 0.2s !important;
}

.call-secondary:hover, .recall-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.reset-btn {
    background: rgba(220, 38, 38, 0.05) !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
    color: #ef4444 !important;
    padding: 18px !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    border-radius: 20px !important;
    margin-top: 10px;
}

/* Table Refinement */
.queue-section {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 40px;
    border-top: none;
}

.queue-section h2 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 25px;
}

.modern-table tr td:first-child {
    color: #38bdf8;
}

.mini-call {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.mini-call:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.5) !important;
    filter: brightness(1.1) !important;
}

.mini-call:active {
    transform: translateY(0) scale(0.98) !important;
}

.row-priority td {
    background: rgba(245, 158, 11, 0.08) !important;
}

.row-priority .mini-call {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

.row-priority .mini-call:hover {
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.5) !important;
}

/* Media Config Section */
.media-config-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.media-config-section h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 20px;
    font-weight: 800;
}

.media-config-section input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    color: #fff;
    border-radius: 15px;
    width: 100%;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.media-hint {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-top: 10px;
}

.video-playlist {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.playlist-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 18px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #fff;
}

.playlist-item button {
    background: rgba(220, 38, 38, 0.2);
    border: none;
    color: #ef4444;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.playlist-item button:hover {
    background: #ef4444;
    color: #fff;
}

/* Video Overlay Styles */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark); /* Align with main panel background */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.stop-video-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(220, 38, 38, 0.2);
    border: 2px solid rgba(220, 38, 38, 0.4);
    color: #ef4444;
    padding: 12px 25px;
    border-radius: 15px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    z-index: 1001;
}

.stop-video-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.video-frame {
    width: 85%;
    max-height: 65vh; /* Adjusted to give space for footer title */
    background: #000;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8), 
                0 0 0 10px rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-frame video {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.video-footer-wrapper {
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.video-footer-title {
    color: var(--accent); /* Golden/Brand color */
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
    font-weight: 900;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.video-footer-pills {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.video-pill {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 180px;
    animation: slideUpPill 0.5s ease-out;
}

.video-pill .pill-pass {
    font-size: 1.8rem;
    font-weight: 900;
    color: #38bdf8;
    line-height: 1;
}

.video-pill .pill-guiche {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 5px;
}

@keyframes slideUpPill {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
    .controls-grid { grid-template-columns: 1fr; }
    .secondary-actions { grid-template-columns: 1fr; }
}


/* DASHBOARD STYLES */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid #eee;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: #003399;
}


/* MODERNO ADMIN LAYOUT (SIDEBAR SPA) */
.admin-body {
    background: #f8fafc;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 140px;
    background: #003399;
    color: white;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 5px;
}

.sidebar-logo {
    height: 45px;
    object-fit: contain;
}

.header-text-mobile {
    display: none; /* Hide text in ultra-narrow mode */
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item i {
    font-size: 0.85rem;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
}

.nav-item.active {
    background: white;
    color: #003399;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 2.5rem;
    background: #f8fafc;
}

.view-section {
    display: none; /* Controlled by JS */
    animation: fadeIn 0.4s ease-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Page Headers */
.page-header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 2rem;
    color: #1e293b;
    font-weight: 800;
}

/* Login Screen */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #001133;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 2rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
}

.login-card h2 {
    margin-bottom: 2rem;
    color: #003399;
    font-size: 2rem;
}

.login-card input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
}

.login-card button {
    width: 100%;
    padding: 1rem;
    background: #003399;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}

/* File Upload Styles */
.upload-area {
    border: 3px dashed #e2e8f0;
    padding: 3rem;
    border-radius: 2rem;
    text-align: center;
    background: white;
    transition: all 0.3s;
    cursor: pointer;
    margin-bottom: 2rem;
}

.upload-area:hover {
    border-color: #003399;
    background: #f1f5f9;
}

.upload-area i {
    font-size: 3rem;
    color: #003399;
    margin-bottom: 1rem;
    display: block;
}

/* User Management Table */
.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-username { font-weight: 700; color: #1e293b; }
.user-role { font-size: 0.8rem; color: #64748b; }

/* ADMIN UI REFINEMENT - PREMIUM & HIGH CONTRAST */
.admin-body {
    --admin-bg: #f8fafc;
    --sidebar-bg: #003399;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --white: #ffffff;
    --accent: #2563eb;
    
    background-color: var(--admin-bg) !important;
    background-image: none !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 16px !important;
    overflow-y: auto !important;
    height: auto !important;
    display: block !important;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - ULTRA SLIM (130px) */
.admin-body .sidebar {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    background: var(--sidebar-bg) !important;
    color: var(--white) !important;
    padding: 1rem 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.2rem !important;
    position: sticky !important;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 100;
}

.admin-body .sidebar-logo {
    height: 30px !important;
    margin: 0 auto 0.5rem auto !important;
    display: block !important;
    filter: none !important;
}

.admin-body .header-text-mobile {
    display: none !important;
}

.admin-body .nav-item {
    padding: 10px 8px !important;
    margin-bottom: 4px;
    border-radius: 8px;
    color: rgba(255,255,255,0.6) !important;
    font-weight: 600;
    font-size: 11px !important; /* Smaller text for narrow sidebar */
    display: flex !important;
    flex-direction: column !important; /* Stack icon and text */
    align-items: center !important;
    text-align: center;
    gap: 5px !important;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-body .nav-item i {
    font-size: 18px !important;
}

.admin-body .nav-item:hover {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
}

.admin-body .nav-item.active {
    background: var(--white) !important;
    color: var(--sidebar-bg) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.admin-body .nav-item.active i {
    color: var(--sidebar-bg) !important;
}

/* Main Content Area */
.admin-body .main-content {
    flex: 1;
    padding: 30px 40px !important;
    background: var(--admin-bg) !important;
    min-width: 0;
}

.admin-body .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-body .page-header h1 {
    color: #0f172a !important;
    font-size: 28px !important;
    font-weight: 800;
    margin: 0;
}

/* Sections & Cards */
.admin-body .queue-section, 
.admin-body .dashboard-stats,
.admin-body .media-config-section,
.admin-body .user-manager,
.admin-body .stat-card,
.admin-body .tips-box {
    background: var(--white) !important;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    color: var(--text-primary) !important;
}

.admin-body .stat-label {
    display: block;
    color: var(--text-secondary) !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.admin-body .stat-value {
    display: block;
    color: var(--accent) !important;
    font-size: 32px;
    font-weight: 800;
}

/* Buttons */
.admin-body button {
    cursor: pointer;
    transition: all 0.2s;
}

.admin-body .call-btn-main {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white !important;
    padding: 20px;
    font-size: 20px;
    font-weight: 800;
    border-radius: 12px;
    width: 100%;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.admin-body .recall-btn {
    background: #4b88ff !important;
    color: white !important;
    border: none;
    padding: 18px;
    font-weight: 800;
    font-size: 18px;
    border-radius: 12px;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(75, 136, 255, 0.3);
}

.admin-body .recall-btn:hover {
    background: #3b78ef !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(75, 136, 255, 0.4);
}

/* Video Management UI */
.admin-body .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.admin-body .video-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 1.5rem;
    position: relative;
    text-align: center;
}

.admin-body .video-icon {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 1rem;
    display: block;
}

.admin-body .video-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 13px;
    word-break: break-all;
}

.admin-body .remove-video-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Inputs & Config Fields - HIGH CONTRAST */
.admin-body input[type="text"],
.admin-body input[type="number"],
.admin-body input[type="password"],
.admin-body select {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 2px solid #cbd5e1 !important;
    padding: 12px 15px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    width: 100%;
    transition: border-color 0.2s;
}

.admin-body input:focus {
    border-color: #2563eb !important;
    outline: none;
}

.admin-body input::placeholder {
    color: #94a3b8 !important;
}

/* Tables */
.admin-body .modern-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-body th {
    background: #f1f5f9;
    color: var(--text-secondary) !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.admin-body td {
    padding: 16px;
    color: var(--text-primary) !important;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

/* Footer Fixes */
.admin-body .sidebar-footer {
    margin-top: auto;
    padding: 15px 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-body .logout-link {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6) !important;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.admin-body .logout-link:hover { color: #fe6b6b !important; }

/* Audio Pill Control */
.audio-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid transparent;
    opacity: 0.95;
}
.audio-pill.enabled { border-color: #22c55e; color: #22c55e; background: rgba(34, 197, 94, 0.2); }
.audio-pill.disabled { border-color: #ef4444; color: #ef4444; background: rgba(239, 68, 68, 0.2); }

.audio-overlay { display: none !important; }

/* AUDIO UNLOCK OVERLAY - PRO & SEAMLESS */
.audio-unlock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 34, 102, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.unlock-card {
    background: rgba(255, 255, 255, 1);
    padding: 3rem;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 500px;
}

.unlock-icon {
    font-size: 5rem;
    color: #003399;
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.unlock-btn {
    background: linear-gradient(135deg, #0055ff, #003399);
    color: white;
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.8rem;
    font-weight: 900;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 85, 255, 0.3);
    transition: all 0.2s;
}

.unlock-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 85, 255, 0.5);
}

/* MODAL SYSTEM */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 25px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    max-width: 500px;
    width: 90%;
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Modern Form Controls */
.modern-input, .modern-select, .modern-textarea {
    width: 100%;
    padding: 14px 18px !important;
    border: 2px solid #f1f5f9 !important;
    border-radius: 15px !important;
    background: #f8fafc !important;
    color: #1e293b !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: none !important;
}

.modern-input:focus, .modern-select:focus, .modern-textarea:focus {
    border-color: #2563eb !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
}

.modern-select {
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1.2rem center !important;
    background-size: 10px !important;
    padding-right: 3rem !important;
}

.modern-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #475569 !important;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Responsive Adjustments & Fixes --- */

/* Mobile & Small Tablets */
@media (max-width: 768px) {
    /* Admin Responsiveness */
    .admin-container {
        margin: 2vh 10px;
        padding: 30px 20px;
        border-radius: 25px;
    }

    .admin-header h1 {
        font-size: 1.8rem;
    }

    .admin-layout {
        gap: 20px;
    }

    /* Calling Hero in Admin */
    .calling-hero {
        padding: 1.5rem !important;
        border-radius: 25px !important;
    }

    .calling-hero h1 {
        font-size: 1.6rem !important;
    }

    .calling-hero > div:first-child {
        text-align: center;
        flex-direction: column !important;
    }

    .calling-hero > div:last-child {
        grid-template-columns: 1fr !important; /* Stack buttons */
    }

    .call-btn-main {
        height: auto !important;
        padding: 2rem !important;
    }

    .call-btn-main span:nth-of-type(1) {
        font-size: 1.4rem !important;
    }

    /* Modal Responsiveness */
    .modal-content {
        padding: 20px !important;
        border-radius: 20px !important;
    }

    .modal-content h2 {
        font-size: 1.2rem !important;
    }

    .modal-content .input-group {
        margin-bottom: 1rem !important;
    }

    /* Index/Panel Responsiveness */
    .password-number {
        font-size: clamp(4rem, 15vh, 18rem);
    }

    .guiche-info {
        font-size: clamp(1.8rem, 5vh, 4rem);
        padding: 1vh 3vh;
    }
    
    .ticker-label {
        padding: 0 1.5vh;
        font-size: 0.9rem;
    }
}

/* Very Small Devices */
@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 1.5rem;
    }

    .modern-table th, .modern-table td {
        padding: 10px 8px !important;
        font-size: 0.85rem;
    }

    .mini-call {
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
    }

    /* Totem Responsiveness */
    .totem-grid {
        grid-template-columns: 1fr !important;
        padding: 10px !important;
    }
    
    .btn-totem {
        padding: 30px 20px !important;
        font-size: 1.2rem !important;
    }
}

/* Specialist View (Consultorio) Responsiveness */
@media (max-width: 900px) {
    .service-container {
        padding: 1rem !important;
    }

    .service-container header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 1.5rem 1rem !important;
    }

    .queue-table thead {
        display: none; /* Hide headers on mobile */
    }

    .queue-row {
        display: flex;
        flex-direction: column;
        padding: 15px !important;
        margin-bottom: 15px;
        border-radius: 15px !important;
    }

    .queue-row td {
        display: block !important;
        padding: 5px 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
        text-align: center !important;
    }
    
    .queue-row td:last-child {
        margin-top: 15px;
    }
    
    .btn-call {
        width: 100%;
        justify-content: center;
    }
}

/* Preferential Highlight - Refined Premium Style */
.row-priority {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%) !important;
    border-left: 8px solid #f59e0b !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.row-priority::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmer-effect 3s infinite;
}

.pulse-glow-priority {
    animation: glow-pulse-priority 2s infinite ease-in-out;
}

.row-priority td {
    color: #854d0e !important; /* Dark amber for better contrast on light backgrounds (Admin) */
    font-weight: 700;
}

/* Base styles for labels/cards that should be standout yellow */
.label-p-highlight {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #854d0e !important;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-weight: 800;
    border: 1px solid rgba(245, 158, 11, 0.3);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
