/* === NEON CYBERPUNK THEME - PROFESSIONAL EDITION === */

:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.98);
    --neon-purple: #b026ff;
    --neon-pink: #ff0080;
    --neon-red: #ff0000;
    --neon-green: #00e676;
    --text-primary: #2c2c2c;
    --text-secondary: rgba(44, 44, 44, 0.65);
    --border-subtle: rgba(0, 0, 0, 0.12);
    --shadow-purple: 0 8px 32px rgba(176, 38, 255, 0.25);
    --shadow-pink: 0 8px 32px rgba(255, 0, 128, 0.25);
    --shadow-red: 0 8px 32px rgba(255, 23, 68, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 15% 15%, rgba(176, 38, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(255, 0, 128, 0.08) 0%, transparent 40%),
        linear-gradient(135deg, #290355 0%, #1F1229 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow-x: hidden;
}

/* === MAIN CONTAINER === */
.main-container {
    width: 100%;
    max-width: 98%;
    min-height: 92vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 10px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === PAGE TITLE === */
.page-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 20px var(--neon-purple);
    margin-bottom: 10px;
    position: relative;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
    box-shadow: 0 0 10px var(--neon-purple);
}

/* === ACTION BAR === */
.actions-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0 10px;
}

.neon-button {
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-pink) 100%);
    border: none;
    padding: 14px 32px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-purple), 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.neon-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.neon-button:hover::before {
    left: 100%;
}

