/* ===============================
   FONTS
================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@300;400;500;600;700;800&display=swap');

@font-face {
    font-family: 'Capitanejo';
    src: url('/static/fonts/Capitanejo-Regular.woff2') format('woff2');
}


/* ===============================
   VARIABLES CORPORATIVAS
================================ */

:root {

    /* COLORES PRINCIPALES */
    --color-primary: #002B83;
    --color-primary-light: #0A4BFF;
    --color-primary-dark: #001B52;

    /* COLOR BASE */
    --color-bg: #F8F2E4; /* Blanco Capitanejo */

    /* ACENTOS */
    --color-gold: #F5B301;
    --color-green: #16a34a;
    --color-red: #dc2626;

    /* TEXTOS */
    --color-text: #111827;
    --color-muted: #6b7280;

    /* SUPERFICIES */
    --surface: rgba(255,255,255,0.72);
    --surface-strong: rgba(255,255,255,0.92);

    /* BORDES */
    --border: rgba(0,43,131,0.08);

    /* SIDEBAR */
    --color-sidebar: #002B83;
    --color-sidebar-hover: #001f5c;

    /* EFECTOS */
    --blur: blur(12px);

    /* SOMBRAS */
    --shadow-sm:
        0 4px 10px rgba(0,0,0,.05);

    --shadow:
        0 10px 30px rgba(0,0,0,.08);

    --shadow-primary:
        0 10px 25px rgba(0,43,131,.18);

    --shadow-gold:
        0 10px 20px rgba(245,179,1,.18);

    /* TIPOGRAFÍAS */
    --font-title: 'Capitanejo', serif;
    --font-body: 'Libre Franklin', sans-serif;

    /* BORDER RADIUS */
    --radius: 20px;
}


/* ===============================
   RESET
================================ */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{

    font-family: var(--font-body);

    color: var(--color-text);

    background:
        radial-gradient(circle at top left, rgba(0,43,131,.05), transparent 22%),
        radial-gradient(circle at bottom right, rgba(245,179,1,.06), transparent 20%),
        var(--color-bg);

    min-height:100vh;

    overflow-x:hidden;
}

body::before{

    content:"";

    position:fixed;
    inset:0;

    background-image:
        linear-gradient(rgba(0,43,131,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,43,131,.025) 1px, transparent 1px);

    background-size:38px 38px;

    pointer-events:none;

    z-index:-1;
}

a{
    text-decoration:none;
    color:inherit;
}


/* ===============================
   HEADER
================================ */

.site-header{

    position:sticky;
    top:0;
    z-index:100;

    background:
        linear-gradient(
            135deg,
            var(--color-primary-dark),
            var(--color-primary)
        );

    color:white;

    box-shadow: var(--shadow);

    overflow:hidden;
}

.site-header::before{

    content:"";

    position:absolute;

    width:280px;
    height:280px;

    border-radius:50%;

    background:
        rgba(255,255,255,.05);

    top:-120px;
    right:-80px;
}

.site-header::after{

    content:"";

    position:absolute;

    width:200px;
    height:200px;

    border-radius:50%;

    background:
        rgba(245,179,1,.10);

    bottom:-90px;
    left:-70px;
}

.header-container{

    max-width:1400px;

    margin:auto;

    padding:18px 28px;

    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:20px;

    position:relative;
    z-index:2;
}


/* ===============================
   BRAND
================================ */

.brand{
    display:flex;
    align-items:center;
}

.header-logo{
    width:340px;
    height:auto;
    display:block;
}

/* ===============================
   NAVBAR
================================ */

.main-nav{

    display:flex;
    align-items:center;
    gap:10px;

    flex-wrap:wrap;
}

.main-nav a{

    padding:12px 18px;

    border-radius:999px;

    font-size:.92rem;
    font-weight:700;

    color: var(--color-bg);

    transition:.25s ease;
}

.main-nav a:hover{

    background:
        rgba(255,255,255,.10);

    transform:translateY(-2px);
}

.main-nav a.active{

    background:white;

    color:var(--color-primary);

    box-shadow: var(--shadow-sm);
}


/* ===============================
   LOGOUT
================================ */

.logout-form{
    margin:0;
}

.nav-logout{

    border:none;
    outline:none;

    padding:12px 18px;

    border-radius:999px;

    cursor:pointer;

    font-weight:700;

    background:
        rgba(255,255,255,.08);

    color:white;

    transition:.25s ease;
}

.nav-logout:hover{

    background:
        linear-gradient(
            135deg,
            #dc2626,
            #ef4444
        );

    transform:translateY(-2px);
}


/* ===============================
   WRAPPER
================================ */

.page-wrapper{

    max-width:1400px;

    margin:auto;

    padding:40px 28px 60px;
}


/* ===============================
   HERO HEADER
================================ */

.page-header{

    position:relative;

    overflow:hidden;

    padding:40px;

    border-radius:30px;

    margin-bottom:30px;

    background:
        linear-gradient(
            135deg,
            var(--color-primary),
            var(--color-primary-light)
        );

    color:white;

    box-shadow:
        var(--shadow-primary);
}

.page-header::before{

    content:"";

    position:absolute;

    width:220px;
    height:220px;

    border-radius:50%;

    background:
        rgba(255,255,255,.08);

    right:-80px;
    top:-80px;
}

.page-header h2{

    position:relative;
    z-index:2;

    font-family: var(--font-title);

    font-size:3rem;

    margin-bottom:10px;
}

.page-header p{

    position:relative;
    z-index:2;

    max-width:700px;

    color:rgba(255,255,255,.82);

    font-size:1rem;
}


/* ===============================
   CARDS
================================ */

