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

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --accent-red: #e11d48;
    --accent-red-hover: #be123c;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --font-sans: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
}

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

body {
    font-family: var(--font-sans);
    background-color: #cbd5e1;
    background: linear-gradient(135deg, #cbd5e1 0%, #e2e8f0 100%);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* AUTH - LOGIN STYLE (GLASSMORPHISM OVERLAY) */
.auth-bg {
    background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.85)), url('https://images.unsplash.com/photo-1541888946425-d81bb19240f5?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-y: auto;
    padding: 6rem 1rem 3rem 1rem;
    box-sizing: border-box;
}

.auth-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

@media (max-width: 640px) {
    .auth-header-bg {
        padding: 1rem 1.5rem;
    }
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text-top {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.1;
}

.logo-text-sub {
    font-size: 0.75rem;
    color: #ffffff;
    font-weight: 400;
    letter-spacing: 2px;
}

.auth-nav {
    display: flex;
    gap: 2rem;
}

.auth-nav-link {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: var(--transition);
}

.auth-nav-link:hover, .auth-nav-link.active {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.login-modal {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 5;
    animation: modalAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 500px) {
    .login-modal {
        padding: 1.5rem !important;
        border-radius: 16px !important;
        max-width: calc(100% - 1.5rem) !important;
    }
    .login-title-container {
        margin: -1.5rem -1.5rem 1.5rem -1.5rem !important;
        padding: 1.5rem !important;
        border-top-left-radius: 16px !important;
        border-top-right-radius: 16px !important;
    }
    .demo-buttons-container {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .demo-buttons-container button {
        width: 100% !important;
        flex: none !important;
    }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-title-container {
    background: #000000;
    color: #ffffff;
    margin: -2.5rem -2.5rem 2rem -2.5rem;
    padding: 2rem;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    text-align: center;
    position: relative;
}

.login-title-container .close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.login-title-container .close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 0.25rem;
    opacity: 0.7;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.demo-buttons-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-demo {
    padding: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.btn-demo-admin {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.2);
}

.btn-demo-admin:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.btn-demo-postor {
    background: #f1f5f9;
    color: var(--text-muted);
}

.btn-demo-postor:hover {
    background: var(--text-dark);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.btn-submit {
    width: 100%;
    padding: 1.1rem;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    transition: var(--transition);
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px rgba(37, 99, 235, 0.4);
}

.btn-register-container {
    margin-top: 1rem;
}

.btn-register {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1.1rem;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-register:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px rgba(37, 99, 235, 0.3);
}

.error-text {
    font-size: 0.8rem;
    color: var(--accent-red);
    margin-top: 0.5rem;
    font-weight: 500;
}


/* MAIN LAYOUT & DASHBOARDS */
.boxed-container {
    width: 100%;
    max-width: 1440px;
    margin: 2.5rem auto;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: calc(100vh - 5rem);
    display: flex;
    flex-direction: column;
}

@media (min-width: 993px) {
    body:has(.boxed-container) {
        height: 100vh;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    body:has(.boxed-container) .boxed-container {
        margin: 0 auto;
    }
}

.dashboard-wrapper {
    display: flex;
    flex-grow: 1;
    align-items: stretch;
    overflow: hidden;
    min-height: 0;
}

.sidebar {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 3rem;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.menu-item-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.menu-item-link svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: var(--transition);
}

.menu-item-link:hover {
    background: #f1f5f9;
}

.menu-item-link.active {
    background: #000000;
    color: #ffffff;
}

.menu-item-link.active svg {
    color: #ffffff;
}

/* Submenu & Dropdown styles */
.menu-item-dropdown {
    display: flex;
    flex-direction: column;
}

.submenu-list {
    list-style: none;
    padding-left: 1rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.menu-item-dropdown.open .submenu-list {
    max-height: 250px;
    opacity: 1;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.menu-item-dropdown.open .chevron-icon {
    transform: rotate(180deg);
}

.menu-item-link.submenu-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    color: var(--text-muted);
}

.menu-item-link.submenu-item:hover {
    color: var(--text-dark);
    background: #f1f5f9;
}

.menu-item-link.submenu-item.active {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

.menu-item-link.submenu-item.active svg {
    color: var(--primary) !important;
}

.main-content {
    flex-grow: 1;
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.header-top {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.user-profile-info {
    text-align: right;
}

.user-name-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.user-role-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.btn-icon-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-action:hover {
    color: var(--accent-red);
    transform: scale(1.1);
}

.content-body {
    padding: 1.25rem 2rem;
    flex-grow: 1;
    overflow-y: auto;
    height: 100%;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

/* ELEGANT TABLE FOR ADMIN */
.table-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background: #f8fafc;
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.company-name {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    display: block;
}

.company-ruc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.badge-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.badge-blue {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.badge-red {
    background: #fff1f2;
    color: var(--accent-red);
    border: 1px solid rgba(225, 29, 72, 0.1);
}

.badge-green {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.1);
}

.btn-table-action {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-table-action:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.btn-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-action-icon.edit {
    background-color: var(--primary-light);
    color: var(--primary);
}

.btn-action-icon.edit:hover {
    background-color: var(--primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-action-icon.delete {
    background-color: #fff1f2;
    color: var(--accent-red);
}

.btn-action-icon.delete:hover {
    background-color: var(--accent-red);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.2);
}

.btn-action-icon.approve {
    background-color: #f0fdf4;
    color: #16a34a;
}

.btn-action-icon.approve:hover {
    background-color: #16a34a;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.2);
}

.btn-action-icon svg {
    width: 18px;
    height: 18px;
}

.btn-download-pdf {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff1f2;
    color: var(--accent-red);
    border: 1px solid rgba(225, 29, 72, 0.15);
    padding: 0.6rem 1rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    text-decoration: none;
    transition: var(--transition);
}

.btn-download-pdf:hover {
    background: var(--accent-red);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.2);
}

.pdf-not-attached {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}


/* POSTOR DASHBOARD STYLES */
.postor-top-card {
    background: var(--bg-dark);
    color: #ffffff;
    border-radius: 24px;
    padding: 1.25rem 2rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.postor-top-card::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 300px;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.postor-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.postor-qualification-area {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.postor-qualification-area strong {
    color: #ffffff;
}

.postor-stats-container {
    display: flex;
    gap: 2rem;
    z-index: 2;
}

.postor-stat-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.6rem 1rem;
    text-align: center;
    min-width: 100px;
}

.postor-stat-number {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

.postor-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.postor-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
}

.postor-left-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.postor-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.postor-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.postor-card-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* MESSAGE LIST IN BOX */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.message-item {
    background: var(--bg-light);
    border-left: 4px solid var(--primary);
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.message-item:hover {
    transform: translateX(4px);
}

.message-item.success {
    border-left-color: #16a34a;
}

.message-item.danger {
    border-left-color: var(--accent-red);
}

.message-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.message-tag {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-tag.success {
    color: #16a34a;
}

.message-tag.danger {
    color: var(--accent-red);
}

.message-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* NEWS LIST */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 135px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.news-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.news-img-container {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-info {
    flex-grow: 1;
}

.news-item-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.news-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

/* LICITACIÓN Y SUBIDA DE ARCHIVO */
.licitacion-box {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.licitacion-status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.licitacion-name {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-dark);
}

.licitacion-code {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.licitacion-delivery-status {
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.licitacion-delivery-status.pendiente {
    color: var(--accent-red);
}

.licitacion-delivery-status.entregado {
    color: #16a34a;
}

.upload-area-card {
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 18px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area-card:hover {
    background: #f1f5f9;
    border-color: var(--primary);
}

.upload-area-card.has-file {
    background: var(--primary-light);
    border-color: var(--primary);
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.upload-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.upload-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    max-width: 320px;
}

.btn-upload {
    padding: 0.8rem 1.5rem;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-upload:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

/* MODAL EDIT ACCESO ADMIN */
.modal-admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-admin-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-admin-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-admin-overlay.active .modal-admin-card {
    transform: scale(1);
}

.modal-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-admin-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select {
    width: 100%;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* SUCCESS ALERT */
.alert-success {
    background: #f0fdf4;
    border: 1px solid rgba(22, 163, 74, 0.15);
    color: #16a34a;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* RESPONSIVE & BOXED LAYOUT MEDIA QUERIES */
@media (max-width: 1480px) {
    .boxed-container {
        margin: 1.5rem;
        width: auto;
        min-height: calc(100vh - 3rem);
    }
}

@media (max-width: 992px) {
    .boxed-container {
        margin: 0;
        border-radius: 0;
        border: none;
        height: auto;
        min-height: 100vh;
        box-shadow: none;
        overflow: visible;
    }
    
    .dashboard-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    .sidebar {
        width: 100%;
        min-width: 0;
        max-width: none;
        flex-shrink: 1;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
        justify-content: space-between;
        height: auto;
        overflow-y: visible;
    }
    
    .sidebar-logo {
        margin-bottom: 0;
    }
    
    .sidebar-menu {
        flex-direction: row;
        flex-grow: 0;
        gap: 0.5rem;
    }
    
    .menu-item-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        gap: 0.5rem;
    }
    
    .main-content {
        height: auto;
        overflow: visible;
    }
    
    .content-body {
        height: auto;
        overflow-y: visible;
    }
    
    .message-list, .news-list {
        max-height: none;
        overflow-y: visible;
    }
    
    .postor-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
    
    .sidebar-menu {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .header-top {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .content-body {
        padding: 1.5rem;
    }
    
    .postor-top-card {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .postor-stats-container {
        width: 100%;
        justify-content: space-between;
        gap: 1rem;
    }
    
    .postor-stat-card {
        flex-grow: 1;
        min-width: unset;
    }
    
    .licitacion-box {
        padding: 1.5rem;
    }
    
    .licitacion-status-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .licitacion-delivery-status {
        text-align: left;
    }
}

/* Vertical Media Queries for Short Screen Heights on Desktop */
@media (min-width: 993px) and (max-height: 820px) {
    .header-top {
        padding: 0.5rem 2rem;
    }
    
    .content-body {
        padding: 1rem 1.5rem;
    }
    
    .postor-top-card {
        padding: 0.85rem 1.5rem;
        margin-bottom: 0.85rem;
    }
    
    .postor-title {
        font-size: 1.25rem;
    }
    
    .postor-qualification-area {
        font-size: 0.75rem;
        margin-top: 0.2rem;
    }
    
    .postor-stat-card {
        padding: 0.4rem 0.75rem;
        min-width: 90px;
    }
    
    .postor-stat-number {
        font-size: 1.15rem;
    }
    
    .postor-grid {
        gap: 1rem;
        grid-template-columns: 320px 1fr;
    }
    
    .postor-left-column {
        gap: 0.85rem;
    }
    
    .postor-card {
        padding: 1rem;
    }
    
    .postor-card-title {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.35rem;
    }
    
    .message-list {
        max-height: 115px;
        gap: 0.4rem;
    }
    
    .message-item {
        padding: 0.5rem 0.75rem;
    }
    
    .news-list {
        max-height: 110px;
        gap: 0.5rem;
    }
    
    .news-img-container {
        width: 48px;
        height: 48px;
        border-radius: 8px;
    }
    
    .news-item-title {
        font-size: 0.75rem;
    }
    
    .licitacion-box {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .licitacion-name {
        font-size: 1.15rem;
    }
    
    .licitacion-code {
        font-size: 0.8rem;
    }
    
    .upload-area-card {
        padding: 1.5rem 1.25rem;
    }
    
    .upload-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 0.35rem;
    }
    
    .upload-title {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }
    
    .upload-text {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }
    
    .btn-upload {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
    }
    
    /* Admin dashboard adjustments */
    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .custom-table th {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
    }
    
    .custom-table td {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .sidebar {
        padding: 1.5rem 1rem;
    }
    
    .sidebar-logo {
        margin-bottom: 1.5rem;
    }
    
    .menu-item-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* SWEETALERT2 PREMIUM CUSTOM STYLES */
.rounded-swal-toast {
    border-radius: 16px !important;
    font-family: var(--font-sans) !important;
    font-size: 0.85rem !important;
    padding: 0.75rem 1rem !important;
    box-shadow: var(--shadow-md) !important;
}

.rounded-swal-card {
    border-radius: 24px !important;
    font-family: var(--font-sans) !important;
    padding: 1.5rem !important;
    width: 360px !important; /* Compact size */
}

.rounded-swal-card .swal2-title {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: var(--text-dark) !important;
    margin-top: 0.5rem !important;
}

.rounded-swal-card .swal2-html-container {
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    margin: 0.5rem 0 1rem 0 !important;
}

.rounded-swal-card .swal2-actions {
    margin-top: 0.75rem !important;
    gap: 0.5rem !important;
}

.rounded-swal-btn {
    border-radius: 10px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 0.6rem 1.25rem !important;
    margin: 0 !important;
}

/* LOGIN NOTIFICATION NOTES */
.login-note {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-note.success {
    background-color: #f0fdf4;
    border: 1px solid rgba(22, 163, 74, 0.2);
    color: #16a34a;
}

.login-note.warning {
    background-color: #fffbeb;
    border: 1px solid rgba(217, 119, 6, 0.25);
    color: #d97706;
}

.login-note.error {
    background-color: #fff1f2;
    border: 1px solid rgba(225, 29, 72, 0.2);
    color: #e11d48;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PREMIUM CHECKBOX SWITCH STYLES */
.switch-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.switch-input {
    display: none;
}

.switch-slider {
    width: 46px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: 9999px;
    position: relative;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-input:checked + .switch-slider {
    background-color: #10b981; /* emerald/green for checked state */
}

.switch-input:checked + .switch-slider::before {
    left: 24px;
}

.switch-input:disabled + .switch-slider {
    background-color: #e2e8f0;
    opacity: 0.6;
    cursor: not-allowed;
}

.switch-input:disabled + .switch-slider::before {
    background-color: #94a3b8;
}

/* Split Layout for Roles and Permissions */
.roles-permission-split {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Sidebar List of Roles */
.roles-sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.roles-list-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.role-selector-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.role-selector-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.role-selector-item.active {
    background: var(--primary-light);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.05);
}

.role-selector-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.role-selector-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.role-selector-code {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.role-selector-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: var(--transition);
}

.role-selector-item.active .role-selector-indicator {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

/* Main Permissions Configuration Card */
.permissions-main-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    overflow: hidden;
}

.permissions-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.permissions-card-header .header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.permissions-active-role-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.permissions-card-header .header-search {
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Scrollable Container for tab content */
.permissions-tabs-container {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
}

.role-permissions-pane {
    display: none;
}

.role-permissions-pane.active {
    display: block;
}

/* Permission Module Groups */
.permission-module-group {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.permission-module-group:last-child {
    margin-bottom: 0;
}

.module-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.module-group-title {
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dark);
}

.btn-group-toggle {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-group-toggle:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.module-group-body {
    display: flex;
    flex-direction: column;
}

.permission-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.permission-row:last-child {
    border-bottom: none;
}

.permission-row:hover {
    background: #f8fafc;
}

.permission-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.permission-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.permission-route {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.required-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-red);
    background: rgba(225, 29, 72, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.permissions-card-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1.5rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* Premium Responsive Modal Layout with Fixed Footer */
.modal-admin-card {
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: var(--shadow-lg) !important;
    width: 95% !important;
}

.modal-admin-header {
    padding: 1.25rem 2rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
}

.modal-admin-body {
    padding: 1.5rem 2rem !important;
    overflow-y: auto !important;
    flex-grow: 1 !important;
    min-height: 0 !important;
}

.modal-admin-body::-webkit-scrollbar {
    width: 6px;
}
.modal-admin-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-admin-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.modal-admin-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-admin-footer {
    padding: 1.25rem 2rem !important;
    border-top: 1px solid var(--border-color) !important;
    background-color: #f8fafc !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.75rem !important;
    flex-shrink: 0 !important;
}

.modal-admin-footer .btn-submit {
    margin-top: 0 !important;
    width: auto !important;
    padding: 0.65rem 1.75rem !important;
}

/* Ensure form stretches properly inside modal */
.modal-admin-card form {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

/* Global Mobile Layout and Viewport Overflow Fixes */
html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

@media (max-width: 992px) {
    .boxed-container {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin: 0 !important;
    }
    
    .main-content {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .table-card {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .sidebar {
        padding: 1rem !important;
        gap: 1rem !important;
    }

    .sidebar-menu {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .menu-item-link {
        padding: 0.5rem 0.85rem !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
        gap: 0.35rem !important;
    }
    
    .header-top {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }

    .header-right {
        width: auto !important;
        justify-content: center !important;
        gap: 1rem !important;
    }
}



