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

/* --- ESCRITORIO OS X --- */
body.mac-desktop {
    background: radial-gradient(circle at center, #4282D3 0%, #174E9A 100%);
    font-family: "Lucida Grande", "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    color: #222;
    min-height: 100vh;
    margin: 0;
    padding-top: 45px;
}

/* --- BARRA DE MENÚ SUPERIOR --- */
.mac-menubar {
    background: linear-gradient(to bottom, #ffffff 0%, #ececec 50%, #dedede 100%);
    border-bottom: 1px solid #777777;
    min-height: 28px;
    font-size: 13px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    z-index: 1050;
    padding: 0;
}

.apple-brand {
    font-size: 13px;
    color: #000;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 28px;
    cursor: pointer;
    user-select: none;
}

.home-icon {
    color: #2A65C9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.home-icon svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    vertical-align: -1px;
}

.brand-text {
    font-weight: 700;
}

.mac-menubar .dropdown-toggle::after {
    display: none;
}

.dropdown.show .apple-brand,
.apple-brand:active {
    background-color: #2A65C9 !important;
    color: #ffffff !important;
}

.dropdown.show .apple-brand .home-icon,
.apple-brand:active .home-icon,
.dropdown.show .apple-brand .brand-text,
.apple-brand:active .brand-text {
    color: #ffffff !important;
}

@media (min-width: 992px) {
    .mac-menubar .nav-link {
        padding: 0 12px;
        line-height: 28px;
        font-weight: 500;
        color: #000 !important;
        cursor: default;
    }

    .mac-menubar .nav-item.show .nav-link,
    .mac-menubar .nav-link:active {
        background-color: #2A65C9 !important;
        color: #ffffff !important;
    }

    .mac-dropdown {
        background: rgba(255, 255, 255, 0.97);
        border: 1px solid #777777;
        border-top: none;
        border-radius: 0 0 5px 5px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
        padding: 4px 0;
        margin-top: 0 !important;
        font-size: 13px;
        min-width: 220px;
    }

    .mac-dropdown .dropdown-item {
        padding: 4px 18px;
        color: #000;
    }

    .mac-dropdown .dropdown-item:hover,
    .mac-dropdown .dropdown-item:focus {
        background-color: #2A65C9;
        color: #ffffff;
    }
}

/* --- BOTÓN HAMBURGUESA RETRO AQUA (< 992px) --- */
.mac-toggler {
    padding: 3px 8px;
    border: 1px solid #888888;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #e1e1e1 45%, #cfcfcf 50%, #bcbcbc 100%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.2);
    outline: none;
}

.mac-toggler:focus {
    box-shadow: 0 0 0 2px rgba(42, 101, 201, 0.5);
}

.mac-toggler-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 15px;
    height: 14px;
}

.mac-toggler-icon .line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    border-radius: 1px;
}

@media (max-width: 991.98px) {
    body.mac-desktop {
        padding-top: 50px;
    }

    .mac-menubar .navbar-collapse {
        background: #f0f0f0;
        background-image: repeating-linear-gradient(to right, #f5f5f5, #f5f5f5 2px, #e9e9e9 2px, #e9e9e9 4px);
        border: 1px solid #777;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
        margin-top: 3px;
        padding: 8px 10px;
    }

    .mac-nav-item {
        margin-bottom: 5px;
    }

    .mac-nav-link {
        font-weight: 600;
        color: #222 !important;
        padding: 8px 12px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.75);
        border: 1px solid #ccc;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mac-nav-link::after {
        content: "▶";
        font-size: 9px;
        color: #666;
        transition: transform 0.2s ease;
        display: inline-block;
    }

    .mac-nav-item.show .mac-nav-link {
        background: linear-gradient(180deg, #b0def5 0%, #68b3e8 45%, #3598db 50%, #1e87d1 100%);
        color: #fff !important;
        border-color: #165b90;
        text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
    }

    .mac-nav-item.show .mac-nav-link::after {
        transform: rotate(90deg);
        color: #fff;
    }

    .mac-dropdown {
        position: static !important;
        transform: none !important;
        float: none;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid #bbb;
        border-left: 3px solid #2A65C9;
        border-radius: 0 0 4px 4px;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
        margin: 2px 0 6px 14px !important;
        padding: 4px 0;
    }

    .mac-dropdown .dropdown-item {
        padding: 6px 14px;
        font-size: 13px;
    }

    .mac-dropdown .dropdown-item:hover {
        background-color: #2A65C9;
        color: #fff;
    }
}

/* --- VENTANAS DE LA INTERFAZ AQUA --- */
.mac-window {
    background: #ffffff;
    border-radius: 6px 6px 4px 4px;
    border: 1px solid #777;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    overflow: hidden;
}

.titlebar {
    height: 25px;
    background: linear-gradient(to bottom, #f2f2f2 0%, #cccccc 100%);
    border-bottom: 1px solid #888;
    display: flex;
    align-items: center;
    position: relative;
}

.traffic-lights {
    display: flex;
    gap: 6px;
    padding-left: 10px;
    position: absolute;
}

.traffic-lights .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.8), inset 0 -2px 2px rgba(0, 0, 0, 0.2);
}

