:root {
    --color-primary: #D32F2F;
    /* Rojo */
    --color-secondary: #000000;
    /* Negro */
    --color-background: #FFFFFF;
    /* Blanco */
    --color-text: #333333;
    --color-text-light: #F5F5F5;
    --color-border: #DDDDDD;
    --spacing-unit: 1rem;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

/* Tipografía */
h1,
h2,
h3 {
    color: var(--color-secondary);
    margin-bottom: var(--spacing-unit);
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-secondary);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;

}

.btn:hover {
    background-color: #B71C1C;
    /* Rojo más oscuro */
}

.btn-secondary {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    color: #000000;
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background-color: #5a6268;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-back:hover {
    background-color: #4a5156;
    color: white;
}

/* Utilidades */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Forms */
input,
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

/* Navbar */
.navbar {
    background-color: var(--color-secondary);
    color: white;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.navbar-inner {
    flex-wrap: nowrap;
    gap: 10px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.navbar-logo {
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.navbar-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.category-filter {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 20px 0;
    margin-bottom: 30px;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-padding-inline: 1rem;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.category-pill {
    text-decoration: none;
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 10px 24px;
    font-size: 0.95rem;
    color: #555;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-pill.active,
.category-pill:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}


.navbar-nav a {
    color: white;
    margin-left: 1.5rem;
}

.navbar-nav a.active {
    color: var(--color-primary);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Responsive Styles */
@media (max-width: 768px) {

    /* Navbar - App Style */
    .navbar {
        padding: 0.75rem 0;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .navbar .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
    }

    .navbar-brand {
        margin-bottom: 0;
        font-size: 1.1rem;
    }

    .navbar-brand img {
        height: 40px !important;
    }

    /* Show hamburger button on mobile */
    .mobile-menu-toggle {
        display: block;
        order: 3;
    }

    /* Hide menu by default on mobile */
    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-secondary);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        height: 100vh;
        max-height: none;
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Show menu when toggled */
    .navbar-nav.show {
        display: flex;
    }

    .navbar-nav a {
        margin: 0;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: left;
        border-left: 3px solid transparent;
        transition: all 0.3s ease;
        color: white;
        /* Ensure text is white */
    }

    .navbar-nav a:hover,
    .navbar-nav a.active {
        background-color: var(--color-primary);
        border-left-color: white;
        transform: translateX(5px);
        color: white !important;
        /* Force white text on active */
    }

    /* Container - More padding for mobile */
    .container {
        width: 100%;
        padding: 1rem;
    }

    /* Typography - Larger for readability */
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* Cards - Stack vertically */
    .card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    /* Grid - Single column on mobile */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Dashboard cards - Better mobile sizing */
    .grid .card h3 {
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem;
    }

    .grid .card p {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem;
    }

    .grid .card small {
        font-size: 0.8rem;
    }

    /* Forms - Larger inputs for touch */
    input,
    select,
    textarea {
        padding: 1rem;
        font-size: 16px;
        border-radius: 8px;
        margin-bottom: 1.25rem;
    }

    label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        font-size: 0.95rem;
    }

    /* Buttons - Larger touch targets */
    .btn,
    .btn-secondary,
    .btn-back {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        border-radius: 8px;
        width: 100%;
        margin-bottom: 0.75rem;
        min-height: 48px;
    }

    /* Tables - Card style on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.85rem;
        min-width: 600px;
    }

    table th {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    table td {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem;
    }

    /* Action buttons in tables */
    table .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        width: auto;
        min-height: auto;
        margin: 0.25rem;
    }

    /* Stack filter inputs on mobile */
    .filter-form {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filter-form input,
    .filter-form select,
    .filter-form button {
        width: 100%;
        margin: 0;
    }

    /* Total cards */
    .total-card {
        width: 100%;
        margin-left: 0;
        margin-top: 1rem;
        padding: 1.25rem;
        text-align: center;
    }

    /* Stat cards improvement */
    .stat-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    /* Better spacing for forms */
    form {
        padding: 0;
    }

    /* Improve readability of small text */
    small {
        font-size: 0.875rem;
        line-height: 1.4;
    }

    /* Links - Larger tap targets */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Search and filter sections */
    .search-box {
        margin-bottom: 1.5rem;
    }

    /* Alert messages */
    .alert,
    .message {
        padding: 1rem;
        font-size: 0.95rem;
        border-radius: 8px;
        margin-bottom: 1rem;
    }
}

/* Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .navbar-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .container {
        width: 90%;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-nav a {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    table {
        font-size: 0.75rem;
    }
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    white-space: nowrap;
}