/* FINRAINCOMEX - Global UI Styles
   File: public_html/assets/css/style.css
   Rendering/design intentionally preserved.
   This stylesheet contains presentation only and does not collect credentials,
   perform redirects, execute PHP, or make network requests.
*/

/* =========================================================
   FINRAINCOMEX GLOBAL DESIGN SYSTEM
========================================================= */

:root {
    --primary: #061a3d;
    --primary-soft: #102a56;

    --accent: #075fe8;
    --accent-hover: #064fc2;
    --accent-light: #eaf3ff;
    --accent-cyan: #00bff3;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    --bg-main: #f5f8fc;
    --bg-card: #ffffff;
    --bg-soft: #f8fbff;

    --text-main: #172b4d;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border-color: #e2e8f0;
    --border-focus: #075fe8;

    --sidebar-width: 260px;
    --header-height: 72px;
    --mobile-nav-height: 68px;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;

    --shadow-sm:
        0 1px 3px rgba(15, 23, 42, 0.05);

    --shadow-md:
        0 8px 25px rgba(15, 23, 42, 0.07);

    --shadow-lg:
        0 18px 45px rgba(15, 23, 42, 0.10);

    --shadow-blue:
        0 12px 30px rgba(7, 95, 232, 0.20);

    --transition-fast:
        0.2s ease;

    --transition:
        0.3s ease;
}


/* =========================================================
   RESET
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;

    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;

    background: var(--bg-main);
    color: var(--text-main);

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    line-height: 1.5;

    overflow-x: hidden;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg {
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button {
    touch-action: manipulation;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(7, 95, 232, 0.22);
    outline-offset: 2px;
}

::selection {
    background: rgba(7, 95, 232, 0.18);
}


/* =========================================================
   APP LAYOUT
========================================================= */

.main-content {
    width: 100%;
    min-width: 0;

    margin-left: 0;

    display: flex;
    flex-direction: column;

    min-height: 100vh;
    min-height: 100dvh;

    transition:
        margin-left var(--transition);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;

    background:
        rgba(255, 255, 255, 0.98);

    color: var(--text-main);

    border-right:
        1px solid var(--border-color);

    box-shadow:
        8px 0 35px rgba(15, 23, 42, 0.08);

    z-index: 1100;

    transform:
        translateX(-105%);

    transition:
        transform var(--transition);

    will-change: transform;
}

.sidebar.mobile-open {
    transform: translateX(0);
}


/* =========================================================
   SIDEBAR BRAND
========================================================= */

.sidebar-brand {
    min-height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        1rem 1.25rem;

    border-bottom:
        1px solid var(--border-color);

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #fbfdff
        );
}

.sidebar-brand img {
    display: block;

    width: auto;
    max-width: 155px;
    max-height: 54px;

    margin: 0 auto;
}


/* =========================================================
   SIDEBAR MENU
========================================================= */

