:root {
    --bg-dark: #090909;
    --bg-panel: #121212;
    --bg-panel-lighter: #1e1e1e;
    --neon-green: #00E61E;
    --neon-glow: rgba(0, 230, 30, 0.4);
    --text-main: #ffffff;
    --text-muted: #888888;
    --danger: #ff2a2a;
    --border: #2a2a2a;
    --gradient-bg: linear-gradient(145deg, #0f0f0f, #161616);
    --sidebar-width: 300px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
    background-image: radial-gradient(circle at 10% 20%, rgba(0, 230, 30, 0.03) 0%, transparent 20%);
}

.hidden-layout {
    display: none !important;
}

.mobile-only {
    display: none !important;
}

/* MODAL DE EDICIÓN AVANZADA (NUEVO) */
.edit-box {
    max-width: 800px;
    width: 95%;
}

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: left;
}

.edit-inputs .form-group {
    margin-bottom: 15px;
}

.edit-inputs .form-group.row {
    display: flex;
    gap: 10px;
}

.edit-inputs .form-group.row>div {
    flex: 1;
}

.edit-inputs label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.edit-inputs textarea {
    resize: vertical;
    min-height: 80px;
}

/* Mini zona de imagen (Columna derecha) */
.edit-media {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-left: 1px solid #333;
    padding-left: 20px;
}

.img-preview-wrapper {
    text-align: center;
}

.img-preview-wrapper img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #444;
    margin-bottom: 10px;
}

.btn-delete-img-small {
    background: #333;
    color: var(--danger);
    border: 1px solid var(--danger);
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-delete-img-small:hover {
    background: var(--danger);
    color: white;
}

/* Mini Dropzone */
.mini-dropzone {
    flex: 1;
    border: 2px dashed #444;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #666;
    transition: 0.2s;
    min-height: 200px;
}

.mini-dropzone.dragover {
    border-color: var(--neon-green);
    background: rgba(0, 230, 30, 0.05);
}

.mini-dropzone i {
    font-size: 2rem;
    margin-bottom: 5px;
}

.btn-mini-browse {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 5px;
}

.btn-mini-browse:hover {
    background: #444;
}

/* ESTILOS PREVIOS (UPLOAD MODAL) */
.upload-box {
    max-width: 500px;
    width: 95%;
}

.drop-zone {
    border: 2px dashed #444;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 30px;
    text-align: center;
    transition: 0.3s;
    margin: 20px 0;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.drop-zone.dragover {
    border-color: var(--neon-green);
    background: rgba(0, 230, 30, 0.05);
    box-shadow: 0 0 15px rgba(0, 230, 30, 0.1) inset;
}

.drop-content p {
    font-size: 0.9rem;
    color: #888;
    margin: 10px 0;
}

.btn-browse {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
    margin-top: 10px;
}

.btn-browse:hover {
    background: #444;
    border-color: #666;
}

#uploadPreviewContainer {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#uploadPreview {
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    border: 1px solid #444;
}

.btn-clear-file {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--danger);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

.btn-confirm:disabled {
    background: #333;
    color: #666;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ... (RESTO DE ESTILOS EXISTENTES SE MANTIENEN IGUAL) ... */
.header-actions {
    display: flex;
    gap: 10px;
}

.btn-export {
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
    font-size: 1.1rem;
}

.btn-export:hover {
    transform: translateY(-2px);
}

.btn-export.pdf {
    background: #E74C3C;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
}

.btn-export.excel {
    background: #27AE60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.4);
}

.chart-container {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 20px;
}

canvas {
    max-height: 100%;
    max-width: 100%;
}

.progress-wrapper {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #ccc;
    font-weight: 600;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #333;
}

.progress-bar-fill {
    height: 100%;
    background: var(--neon-green);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--neon-glow);
}

.dashboard-btn {
    background: linear-gradient(90deg, rgba(0, 230, 30, 0.1), transparent);
    color: var(--neon-green);
    padding: 12px 15px;
    margin-bottom: 25px;
    border-radius: 8px;
    cursor: pointer;
    border-left: 3px solid var(--neon-green);
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-btn:hover {
    background: rgba(0, 230, 30, 0.2);
    box-shadow: 0 0 15px rgba(0, 230, 30, 0.1);
}

.project-badge {
    display: inline-block;
    background: #333;
    color: #ccc;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #444;
}

.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 9, 9, 0.85);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

.loader-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-bottom-color: var(--neon-green);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
}

