@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #0F172A;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #06B6D4;
    --purple: #A855F7;
    --pink: #EC4899;
    --light: #F8FAFC;
    --dark: #1E293B;
    --border: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LOGIN - DISEÑO MODERNO
   ============================================ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px 25px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.login-logo-icon i {
    font-size: 32px;
    color: white;
}

.login-card h1 {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 6px;
}

.login-subtitle {
    text-align: center;
    color: #64748B;
    font-size: 13px;
    margin-bottom: 25px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: #64748B;
    font-size: 12px;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
    font-size: 13px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* ============================================
   FORMULARIOS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
}

.form-group label i {
    color: var(--primary);
    font-size: 13px;
}

.form-group label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: #94A3B8;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #64748B;
    line-height: 1.4;
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: #64748B;
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: var(--secondary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR - MOBILE FIRST
   ============================================ */
.sidebar {
    width: 280px;
    background: var(--secondary);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.sidebar-logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.sidebar-logo-icon i {
    font-size: 24px;
    color: white;
}

.sidebar-title h2 {
    font-size: 22px;
    font-weight: 800;
    color: white;
    margin-bottom: 2px;
}

.sidebar-title p {
    font-size: 11px;
    color: #94A3B8;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: 10px;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--info), var(--primary));
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: #94A3B8;
    font-size: 11px;
}

.sidebar-nav {
    padding: 20px 14px;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    padding: 0 10px;
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748B;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 4px;
    color: #94A3B8;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: white;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    color: white;
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 17px;
    flex-shrink: 0;
}

.nav-item span {
    font-size: 14px;
    font-weight: 500;
}

.nav-item.nav-logout {
    color: #FCA5A5;
    margin-top: 14px;
}

.nav-item.nav-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #FEE2E2;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: white;
    color: var(--secondary);
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 19px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    transform: scale(1.05);
}

.mobile-toggle:active {
    transform: scale(0.95);
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.overlay.active {
    display: block;
}

/* ============================================
   MAIN CONTENT - MOBILE FIRST
   ============================================ */
.main-content {
    flex: 1;
    margin-left: 0;
    padding: 85px 15px 25px;
    background: var(--light);
    min-height: 100vh;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #64748B;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #64748B;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb i.fa-chevron-right {
    font-size: 9px;
}

.breadcrumb span {
    color: var(--secondary);
    font-weight: 600;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.page-header h1 i {
    font-size: 22px;
    color: var(--primary);
}

.page-subtitle {
    color: #64748B;
    font-size: 13px;
    line-height: 1.4;
}

/* ============================================
   CARDS GRID
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 25px;
}

.metric-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, transparent, rgba(99, 102, 241, 0.05));
    border-radius: 0 0 0 100%;
}

.metric-card:active {
    transform: scale(0.98);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.metric-icon i {
    font-size: 22px;
}

.metric-badge {
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
    line-height: 1;
}

.metric-label {
    color: #64748B;
    font-size: 13px;
    font-weight: 500;
}

.metric-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: #64748B;
}

.metric-footer i {
    font-size: 9px;
}

/* ============================================
   MINI STATS
   ============================================ */
.stats-mini {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 25px;
}

.stat-mini-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.stat-mini-item:active {
    transform: scale(0.98);
}

.stat-mini-icon {
    width: 50px;
    height: 50px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-mini-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
}

.stat-mini-label {
    font-size: 12px;
    color: #64748B;
    font-weight: 500;
    margin-top: 2px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border);
    gap: 10px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary);
    font-size: 16px;
}

/* ============================================
   FILTROS
   ============================================ */
.filters-form {
    margin: 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.filter-item {
    width: 100%;
}

.filter-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--dark);
}

