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

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body, 'Public Sans', sans-serif);
    color: var(--brand-text);
    background: transparent;
}

.app-bg {
    position: relative;
    min-height: 100vh;
    background: transparent;
    color: var(--brand-text);
}

.app-bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url('../images/bg-01.jpg');
    background-image: var(--brand-bg-image, url('../images/bg-01.jpg'));
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.76;
    filter: grayscale(10%) contrast(1.05);
}

.app-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.62;
    background:
        radial-gradient(1200px 600px at 15% 10%, color-mix(in srgb, var(--brand-accent) 18%, transparent) 0%, transparent 55%),
        radial-gradient(900px 500px at 85% 0%, color-mix(in srgb, var(--brand-primary) 14%, transparent) 0%, transparent 60%),
        linear-gradient(180deg, #ffffff 0%, var(--brand-bg-from) 100%);
}

.portal-shell {
    width: min(1680px, 96vw);
    margin: 1.2rem auto 2rem;
    position: relative;
    z-index: 1;
}

.topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--brand-border);
    border-radius: 18px;
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 12px 30px rgba(15, 78, 120, 0.08);
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    min-width: 0;
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--brand-border);
    padding: 0.35rem;
}

.brand-copy {
    min-width: 0;
}

.brand-company {
    margin: 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: clamp(1.02rem, 1.4vw, 1.35rem);
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.1;
}

