/* ============================================
   CREDIMAS Portal del Colaborador
   Diseño moderno · Rojo · Negro · Blanco
   ============================================ */

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

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

:root {
    --red: #DC2626;
    --red-dark: #B91C1C;
    --red-light: #FEE2E2;
    --red-50: #FEF2F2;
    --black: #111111;
    --black-soft: #1E1E1E;
    --gray-900: #18181B;
    --gray-800: #27272A;
    --gray-700: #3F3F46;
    --gray-600: #52525B;
    --gray-500: #71717A;
    --gray-400: #A1A1AA;
    --gray-300: #D4D4D8;
    --gray-200: #E4E4E7;
    --gray-100: #F4F4F5;
    --gray-50: #FAFAFA;
    --white: #FFFFFF;
    --bg: #F8F8F8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--red-dark); }

/* ── Header ── */
.header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--gray-200);
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    max-width: 1280px;
    margin: 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--red);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.logo-icon svg { width: 22px; height: 22px; }

.logo-text {
    color: var(--black);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-sub {
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 8px 14px;
    gap: 8px;
    transition: var(--transition);
}

.search-box:focus-within {
    background: var(--white);
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-light);
}

.search-box form { display: contents; }

.search-box svg { color: var(--gray-400); flex-shrink: 0; }

.search-box input {
    background: none;
    border: none;
    color: var(--gray-900);
    font-size: 14px;
    outline: none;
    width: 200px;
    font-family: 'Inter', sans-serif;
}

.search-box input::placeholder { color: var(--gray-400); }

/* ── Buttons ── */
.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: var(--white);
    border: none;
    padding: 9px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-login:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

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

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--red);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--white);
}

.user-name { font-weight: 600; font-size: 14px; color: var(--gray-900); }
.user-role { font-size: 11px; color: var(--gray-500); font-weight: 500; }

.btn-logout {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-logout:hover { background: var(--gray-200); color: var(--gray-900); }

/* ── Nav ── */
.nav {
    display: flex;
    gap: 0;
    padding: 0 32px;
    max-width: 1280px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav a:hover { color: var(--gray-900); }

.nav a.active {
    color: var(--red);
    border-bottom-color: var(--red);
}

.nav-admin { margin-left: auto; color: var(--gray-400) !important; }
.nav-admin:hover { color: var(--red) !important; }

/* ── Ticker ── */
.ticker {
    background: var(--black);
    padding: 10px 0;
    overflow: hidden;
}

.ticker-inner {
    display: flex;
    gap: 48px;
    animation: tickerScroll 35s linear infinite;
    white-space: nowrap;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker span {
    font-size: 13px;
    font-weight: 500;
    color: var(--white);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ticker span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--red);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Main Layout ── */
.main-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
}

/* ── Section Title ── */
.section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.3px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--red);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── News Cards ── */
.news-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.news-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--gray-300);
}

.news-img {
    width: 200px;
    min-height: 200px;
    object-fit: cover;
    flex-shrink: 0;
}

.news-img-placeholder {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.news-img-placeholder span { font-size: 40px; }
.news-img-placeholder svg { width: 48px; height: 48px; color: rgba(255,255,255,0.5); }

.news-body {
    padding: 22px 26px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    width: fit-content;
}

.news-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.news-date {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-date svg { width: 14px; height: 14px; color: var(--gray-400); }

.news-excerpt {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-600);
    flex: 1;
}

.btn-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: var(--red);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    text-decoration: none;
}

.btn-read:hover { color: var(--red-dark); gap: 10px; }
.btn-read svg { width: 16px; height: 16px; transition: transform 0.2s; }
.btn-read:hover svg { transform: translateX(3px); }

.lock-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 6px;
    font-weight: 500;
}

.lock-hint svg { width: 12px; height: 12px; }

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 28px;
}

.page-btn {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
}

.page-btn:hover { border-color: var(--red); color: var(--red); }

.page-btn.active {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

/* ── Sidebar ── */
.sidebar-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    margin-bottom: 20px;
}