.btn-close-img {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.btn-delete-img {
    position: absolute;
    top: -40px;
    left: 0;
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s;
    opacity: 0.8;
}

.btn-delete-img:hover {
    opacity: 1;
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 42, 42, 0.6);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-box {
    background: var(--bg-panel);
    border: 1px solid var(--neon-green);
    box-shadow: 0 0 30px rgba(0, 230, 30, 0.2);
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    text-align: center;
    transform: translateY(0);
    transition: transform 0.3s;
}

.modal-overlay.hidden .modal-box {
    transform: translateY(20px);
}

.modal-box h3 {
    color: var(--neon-green);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.modal-box p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    flex: 1;
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-cancel:hover {
    background: #333;
}

.btn-confirm {
    flex: 1;
    background: var(--neon-green);
    border: none;
    color: #000;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-glow);
    transition: 0.2s;
}

.btn-confirm:hover {
    transform: scale(1.05);
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(18, 18, 18, 0.98);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 25px;
    z-index: 20;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-shadow: 0 0 10px var(--neon-glow);
}

.brand i {
    color: var(--neon-green);
}

.btn-close-sidebar {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn-icon-small {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--neon-green);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 15px var(--neon-glow);
}

#projectsList {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.project-item {
    padding: 15px;
    margin-bottom: 12px;
    background: var(--bg-panel-lighter);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.project-item.active {
    background: linear-gradient(135deg, #1f1f1f, #252525);
    border: 1px solid var(--neon-green);
    box-shadow: 0 4px 15px rgba(0, 230, 30, 0.15);
}

.delete-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
}

.delete-btn:hover {
    color: var(--danger);
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: var(--gradient-bg);
    position: relative;
}

header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.btn-menu {
    display: none;
    background: none;
    border: none;
    color: var(--neon-green);
    font-size: 1.5rem;
    cursor: pointer;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 300;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

header h1 span {
    color: var(--neon-green);
    font-weight: 700;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 16px;
    position: relative;
    backdrop-filter: blur(5px);
}

.card.neon-border {
    border-bottom: 2px solid var(--neon-green);
}

.card-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.2rem;
    opacity: 0.3;
}

.card h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card .amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.input-panel {
    background: #181818;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 0.8fr auto;
    gap: 12px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 2px;
}

.modern-input {
    background: #0a0a0a;
    border: 1px solid #333;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    width: 100%;
}

.modern-input:focus {
    border-color: var(--neon-green);
    background: #0f0f0f;
}

.btn-add {
    background: var(--neon-green);
    color: #000;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.items-wrapper {
    background: #181818;
    border-radius: 16px;
    border: 1px solid var(--border);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 200px;
}

.table-header {
    display: grid;
    grid-template-columns: 50px 3fr 60px 0.8fr 1fr 1fr 50px;
    padding: 15px;
    background: #1f1f1f;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.items-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.item-row {
    display: grid;
    grid-template-columns: 50px 3fr 60px 0.8fr 1fr 1fr 80px;
    padding: 15px 10px;
    margin-bottom: 5px;
    border-radius: 8px;
    align-items: center;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.01);
}

.item-row:hover {
    background: rgba(0, 119, 6, 0.137);

}

.item-row.checked {
    opacity: 0.4;
    background: #0f0f0f;
}

.item-row.checked .item-title {
    text-decoration: line-through;
}

.item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.item-desc {
    font-size: 0.75rem;
    color: #666;
    margin-top: 3px;
    font-style: italic;
}

.price-display {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.9rem;
}

.mobile-details {
    display: none;
}

.desktop-only-col {
    display: block;
}

.check-container {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    height: 100%;
}

.neon-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #444;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.item-row.checked .neon-checkbox {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-glow);
}

.neon-checkbox i {
    opacity: 0;
    font-size: 14px;
    color: #000;
    transform: scale(0.5);
    transition: 0.2s;
}

.item-row.checked .neon-checkbox i {
    opacity: 1;
    transform: scale(1);
}

.empty-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #444;
    gap: 15px;
    padding: 40px;
    text-align: center;
}

.empty-placeholder i {
    font-size: 2.5rem;
    color: #333;
}

.action-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    margin: 0 2px;
}

.action-btn:hover {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.btn-view-img {
    color: var(--neon-green);
    border-color: rgba(0, 230, 30, 0.3);
}

.btn-upload-img {
    color: #aaa;
}

@media (max-width: 768px) {
    body {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .btn-close-sidebar {
        display: block;
    }

    .brand {
        justify-content: space-between;
        width: 100%;
    }

    .main-content {
        padding: 15px;
        gap: 20px;
        width: 100%;
    }

    .btn-menu {
        display: block;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .card {
        padding: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .card h3 {
        margin: 0;
    }

    .card .amount {
        font-size: 1.4rem;
    }

    .card-icon {
        position: static;
        font-size: 1.2rem;
    }

    .input-panel {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .form-group:nth-child(1),
    .form-group:nth-child(2) {
        grid-column: span 2;
    }

    .btn-add {
        grid-column: span 2;
        width: 100%;
        margin-top: 5px;
    }

    .table-header {
        display: none;
    }

    .item-row {
        display: grid;
        grid-template-columns: 40px 1fr auto;
        grid-template-rows: auto auto;
        gap: 5px 10px;
        padding: 15px;
        background: #181818;
        border: 1px solid #2a2a2a;
    }

    .check-container {
        grid-row: 1 / span 2;
        grid-column: 1;
        justify-content: flex-start;
    }

    .item-info {
        grid-column: 2;
        grid-row: 1;
    }

    .actions-col {
        grid-column: 3;
        grid-row: 1;
        text-align: right;
    }

    .img-col-mobile {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 5px;
    }

    .desktop-only-col {
        display: none;
    }

    .mobile-only {
        display: contents !important;
    }

    .mobile-details {
        grid-column: 2 / span 2;
        grid-row: 2;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #333;
        font-size: 0.85rem;
        color: #888;
    }

    /* MODAL RESPONSIVE */
    .edit-grid {
        grid-template-columns: 1fr;
    }

    .edit-media {
        border-left: none;
        border-top: 1px solid #333;
        padding-left: 0;
        padding-top: 20px;
    }
}