.card{

    background:
        var(--surface);

    backdrop-filter: var(--blur);

    border:
        1px solid rgba(255,255,255,.45);

    border-radius: var(--radius);

    padding:24px;

    box-shadow: var(--shadow);

    transition:.25s ease;
}

.card:hover{

    transform:
        translateY(-4px);

    box-shadow:
        var(--shadow),
        var(--shadow-primary);
}


/* ===============================
   GRID
================================ */

.grid-2{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;
}

.grid-3{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:20px;
}

.grid-4{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}


/* ===============================
   FORMULARIOS
================================ */

.auth-container{

    max-width:600px;

    margin:40px auto;
}

.auth-card{

    background:
        var(--surface-strong);

    backdrop-filter: var(--blur);

    border:
        1px solid rgba(255,255,255,.50);

    border-radius:30px;

    padding:35px;

    box-shadow: var(--shadow);
}

.auth-title{

    font-family: var(--font-title);

    text-align:center;

    font-size:2rem;

    margin-bottom:30px;

    color:var(--color-primary-dark);
}

.form-group{
    margin-bottom:18px;
}

.form-group label{

    display:block;

    margin-bottom:8px;

    font-size:.92rem;

    font-weight:700;

    color:var(--color-text);
}

.form-group input,
.form-group select{

    width:100%;

    padding:14px 16px;

    border-radius:16px;

    border:
        1px solid rgba(0,43,131,.08);

    background:white;

    color:var(--color-text);

    font-size:.95rem;

    transition:.25s ease;
}

.form-group input::placeholder{
    color:#9ca3af;
}

.form-group input:focus,
.form-group select:focus{

    outline:none;

    border-color:
        var(--color-primary-light);

    box-shadow:
        0 0 0 4px rgba(0,43,131,.10);
}


/* ===============================
   BOTONES
================================ */

.btn-primary{

    width:100%;

    border:none;
    outline:none;

    padding:15px 20px;

    border-radius:999px;

    cursor:pointer;

    font-size:.95rem;
    font-weight:800;

    color:white;

    background:
        linear-gradient(
            135deg,
            var(--color-primary-light),
            var(--color-primary)
        );

    transition:.25s ease;

    box-shadow:
        var(--shadow-primary);
}

.btn-primary:hover{

    transform:
        translateY(-2px)
        scale(1.01);
}

.btn-gold{

    background:
        linear-gradient(
            135deg,
            #F5B301,
            #ffd447
        );

    color:#111;

    box-shadow:
        var(--shadow-gold);
}


/* ===============================
   TABLAS
================================ */

.table-container{

    overflow:auto;

    border-radius:24px;

    background:
        rgba(255,255,255,.75);

    backdrop-filter: var(--blur);

    box-shadow: var(--shadow);
}

table{
    width:100%;
    border-collapse:collapse;
}

thead{

    background:
        rgba(0,43,131,.04);
}

thead th{

    padding:18px;

    text-align:left;

    color:var(--color-primary);

    font-size:.85rem;
    font-weight:800;

    text-transform:uppercase;
}

tbody td{

    padding:18px;

    border-top:
        1px solid rgba(0,43,131,.05);

    color:var(--color-text);
}

tbody tr{

    transition:.2s ease;
}

tbody tr:hover{

    background:
        rgba(0,43,131,.03);
}


/* ===============================
   MENSAJES
================================ */

.messages{
    margin-bottom:20px;
}

.message{

    padding:16px 18px;

    border-radius:18px;

    margin-bottom:12px;

    font-weight:700;

    border:1px solid transparent;
}

.message.success{

    background:
        rgba(22,163,74,.12);

    border-color:
        rgba(22,163,74,.18);

    color:#15803d;
}

.message.error{

    background:
        rgba(220,38,38,.12);

    border-color:
        rgba(220,38,38,.18);

    color:#b91c1c;
}

.message.warning{

    background:
        rgba(245,179,1,.12);

    border-color:
        rgba(245,179,1,.18);

    color:#a16207;
}


/* ===============================
   BADGES
================================ */

.badge{

    display:inline-flex;
    align-items:center;

    padding:8px 14px;

    border-radius:999px;

    font-size:.82rem;
    font-weight:700;
}

.badge-success{

    background:
        rgba(22,163,74,.15);

    color:#15803d;
}

.badge-danger{

    background:
        rgba(220,38,38,.15);

    color:#b91c1c;
}

.badge-gold{

    background:
        rgba(245,179,1,.15);

    color:#a16207;
}


/* ===============================
   FOOTER
================================ */

.site-footer{

    margin-top:50px;

    padding:30px;

    text-align:center;

    color:var(--color-muted);

    font-size:.92rem;
}


/* ===============================
   SCROLLBAR
================================ */

::-webkit-scrollbar{
    width:10px;
}

::-webkit-scrollbar-track{
    background:#e9edf5;
}

::-webkit-scrollbar-thumb{

    background:
        linear-gradient(
            180deg,
            var(--color-primary-light),
            var(--color-primary)
        );

    border-radius:999px;
}


/* ===============================
   RESPONSIVE
================================ */

@media(max-width:992px){

    .grid-4{
        grid-template-columns:repeat(2,1fr);
    }

    .grid-3{
        grid-template-columns:repeat(2,1fr);
    }

    .page-header h2{
        font-size:2.2rem;
    }
}

@media(max-width:768px){

    .header-container{
        flex-direction:column;
        align-items:flex-start;
    }

    .main-nav{
        width:100%;
    }

    .page-wrapper{
        padding:24px 18px 50px;
    }

    .page-header{
        padding:30px 24px;
    }

    .page-header h2{
        font-size:1.8rem;
    }

    .grid-2,
    .grid-3,
    .grid-4{
        grid-template-columns:1fr;
    }

    .auth-card{
        padding:25px;
    }

    .brand-text h1{
        font-size:1.4rem;
    }
}