@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap");

/* --- Variables de Diseño --- */
:root {
    --bg-dark: #000000;
    --primary-color: #0f0;
    --secondary-color: #000000;
    --accent-color: #FF4136;
    --text-light: #0f0;
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
    --hover-bg: rgba(0, 255, 0, 0.1);
    --glow-effect: 0 0 15px rgba(0, 255, 0, 0.2);
    --card-bg-dark: #1a1a1a;
    --border-radius-sm: 4px;
    --border-radius-md: 12px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 40px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-xl: 28px;
    --font-size-xxl: 36px;
    --transition-normal: 0.3s ease-in-out;
    --hover-transform: translateY(-2px);
}

/* --- Base y Layout General --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

section {
    position: relative;
    min-height: 100vh;
}

/* Contenedor principal de la interfaz */
#billing-screen { 
    max-width: 1400px; 
    margin: 20px auto; 
    padding-left: 80px; 
    position: relative; 
    z-index: 10;
}

.module-content {
    flex: 1; 
    padding: var(--spacing-xl);
    position: relative;
}

/* --- Títulos y Contenedores Comunes --- */
/* --- Estilos para Edición de Facturas Profesional --- */

.module-title {
    font-size: var(--font-size-xxl);
    color: var(--primary-color);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-weight: 800;
    background: var(--white);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.card-like-container { 
    background: rgba(34, 34, 34, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 0, 0.3);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-xl);
}

/* --- Sidebar (Navegación) --- */
.sidebar {
    width: 80px;
    background-color: var(--card-bg-dark);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid rgba(0, 255, 0, 0.1);
    z-index: 1000;
}

.sidebar-btn {
    background: none; 
    border: none;
    color: var(--primary-color);
    font-size: 24px; 
    padding: 15px;
    cursor: pointer; 
    transition: all var(--transition-normal);
    width: 60px; 
    height: 60px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    position: relative; 
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.sidebar-btn.active {
    background-color: var(--hover-bg);
    color: #fff;
    box-shadow: inset 0 0 8px rgba(0, 255, 0, 0.2), 0 0 10px rgba(0, 255, 0, 0.1);
}

.sidebar-btn:hover {
    background-color: var(--hover-bg);
    transform: scale(1.05);
}

.logout-btn {
    margin-top: auto;
}

/* --- Componentes (Botones) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    font-size: var(--font-size-md);
    transition: all var(--transition-normal);
    font-weight: bold;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    box-shadow: var(--glow-effect);
    transform: var(--hover-transform);
}

/* --- Edición de Facturas Premium SaaS --- */

.controls-area-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    background: var(--bg-main);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.controls-area {
    display: flex;
    gap: 15px;
    flex: 1;
}

/* Tabla de Documentos para Edición */
.data-table-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 20px;
}

.premium-data-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-data-table th {
    background: var(--bg-main);
    padding: 15px 20px;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.premium-data-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
}

.premium-data-table tr:hover {
    background: var(--primary-light);
}

/* Acciones de Edición */
.edit-actions-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-action {
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn-edit-inline {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
}

.btn-edit-inline:hover {
    background: var(--primary);
    color: white;
}

.btn-cancel-inline {
    background: hsl(350, 89%, 93%);
    color: var(--danger);
    border-color: hsl(350, 89%, 90%);
}

.btn-cancel-inline:hover {
    background: var(--danger);
    color: white;
}

/* Iconos de apoyo */
.doc-icon {
    font-size: 1.1rem;
    margin-right: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.doc-icon:hover { color: var(--primary); }

/* --- Fondo Interactivo (Tiles) --- */
#tiles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    grid-template-rows: repeat(var(--rows), 1fr);
    gap: 2px;
    background-color: var(--bg-dark, #000000); 
}

.tile {
    background-color: var(--card-bg-dark, #1a1a1a); 
    transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

/* --- Media Queries --- */
@media (max-width: 1024px) {
    #billing-screen {
        padding-left: 0;
    }
}
@media (max-width: 768px) {
    .module-content {
        padding: var(--spacing-lg);
    }
    .controls-area {
        justify-content: center;
        width: 100%;
    }
    .controls-area input, .controls-area select, .controls-area button {
        min-width: 100%;
    }
    .data-table thead th {
        font-size: 10px;
        padding: 8px;
    }
    .data-table tbody td {
        font-size: 12px;
        padding: 8px;
    }
    .controls-area-container { flex-direction: column; }
    .data-table { display: block; overflow-x: auto; }
}