.sidebar-card-title {
    padding: 16px 20px;
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-100);
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--gray-700);
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--gray-50);
    border-left-color: var(--red);
    color: var(--gray-900);
}

.sidebar-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-icon svg { width: 20px; height: 20px; }

.sidebar-label {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.lock-icon { flex-shrink: 0; opacity: 0.4; }
.lock-icon svg { width: 14px; height: 14px; }

.sidebar-item + .sidebar-item {
    border-top: 1px solid var(--gray-100);
}

.cumple-item { font-size: 14px; font-weight: 500; }

.cumple-dia {
    width: 32px;
    height: 32px;
    background: var(--red-light);
    color: var(--red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

/* ── Auth Banner ── */
.auth-banner {
    background: var(--black);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    color: white;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.auth-banner::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: var(--red);
    border-radius: 50%;
    opacity: 0.15;
}

.auth-banner h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    position: relative;
}

.auth-banner p {
    font-size: 13px;
    opacity: 0.6;
    margin-bottom: 18px;
    position: relative;
}

.auth-banner button {
    background: var(--red);
    color: var(--white);
    border: none;
    padding: 10px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    position: relative;
}

.auth-banner button:hover {
    background: var(--red-dark);
    transform: scale(1.03);
}

/* ── Modal Login ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 420px;
    max-width: 92vw;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.modal-header {
    background: var(--black);
    padding: 36px 32px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 120px;
    height: 120px;
    background: var(--red);
    border-radius: 50%;
    opacity: 0.1;
}

.modal-logo {
    width: 52px;
    height: 52px;
    background: var(--red);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    position: relative;
}

.modal-logo svg { width: 26px; height: 26px; color: white; }

.modal-header h2 {
    color: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    letter-spacing: -0.3px;
}

.modal-header p { color: var(--gray-500); font-size: 14px; position: relative; }

.modal-body { padding: 28px 32px 32px; }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
    background: var(--gray-50);
}

.form-group input:focus {
    border-color: var(--red);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--red-light);
}

.form-error {
    color: var(--red);
    font-size: 13px;
    margin-top: 4px;
    display: none;
    background: var(--red-50);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--red-light);
    font-weight: 500;
}

.btn-submit {
    width: 100%;
    padding: 13px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    margin-top: 4px;
}

.btn-submit:hover {
    background: var(--red-dark);
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
    transform: translateY(-1px);
}

.btn-cancel {
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    font-family: 'Inter', sans-serif;
}

.btn-cancel:hover { color: var(--gray-900); }

/* ── Article Full ── */
.article-full { max-width: 100%; }

.breadcrumb {
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 20px;
    font-weight: 500;
}

.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb span { color: var(--gray-700); }

.article-hero {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.article-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px;
    border: 1px solid var(--gray-200);
}

.article-content h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 28px;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.article-meta {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 28px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-weight: 500;
}

.article-text {
    font-size: 15px;
    line-height: 1.85;
    color: var(--gray-700);
}

.article-attachments {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-100);
}

.article-attachments h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--gray-900);
    font-weight: 700;
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    color: var(--gray-700);
}

.attachment-link:hover { border-color: var(--red); color: var(--red); }
.attachment-link small { color: var(--gray-400); }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    padding: 10px 22px;
    background: var(--gray-900);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.btn-back:hover { background: var(--red); color: white; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

/* ── Footer ── */
.footer {
    background: var(--gray-900);
    color: var(--gray-500);
    margin-top: 48px;
    padding: 28px 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
}

.footer-brand strong { font-size: 15px; font-weight: 700; }
.footer-brand small { color: var(--gray-500); font-size: 11px; }
.footer-text { font-size: 13px; }

/* ── Alert ── */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
        padding: 20px 16px;
    }
}

@media (max-width: 768px) {
    .news-card { flex-direction: column; }
    .news-img { width: 100%; height: 180px; min-height: 180px; }
    .header-top { padding: 12px 16px; }
    .nav { padding: 0 16px; }
    .search-box { display: none; }
    .article-content { padding: 24px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .modal { max-width: 95vw; }
    .modal-header { padding: 28px 24px 24px; }
    .modal-body { padding: 24px; }
}
