/* ========================================
   ADMIN PANEL SUAUTOLOTE - RESPONSIVE DESIGN
   Colores: Negro, Rojo #E31E24, Amarillo #F7EC13, Blanco
   ======================================== */

:root {
    --suautolote-yellow: #F7EC13;
    --suautolote-red: #E31E24;
    --suautolote-black: #000000;
    --suautolote-white: #FFFFFF;
    --color-header: #F7EC13;
    --color-sidebar-header: #F7EC13;
    --color-texto-header: #000000;
    --color-btn-primary: #0D6EFD;
    --gray-light: #F5F5F5;
    --gray-medium: #6C757D;
    --gray-dark: #333333;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-light);
    color: var(--suautolote-black);
    overflow-x: hidden;
}

/* ========================================
   TOP HEADER
   ======================================== */
.top-header {
    background: var(--suautolote-white);
    padding: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-bottom: 4px solid var(--suautolote-yellow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 100%;
}

.logo-admin {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--suautolote-black);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-admin img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-admin span:first-child {
    color: var(--suautolote-black);
}

.logo-admin span:last-child {
    color: var(--suautolote-red);
}

.logo-admin i {
    color: var(--suautolote-yellow);
    font-size: 1.8rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--suautolote-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--suautolote-black);
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--suautolote-black);
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--gray-medium);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: var(--suautolote-yellow);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--suautolote-black);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--suautolote-red);
    color: var(--suautolote-white);
}

/* ========================================
   LAYOUT
   ======================================== */
.main-container {
    display: flex;
    min-height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--suautolote-white);
    border-right: 3px solid var(--suautolote-yellow);
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar-header {
    background: var(--color-sidebar-header);
    color: var(--suautolote-black);
    padding: 1.2rem;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    border-bottom: 2px solid var(--suautolote-red);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: var(--suautolote-black);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-menu a:hover {
    background: rgba(247, 236, 19, 0.2);
    color: var(--suautolote-black);
    padding-left: 1.75rem;
}

.sidebar-menu a.active {
    background: var(--suautolote-yellow);
    color: var(--suautolote-black);
    font-weight: 700;
    border-left: 4px solid var(--suautolote-red);
}

.sidebar-menu i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* ========================================
   CONTENT AREA
   ======================================== */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
    width: calc(100% - var(--sidebar-width));
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--suautolote-black);
}

.page-title i {
    color: var(--suautolote-red);
    margin-right: 0.5rem;
}

.page-subtitle {
    color: var(--gray-medium);
    font-size: 0.95rem;
}

/* ========================================
   STATS CARDS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--suautolote-white);
    border-radius: 10px;
    padding: 1.75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-top: 4px solid var(--suautolote-yellow);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.stats-card.card-red {
    border-top-color: var(--suautolote-red);
}

.stats-card.card-yellow {
    border-top-color: var(--suautolote-yellow);
}

.stats-card.card-black {
    border-top-color: var(--suautolote-black);
}

.stats-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--suautolote-black);
    line-height: 1;
}

.stats-label {
    font-size: 0.9rem;
    color: var(--gray-medium);
    margin-top: 0.5rem;
    font-weight: 500;
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.icon-yellow {
    background: var(--suautolote-yellow);
    color: var(--suautolote-black);
}

.icon-red {
    background: var(--suautolote-red);
    color: var(--suautolote-white);
}

.icon-black {
    background: var(--suautolote-black);
    color: var(--suautolote-yellow);
}

/* ========================================
   CARDS
   ======================================== */