.sidebar-menu {
    flex: 1;

    list-style: none;

    margin: 0;
    padding:
        0.9rem 0.55rem 1.5rem;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;

    scrollbar-width: thin;
    scrollbar-color:
        #cbd5e1 transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}


/* =========================================================
   SIDEBAR LINKS
========================================================= */

.sidebar-menu li {
    margin: 0;
    padding: 0;
}

.sidebar-menu li a {
    position: relative;

    min-height: 48px;

    display: flex;
    align-items: center;

    gap: 0.85rem;

    margin:
        0.22rem 0.3rem;

    padding:
        0.78rem 1rem;

    border-radius:
        var(--radius);

    color: #52637a;

    text-decoration: none;

    font-size: 0.92rem;
    font-weight: 650;

    transition:
        color var(--transition-fast),
        background var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.sidebar-menu li a i {
    width: 26px;

    flex-shrink: 0;

    text-align: center;

    font-size: 1.08rem;

    color: #7890ad;

    transition:
        color var(--transition-fast),
        transform var(--transition-fast);
}


/* =========================================================
   SIDEBAR HOVER
========================================================= */

.sidebar-menu li a:hover {
    color: var(--accent);

    background:
        var(--accent-light);

    transform:
        translateX(3px);
}

.sidebar-menu li a:hover i {
    color: var(--accent);
}


/* =========================================================
   ACTIVE SIDEBAR ITEM
========================================================= */

.sidebar-menu li a.active {
    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #0872ff 0%,
            #075fe8 45%,
            #0343a7 100%
        );

    box-shadow:
        0 8px 22px rgba(7, 95, 232, 0.24);

    transform:
        translateX(2px);
}

.sidebar-menu li a.active i {
    color: #ffffff;
}

.sidebar-menu li a.active::before {
    content: "";

    position: absolute;

    left: -0.3rem;
    top: 50%;

    width: 4px;
    height: 24px;

    border-radius: 0 6px 6px 0;

    background: var(--accent-cyan);

    transform:
        translateY(-50%);
}


/* =========================================================
   SIDEBAR BACKDROP
========================================================= */

.sidebar-backdrop {
    position: fixed;

    inset: 0;

    z-index: 1050;

    background:
        rgba(4, 15, 35, 0.48);

    backdrop-filter:
        blur(2px);

    -webkit-backdrop-filter:
        blur(2px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity var(--transition),
        visibility var(--transition);
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* =========================================================
   HEADER
========================================================= */

.header {
    position: sticky;

    top: 0;

    z-index: 900;

    min-height:
        var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    padding:
        0.85rem 1.5rem;

    background:
        rgba(255, 255, 255, 0.92);

    backdrop-filter:
        blur(14px);

    -webkit-backdrop-filter:
        blur(14px);

    border-bottom:
        1px solid rgba(226, 232, 240, 0.9);

    box-shadow:
        0 4px 20px rgba(15, 23, 42, 0.025);
}


/* =========================================================
   CONTENT
========================================================= */

.content-body {
    width: 100%;

    flex: 1;

    padding:
        1.25rem;

    overflow-x: hidden;
}


/* =========================================================
   CARDS
========================================================= */

.card {
    position: relative;

    width: 100%;

    margin-bottom:
        1.25rem;

    padding:
        1.25rem;

    background:
        var(--bg-card);

    border:
        1px solid var(--border-color);

    border-radius:
        var(--radius-md);

    box-shadow:
        var(--shadow-sm);

    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.card:hover {
    border-color:
        #d7e2f0;

    box-shadow:
        var(--shadow-md);
}


/* =========================================================
   DASHBOARD GRID
========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap:
        0.75rem;

    width: 100%;

    margin-bottom:
        1.5rem;
}


/* =========================================================
   STAT CARD
========================================================= */

.stat-card {
    position: relative;

    min-width: 0;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    padding:
        0.9rem 0.6rem;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #fbfdff
        );

    border:
        1px solid var(--border-color);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow-sm);

    overflow: hidden;

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.stat-card:hover {
    transform:
        translateY(-3px);

    border-color:
        #cfe0f6;

    box-shadow:
        0 10px 25px rgba(15, 23, 42, 0.07);
}


/* =========================================================
   TABLES
========================================================= */

.table-responsive {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;

    border-radius:
        var(--radius);

    scrollbar-width: thin;
}

.table-responsive table {
    width: 100%;

    min-width: 640px;

    border-collapse: collapse;

    text-align: left;

    font-size: 0.92rem;
}

.table-responsive th,
.table-responsive td {
    padding:
        0.85rem 1rem;

    border-bottom:
        1px solid var(--border-color);

    vertical-align: middle;
}

.table-responsive th {
    color:
        var(--text-muted);

    background:
        #f8fafc;

    font-size:
        0.78rem;

    font-weight:
        700;

    text-transform:
        uppercase;

    letter-spacing:
        0.04em;

    white-space:
        nowrap;
}

.table-responsive tbody tr {
    transition:
        background var(--transition-fast);
}

.table-responsive tbody tr:hover {
    background:
        #f8fbff;
}

.table-responsive tbody tr:last-child td {
    border-bottom: 0;
}


/* =========================================================
   FORMS
========================================================= */

.form-group {
    margin-bottom:
        1.2rem;
}

.form-label {
    display: block;

    margin-bottom:
        0.5rem;

    color:
        #53647b;

    font-size:
        0.78rem;

    font-weight:
        700;

    text-transform:
        uppercase;

    letter-spacing:
        0.045em;
}

.form-control {
    display: block;

    width: 100%;

    min-height:
        48px;

    padding:
        0.8rem 0.95rem;

    color:
        var(--text-main);

    background:
        #ffffff;

    border:
        1px solid var(--border-color);

    border-radius:
        var(--radius);

    outline:
        none;

    font-size:
        0.95rem;

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.form-control::placeholder {
    color:
        #9aa9bc;
}

.form-control:hover {
    border-color:
        #c5d3e5;
}

.form-control:focus {
    border-color:
        var(--border-focus);

    background:
        #ffffff;

    box-shadow:
        0 0 0 4px
        rgba(7, 95, 232, 0.09);
}

.form-control:disabled,
.form-control[readonly] {
    cursor:
        not-allowed;

    color:
        #94a3b8;

    background:
        #f1f5f9;

    opacity:
        1;
}

textarea.form-control {
    min-height:
        120px;

    resize:
        vertical;
}

select.form-control {
    cursor:
        pointer;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    min-height:
        44px;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        0.5rem;

    padding:
        0.72rem 1.25rem;

    border:
        1px solid transparent;

    border-radius:
        var(--radius);

    font-size:
        0.92rem;

    font-weight:
        700;

    line-height:
        1;

    text-decoration:
        none;

    cursor:
        pointer;

    user-select:
        none;

    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.btn:hover {
    transform:
        translateY(-1px);
}

.btn:active {
    transform:
        scale(0.985);
}

.btn:disabled,
.btn.disabled {
    cursor:
        not-allowed;

    opacity:
        0.6;

    transform:
        none;
}


/* =========================================================
   PRIMARY BUTTON
========================================================= */

.btn-primary {
    color:
        #ffffff;

    background:
        linear-gradient(
            135deg,
            #0872ff,
            #075fe8 55%,
            #0347ad
        );

    box-shadow:
        0 8px 20px
        rgba(7, 95, 232, 0.18);
}

.btn-primary:hover {
    color:
        #ffffff;

    background:
        linear-gradient(
            135deg,
            #0768ec,
            #054ec4
        );

    box-shadow:
        var(--shadow-blue);
}


/* =========================================================
   OPTIONAL BUTTON TYPES
========================================================= */

.btn-success {
    color: #ffffff;
    background: var(--success);
}

.btn-warning {
    color: #ffffff;
    background: var(--warning);
}

.btn-danger {
    color: #ffffff;
    background: var(--danger);
}

.btn-outline {
    color:
        var(--accent);

    background:
        #ffffff;

    border-color:
        rgba(7, 95, 232, 0.25);
}

.btn-outline:hover {
    background:
        var(--accent-light);

    border-color:
        var(--accent);
}


/* =========================================================
   ALERTS
========================================================= */

.alert {
    width: 100%;

    margin-bottom:
        1rem;

    padding:
        0.85rem 1rem;

    border:
        1px solid transparent;

    border-radius:
        var(--radius);

    font-size:
        0.9rem;
}

.alert-success {
    color: #067647;
    background: #ecfdf3;
    border-color: #abefc6;
}

.alert-danger,
.alert-error {
    color: #b42318;
    background: #fff1f2;
    border-color: #fecdd3;
}

.alert-warning {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.alert-info {
    color: #075985;
    background: #f0f9ff;
    border-color: #bae6fd;
}


/* =========================================================
   BADGES
========================================================= */

.badge {
    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        0.3rem;

    padding:
        0.3rem 0.6rem;

    border-radius:
        999px;

    font-size:
        0.72rem;

    font-weight:
        700;
}

.badge-success {
    color: #067647;
    background: #dcfae6;
}

.badge-warning {
    color: #92400e;
    background: #fef3c7;
}

.badge-danger {
    color: #b42318;
    background: #fee2e2;
}

.badge-info {
    color: #075985;
    background: #e0f2fe;
}


/* =========================================================
   MOBILE BOTTOM NAVIGATION
========================================================= */

.mobile-bottom-nav {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 1000;

    display: none;

    align-items: stretch;
    justify-content: space-around;

    width: 100%;

    min-height:
        var(--mobile-nav-height);

    padding:
        0.35rem 0
        max(
            0.35rem,
            env(safe-area-inset-bottom)
        );

    background:
        rgba(255, 255, 255, 0.96);

    backdrop-filter:
        blur(16px);

    -webkit-backdrop-filter:
        blur(16px);

    border-top:
        1px solid rgba(226, 232, 240, 0.95);

    box-shadow:
        0 -8px 30px
        rgba(15, 23, 42, 0.08);
}

.mobile-bottom-nav a {
    position: relative;

    flex: 1;

    min-width: 0;
    min-height: 52px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap:
        0.2rem;

    padding:
        0.25rem 0.15rem;

    color:
        #718096;

    text-decoration:
        none;

    font-size:
        0.68rem;

    font-weight:
        650;

    line-height:
        1.15;

    transition:
        color var(--transition-fast),
        transform var(--transition-fast);
}

.mobile-bottom-nav a i {
    margin:
        0;

    font-size:
        1.2rem;

    transition:
        transform var(--transition-fast);
}

.mobile-bottom-nav a:hover,
.mobile-bottom-nav a.active {
    color:
        var(--accent);
}

.mobile-bottom-nav a.active i {
    transform:
        translateY(-2px);
}

.mobile-bottom-nav a.active::before {
    content: "";

    position: absolute;

    top: -0.35rem;
    left: 50%;

    width: 28px;
    height: 3px;

    border-radius:
        0 0 10px 10px;

    background:
        linear-gradient(
            90deg,
            var(--accent),
            var(--accent-cyan)
        );

    transform:
        translateX(-50%);
}


/* =========================================================
   TABLET GRID
========================================================= */

@media (min-width: 768px) {

    .dashboard-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap:
            1rem;
    }

}


/* =========================================================
   DESKTOP LAYOUT
========================================================= */

@media (min-width: 1200px) {

    .sidebar {
        transform:
            translateX(0);
    }

    .main-content {
        margin-left:
            var(--sidebar-width);

        width:
            calc(
                100% - var(--sidebar-width)
            );
    }

    .sidebar-backdrop {
        display:
            none;
    }

    .dashboard-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        gap:
            1.1rem;
    }

    .content-body {
        padding:
            1.5rem;
    }

}


/* =========================================================
   MOBILE AND TABLET
========================================================= */

@media (max-width: 1199px) {

    .sidebar {
        transform:
            translateX(-105%);
    }

    .sidebar.mobile-open {
        transform:
            translateX(0);
    }

    .main-content {
        width:
            100%;

        margin-left:
            0;

        padding-bottom:
            calc(
                var(--mobile-nav-height)
                + 20px
                + env(safe-area-inset-bottom)
            );
    }

    .mobile-bottom-nav {
        display:
            flex;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .header {
        min-height:
            62px;

        padding:
            0.7rem 0.85rem;
    }

    .content-body {
        padding:
            0.8rem;
    }

    .card {
        padding:
            1rem;

        border-radius:
            14px;

        margin-bottom:
            0.9rem;
    }

    .dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap:
            0.6rem;

        margin-bottom:
            1rem;
    }

    .stat-card {
        min-height:
            105px;

        padding:
            0.75rem 0.4rem;
    }

    .btn {
        min-height:
            44px;

        padding:
            0.7rem 1rem;

        font-size:
            0.88rem;
    }

    .form-control {
        min-height:
            50px;

        font-size:
            16px;
    }

    .table-responsive table {
        font-size:
            0.85rem;
    }

    .table-responsive th,
    .table-responsive td {
        padding:
            0.75rem 0.8rem;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    :root {
        --sidebar-width:
            min(86vw, 300px);
    }

    .content-body {
        padding:
            0.65rem;
    }

    .dashboard-grid {
        gap:
            0.5rem;
    }

    .stat-card {
        min-height:
            98px;

        padding:
            0.65rem 0.3rem;
    }

    .mobile-bottom-nav a {
        font-size:
            0.62rem;
    }

    .mobile-bottom-nav a i {
        font-size:
            1.1rem;
    }

}


/* =========================================================
   VERY SMALL DEVICES
========================================================= */

@media (max-width: 350px) {

    .dashboard-grid {
        grid-template-columns:
            1fr;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior:
            auto;
    }

    *,
    *::before,
    *::after {
        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;
    }

}


/* =========================================================
   PRINT
========================================================= */

@media print {

    .sidebar,
    .header,
    .mobile-bottom-nav,
    .sidebar-backdrop {
        display:
            none !important;
    }

    .main-content {
        width:
            100% !important;

        margin:
            0 !important;

        padding:
            0 !important;
    }

    body {
        background:
            #ffffff;
    }

    .card {
        box-shadow:
            none;

        break-inside:
            avoid;
    }

}