.neon-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(176, 38, 255, 0.45), 0 8px 24px rgba(255, 0, 128, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.neon-button:active {
    transform: translateY(-1px);
}

/* === TABLE WRAPPER === */
.table-wrapper {
    flex: 1;
    /* Background matching the dark theme */
    background: linear-gradient(135deg, #240046 0%, #3c096c 100%);
    border-radius: 24px;
    padding: 3px;
    position: relative;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(176, 38, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.table-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg,
            var(--neon-purple) 0%,
            var(--neon-pink) 50%,
            var(--neon-red) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.7;
    animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 0.9;
    }
}

.table-scroll-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    border-radius: 22px;
    padding: 8px;
    /* Fondo Morado Intenso - Deep Purple Background */
    background: linear-gradient(135deg, #240046 0%, #3c096c 100%);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
    cursor: grab;
}

.table-scroll-container.is-dragging {
    cursor: grabbing;
    user-select: none;
}

/* === TABLE STYLES === */
.neon-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.neon-table thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

.neon-table th {
    background: linear-gradient(180deg, #10002b 0%, #240046 100%);
    padding: 18px 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    border-bottom: 3px solid var(--neon-purple);
    backdrop-filter: blur(15px);
    position: relative;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    /* White text for header */
}

.neon-table th ion-icon {
    font-size: 1.3rem;
    vertical-align: middle;
}

.neon-table th::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
    box-shadow: 0 0 8px var(--neon-purple);
}

.neon-table th:nth-child(1) {
    width: 45px;
    text-align: center;
}

.neon-table th:nth-child(2) {
    width: 15%;
    text-align: center;
}

.neon-table th:nth-child(3) {
    width: 8%;
    text-align: center;
}

.neon-table th:nth-child(4) {
    width: 10%;
    text-align: center;
}

.neon-table th:nth-child(5) {
    width: 45px;
    text-align: center;
}

.neon-table th:nth-child(6),
.neon-table th:nth-child(7),
.neon-table th:nth-child(8) {
    width: 8%;
    text-align: center;
}

.neon-table th:nth-child(9) {
    width: 8%;
    text-align: center;
}

.neon-table th:nth-child(10) {
    width: 17%;
    text-align: center;
}

.neon-table th:nth-child(11) {
    width: 12%;
    text-align: center;
}

/* Status Badges */
/* Editable Input for Status */
.status-editable {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
    width: 100%;
    min-width: 80px;
    padding: 4px;
    outline: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.status-editable:focus {
    border-bottom: 1px solid #00e676;
    background: rgba(0, 0, 0, 0.2);
}

/* Legacy badges kept if needed elsewhere, but Status column now uses input above */
.status-active {
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
    background: rgba(0, 230, 118, 0.1);
    padding: 4px 12px;
    border-radius: 8px;
    /* Changed to match square-ish look */
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
    display: inline-flex;
    /* Added for multiline */
    flex-direction: column;
    /* Added for multiline */
    align-items: center;
    /* Added for multiline */
    line-height: 1.2;
    /* Added for multiline */
    font-size: 0.9em;
    /* Adjusted to match Inactive */
}

.status-inactive {
    color: #ffffff;
    /* White text for better visibility */
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.25);
    /* Darker background to pop against red rows */
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9em;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.status-date {
    font-size: 0.75em;
    opacity: 0.8;
    margin-top: 2px;
    font-weight: 400;
}

/* === TEAM BADGES === */
.team-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Team Colors Palette */
.team-color-0 {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5253 100%);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
}

.team-color-1 {
    background: linear-gradient(135deg, #4834d4 0%, #686de0 100%);
    box-shadow: 0 0 15px rgba(72, 52, 212, 0.4);
}

.team-color-2 {
    background: linear-gradient(135deg, #6ab04c 0%, #badc58 100%);
    box-shadow: 0 0 15px rgba(106, 176, 76, 0.4);
}

.team-color-3 {
    background: linear-gradient(135deg, #f0932b 0%, #ffbe76 100%);
    box-shadow: 0 0 15px rgba(240, 147, 43, 0.4);
}

.team-color-4 {
    background: linear-gradient(135deg, #eb4d4b 0%, #ff7979 100%);
    box-shadow: 0 0 15px rgba(235, 77, 75, 0.4);
}

.team-color-5 {
    background: linear-gradient(135deg, #22a6b3 0%, #7ed6df 100%);
    box-shadow: 0 0 15px rgba(34, 166, 179, 0.4);
}

.team-color-6 {
    background: linear-gradient(135deg, #be2edd 0%, #e056fd 100%);
    box-shadow: 0 0 15px rgba(190, 46, 221, 0.4);
}

.team-color-7 {
    background: linear-gradient(135deg, #130f40 0%, #30336b 100%);
    box-shadow: 0 0 15px rgba(19, 15, 64, 0.4);
}

.team-color-8 {
    background: linear-gradient(135deg, #f9ca24 0%, #f6e58d 100%);
    box-shadow: 0 0 15px rgba(249, 202, 36, 0.4);
    color: #333;
    text-shadow: none;
}

.team-color-9 {
    background: linear-gradient(135deg, #7ed6df 0%, #22a6b3 100%);
    box-shadow: 0 0 15px rgba(126, 214, 223, 0.4);
}

/* === TABLE BODY === */
.neon-table tbody tr {
    transition: all 0.3s ease;
    position: relative;
}

.neon-table tbody tr:hover:not(.empty-row) {
    background: rgba(176, 38, 255, 0.08);
}

.neon-table td {
    padding: 20px 10px;
    color: #ffffff;
    vertical-align: middle;
    font-size: 1.3rem;
}

.neon-table td:nth-child(1) {
    text-align: center;
    vertical-align: middle;
}

/* El Número */
.neon-table td:nth-child(2) {
    font-family: 'Tw Cen MT';
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 1px;
    padding: 10px;
}

/* Pre/Pos */
.neon-table td:nth-child(3) {
    text-align: center;
}

/* Equipo */
.neon-table td:nth-child(4) {
    text-align: center;
}

/* Bloqueado, Restringido, WF, W, P */
.neon-table td:nth-child(5),
.neon-table td:nth-child(6),
.neon-table td:nth-child(7),
.neon-table td:nth-child(8),
.neon-table td:nth-child(9) {
    text-align: center;
}

/* Desbloqueo */
.neon-table td:nth-child(10) {
    text-align: center;
}

.neon-table td:nth-child(10) .status-display {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    font-size: 0.95rem;
    font-weight: 700;
}

/* Acciones */
.neon-table td:nth-child(11) {
    text-align: center;
}

/* === STATUS BADGES === */
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    user-select: none;
    position: relative;
    overflow: hidden;
    line-height: 1;
    border: none;
    outline: none;
    background: transparent;
}

.badge-toggle {
    cursor: pointer !important;
}

.status:hover {
    transform: scale(1.08);
    filter: brightness(1.15);
}

/* Red Status - Blocked */
.status-red {
    background: linear-gradient(135deg, #ff0000 0%, #d50000 100%) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Neutral Status - Restricted/Default */
.status-cyan {
    background: linear-gradient(135deg, #3c096c 0%, #5a189a 100%) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Green Status - All Clear */
.status-green {
    background: linear-gradient(135deg, #00e676 0%, #00c853 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow:
        0 4px 10px rgba(0, 230, 118, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Orange Status - Warning/Process */
.status-orange {
    background: linear-gradient(135deg, #ff9100 0%, #ff6d00 100%) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 4px 15px rgba(255, 145, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* === ESTADO TOGGLE BUTTONS === */
.estado-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.estado-toggle-btn {
    display: block;
    width: 100%;
    min-width: 90px;
    padding: 6px 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: linear-gradient(135deg, #3c096c 0%, #5a189a 100%);
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.estado-toggle-btn:hover {
    background: linear-gradient(135deg, #5a189a 0%, #7b2cbf 100%);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.02);
}

.estado-toggle-btn.active-pre {
    background: linear-gradient(135deg, #ffd600 0%, #ffab00 100%);
    color: #000000;
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(255, 214, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    font-weight: 800;
}

.estado-toggle-btn.active-cal {
    background: linear-gradient(135deg, #ff9100 0%, #ff6d00 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(255, 145, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.estado-toggle-btn.active-cam {
    background: linear-gradient(135deg, #00c853 0%, #00e676 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* === ROW STATUS BACKGROUNDS === */
.row-status-red {
    background: linear-gradient(90deg,
            rgba(255, 0, 0, 0.7) 0%,
            rgba(150, 0, 0, 0.5) 100%) !important;
}

.row-status-red td,
.row-status-red ion-icon,
.row-status-red .icon-button {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.row-status-red .status {
    border: 2px solid #ffffff !important;
}

.row-status-cyan {
    /* Fondo transparente (Tome el fondo que estas) - Transparent to show Deep Purple */
    background: transparent !important;
}

/* === DRAG HANDLES & SORTABLE === */
.drag-handle-cell {
    width: 50px;
    text-align: center;
    padding: 0 !important;
}

.drag-handle {
    cursor: grab;
    color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: all 0.2s ease;
    height: 100%;
}

.drag-handle:hover {
    color: var(--neon-purple);
    transform: scale(1.2);
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.3;
    background: rgba(176, 38, 255, 0.4) !important;
}

.sortable-chosen {
    background: rgba(255, 255, 255, 0.1) !important;
}

.row-status-green {
    background: linear-gradient(90deg,
            rgba(0, 230, 118, 0.6) 0%,
            rgba(0, 150, 80, 0.4) 100%) !important;
}

.row-status-green td,
.row-status-green ion-icon,
.row-status-green .icon-button {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.row-status-green .status {
    border: 2px solid #ffffff !important;
}

/* === ORANGE ROW STATUS === */
.row-status-orange {
    background: linear-gradient(90deg,
            rgba(255, 145, 0, 0.6) 0%,
            rgba(200, 100, 0, 0.4) 100%) !important;
}

.row-status-orange td,
.row-status-orange ion-icon,
.row-status-orange .icon-button {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.row-status-orange .status {
    border: 2px solid #ffffff !important;
}

/* === ACTION BUTTONS === */
.action-buttons {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.icon-button {
    width: 45px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(18, 18, 31, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 5;
}

.icon-button.edit {
    color: #ffffff;
    /* Changed from dark #1a1a1a to white */
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.icon-button.edit:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    transform: translateY(-2px) scale(1.1);
}

.icon-button.delete {
    color: #ff4d4d;
    /* Brighter red for visibility */
    border-color: rgba(255, 77, 77, 0.3);
    background: rgba(255, 77, 77, 0.1);
}

.icon-button.delete:hover {
    background: rgba(255, 77, 77, 0.2);
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.4);
    border-color: #ff4d4d;
    transform: translateY(-2px) scale(1.1);
}

.icon-button ion-icon {
    font-size: 1.5rem;
    pointer-events: none;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 16, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, rgba(18, 18, 31, 0.95), rgba(10, 10, 20, 0.95));
    padding: 24px;
    border-radius: 20px;
    width: 95%;
    max-width: 600px;
    max-height: 95vh;
    overflow-y: auto;
    border: 1px solid rgba(176, 38, 255, 0.3);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(176, 38, 255, 0.2);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-title {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* === FORM GROUPS & GRID === */
.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 5px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(176, 38, 255, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
}

.form-group select option {
    background-color: #10002b;
    color: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--neon-purple);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(176, 38, 255, 0.4), 0 0 40px rgba(176, 38, 255, 0.2);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* === MODAL ACTIONS === */
.modal-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.btn-save,
.neon-button-outline {
    flex: 1;
    padding: 14px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: 'Outfit', sans-serif;
}

.btn-save {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    color: white;
    box-shadow: 0 4px 15px rgba(176, 38, 255, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(176, 38, 255, 0.5);
}

.neon-button-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

.neon-button-outline:hover {
    border-color: var(--neon-purple);
    color: #ffffff;
    background: rgba(176, 38, 255, 0.15);
    box-shadow: 0 0 20px rgba(176, 38, 255, 0.3);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-pink));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(176, 38, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-purple));
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .main-container {
        padding: 15px;
        gap: 20px;
    }

    .neon-table th,
    .neon-table td {
        padding: 16px 12px;
    }

    .status {
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .neon-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .modal-content {
        padding: 30px 25px;
    }

    .neon-table th,
    .neon-table td {
        padding: 14px 10px;
    }

    .status {
        padding: 8px 16px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    body {
        font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        background:
            radial-gradient(circle at 15% 15%, rgba(45, 3, 100, 0.12) 0%, transparent 40%),
            radial-gradient(circle at 85% 85%, rgba(26, 3, 53, 0.08) 0%, transparent 40%),
            linear-gradient(135deg, #1a0631 0%, #300552 100%);
        color: var(--text-primary);
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        overflow-x: hidden;
    }

    .main-container {
        padding: 10px;
        gap: 15px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .actions-bar {
        padding: 0 5px;
    }

    .table-scroll-container {
        padding: 10px;
    }

    .neon-table th,
    .neon-table td {
        padding: 12px 8px;
    }

    .icon-button {
        width: 36px;
        height: 36px;
    }

    .modal-content {
        padding: 25px 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-save,
    .neon-button-outline {
        width: 100%;
    }
}

/* === BLINKING DOT === */
@keyframes blink-dot {
    0% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px #00ff00;
    }

    50% {
        opacity: 0.3;
        transform: scale(1.2);
        box-shadow: 0 0 2px #00ff00;
    }

    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px #00ff00;
    }
}

.blinking-dot {
    width: 10px;
    height: 10px;
    background-color: #00ff00;
    border-radius: 50%;
    display: inline-block;
    animation: blink-dot 1.2s infinite;
    flex-shrink: 0;
}

/* === GROUPING STYLES (CONJUNTO) === */
/* Encapsula grupos del mismo equipo en una sola "burbuja" o cápsula */

.neon-table tbody tr {
    border: none !important;
}

.neon-table td {
    border-top: none !important;
    border-bottom: none !important;
    /* Remove default row borders */
}

.neon-table tbody tr.in-group {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. Bordes Laterales para TODO el grupo */
.neon-table tbody tr.in-group td:first-child {
    border-left: 4px solid #ff00de !important;
}

.neon-table tbody tr.in-group td:last-child {
    border-right: 4px solid #ff00de !important;
}

/* 2. Borde Superior (Solo la primera fila del grupo) */
.neon-table tbody tr.row-group-start td,
.neon-table tbody tr.row-group-single td {
    border-top: 4px solid #ff00de !important;
}

.neon-table tbody tr.row-group-start td:first-child,
.neon-table tbody tr.row-group-single td:first-child {
    border-top-left-radius: 25px !important;
}

.neon-table tbody tr.row-group-start td:last-child,
.neon-table tbody tr.row-group-single td:last-child {
    border-top-right-radius: 25px !important;
}

/* 3. Borde Inferior (Solo la última fila del grupo) */
.neon-table tbody tr.row-group-end td,
.neon-table tbody tr.row-group-single td {
    border-bottom: 4px solid #ff00de !important;
}

.neon-table tbody tr.row-group-end td:first-child,
.neon-table tbody tr.row-group-single td:first-child {
    border-bottom-left-radius: 25px !important;
}

.neon-table tbody tr.row-group-end td:last-child,
.neon-table tbody tr.row-group-single td:last-child {
    border-bottom-right-radius: 25px !important;
}

/* 4. Separación entre cápsulas */
.neon-table tbody tr.row-group-end {
    border-bottom: 12px solid transparent !important;
}

.neon-table tbody tr.row-group-single {
    border-bottom: 12px solid transparent !important;
}

/* Efecto hover sobre el conjunto */
.neon-table tbody tr.in-group:hover {
    background: rgba(255, 0, 222, 0.05) !important;
    z-index: 10;
}