.dot.red { background: #ff5f56; cursor: pointer; }
.dot.yellow { background: #ffbd2e; cursor: pointer; }
.dot.green { background: #27c93f; cursor: pointer; }

.traffic-lights .dot.dot-disabled {
    background: #e0e0e0 !important;
    border-color: #c0c0c0 !important;
    cursor: default !important;
    box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.4) !important;
}

.title {
    width: 100%;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-shadow: 0 1px 0 #fff;
    cursor: default;
}

.window-content {
    background: repeating-linear-gradient(to right, #f4f4f4, #f4f4f4 2px, #ffffff 2px, #ffffff 4px);
    min-height: 200px;
}

/* Maximizar Modales */
.modal-dialog.mac-window-maximized {
    max-width: 100% !important;
    margin: 0 !important;
    height: 100vh !important;
}

.modal-dialog.mac-window-maximized .modal-content {
    height: 100vh !important;
    border-radius: 0 !important;
}

/* Maximizar Ventanas Estáticas */
.mac-window.mac-window-maximized-static {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1100 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    max-width: none !important;
    display: flex;
    flex-direction: column;
}

.mac-window.mac-window-maximized-static > .window-content,
.mac-window.mac-window-maximized-static > .cpanel-container {
    flex-grow: 1;
    overflow-y: auto;
}

/* Dock */
.mac-dock {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 10px 15px;
    display: flex;
    gap: 15px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.8);
    z-index: 2000;
    transition: transform 0.3s ease;
    align-items: flex-end;
}

.dock-item {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle at 50% 120%, #e6e6e6 10%, #ffffff 80%);
    border: 1px solid #999;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 2px 2px rgba(255, 255, 255, 1);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    transform-origin: bottom center;
}

.dock-item:hover {
    transform: scale(1.4);
    z-index: 10;
    margin: 0 10px;
}

.dock-item::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #222;
    border-radius: 50%;
    box-shadow: 0 1px 1px rgba(255,255,255,0.5);
}

/* --- TOOLBAR, INPUTS, ETC --- */
.mac-toolbar {
    background: #e6e6e6;
    border-bottom: 1px solid #999;
    box-shadow: inset 0 1px 0 #fff;
}

.toolbar-item {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    color: #444;
}

.toolbar-item:hover,
.toolbar-item.active {
    background: rgba(0, 0, 0, 0.08);
}

.mac-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.mac-input,
.mac-textarea {
    background-color: #ffffff;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 13px;
    padding: 6px 9px;
    border: 1px solid #8e8e8e;
    border-top: 1px solid #666666;
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.mac-input:focus,
.mac-textarea:focus {
    background-color: #ffffff;
    border-color: #3b88e0;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 0 1px #2a75d3, 0 0 6px 2px rgba(78, 161, 255, 0.85);
}

.mac-input-prefix {
    background: linear-gradient(180deg, #f2f2f2 0%, #dcdcdc 100%);
    border: 1px solid #8e8e8e;
    border-right: none;
    border-radius: 3px 0 0 3px;
    color: #444;
    font-weight: bold;
    font-size: 13px;
    padding: 6px 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mac-input-group .mac-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.mac-search {
    border-radius: 14px;
    border: 1px solid #8e8e8e;
    border-top: 1px solid #666666;
    font-size: 12px;
    padding: 3px 12px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
    outline: none;
}

.mac-search:focus {
    border-color: #3b88e0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 0 1px #2a75d3, 0 0 6px 2px rgba(78, 161, 255, 0.85);
}

/* --- ICONOS Y TARJETAS --- */
.cpanel-tile {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    display: flex;
    flex-direction: column;
}

.cpanel-tile:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
    border-color: #8bbce0;
}

.sala-titulo {
    color: #1a1a1a;
    font-size: 15px;
}

.sala-desc {
    min-height: 34px;
    line-height: 1.3;
}

.badge-mac-users {
    background: linear-gradient(180deg, #f7f7f7 0%, #e0e0e0 100%);
    border: 1px solid #b5b5b5;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    color: #555;
    display: inline-block;
    align-self: center;
    box-shadow: inset 0 1px 0 #fff;
}

.aqua-orb-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.aqua-orb {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.28), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
    user-select: none;
}

.orb-highlight {
    position: absolute;
    top: 3px;
    left: 11px;
    width: 44px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.15) 100%);
    pointer-events: none;
}

.orb-icon {
    font-size: 28px;
    z-index: 2;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

/* Esferas y Botones Multicolor */
.orb-aqua {
    background: radial-gradient(circle at 50% 120%, #0c619e 10%, #1588d3 40%, #5dcbf8 80%, #a2e8fd 100%);
    border: 1px solid #146294;
}

.mac-btn-aqua {
    background: linear-gradient(180deg, #b0def5 0%, #68b3e8 45%, #3598db 50%, #1e87d1 100%);
    border: 1px solid #165b90;
    border-radius: 15px;
    color: white;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 18px;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.mac-btn-aqua:active {
    background: linear-gradient(180deg, #3598db 0%, #68b3e8 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.orb-orange {
    background: radial-gradient(circle at 50% 120%, #a63f00 10%, #d86500 40%, #ffa52c 80%, #ffde94 100%);
    border: 1px solid #994000;
}

.mac-btn-orange {
    background: linear-gradient(180deg, #ffe29a 0%, #ff9d1c 45%, #f07800 50%, #c45200 100%);
    border: 1px solid #9c4200;
    border-radius: 15px;
    color: white;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 18px;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.35);
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.85), 0 2px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.mac-btn-orange:active {
    background: linear-gradient(180deg, #f07800 0%, #ff9d1c 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.orb-purple {
    background: radial-gradient(circle at 50% 120%, #30004a 10%, #7115aa 40%, #c568f2 80%, #f4d4ff 100%);
    border: 1px solid #4a148c;
}

.mac-btn-purple {
    background: linear-gradient(180deg, #e4b3ff 0%, #9c27b0 45%, #7b1fa2 50%, #4a148c 100%);
    border: 1px solid #4a148c;
    border-radius: 15px;
    color: white;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 18px;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.mac-btn-purple:active {
    background: linear-gradient(180deg, #7b1fa2 0%, #9c27b0 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.orb-green {
    background: radial-gradient(circle at 50% 120%, #005200 10%, #158a15 40%, #68d968 80%, #d4f7d4 100%);
    border: 1px solid #1b5e20;
}

.mac-btn-green {
    background: linear-gradient(180deg, #a8e6a8 0%, #4caf50 45%, #388e3c 50%, #1b5e20 100%);
    border: 1px solid #1b5e20;
    border-radius: 15px;
    color: white;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 18px;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.mac-btn-green:active {
    background: linear-gradient(180deg, #388e3c 0%, #4caf50 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.orb-yellow {
    background: radial-gradient(circle at 50% 120%, #996e00 10%, #e6a800 40%, #ffda66 80%, #fff5d4 100%);
    border: 1px solid #a67c00;
}

.mac-btn-yellow {
    background: linear-gradient(180deg, #ffeda8 0%, #ffca28 45%, #ffb300 50%, #ff8f00 100%);
    border: 1px solid #a67c00;
    border-radius: 15px;
    color: #4a3000;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 18px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.9), 0 2px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.mac-btn-yellow:active {
    background: linear-gradient(180deg, #ffb300 0%, #ffca28 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.orb-red {
    background: radial-gradient(circle at 50% 120%, #7a0000 10%, #d31515 40%, #ff6b6b 80%, #ffdada 100%);
    border: 1px solid #b30000;
}

.mac-btn-red {
    background: linear-gradient(180deg, #ffb3b3 0%, #ff4d4d 45%, #e60000 50%, #b30000 100%);
    border: 1px solid #b30000;
    border-radius: 15px;
    color: white;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 18px;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.mac-btn-red:active {
    background: linear-gradient(180deg, #e60000 0%, #ff4d4d 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.mac-btn-standard {
    background: linear-gradient(180deg, #ffffff 0%, #e6e6e6 45%, #d9d9d9 50%, #cccccc 100%);
    border: 1px solid #999;
    border-radius: 15px;
    color: #222;
    font-size: 13px;
    padding: 5px 18px;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.mac-btn-standard:active {
    background: #cccccc;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mac-link {
    color: #1e87d1;
    text-decoration: none;
}

.mac-link:hover {
    text-decoration: underline;
}

.mac-fieldset {
    border: 1px solid #bbb;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.65);
    padding: 16px;
}

.mac-legend {
    font-size: 12px;
    font-weight: bold;
    padding: 0 6px;
    width: auto;
    color: #444;
}

/* --- CPANEL SPLIT VIEW --- */
.cpanel-container {
    display: flex;
    min-height: 65vh;
    margin: 0;
    padding: 0;
    background: repeating-linear-gradient(to right, #f4f4f4, #f4f4f4 2px, #ffffff 2px, #ffffff 4px);
}

.mac-sidebar {
    width: 240px;
    background-color: #e8eaf0;
    border-right: 1px solid #a0a0a0;
    flex-shrink: 0;
    overflow-y: auto;
    box-shadow: inset -1px 0 3px rgba(0,0,0,0.05);
}

.mac-content-area {
    flex-grow: 1;
    padding: 25px;
    overflow-y: auto;
}

.mac-sidebar .nav-pills .nav-link {
    border-radius: 0;
    color: #333;
    font-weight: 500;
    font-size: 13px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1px 0;
    transition: none;
    border-bottom: 1px solid transparent;
    border-top: 1px solid transparent;
}

.mac-sidebar .nav-pills .nav-link:hover:not(.active) {
    background-color: #dce0e8;
}

.mac-sidebar .nav-pills .nav-link.active {
    background: linear-gradient(180deg, #599ce6 0%, #1e6acb 100%);
    color: white !important;
    border-top: 1px solid #4a8cd5;
    border-bottom: 1px solid #14509d;
    text-shadow: 0 1px 1px rgba(0,0,0,0.4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.mac-sidebar .nav-link .sidebar-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.mac-sidebar .nav-link.active .sidebar-icon {
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
}

.sidebar-heading {
    font-size: 11px;
    font-weight: bold;
    color: #777;
    text-transform: uppercase;
    padding: 15px 15px 5px 15px;
    letter-spacing: 0.5px;
}

@media (max-width: 767.98px) {
    .cpanel-container {
        flex-direction: column;
    }

    .mac-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #a0a0a0;
    }

    .mac-sidebar .nav-pills {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .mac-sidebar .nav-pills .nav-link {
        white-space: nowrap;
        border-radius: 6px;
        margin: 5px;
        border: 1px solid transparent;
    }

    .sidebar-heading {
        display: none;
    }
}