:root {
    --bg-base:      #060608;
    --bg-surface:   rgba(255,255,255,0.04);
    --bg-elevated:  rgba(255,255,255,0.07);
    --border:       rgba(255,255,255,0.08);
    --accent:       #ea580c;
    --accent-hover: #f97316;
    --text-primary: #f1f5f9;
    --text-muted:   #64748b;
    --success:      #22c55e;
    --warning:      #f59e0b;
    --danger:       #ef4444;
    --info:         #3b82f6;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    box-sizing: border-box;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.glass {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.input-field {
    padding: 0.625rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.5rem;
    color: #f1f5f9;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    width: 100%;
    min-width: 0;
}

.input-field::placeholder {
    color: #475569;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(234,88,12,0.15);
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

select.input-field option {
    background: #0a0a0f;
    color: #f1f5f9;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    left: auto;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    z-index: 100;
    animation: slideUp 0.3s ease;
    max-width: 400px;
}

.toast-success {
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.3);
    color: #22c55e;
}

.toast-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
}

@keyframes slideUp {
    from { transform: translateY(1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Truncar textos largos en tablas */
td .truncate-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .toast {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    /* Tablas legibles en mobile */
    table {
        font-size: 0.75rem;
    }
    table th {
        font-size: 0.6875rem;
        white-space: nowrap;
    }
    table td {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    /* Scroll hint en tablas */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Inputs no forzar ancho minimo */
    [class*="min-w-"] {
        min-width: 0 !important;
    }
}

/* PWA safe area */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .toast {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}