.filter-item label i {
    color: var(--primary);
    font-size: 12px;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-actions .btn,
.filter-actions .btn-clear {
    width: 100%;
}

.btn-clear {
    padding: 12px 18px;
    background: white;
    color: #64748B;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn-clear:active {
    transform: scale(0.98);
}

/* ============================================
   TABLAS
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.table thead {
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
}

.table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--dark);
    font-size: 13px;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.codigo-obra {
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
}

.valor-obra {
    color: #10B981;
    font-size: 13px;
    font-weight: 600;
}

.ganancia-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.margen-percent {
    font-size: 10px;
    font-weight: 600;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1E40AF;
}

.badge-success {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #065F46;
}

.badge-warning {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.badge-danger {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
}

/* ============================================
   BOTONES DE ACCIÓN
   ============================================ */
.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-action {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
    flex-shrink: 0;
}

.btn-view {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1E40AF;
}

.btn-view:active {
    transform: scale(0.9);
}

.btn-edit {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.btn-edit:active {
    transform: scale(0.9);
}

.btn-delete {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
}

.btn-delete:active {
    transform: scale(0.9);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state i {
    font-size: 56px;
    color: #E2E8F0;
    margin-bottom: 14px;
    display: block;
}

.empty-state p {
    color: #94A3B8;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ============================================
   FORMULARIOS DE OBRAS
   ============================================ */
.form-obra {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.form-section-full {
    grid-column: 1;
}

.form-section {
    background: #F8FAFC;
    border-radius: 10px;
    padding: 18px;
    border: 2px solid var(--border);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.form-section-header i {
    color: var(--primary);
    font-size: 16px;
}

.form-section-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.input-group {
    display: flex;
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: #10B981;
    font-size: 15px;
    pointer-events: none;
}

.input-group .form-control {
    padding-left: 34px;
}

.info-box {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    margin-top: 16px;
}

.info-box i {
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.info-box strong {
    display: block;
    color: var(--secondary);
    margin-bottom: 4px;
    font-size: 12px;
}

.info-box p {
    margin: 0;
    font-size: 11px;
    color: #475569;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    padding-top: 18px;
    border-top: 2px solid var(--border);
}

.form-actions .btn {
    width: 100%;
}

.link-primary {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.link-primary:hover {
    text-decoration: underline;
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-center {
    text-align: center;
}

.text-muted {
    color: #94A3B8;
}

/* ============================================
   RESPONSIVE - TABLETS Y DESKTOP
   ============================================ */

/* Tablets (768px+) */
@media (min-width: 768px) {
    .login-card {
        padding: 50px 40px;
    }

    .mobile-toggle {
        display: none;
    }

    .sidebar {
        transform: translateX(0);
    }

    .overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 280px;
        padding: 35px 30px;
    }

    .page-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 30px;
        gap: 20px;
    }

    .page-header h1 {
        font-size: 30px;
    }

    .page-header h1 i {
        font-size: 26px;
    }

    .page-subtitle {
        font-size: 14px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-bottom: 30px;
    }

    .metric-card {
        padding: 22px;
    }

    .metric-value {
        font-size: 34px;
    }

    .stats-mini {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .filters-grid {
        grid-template-columns: 1fr 1fr auto;
        gap: 16px;
        align-items: end;
    }

    .filter-actions {
        flex-direction: row;
    }

    .filter-actions .btn,
    .filter-actions .btn-clear {
        width: auto;
    }

    .section {
        padding: 24px;
    }

    .section-title {
        font-size: 19px;
    }

    .table th,
    .table td {
        padding: 14px 16px;
        font-size: 14px;
    }

    .form-obra {
        padding: 28px;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 26px;
    }

    .form-section-full {
        grid-column: 1 / -1;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .form-actions .btn {
        width: auto;
    }
}

/* Desktop Grande (1024px+) */
@media (min-width: 1024px) {
    .main-content {
        padding: 40px;
    }

    .page-header h1 {
        font-size: 32px;
    }

    .page-header h1 i {
        font-size: 28px;
    }

    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
        margin-bottom: 35px;
    }

    .metric-card {
        padding: 24px;
    }

    .metric-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

    .metric-value {
        font-size: 36px;
    }

    .stat-mini-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .section {
        padding: 28px;
    }

    .table thead tr:hover {
        background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    }

    .table tbody tr:hover {
        background: #F8FAFC;
    }

    .btn-action:hover {
        transform: scale(1.1);
    }

    .btn-clear:hover {
        background: #F8FAFC;
        border-color: #CBD5E1;
        color: var(--secondary);
    }

    .form-obra {
        padding: 32px;
    }

    .form-grid {
        gap: 30px;
    }
}

/* Desktop Extra Grande (1280px+) */
@media (min-width: 1280px) {
    .stats-mini {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   DETALLE DE OBRA
   ============================================ */

/* Alert Success */
.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

/* Obra Header */
.obra-header {
    background: white;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.obra-header-info {
    margin-bottom: 16px;
}

.obra-codigo {
    display: inline-block;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.obra-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.obra-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #64748B;
}

.obra-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.obra-meta i {
    color: var(--primary);
    width: 16px;
}

.obra-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Obra Metrics */
.obra-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.obra-metric {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    box-shadow: var(--shadow);
}

.obra-metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.obra-metric-info {
    flex: 1;
    min-width: 0;
}

.obra-metric-label {
    font-size: 11px;
    color: #64748B;
    margin-bottom: 4px;
}

.obra-metric-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
}

.obra-metric-percent {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Tabs */
.tabs-container {
    background: white;
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-header::-webkit-scrollbar {
    height: 3px;
}

.tabs-header::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.tab-btn {
    flex: 1;
    min-width: max-content;
    padding: 14px 16px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.tab-btn i {
    font-size: 15px;
}

.tab-btn span:not(.tab-badge) {
    display: none;
}

.tab-badge {
    background: #E2E8F0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.tab-btn.active .tab-badge {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.tab-actions {
    margin-bottom: 20px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.info-card {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 18px;
    border: 2px solid var(--border);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.info-card-header i {
    color: var(--primary);
    font-size: 18px;
}

.info-card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    color: #64748B;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    color: var(--dark);
    font-weight: 500;
}

.info-description {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

/* Trabajadores Grid */
.trabajadores-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.trabajador-card {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 16px;
    border: 2px solid var(--border);
}

.trabajador-header {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border);
}

.trabajador-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.trabajador-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 2px;
}

.trabajador-info p {
    font-size: 12px;
    color: #64748B;
}

.trabajador-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.trabajador-stat {
    text-align: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 10px;
    color: #64748B;
}

.trabajador-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.btn-small.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

/* Responsive Detalle Obra */
@media (min-width: 768px) {
    .obra-header {
        padding: 24px;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    .obra-header-info {
        margin-bottom: 0;
        flex: 1;
    }

    .obra-header h1 {
        font-size: 26px;
    }

    .obra-meta {
        flex-direction: row;
        gap: 20px;
    }

    .obra-header-actions {
        flex-shrink: 0;
    }

    .obra-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .tab-btn span:not(.tab-badge) {
        display: inline;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .info-item {
        flex-direction: row;
        justify-content: space-between;
    }

    .info-label {
        flex: 1;
    }

    .info-value {
        flex: 1;
        text-align: right;
    }

    .trabajadores-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tab-content {
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .obra-header h1 {
        font-size: 30px;
    }

    .obra-metrics {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .obra-metric {
        padding: 20px;
    }

    .obra-metric-value {
        font-size: 24px;
    }

    .trabajadores-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tab-content {
        padding: 28px;
    }
}
/* ============================================
   DASHBOARD MOBILE OPTIMIZATIONS
   ============================================ */

/* Valores más pequeños en mobile */
.metric-value-small {
    font-size: 22px !important;
}

.metric-footer-small {
    font-size: 10px;
}

.btn-text-desktop {
    display: none;
}

/* Obras Mobile Cards */
.obras-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.obras-desktop {
    display: none;
}

.obra-card-mobile {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 14px;
    border: 2px solid var(--border);
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.obra-card-mobile:active {
    transform: scale(0.98);
    border-color: var(--primary);
}

.obra-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.obra-codigo-small {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.obra-nombre-small {
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.3;
}

.obra-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.obra-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748B;
}

.obra-info-item i {
    color: var(--primary);
    width: 14px;
    font-size: 11px;
}

.obra-card-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.obra-valor,
.obra-ganancia {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.obra-valor-label {
    font-size: 10px;
    color: #64748B;
    font-weight: 600;
    text-transform: uppercase;
}

.obra-valor strong,
.obra-ganancia strong {
    font-size: 14px;
}

/* Responsive Desktop */
@media (min-width: 768px) {
    .metric-value-small {
        font-size: 28px !important;
    }

    .metric-footer-small {
        font-size: 11px;
    }

    .btn-text-desktop {
        display: inline;
    }

    .obras-mobile {
        display: none;
    }

    .obras-desktop {
        display: block;
    }
}

@media (min-width: 1024px) {
    .metric-value-small {
        font-size: 32px !important;
    }
}

/* ============================================
   INPUTS CON UNIDADES Y TOTALES
   ============================================ */

.input-with-unit {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-unit input {
    flex: 1;
}

.input-unit {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    min-width: 60px;
    text-align: center;
}

.total-preview {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary);
}

.total-preview-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.total-preview-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

@media (max-width: 768px) {
    .input-unit {
        min-width: 50px;
        padding: 12px;
        font-size: 12px;
    }

    .total-preview {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .total-preview-value {
        font-size: 24px;
    }
}

/* ============================================
   REGISTRAR HORAS - ESTILOS
   ============================================ */

.trabajador-info-box {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.trabajador-info-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--border);
}

.trabajador-avatar-big {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    flex-shrink: 0;
}

.trabajador-info-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 4px;
}

.trabajador-info-header p {
    font-size: 14px;
    color: #64748B;
}

.trabajador-valores {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.valor-item {
    background: #F8FAFC;
    border-radius: 10px;
    padding: 14px;
    border: 2px solid var(--border);
}

.valor-label {
    font-size: 11px;
    color: #64748B;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.valor-amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

/* Costo Preview */
.costo-preview {
    background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
    border-radius: 12px;
    padding: 18px;
    margin-top: 20px;
    border: 2px solid #BAE6FD;
}

.costo-preview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.costo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.costo-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.costo-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.costo-total {
    border-top: 2px solid #BAE6FD;
    padding-top: 16px;
    margin-top: 8px;
}

.costo-total .costo-label {
    font-size: 14px;
}

.costo-total .costo-value {
    font-size: 24px;
    color: #10B981;
}

/* Historial Grid */
.historial-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.historial-card {
    background: #F8FAFC;
    border-radius: 10px;
    padding: 14px;
    border: 2px solid var(--border);
}

.historial-fecha {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 10px;
}

.historial-fecha i {
    color: var(--primary);
}

.historial-horas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.hora-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.hora-normal {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1E40AF;
}

.hora-extra {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.historial-obs {
    font-size: 12px;
    color: #64748B;
    margin-bottom: 10px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    display: flex;
    gap: 6px;
}

.historial-obs i {
    color: var(--primary);
    flex-shrink: 0;
}

.historial-costo {
    text-align: right;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.historial-costo strong {
    font-size: 16px;
    color: #10B981;
}

/* Responsive */
@media (min-width: 768px) {
    .trabajador-valores {
        grid-template-columns: repeat(3, 1fr);
    }

    .costo-preview-grid {
        grid-template-columns: 1fr 1fr 1.5fr;
    }

    .historial-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .historial-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   DANGER ZONE - ZONA DE PELIGRO
   ============================================ */

.danger-zone {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 30px;
    border: 2px solid #FEE2E2;
}

.danger-zone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #FEE2E2;
}

.danger-zone-header i {
    color: var(--danger);
    font-size: 20px;
}

.danger-zone-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
    margin: 0;
}

.danger-zone-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.danger-info strong {
    display: block;
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 6px;
}

.danger-info p {
    font-size: 13px;
    color: #64748B;
    line-height: 1.5;
    margin: 0;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .danger-zone-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .danger-info {
        flex: 1;
    }

    .btn-danger {
        width: auto;
        flex-shrink: 0;
    }
}

/* ============================================
   LISTADO OBRAS MOBILE - CARDS
   ============================================ */

.obras-list-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.obras-list-desktop {
    display: none;
}

.obra-card-list {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.obra-card-list:active {
    transform: scale(0.98);
}

.obra-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.obra-card-badge-code {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.obra-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.obra-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border);
}

.obra-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748B;
}

.obra-meta-item i {
    color: var(--primary);
    width: 14px;
    font-size: 11px;
    flex-shrink: 0;
}

.obra-meta-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.obra-card-valores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.obra-valor-box {
    background: #F8FAFC;
    border-radius: 10px;
    padding: 12px;
    border: 2px solid var(--border);
}

.obra-valor-label {
    font-size: 10px;
    color: #64748B;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.obra-valor-amount {
    font-size: 16px;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.obra-margen {
    font-size: 11px;
    font-weight: 600;
}

.obra-card-actions {
    display: flex;
    gap: 10px;
}

.btn-obra-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-obra-view {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-obra-view:active {
    transform: scale(0.95);
}

.btn-obra-edit {
    background: #F8FAFC;
    color: var(--dark);
    border: 2px solid var(--border);
    flex: 0;
    width: 48px;
    padding: 10px;
}

.btn-obra-edit:active {
    transform: scale(0.95);
    background: #F1F5F9;
}

.stat-mini-value-small {
    font-size: 18px !important;
}

/* Responsive Desktop */
@media (min-width: 768px) {
    .obras-list-mobile {
        display: none;
    }

    .obras-list-desktop {
        display: block;
    }

    .stat-mini-value-small {
        font-size: 22px !important;
    }
}

/* ============================================
   LISTADO TRABAJADORES MOBILE
   ============================================ */

.trabajadores-list-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.trabajadores-list-desktop {
    display: none;
}

.trabajador-card-list {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.trabajador-card-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border);
}

.trabajador-avatar-list {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.trabajador-card-info {
    flex: 1;
    min-width: 0;
}

.trabajador-card-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trabajador-card-info p {
    font-size: 12px;
    color: #64748B;
}

.trabajador-card-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748B;
}

.detail-item i {
    color: var(--primary);
    width: 14px;
    font-size: 11px;
    flex-shrink: 0;
}

.trabajador-card-salary {
    background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
    border: 2px solid #BAE6FD;
}

.salary-label {
    font-size: 10px;
    color: #64748B;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.salary-amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.trabajador-card-actions {
    display: flex;
    gap: 10px;
}

.btn-trabajador-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-trabajador-view {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-trabajador-view:active {
    transform: scale(0.95);
}

.btn-trabajador-edit {
    background: #F8FAFC;
    color: var(--dark);
    border: 2px solid var(--border);
    flex: 0;
    width: 48px;
    padding: 10px;
}

.btn-trabajador-edit:active {
    transform: scale(0.95);
    background: #F1F5F9;
}

/* Responsive Desktop */
@media (min-width: 768px) {
    .trabajadores-list-mobile {
        display: none;
    }

    .trabajadores-list-desktop {
        display: block;
    }
}

/* ============================================
   SALARY PREVIEW CARD
   ============================================ */

.salary-preview-card {
    background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
    border-radius: 12px;
    padding: 16px;
    border: 2px solid #BAE6FD;
}

.salary-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #BAE6FD;
}

.salary-preview-item:last-child {
    border-bottom: none;
}

.salary-preview-label {
    font-size: 12px;
    color: #64748B;
    font-weight: 600;
}

.salary-preview-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

@media (min-width: 768px) {
    .salary-preview-value {
        font-size: 20px;
    }
}

/* ============================================
   DETALLE TRABAJADOR
   ============================================ */

.trabajador-header-detail {
    background: white;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.trabajador-header-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    flex-shrink: 0;
}

.trabajador-header-info {
    flex: 1;
    min-width: 0;
}

.trabajador-header-info h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.trabajador-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748B;
}

.meta-item i {
    color: var(--primary);
}

.trabajador-header-actions {
    flex-shrink: 0;
}

/* Salary Calculations */
.salary-calculations {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.calc-card {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 16px;
    border: 2px solid var(--border);
    display: flex;
    gap: 14px;
    align-items: center;
}

.calc-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.calc-info {
    flex: 1;
}

.calc-label {
    font-size: 12px;
    color: #64748B;
    font-weight: 600;
    margin-bottom: 4px;
}

.calc-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 2px;
}

.calc-formula {
    font-size: 11px;
    color: #94A3B8;
}

/* Responsive */
@media (min-width: 768px) {
    .trabajador-header-detail {
        padding: 24px;
    }

    .trabajador-header-avatar {
        width: 100px;
        height: 100px;
        font-size: 44px;
    }

    .trabajador-header-info h1 {
        font-size: 26px;
    }

    .meta-item {
        font-size: 13px;
    }

    .salary-calculations {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .trabajador-header-info h1 {
        font-size: 30px;
    }

    .salary-calculations {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   MÓDULO DE INVENTARIO - ESTILOS ESPECÍFICOS
   ============================================ */

/* MATERIALES LIST - MOBILE */
.materiales-list-mobile {
    display: grid;
    gap: 16px;
}

@media (min-width: 769px) {
    .materiales-list-mobile {
        display: none;
    }
}

.material-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    transition: all 0.3s ease;
}

.material-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.material-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.material-codigo {
    font-size: 12px;
    color: #6B7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.material-nombre {
    font-size: 16px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.material-categoria {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6366F1;
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.material-categoria i {
    font-size: 10px;
}

/* STOCK BAR */
.material-stock-bar {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.stock-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stock-label {
    font-size: 12px;
    color: #6B7280;
    font-weight: 600;
}

.stock-value {
    font-size: 14px;
    font-weight: 700;
}

.stock-progress {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stock-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stock-bar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock-min {
    font-size: 11px;
    color: #9CA3AF;
}

.stock-alert {
    font-size: 11px;
    color: #EF4444;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* MATERIAL VALUES */
.material-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.material-value-item {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 10px;
}

.value-label {
    font-size: 11px;
    color: #6B7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.value-amount {
    font-size: 14px;
    font-weight: 700;
    color: #1F2937;
}

.material-ubicacion {
    font-size: 12px;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    padding: 8px;
    background: #F9FAFB;
    border-radius: 6px;
}

.material-ubicacion i {
    color: #F59E0B;
}

/* MATERIAL ACTIONS */
.material-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
}

.btn-material-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid;
}

.btn-material-view {
    background: white;
    color: #6366F1;
    border-color: #6366F1;
}

.btn-material-view:hover {
    background: #6366F1;
    color: white;
}

.btn-material-move {
    background: white;
    color: #10B981;
    border-color: #10B981;
    padding: 10px;
}

.btn-material-move:hover {
    background: #10B981;
    color: white;
}

.btn-material-edit {
    background: white;
    color: #F59E0B;
    border-color: #F59E0B;
    padding: 10px;
}

.btn-material-edit:hover {
    background: #F59E0B;
    color: white;
}

/* DESKTOP LIST */
.materiales-list-desktop {
    display: none;
}

@media (min-width: 769px) {
    .materiales-list-desktop {
        display: block;
    }
}

/* ACTION BUTTONS */
.btn-action.btn-move {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.btn-action.btn-move:hover {
    background: #10B981;
    color: white;
}

/* FILTERS EXTENDED */
.filters-grid-extended {
    display: grid;
    gap: 16px;
}

@media (min-width: 769px) {
    .filters-grid-extended {
        grid-template-columns: 2fr 1fr 1fr 1fr auto;
        align-items: end;
    }
}

/* RADIO GROUP */
.radio-group {
    display: grid;
    gap: 12px;
}

@media (min-width: 769px) {
    .radio-group {
        grid-template-columns: repeat(3, 1fr);
    }
}

.radio-card {
    cursor: pointer;
    display: block;
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.radio-card:hover .radio-card-content {
    border-color: currentColor;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.radio-card input[type="radio"]:checked+.radio-card-content {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.radio-card.selected .radio-card-content {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.radio-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.radio-card-info strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 4px;
}

.radio-card-info p {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
    line-height: 1.4;
}

/* INPUT GROUP SUFFIX */
.input-suffix {
    background: #F3F4F6;
    padding: 0 16px;
    border: 1px solid #D1D5DB;
    border-left: none;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    color: #6B7280;
    font-weight: 600;
    font-size: 14px;
}

/* STOCK STATUS COLORS */
.text-success {
    color: #10B981;
}

.text-danger {
    color: #EF4444;
}

.text-warning {
    color: #F59E0B;
}

/* STAT CARD ALERT */
.stat-card-alert {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* INFO BOX VARIATIONS */
.info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: 8px;
    margin-top: 16px;
}

.info-box i {
    color: #F59E0B;
    font-size: 20px;
    flex-shrink: 0;
}

.info-box strong {
    display: block;
    color: #92400E;
    margin-bottom: 4px;
}

.info-box p {
    color: #78350F;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.info-box small {
    color: #92400E;
    font-size: 12px;
}

/* DANGER ZONE */
.danger-zone {
    background: white;
    border-radius: 12px;
    border: 2px solid #FEE2E2;
    margin-top: 32px;
    overflow: hidden;
}

.danger-zone-header {
    background: #FEE2E2;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.danger-zone-header i {
    color: #DC2626;
    font-size: 20px;
}

.danger-zone-header h3 {
    margin: 0;
    color: #991B1B;
    font-size: 16px;
    font-weight: 700;
}

.danger-zone-content {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

@media (max-width: 768px) {
    .danger-zone-content {
        flex-direction: column;
        align-items: stretch;
    }
}

.danger-info strong {
    display: block;
    color: #991B1B;
    font-size: 15px;
    margin-bottom: 6px;
}

.danger-info p {
    color: #6B7280;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.btn-danger {
    background: #DC2626;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-danger:hover {
    background: #991B1B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger i {
    font-size: 16px;
}

/* DECIMAL INPUT STYLING */
.decimal-input {
    font-variant-numeric: tabular-nums;
}

/* LINK PRIMARY */
.link-primary {
    color: #6366F1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.link-primary:hover {
    color: #4F46E5;
    text-decoration: underline;
}

/* TAB BADGE */
.tab-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}

.tab-btn.active .tab-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #6366F1;
}

/* SALARY PREVIEW CARD */
.salary-preview-card {
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: 8px;
    padding: 16px;
}

.salary-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #E0F2FE;
}

.salary-preview-item:last-child {
    border-bottom: none;
}

.salary-preview-label {
    font-size: 13px;
    color: #075985;
    font-weight: 500;
}

.salary-preview-value {
    font-size: 16px;
    font-weight: 700;
    color: #0369A1;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
    .material-card {
        padding: 14px;
    }

    .material-nombre {
        font-size: 15px;
    }

    .material-values {
        gap: 10px;
    }

    .value-amount {
        font-size: 13px;
    }

    .radio-card-content {
        padding: 12px;
        gap: 12px;
    }

    .radio-card-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .radio-card-info strong {
        font-size: 14px;
    }

    .radio-card-info p {
        font-size: 12px;
    }
}

/* STAT MINI VALUE SMALL */
.stat-mini-value-small {
    font-size: 14px;
}

@media (min-width: 769px) {
    .stat-mini-value-small {
        font-size: 16px;
    }
}

/* SCROLLBAR PARA TABLAS EN MOBILE */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* FILTER ACTIONS */
.filter-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .filter-actions {
        grid-column: 1 / -1;
    }
}

.btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    color: #6B7280;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
    color: #374151;
}

/* EMPTY STATE ENHANCEMENTS */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: #D1D5DB;
    margin-bottom: 16px;
}

.empty-state p {
    color: #6B7280;
    font-size: 15px;
    margin: 0;
}

/* PÁGINA SUCCESS REDIRECT */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: fadeInUp 0.3s ease;
}

/* ============================================
   FIN MÓDULO DE INVENTARIO
   ============================================ */


   /* ============================================
   MÓDULO DE COTIZACIONES - ESTILOS ESPECÍFICOS
   ============================================ */

   /* COTIZACIONES LIST - MOBILE */
   .cotizaciones-list-mobile {
       display: grid;
       gap: 16px;
   }

   @media (min-width: 769px) {
       .cotizaciones-list-mobile {
           display: none;
       }
   }

   .cotizacion-card {
       background: white;
       border-radius: 12px;
       padding: 16px;
       box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
       border: 1px solid #E5E7EB;
       transition: all 0.3s ease;
   }

   .cotizacion-card:hover {
       box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
       transform: translateY(-2px);
   }

   .cotizacion-card-header {
       display: flex;
       justify-content: space-between;
       align-items: flex-start;
       margin-bottom: 16px;
       gap: 12px;
   }

   .cotizacion-numero {
       font-size: 12px;
       color: #6B7280;
       font-weight: 600;
       text-transform: uppercase;
       letter-spacing: 0.5px;
       margin-bottom: 4px;
   }

   .cotizacion-titulo {
       font-size: 16px;
       font-weight: 700;
       color: #1F2937;
       margin: 0 0 8px 0;
       line-height: 1.3;
   }

   .cotizacion-cliente {
       display: flex;
       align-items: center;
       gap: 6px;
       font-size: 13px;
       color: #6B7280;
   }

   .cotizacion-cliente i {
       font-size: 11px;
   }

   .cotizacion-dates {
       display: grid;
       grid-template-columns: 1fr 1fr;
       gap: 12px;
       margin-bottom: 16px;
       padding: 12px;
       background: #F9FAFB;
       border-radius: 8px;
   }

   .cotizacion-date-item {
       display: flex;
       align-items: center;
       gap: 6px;
       font-size: 12px;
       color: #6B7280;
   }

   .cotizacion-date-item i {
       color: #6366F1;
       font-size: 11px;
   }

   .cotizacion-total {
       display: flex;
       justify-content: space-between;
       align-items: center;
       padding: 12px;
       background: linear-gradient(135deg, #6366F1, #4F46E5);
       border-radius: 8px;
       margin-bottom: 16px;
   }

   .cotizacion-total-label {
       font-size: 13px;
       color: rgba(255, 255, 255, 0.9);
       font-weight: 500;
   }

   .cotizacion-total-value {
       font-size: 18px;
       font-weight: 700;
       color: white;
   }

   .cotizacion-actions {
       display: grid;
       grid-template-columns: 1fr auto auto;
       gap: 8px;
   }

   .btn-cotizacion-action {
       display: flex;
       align-items: center;
       justify-content: center;
       gap: 8px;
       padding: 10px 16px;
       border-radius: 8px;
       font-size: 13px;
       font-weight: 600;
       text-decoration: none;
       transition: all 0.2s ease;
       border: 1px solid;
   }

   .btn-cotizacion-view {
       background: white;
       color: #6366F1;
       border-color: #6366F1;
   }

   .btn-cotizacion-view:hover {
       background: #6366F1;
       color: white;
   }

   .btn-cotizacion-pdf {
       background: white;
       color: #DC2626;
       border-color: #DC2626;
       padding: 10px;
   }

   .btn-cotizacion-pdf:hover {
       background: #DC2626;
       color: white;
   }

   .btn-cotizacion-edit {
       background: white;
       color: #F59E0B;
       border-color: #F59E0B;
       padding: 10px;
   }

   .btn-cotizacion-edit:hover {
       background: #F59E0B;
       color: white;
   }

   /* DESKTOP LIST */
   .cotizaciones-list-desktop {
       display: none;
   }

   @media (min-width: 769px) {
       .cotizaciones-list-desktop {
           display: block;
       }
   }

   /* PDF BUTTON */
   .btn-action.btn-pdf {
       background: rgba(220, 38, 38, 0.1);
       color: #DC2626;
   }

   .btn-action.btn-pdf:hover {
       background: #DC2626;
       color: white;
   }

   /* ITEMS DINÁMICOS (CREAR/EDITAR) */
   .items-container {
       margin-top: 20px;
   }

   .item-row {
       background: white;
       border: 2px solid #E5E7EB;
       border-radius: 12px;
       padding: 20px;
       margin-bottom: 16px;
       position: relative;
       transition: all 0.3s ease;
   }

   .item-row:hover {
       border-color: #6366F1;
       box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
   }

   .item-row-header {
       display: flex;
       justify-content: space-between;
       align-items: center;
       margin-bottom: 16px;
       padding-bottom: 12px;
       border-bottom: 2px solid #F3F4F6;
   }

   .item-row-number {
       font-size: 16px;
       font-weight: 700;
       color: #6366F1;
       display: flex;
       align-items: center;
       gap: 8px;
   }

   .item-row-number::before {
       content: '';
       width: 8px;
       height: 8px;
       background: #6366F1;
       border-radius: 50%;
   }

   .btn-remove-item {
       background: #FEE2E2;
       color: #DC2626;
       border: none;
       padding: 8px 12px;
       border-radius: 6px;
       cursor: pointer;
       font-size: 14px;
       font-weight: 600;
       transition: all 0.2s ease;
       display: flex;
       align-items: center;
       gap: 6px;
   }

   .btn-remove-item:hover {
       background: #DC2626;
       color: white;
       transform: scale(1.05);
   }

   .btn-remove-item i {
       font-size: 13px;
   }

   /* TOTALES BOX */
   .totales-box {
       background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
       color: white;
       border-radius: 12px;
       padding: 24px;
       margin-top: 24px;
       box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
   }

   .totales-row {
       display: flex;
       justify-content: space-between;
       align-items: center;
       padding: 12px 0;
       border-bottom: 1px solid rgba(255, 255, 255, 0.2);
   }

   .totales-row:last-child {
       border-bottom: none;
       padding-top: 16px;
       margin-top: 8px;
       border-top: 2px solid rgba(255, 255, 255, 0.3);
   }

   .totales-label {
       font-size: 15px;
       font-weight: 500;
       opacity: 0.95;
   }

   .totales-value {
       font-size: 18px;
       font-weight: 700;
   }

   .totales-row:last-child .totales-label {
       font-size: 18px;
       font-weight: 700;
   }

   .totales-row:last-child .totales-value {
       font-size: 24px;
   }

   /* SELECT MATERIAL DINÁMICO */
   #selectMaterial-1,
   #selectMaterial-2,
   #selectMaterial-3,
   #selectMaterial-4,
   #selectMaterial-5 {
       display: block;
   }

   /* ITEM SUBTOTAL READONLY */
   .item-subtotal {
       background: #F9FAFB !important;
       font-weight: 700 !important;
       color: #1F2937 !important;
       cursor: not-allowed;
   }

   /* RESPONSIVE MOBILE ITEMS */
   @media (max-width: 768px) {
       .item-row {
           padding: 16px;
       }

       .item-row-header {
           flex-direction: column;
           align-items: flex-start;
           gap: 12px;
       }

       .btn-remove-item {
           width: 100%;
           justify-content: center;
       }

       .totales-box {
           padding: 20px;
       }

       .totales-label {
           font-size: 13px;
       }

       .totales-value {
           font-size: 16px;
       }

       .totales-row:last-child .totales-label {
           font-size: 16px;
       }

       .totales-row:last-child .totales-value {
           font-size: 20px;
       }
   }

   /* ESTADO BADGES EN TABLA */
   .badge {
       display: inline-flex;
       align-items: center;
       gap: 6px;
       padding: 6px 12px;
       border-radius: 6px;
       font-size: 12px;
       font-weight: 600;
       color: white;
   }

   .badge i {
       font-size: 11px;
   }

   /* FORM GRID RESPONSIVE */
   @media (max-width: 768px) {
       .form-grid {
           grid-template-columns: 1fr;
       }

       .form-section-full {
           grid-column: 1;
       }
   }

   /* ANIMATION SLIDE IN */
   @keyframes slideInUp {
       from {
           opacity: 0;
           transform: translateY(20px);
       }

       to {
           opacity: 1;
           transform: translateY(0);
       }
   }

   .item-row {
       animation: slideInUp 0.3s ease;
   }

   /* DECIMAL INPUT STYLE */
   .decimal-input {
       font-variant-numeric: tabular-nums;
   }

   /* LOADING STATE */
   .btn-primary:disabled,
   .btn-secondary:disabled {
       opacity: 0.6;
       cursor: not-allowed;
   }

   /* SUCCESS MESSAGE */
   .alert-success {
       background: #D1FAE5;
       border: 1px solid #10B981;
       color: #065F46;
       padding: 12px 16px;
       border-radius: 8px;
       margin-bottom: 20px;
       display: flex;
       align-items: center;
       gap: 10px;
       animation: slideInDown 0.3s ease;
   }

   @keyframes slideInDown {
       from {
           opacity: 0;
           transform: translateY(-20px);
       }

       to {
           opacity: 1;
           transform: translateY(0);
       }
   }

   .alert-success i {
       font-size: 18px;
   }

   /* ERROR MESSAGE */
   .alert-error {
       background: #FEE2E2;
       border: 1px solid #EF4444;
       color: #991B1B;
       padding: 12px 16px;
       border-radius: 8px;
       margin-bottom: 20px;
       display: flex;
       align-items: center;
       gap: 10px;
       animation: shake 0.5s ease;
   }

   @keyframes shake {

       0%,
       100% {
           transform: translateX(0);
       }

       25% {
           transform: translateX(-10px);
       }

       75% {
           transform: translateX(10px);
       }
   }

   .alert-error i {
       font-size: 18px;
   }

   /* ============================================
   FIN MÓDULO DE COTIZACIONES
   ============================================ */

   /* ============================================
   MÓDULO DE NÓMINA - ESTILOS ESPECÍFICOS
   ============================================ */

   /* NÓMINA LIST - MOBILE */
   .nominas-list-mobile {
       display: grid;
       gap: 16px;
   }

   @media (min-width: 769px) {
       .nominas-list-mobile {
           display: none;
       }
   }

   .nomina-card {
       background: white;
       border-radius: 12px;
       padding: 16px;
       box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
       border: 1px solid #E5E7EB;
       transition: all 0.3s ease;
   }

   .nomina-card:hover {
       box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
       transform: translateY(-2px);
   }

   .nomina-card-header {
       display: flex;
       justify-content: space-between;
       align-items: flex-start;
       margin-bottom: 16px;
       gap: 12px;
   }

   .nomina-obra {
       font-size: 12px;
       color: #6B7280;
       font-weight: 600;
       text-transform: uppercase;
       letter-spacing: 0.5px;
       margin-bottom: 4px;
   }

   .nomina-titulo {
       font-size: 16px;
       font-weight: 700;
       color: #1F2937;
       margin: 0 0 8px 0;
       line-height: 1.3;
   }

   .nomina-periodo {
       margin-top: 4px;
   }

   .nomina-dates {
       display: grid;
       grid-template-columns: 1fr;
       gap: 8px;
       margin-bottom: 16px;
       padding: 12px;
       background: #F9FAFB;
       border-radius: 8px;
   }

   .nomina-date-item {
       display: flex;
       align-items: center;
       gap: 6px;
       font-size: 12px;
       color: #6B7280;
   }

   .nomina-date-item i {
       color: #6366F1;
       font-size: 11px;
   }

   .nomina-total {
       display: flex;
       justify-content: space-between;
       align-items: center;
       padding: 12px;
       background: linear-gradient(135deg, #10B981, #34D399);
       border-radius: 8px;
       margin-bottom: 16px;
   }

   .nomina-total-label {
       font-size: 13px;
       color: rgba(255, 255, 255, 0.9);
       font-weight: 500;
   }

   .nomina-total-value {
       font-size: 18px;
       font-weight: 700;
       color: white;
   }

   .nomina-actions {
       display: grid;
       grid-template-columns: 1fr auto;
       gap: 8px;
   }

   .btn-nomina-action {
       display: flex;
       align-items: center;
       justify-content: center;
       gap: 8px;
       padding: 10px 16px;
       border-radius: 8px;
       font-size: 13px;
       font-weight: 600;
       text-decoration: none;
       transition: all 0.2s ease;
       border: 1px solid;
   }

   .btn-nomina-view {
       background: white;
       color: #6366F1;
       border-color: #6366F1;
   }

   .btn-nomina-view:hover {
       background: #6366F1;
       color: white;
   }

   .btn-nomina-edit {
       background: white;
       color: #F59E0B;
       border-color: #F59E0B;
       padding: 10px;
   }

   .btn-nomina-edit:hover {
       background: #F59E0B;
       color: white;
   }

   /* DESKTOP LIST */
   .nominas-list-desktop {
       display: none;
   }

   @media (min-width: 769px) {
       .nominas-list-desktop {
           display: block;
       }
   }

   /* OBRAS GRID (SELECCIÓN) */
   .obras-grid {
       display: grid;
       grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
       gap: 20px;
       margin-top: 20px;
   }

   .obra-select-card {
       background: white;
       border: 2px solid #E5E7EB;
       border-radius: 12px;
       padding: 20px;
       text-decoration: none;
       color: inherit;
       transition: all 0.3s ease;
   }

   .obra-select-card:hover {
       border-color: #6366F1;
       box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
       transform: translateY(-4px);
   }

   .obra-select-header {
       display: flex;
       justify-content: space-between;
       align-items: center;
       margin-bottom: 12px;
   }

   .obra-select-header h3 {
       margin: 0;
       color: #6366F1;
       font-size: 18px;
       font-weight: 700;
   }

   .obra-select-card p {
       margin: 0 0 12px 0;
       color: #1F2937;
       font-weight: 600;
       font-size: 15px;
   }

   .obra-select-footer {
       padding-top: 12px;
       border-top: 1px solid #E5E7EB;
   }

   /* TRABAJADORES TABLE */
   .trabajadores-table {
       margin-top: 20px;
   }

   .trabajador-row {
       background: white;
       border: 2px solid #E5E7EB;
       border-radius: 12px;
       padding: 20px;
       margin-bottom: 16px;
       transition: all 0.3s ease;
   }

   .trabajador-row:hover {
       border-color: #6366F1;
       box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
   }

   .trabajador-row.disabled {
       opacity: 0.5;
       background: #F9FAFB;
       border-color: #D1D5DB;
   }

   .trabajador-row.disabled:hover {
       border-color: #D1D5DB;
       box-shadow: none;
   }

   .trabajador-header {
       display: flex;
       justify-content: space-between;
       align-items: center;
       margin-bottom: 16px;
       padding-bottom: 12px;
       border-bottom: 2px solid #F3F4F6;
   }

   .trabajador-info h4 {
       margin: 0 0 4px 0;
       color: #1F2937;
       font-size: 16px;
       font-weight: 700;
   }

   .trabajador-info small {
       color: #6B7280;
       font-size: 13px;
   }

   .trabajador-inputs {
       grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   }

   /* SWITCH TOGGLE */
   .switch-incluir {
       position: relative;
       display: inline-block;
       width: 60px;
       height: 34px;
   }

   .switch-incluir input {
       opacity: 0;
       width: 0;
       height: 0;
   }

   .slider {
       position: absolute;
       cursor: pointer;
       top: 0;
       left: 0;
       right: 0;
       bottom: 0;
       background-color: #CBD5E1;
       transition: .4s;
       border-radius: 34px;
   }

   .slider:before {
       position: absolute;
       content: "";
       height: 26px;
       width: 26px;
       left: 4px;
       bottom: 4px;
       background-color: white;
       transition: .4s;
       border-radius: 50%;
       box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
   }

   input:checked+.slider {
       background-color: #10B981;
   }

   input:checked+.slider:before {
       transform: translateX(26px);
   }

   input:focus+.slider {
       box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
   }

   /* TOTALES NÓMINA */
   .totales-nomina {
       background: linear-gradient(135deg, #6366F1, #4F46E5);
       color: white;
       padding: 24px;
       border-radius: 12px;
       margin-top: 24px;
       box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
   }

   .totales-nomina h3 {
       margin: 0 0 16px 0;
       font-size: 18px;
       display: flex;
       align-items: center;
       gap: 8px;
   }

   .total-item {
       display: flex;
       justify-content: space-between;
       align-items: center;
       padding: 8px 0;
       border-bottom: 1px solid rgba(255, 255, 255, 0.2);
   }

   .total-item:last-child {
       border-bottom: none;
       font-size: 20px;
       font-weight: 700;
       padding-top: 12px;
       margin-top: 8px;
       border-top: 2px solid rgba(255, 255, 255, 0.3);
   }

   /* TOTALES TRABAJADOR */
   .totales-trabajador {
       background: #F9FAFB;
       padding: 16px;
       border-radius: 8px;
       text-align: right;
   }

   .totales-trabajador strong {
       font-size: 16px;
       color: #1F2937;
   }

   .neto-pagar {
       color: #10B981;
       font-size: 18px;
       font-weight: 700;
   }

   /* RESPONSIVE */
   @media (max-width: 768px) {
       .obras-grid {
           grid-template-columns: 1fr;
       }

       .trabajador-header {
           flex-direction: column;
           align-items: flex-start;
           gap: 12px;
       }

       .switch-incluir {
           align-self: flex-end;
       }

       .trabajador-inputs {
           grid-template-columns: 1fr;
       }
   }

   /* ANIMATION */
   @keyframes slideInUp {
       from {
           opacity: 0;
           transform: translateY(20px);
       }

       to {
           opacity: 1;
           transform: translateY(0);
       }
   }

   .trabajador-row {
       animation: slideInUp 0.3s ease;
   }

   .btn-nomina-pdf {
       background: linear-gradient(135deg, #DC2626, #EF4444);
       color: white;
   }

   .btn-nomina-receipt {
       background: linear-gradient(135deg, #8B5CF6, #A78BFA);
       color: white;
   }

   .btn-nomina-delete {
       background: linear-gradient(135deg, #EF4444, #F87171);
       color: white;
   }

   .btn-action-danger {
       color: #EF4444;
   }

   .btn-action-danger:hover {
       background: rgba(239, 68, 68, 0.1);
   }

   .info-section {
       background: #f8fafc;
       border: 1px solid #e2e8f0;
       border-radius: 8px;
       padding: 20px;
       margin-bottom: 24px;
   }

   .info-grid {
       display: grid;
       grid-template-columns: repeat(4, 1fr);
       gap: 20px;
   }

   .info-item {
       display: flex;
       flex-direction: column;
       gap: 6px;
   }

   .info-label {
       font-size: 11px;
       color: #64748b;
       font-weight: 600;
       text-transform: uppercase;
       letter-spacing: 0.5px;
   }

   .info-value {
       font-size: 15px;
       color: #1e293b;
       font-weight: 600;
   }

   .info-grid-periodo {
       display: grid;
       grid-template-columns: repeat(5, 1fr);
       gap: 20px;
   }

   .info-grid-pagado {
       display: grid;
       grid-template-columns: 1fr;
       gap: 6px;
       margin-top: 16px;
   }

   @media (max-width: 1200px) {
       .info-grid {
           grid-template-columns: repeat(2, 1fr);
       }

       .info-grid-periodo {
           grid-template-columns: repeat(2, 1fr);
       }
   }

   @media (max-width: 768px) {

       .info-grid,
       .info-grid-periodo {
           grid-template-columns: 1fr;
       }
   }
   /* ============================================
   FIN MÓDULO DE NÓMINA
   ============================================ */

/* Botones PDF */
.btn-action.btn-pdf {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
}

.btn-action.btn-pdf:hover {
    background: #DC2626;
    color: white;
}

/* Botones Receipt */
.btn-action.btn-receipt {
    background: linear-gradient(135deg, #E0E7FF, #C7D2FE);
    color: #4338CA;
}

.btn-action.btn-receipt:hover {
    background: #6366F1;
    color: white;
}

/* DETALLE PAGO - RESPONSIVE MOBILE */

/* Info cards responsive */
@media (max-width: 768px) {
    .info-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .info-header h3 {
        font-size: 16px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .info-item {
        background: #F9FAFB;
        padding: 12px;
        border-radius: 8px;
    }

    .info-label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .info-value {
        font-size: 14px;
    }

    /* Tabla de detalles responsive */
    .detalles-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .detalles-table thead {
        display: none;
    }

    .detalles-table tbody {
        display: block;
    }

    .detalles-table tr {
        display: flex;
        flex-direction: column;
        background: #F9FAFB;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 10px;
        border: 1px solid #E5E7EB;
    }

    .detalles-table td {
        display: block;
        padding: 6px 0;
        border: none;
        text-align: left !important;
    }

    .detalles-table td:first-child {
        font-weight: 600;
        color: #1F2937;
        padding-bottom: 8px;
        border-bottom: 1px solid #E5E7EB;
        margin-bottom: 8px;
    }

    .detalles-table td:last-child {
        font-size: 18px;
        font-weight: 700;
        color: #6366F1;
    }

    /* Totales box responsive */
    .totales-box {
        padding: 16px;
    }

    .total-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px 0;
    }

    .total-row.final {
        font-size: 18px;
        background: #EEF2FF;
        padding: 16px;
        border-radius: 10px;
        margin-top: 16px;
    }

    .total-row span:last-child {
        font-size: 20px;
        align-self: flex-end;
    }

    /* Action buttons responsive */
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    /* Badge tipo */
    .badge-tipo {
        padding: 4px 10px;
        font-size: 11px;
    }

    /* Page header mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .page-header h1 i {
        font-size: 18px;
    }

    .page-subtitle {
        font-size: 13px;
    }
}

/* Mejoras adicionales para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}