/* styles.css */
      
	  * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-color: #32b8c6;
            --dark-bg: #1f2121;
            --darker-bg: #262828;
            --text-primary: #f5f5f5;
            --text-secondary: #a7a9a9;
            --border-color: #3a3d3d;
            --success: #22c55e;
            --danger: #ff5459;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--dark-bg);
            color: var(--text-primary);
            line-height: 1.6;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        .main-content {
            flex: 1;
        }

        /* NAVBAR */
        nav {
            background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
            border-bottom: 2px solid var(--primary-color);
            padding: 0 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 80px;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(50, 184, 198, 0.15);
        }

        .nav-left {
            display: flex;
            align-items: center;
            gap: 50px;
        }

        .nav-logo {
            font-size: 26px;
            font-weight: 800;
            background: linear-gradient(135deg, var(--primary-color), #1d7480);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: 1px;
            white-space: nowrap;
        }

        .nav-menu {
            display: flex;
            gap: 10px;
        }

        .nav-link {
            padding: 10px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.3s;
            cursor: pointer;
            font-weight: 600;
            border: 2px solid transparent;
        }

        .nav-link:hover {
            color: var(--primary-color);
            background-color: rgba(50, 184, 198, 0.1);
            border-bottom: 2px solid var(--primary-color);
        }

        .nav-link.active {
            color: var(--primary-color);
            background-color: rgba(50, 184, 198, 0.15);
            border-bottom: 2px solid var(--primary-color);
        }

        .nav-right {
            display: flex;
            gap: 15px;
            align-items: center;
        }

        .hamburger {
            display: none;
            background: none;
            border: none;
            color: var(--primary-color);
            font-size: 24px;
            padding: 5px 10px;
            cursor: pointer;
        }

        .user-badge {
            padding: 8px 16px;
            background-color: rgba(50, 184, 198, 0.1);
            border: 1px solid var(--primary-color);
            border-radius: 20px;
            color: var(--primary-color);
            font-size: 13px;
            font-weight: 600;
        }

        .btn-login, .btn-logout {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
            min-height: 44px;
        }

        .btn-login {
            background: var(--primary-color);
            color: white;
        }

        .btn-login:hover {
            background: #1d7480;
            transform: scale(1.05);
        }

        .btn-logout {
            background: var(--danger);
            color: white;
        }

        .btn-logout:hover {
            background: #c41530;
        }

        /* CONTAINER */
        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 40px 20px;
            flex: 1;
        }

        .page {
            display: none !important;
        }

        .page.active {
            display: block !important;
            animation: fadeIn 0.3s ease-in;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* LOGIN PAGE */
        .login-page {
            display: none !important;
            flex-direction: column !important;
            justify-content: center !important;
            align-items: center !important;
            min-height: 100vh !important;
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            height: 100% !important;
            background-color: var(--dark-bg) !important;
            z-index: 9999 !important;
            margin: 0 !important;
            padding: 0 !important;
        }

        .login-page.active {
            display: flex !important;
        }

        .login-box {
            background: var(--darker-bg);
            border: 2px solid var(--primary-color);
            padding: 50px 40px;
            border-radius: 15px;
            max-width: 450px;
            width: 90%;
            box-shadow: 0 15px 50px rgba(50, 184, 198, 0.25);
        }

        .login-box h2 {
            color: var(--primary-color);
            margin-bottom: 30px;
            text-align: center;
            font-size: 32px;
        }

        /* HOME */
        .home-hero {
            text-align: center;
            padding: 80px 40px;
        }

        .home-hero h1 {
            font-size: 48px;
            color: var(--primary-color);
            margin-bottom: 20px;
        }

        .home-hero p {
            font-size: 18px;
            color: var(--text-secondary);
            margin-bottom: 30px;
        }

        .btn-primary {
            padding: 12px 30px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            min-height: 44px;
            font-size: 16px;
        }

        .btn-primary:hover {
            background: #1d7480;
            transform: scale(1.05);
        }

        /* DASHBOARD */
        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            gap: 15px;
            flex-wrap: wrap;
        }

        .dashboard-header h2 {
            font-size: 32px;
            color: var(--primary-color);
        }

        .btn-add {
            padding: 12px 24px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            min-height: 44px;
            font-size: 16px;
        }

        .btn-add:hover {
            background: #1d7480;
        }

        /* TABLE */
        .table-container {
            background: var(--darker-bg);
            border-radius: 10px;
            border: 1px solid var(--border-color);
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            background: rgba(50, 184, 198, 0.1);
            padding: 18px;
            text-align: left;
            color: var(--primary-color);
            font-weight: 600;
            border-bottom: 2px solid var(--border-color);
            text-transform: uppercase;
            font-size: 13px;
            letter-spacing: 1px;
            white-space: nowrap;
        }

        td {
            padding: 18px;
            border-bottom: 1px solid var(--border-color);
            color: var(--text-primary);
            cursor: pointer;
            transition: background-color 0.3s;
        }

        tbody tr:hover {
            background-color: rgba(50, 184, 198, 0.05);
        }

        .status-badge {
            display: inline-block;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .status-online {
            background-color: rgba(34, 197, 94, 0.2);
            color: var(--success);
            border: 1px solid var(--success);
        }

        .status-offline {
            background-color: rgba(255, 84, 89, 0.2);
            color: var(--danger);
            border: 1px solid var(--danger);
        }

        .status-checking {
            background-color: rgba(255, 193, 7, 0.2);
            color: #ffc107;
            border: 1px solid #ffc107;
        }

        .action-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .btn-edit, .btn-delete, .btn-visit {
            padding: 8px 14px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
            font-size: 12px;
            white-space: nowrap;
            min-height: 40px;
        }

        .btn-edit {
            background: var(--primary-color);
            color: white;
        }

        .btn-edit:hover {
            background: #1d7480;
        }

        .btn-delete {
            background: var(--danger);
            color: white;
        }

        .btn-delete:hover {
            background: #c41530;
        }

        .btn-visit {
            background: var(--success);
            color: white;
        }

        .btn-visit:hover {
            background: #15803d;
        }

        /* MODAL */
        .modal {
            display: none !important;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 2000;
            align-items: center;
            justify-content: center;
        }

        .modal.active {
            display: flex !important;
        }

        .modal-content {
            background: var(--darker-bg);
            padding: 40px;
            border-radius: 10px;
            border: 2px solid var(--primary-color);
            max-width: 500px;
            width: 90%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-header {
            font-size: 24px;
            color: var(--primary-color);
            margin-bottom: 25px;
            font-weight: 600;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .close-btn {
            background: none;
            border: none;
            color: var(--primary-color);
            font-size: 28px;
            cursor: pointer;
            transition: color 0.3s;
        }

        .close-btn:hover {
            color: #1d7480;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-secondary);
            font-weight: 500;
            font-size: 14px;
        }

        .form-group input {
            width: 100%;
            padding: 12px;
            background: var(--dark-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 16px;
            transition: all 0.3s;
        }

        .form-group input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(50, 184, 198, 0.2);
        }

        .form-buttons {
            display: flex;
            gap: 10px;
            margin-top: 30px;
        }

        .form-buttons button {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
            min-height: 44px;
            font-size: 16px;
        }

        .btn-submit {
            background: var(--primary-color);
            color: white;
        }

        .btn-submit:hover {
            background: #1d7480;
        }

        .btn-cancel {
            background: var(--border-color);
            color: var(--text-primary);
        }

        .btn-cancel:hover {
            background: #4a4d4d;
        }

        .error-message {
            color: var(--danger);
            margin-bottom: 15px;
            padding: 12px;
            background: rgba(255, 84, 89, 0.1);
            border-radius: 6px;
            border-left: 4px solid var(--danger);
            display: none;
        }

        .error-message.show {
            display: block;
        }

        .success-message {
            color: var(--success);
            margin-bottom: 15px;
            padding: 12px;
            background: rgba(34, 197, 94, 0.1);
            border-radius: 6px;
            border-left: 4px solid var(--success);
            display: none;
        }

        .success-message.show {
            display: block;
        }

        .content-page {
            background: var(--darker-bg);
            border: 1px solid var(--border-color);
            padding: 40px;
            border-radius: 10px;
            line-height: 1.8;
            color: var(--text-primary);
        }

        .content-page h2 {
            color: var(--primary-color);
            margin-top: 30px;
            margin-bottom: 15px;
            font-size: 22px;
        }

        .content-page h3 {
            color: var(--primary-color);
            margin-top: 20px;
            margin-bottom: 10px;
            font-size: 18px;
        }

        .content-page p {
            margin-bottom: 15px;
            text-align: justify;
        }

        .loading {
            text-align: center;
            color: var(--text-secondary);
            padding: 40px;
        }
       /* FILTRO DE BÚSQUEDA */
        .search-container {
            position: relative;
            margin-top: 15px;
            display: flex;
            gap: 10px;
            max-width: 300px;
        }

        .filter-input {
            width: 100%;
            padding: 12px 16px;
            background: var(--dark-bg);
            border: 2px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            transition: all 0.3s;
            font-weight: 500;
        }

        .filter-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 10px rgba(50, 184, 198, 0.3);
            background: rgba(50, 184, 198, 0.05);
        }

        .filter-input::placeholder {
            color: var(--text-secondary);
        }

        .btn-clear-filter {
            background: var(--danger);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 12px 14px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
            min-width: 44px;
            height: 44px;
        }

        .btn-clear-filter:hover {
            background: #c41530;
        }

        /* Tabla filtrada */
        .server-row-hidden {
            display: none !important;
        }

        .filter-highlight {
            background: rgba(50, 184, 198, 0.15);
            transition: background 0.2s;
        }

        .no-results {
            text-align: center;
            padding: 40px;
            color: var(--text-secondary);
            font-size: 16px;
        }

        @media (max-width: 768px) {
            .dashboard-header {
                flex-direction: column;
                gap: 15px;
            }

            .search-container {
                max-width: 100%;
                margin-top: 10px;
            }

            .filter-input {
                padding: 14px 16px;
                font-size: 16px; /* Evita zoom en iOS */
            }

            .btn-add {
                width: 100%;
            }
        }

        th {
            background: rgba(50, 184, 198, 0.1);
            padding: 18px;
            text-align: left;
            color: var(--primary-color);
            font-weight: 600;
            border-bottom: 2px solid var(--border-color);
            text-transform: uppercase;
            font-size: 13px;
            letter-spacing: 1px;
            cursor: pointer;
            user-select: none;
            transition: all 0.3s;
        }

        th:hover {
            background: rgba(50, 184, 198, 0.2);
        }

        th.sortable {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .sort-icon {
            display: inline-block;
            font-size: 12px;
            opacity: 0.5;
            transition: opacity 0.3s;
        }

        th:hover .sort-icon {
            opacity: 1;
        }

        th.sorted-asc .sort-icon,
        th.sorted-desc .sort-icon {
            opacity: 1;
            color: var(--primary-color);
        }





        /* FOOTER */
        footer {
            background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
            border-top: 1px solid var(--border-color);
            padding: 30px 20px;
            text-align: center;
            color: var(--text-secondary);
            font-size: 13px;
            margin-top: 60px;
        }

        footer a {
            color: var(--primary-color);
            text-decoration: none;
            transition: color 0.3s;
        }

        footer a:hover {
            color: #1d7480;
            text-decoration: underline;
        }

        footer p {
            margin: 8px 0;
            line-height: 1.8;
        }

        /* SERVER DETAIL MODAL */
        .server-detail-modal {
            display: none !important;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 90%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 3000;
            align-items: center;
            justify-content: center;
            overflow-y: auto;
            padding: 15px 0;
        }

        .server-detail-modal.active {
            display: flex !important;
        }

        .server-detail-content {
            background: var(--darker-bg);
            border: 2px solid var(--primary-color);
            border-radius: 15px;
            max-width: 600px;
            width: 50%;
            margin: auto;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(50, 184, 198, 0.3);
            animation: slideUp 0.3s ease-out;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .server-detail-header {
            position: relative;
            height: 200px;
            overflow: hidden;
            background: linear-gradient(135deg, var(--primary-color), #1d7480);
        }

        .server-detail-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .server-detail-close {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(0, 0, 0, 0.7);
            border: none;
            color: var(--primary-color);
            font-size: 32px;
            cursor: pointer;
            width: 45px;
            height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s;
        }

        .server-detail-close:hover {
            background: rgba(0, 0, 0, 0.9);
            color: #1d7480;
        }

        .server-detail-body {
            padding: 20px 40px;
        }

        .server-detail-title {
            font-size: 28px;
            color: var(--primary-color);
            margin-bottom: 25px;
            font-weight: 700;
        }

        .server-detail-info {
            margin-bottom: 10px;
        }

        .server-detail-label {
            font-size: 12px;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: 600;
            margin-bottom: 6px;
        }

        .server-detail-value {
            font-size: 14px;
            color: var(--text-primary);
            background: rgba(50, 184, 198, 0.1);
            padding: 8px 12px;
            border-radius: 8px;
            border-left: 3px solid var(--primary-color);
            font-family: 'Courier New', monospace;
            word-break: break-all;
        }

        .server-detail-status-badge {
            display: inline-block;
            margin-top: 10px;
        }

        .server-detail-actions {
            display: flex;
            gap: 15px;
            margin-top: 30px;
            padding-top: 25px;
            border-top: 1px solid var(--border-color);
        }

        .server-detail-actions button {
            flex: 1;
            padding: 12px 20px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
            min-height: 44px;
            font-size: 16px;
        }

        .btn-detail-edit {
            background: var(--primary-color);
            color: white;
        }

        .btn-detail-edit:hover {
            background: #1d7480;
            transform: translateY(-2px);
        }

        .btn-detail-delete {
            background: var(--danger);
            color: white;
        }

        .btn-detail-delete:hover {
            background: #c41530;
            transform: translateY(-2px);
        }

        .btn-detail-visit {
            background: var(--success);
            color: white;
        }

        .btn-detail-visit:hover {
            background: #15803d;
            transform: translateY(-2px);
        }

        /* RESPONSIVE MÓVIL */
        @media (max-width: 768px) {
            /* NAVBAR MÓVIL */
            nav {
                flex-direction: row;
                height: auto;
                padding: 15px;
                gap: 10px;
            }

            .nav-left {
                flex: 1;
                gap: 15px;
            }

            .nav-logo {
                font-size: 20px;
                letter-spacing: 0;
            }

            .nav-menu {
                display: none;
                position: absolute;
                top: 65px;
                left: 0;
                width: 100%;
                background: var(--darker-bg);
                flex-direction: column;
                padding: 20px;
                gap: 10px;
                border-bottom: 2px solid var(--primary-color);
            }

            .nav-menu.active {
                display: flex;
            }

            .hamburger {
                display: block;
                order: 2;
            }

            .nav-right {
                display: flex;
                gap: 10px;
                flex-direction: row;
                flex-wrap: wrap;
                width: 100%;
                order: 3;
                margin-top: 10px;
            }

            .user-badge {
                font-size: 11px;
                padding: 6px 12px;
            }

            .btn-login, .btn-logout {
                padding: 10px 16px;
                font-size: 14px;
                min-height: auto;
            }

            /* CONTAINER MÓVIL */
            .container {
                padding: 20px 15px;
            }

            /* HOME MÓVIL */
            .home-hero {
                padding: 40px 20px;
            }

            .home-hero h1 {
                font-size: 28px;
                margin-bottom: 15px;
            }

            .home-hero p {
                font-size: 14px;
                margin-bottom: 20px;
            }

            /* DASHBOARD MÓVIL */
            .dashboard-header {
                flex-direction: column;
                gap: 15px;
            }

            .dashboard-header h2 {
                font-size: 24px;
                width: 100%;
            }

            .btn-add {
                width: 100%;
            }

            /* TABLA MÓVIL */
            .table-container {
                border-radius: 6px;
            }

            table {
                font-size: 12px;
                min-width: 800px;
            }

            th, td {
                padding: 12px 8px;
            }

            .action-buttons {
                flex-direction: column;
                gap: 6px;
            }

            .btn-edit, .btn-delete, .btn-visit {
                width: 100%;
                padding: 10px 8px;
                font-size: 11px;
                min-height: 40px;
            }

            /* MODAL MÓVIL */
            .modal-content {
                width: 95%;
                padding: 25px 20px;
                margin: 10px;
            }

            .modal-header {
                font-size: 20px;
            }

            .form-group input {
                font-size: 16px;
                padding: 14px 12px;
            }

            .form-buttons button {
                font-size: 14px;
            }

            /* CONTENT PAGE MÓVIL */
            .content-page {
                padding: 25px 20px;
            }

            .content-page h2 {
                font-size: 20px;
                margin-top: 20px;
            }

            .content-page h3 {
                font-size: 16px;
            }

            .content-page p {
                text-align: left;
                font-size: 14px;
            }

            /* SERVER DETAIL MÓVIL */
            .server-detail-header {
                height: 180px;
            }

            .server-detail-body {
                padding: 25px 20px;
            }

            .server-detail-title {
                font-size: 22px;
                margin-bottom: 20px;
            }

            .server-detail-value {
                font-size: 14px;
                padding: 10px 12px;
            }

            .server-detail-actions {
                flex-direction: column;
                gap: 10px;
            }

            .server-detail-actions button {
                width: 100%;
                padding: 12px;
                font-size: 14px;
            }

            /* FOOTER MÓVIL */
            footer {
                padding: 20px 15px;
                font-size: 12px;
                margin-top: 40px;
            }

            footer p {
                margin: 6px 0;
            }

            /* LOGIN MÓVIL */
            .login-box {
                padding: 30px 20px;
                width: 95%;
            }

            .login-box h2 {
                font-size: 24px;
                margin-bottom: 25px;
            }
        }

        @media (max-width: 480px) {
            nav {
                padding: 12px;
            }

            .nav-logo {
                font-size: 18px;
            }

            .home-hero {
                padding: 30px 15px;
            }

            .home-hero h1 {
                font-size: 22px;
            }

            .dashboard-header h2 {
                font-size: 20px;
            }

            .modal-content {
                width: 98%;
                padding: 20px 15px;
            }

            .container {
                padding: 15px 10px;
            }
        }
		
		/* TABLA MÓVIL ULTRA MEJORADA */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
        margin: 10px 0;
        box-shadow: 0 5px 20px rgba(50, 184, 198, 0.2);
    }
    
    table {
        min-width: 850px; /* Ancho fijo para scroll */
        font-size: 14px;
    }
    
    th, td {
        padding: 12px 10px !important; /* Más espacio */
        white-space: nowrap; /* Evita saltos de línea */
        min-width: 80px;
    }
    
    /* Sticky primera columna (Juego) */
    th:first-child,
    td:first-child {
        position: sticky;
        left: 0;
        background: var(--darker-bg);
        z-index: 10;
        border-right: 2px solid var(--primary-color);
    }
    
    /* Scrollbar personalizada */
    .table-container::-webkit-scrollbar {
        height: 6px;
    }
    .table-container::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 3px;
    }
}

/* MÓVILES MUY PEQUEÑOS */
@media (max-width: 480px) {
    table { font-size: 13px; }
    th, td { padding: 10px 8px !important; }
    .action-buttons button { 
        font-size: 14px !important; 
        padding: 10px 12px !important;
        min-height: 44px; /* Touch-friendly */
    }
}