.card-suautolote {
    background: var(--suautolote-white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header-suautolote {
    background: var(--color-header);
    color: var(--color-texto-header);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--suautolote-red);
}

.card-header-suautolote i {
    margin-right: 0.5rem;
}

.card-body-suautolote {
    padding: 1.5rem;
}

/* ========================================
   TABLES
   ======================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-suautolote {
    width: 100%;
    border-collapse: collapse;
    background: var(--suautolote-white);
    font-size: 0.9rem;
}

.table-suautolote thead {
    background: var(--color-header);
    color: var(--color-texto-header);
}

.table-suautolote th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.table-suautolote td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.table-suautolote tbody tr:hover {
    background: var(--gray-light);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-suautolote {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-suautolote.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-yellow {
    background: var(--suautolote-yellow);
    color: var(--suautolote-black);
    box-shadow: 0 4px 10px rgba(247, 236, 19, 0.3);
}

.btn-yellow:hover {
    background: #e6da11;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(247, 236, 19, 0.4);
}

.btn-red {
    background: var(--suautolote-red);
    color: var(--suautolote-white);
    box-shadow: 0 4px 10px rgba(227, 30, 36, 0.3);
}

.btn-red:hover {
    background: #c71a1f;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(227, 30, 36, 0.4);
}

.btn-black {
    background: var(--suautolote-black);
    color: var(--suautolote-yellow);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-black:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Bootstrap btn-primary override */
.btn-primary {
    background-color: var(--color-btn-primary) !important;
    border-color: var(--color-btn-primary) !important;
}

.btn-primary:hover {
    background-color: var(--color-btn-primary) !important;
    border-color: var(--color-btn-primary) !important;
    filter: brightness(0.9);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--suautolote-white);
}

.btn-action.btn-view {
    background: var(--info);
}

.btn-action.btn-edit {
    background: var(--warning);
}

.btn-action.btn-delete {
    background: var(--danger);
}

.btn-action:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ========================================
   BADGES
   ======================================== */
.badge-suautolote {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-yellow {
    background: var(--suautolote-yellow);
    color: var(--suautolote-black);
}

.badge-pendiente {
    background: var(--warning);
    color: var(--suautolote-black);
}

.badge-aprobado {
    background: var(--success);
    color: var(--suautolote-white);
}

.badge-rechazado {
    background: var(--danger);
    color: var(--suautolote-white);
}

.badge-vencido {
    background: var(--gray-dark);
    color: var(--suautolote-white);
}

.badge-generado {
    background: var(--info);
    color: var(--suautolote-white);
}

.badge-firmado {
    background: var(--success);
    color: var(--suautolote-white);
}

.badge-borrador {
    background: var(--gray-medium);
    color: var(--suautolote-white);
}

/* ========================================
   ALERTS
   ======================================== */
.alert-suautolote {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-suautolote i {
    font-size: 1.5rem;
    margin-top: 0.1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablets (max-width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .content-area {
        padding: 1.5rem;
    }

    .sidebar-menu a {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .mobile-menu-toggle {
        display: block;
        order: -1;
    }

    .header-content {
        padding: 0 1rem;
    }

    .logo-admin {
        font-size: 1.2rem;
    }

    .logo-admin img {
        height: 32px;
    }

    .user-info {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .content-area {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .table-suautolote {
        font-size: 0.8rem;
    }

    .table-suautolote th,
    .table-suautolote td {
        padding: 0.75rem 0.5rem;
    }

    .btn-suautolote {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    .card-header-suautolote {
        padding: 1rem;
        font-size: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .card-body-suautolote {
        padding: 1rem;
    }

    .action-buttons {
        justify-content: flex-start;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
    }

    .logo-admin {
        font-size: 1rem;
    }

    .logo-admin i {
        font-size: 1.3rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .content-area {
        padding: 0.75rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .stats-number {
        font-size: 1.8rem;
    }

    .stats-label {
        font-size: 0.8rem;
    }

    .stats-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .table-suautolote {
        font-size: 0.75rem;
    }

    .btn-suautolote {
        width: 100%;
        justify-content: center;
    }

    .btn-action {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

/* Overlay for mobile menu */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .sidebar-overlay.active {
        display: block;
    }
}

/* Print Styles */
@media print {
    .top-header,
    .sidebar,
    .mobile-menu-toggle,
    .action-buttons {
        display: none !important;
    }

    .content-area {
        margin-left: 0;
        padding: 0;
    }
}