.brand-unit {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: var(--brand-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-brand,
.btn-soft,
.btn-outline-brand {
    border: 0;
    border-radius: 12px;
    padding: 0.62rem 0.95rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-brand {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    box-shadow: 0 10px 20px rgba(15, 78, 120, 0.25);
}

.btn-brand:hover {
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-outline-brand {
    color: var(--brand-primary);
    background: #ffffff;
    border: 1px solid rgba(15, 78, 120, 0.22);
}

.btn-outline-brand:hover {
    background: rgba(15, 78, 120, 0.08);
    color: var(--brand-primary);
}

.btn-soft {
    color: var(--brand-text);
    background: var(--brand-surface-soft);
    border: 1px solid var(--brand-border);
}

.btn-soft:hover {
    color: var(--brand-text);
    background: #e8f2f8;
}

.hero {
    margin-top: 1rem;
    border-radius: 24px;
    padding: clamp(1.2rem, 3vw, 2.1rem);
    color: #ffffff;
    background: linear-gradient(125deg, rgba(15, 78, 120, 0.95), rgba(31, 110, 164, 0.92));
    box-shadow: 0 18px 36px rgba(11, 46, 70, 0.28);
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    width: min(360px, 45vw);
    aspect-ratio: 1;
    border-radius: 50%;
    right: -12%;
    top: -32%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
}

.hero-title {
    margin: 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: clamp(1.36rem, 2.2vw, 2.2rem);
    font-weight: 800;
    max-width: 900px;
    line-height: 1.1;
}

.hero-subtitle {
    margin: 0.75rem 0 0;
    max-width: 820px;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(0.92rem, 1.3vw, 1.04rem);
}

.hero-meta {
    display: inline-flex;
    margin-top: 1rem;
    padding: 0.4rem 0.74rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
}

.metric-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 0.8rem;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: 16px;
    padding: 0.95rem;
    box-shadow: 0 10px 22px rgba(16, 32, 47, 0.06);
}

.metric-label {
    font-size: 0.8rem;
    color: var(--brand-muted);
    margin: 0;
}

.metric-value {
    margin: 0.28rem 0 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: clamp(1.05rem, 1.8vw, 1.6rem);
    color: var(--brand-text);
    line-height: 1.1;
    font-weight: 700;
}

.metric-value.overdue {
    color: #b42318;
}

.control-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.filters-card,
.table-card {
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(16, 32, 47, 0.06);
}

.filters-card {
    padding: 1rem;
    position: sticky;
    top: 0.9rem;
    height: fit-content;
}

.section-title {
    margin: 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    color: var(--brand-primary);
    font-size: 1.12rem;
    font-weight: 700;
}

.section-subtitle {
    margin: 0.45rem 0 0.85rem;
    font-size: 0.88rem;
    color: var(--brand-muted);
}

.form-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 0.34rem;
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: var(--brand-border);
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(15, 78, 120, 0.15);
}

.info-note {
    margin-top: 0.85rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: #f6fbff;
    border: 1px dashed rgba(15, 78, 120, 0.3);
    font-size: 0.84rem;
    color: var(--brand-muted);
}

.table-card {
    padding: 0.4rem 0.7rem 0.9rem;
    min-width: 0;
}

.table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 0.55rem 0.5rem;
}

.table-head-title {
    margin: 0;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    color: var(--brand-primary);
    font-size: 1.12rem;
}

.table-head-meta {
    font-size: 0.84rem;
    color: var(--brand-muted);
}

.table-responsive {
    border-radius: 14px;
    border: 1px solid var(--brand-border);
    overflow: hidden;
}

.table {
    margin: 0;
    vertical-align: middle;
}

.table thead th {
    background: linear-gradient(125deg, var(--brand-primary), var(--brand-secondary));
    color: #ffffff;
    font-size: 0.76rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding-top: 0.78rem;
    padding-bottom: 0.78rem;
    border-bottom: 0;
}

.table tbody td {
    border-color: #eaf1f6;
    font-size: 0.88rem;
    color: var(--brand-text);
}

.table tbody tr:hover {
    background: #f8fcff;
}

.status-badge {
    border-radius: 999px;
    padding: 0.24rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-paid {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.status-pending {
    color: #155eef;
    background: #eff4ff;
    border: 1px solid #b2ccff;
}

.status-overdue {
    color: #b42318;
    background: #fef3f2;
    border: 1px solid #fecdca;
}

.actions-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.btn-inline {
    border: 1px solid rgba(15, 78, 120, 0.22);
    background: #ffffff;
    color: var(--brand-primary);
    border-radius: 9px;
    padding: 0.28rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-inline:hover {
    background: rgba(15, 78, 120, 0.08);
    color: var(--brand-primary);
}

.floating-whatsapp {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(9, 94, 84, 0.35);
    text-decoration: none;
    font-size: 1.45rem;
}

.floating-whatsapp:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.footer-note {
    margin-top: 1rem;
    text-align: center;
    color: var(--brand-muted);
    font-size: 0.83rem;
    padding: 0.7rem;
}

.auth-shell {
    width: min(1040px, 94vw);
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.auth-panel,
.auth-card {
    border-radius: 24px;
    border: 1px solid var(--brand-border);
    box-shadow: 0 18px 38px rgba(16, 32, 47, 0.12);
}

.auth-panel {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    color: #ffffff;
    background: linear-gradient(140deg, rgba(15, 78, 120, 0.96), rgba(31, 110, 164, 0.93));
}

.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background-image:
        linear-gradient(45deg, transparent 46%, rgba(255, 255, 255, 0.7) 47%, transparent 48%),
        linear-gradient(-45deg, transparent 46%, rgba(255, 255, 255, 0.7) 47%, transparent 48%);
    background-size: 52px 52px;
}

.auth-panel > * {
    position: relative;
    z-index: 1;
}

.auth-title {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    line-height: 1.05;
}

.auth-lead {
    margin-top: 0.9rem;
    max-width: 550px;
    color: rgba(255, 255, 255, 0.9);
}

.auth-highlights {
    margin-top: 1.2rem;
    display: grid;
    gap: 0.55rem;
    font-size: 0.94rem;
}

.auth-card {
    background: #ffffff;
    padding: 1.35rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--brand-border);
    padding: 0.5rem;
    background: #ffffff;
}

.auth-card h2 {
    margin: 0.6rem 0 0.35rem;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.38rem;
    color: var(--brand-primary);
}

.auth-card p {
    color: var(--brand-muted);
    margin-bottom: 1rem;
}

.form-error {
    border-radius: 11px;
    padding: 0.65rem 0.8rem;
    margin-bottom: 0.85rem;
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #912018;
    font-size: 0.86rem;
}

.auth-separator {
    display: flex;
    align-items: center;
    color: var(--brand-muted);
    margin: 0.8rem 0;
    font-size: 0.82rem;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--brand-border);
}

.auth-separator::before {
    margin-right: 0.7rem;
}

.auth-separator::after {
    margin-left: 0.7rem;
}

@media (max-width: 1280px) {
    .control-grid {
        grid-template-columns: 320px minmax(0, 1fr);
    }
}

@media (max-width: 1100px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .control-grid {
        grid-template-columns: 1fr;
    }

    .filters-card {
        position: static;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .portal-shell {
        width: min(100%, 94vw);
        margin-top: 0.7rem;
    }

    .topbar {
        border-radius: 14px;
        padding: 0.8rem;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero {
        border-radius: 16px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .table-card {
        padding: 0.4rem;
    }

    .table thead th,
    .table tbody td {
        white-space: nowrap;
    }
}
