:root {
    --ink: #0d1a33;
    --muted: #5b6a84;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-solid: #ffffff;
    --surface-border: rgba(123, 146, 181, 0.26);
    --brand: #0f766e;
    --brand-soft: #0ea5a5;
    --brand-strong: #0f525f;
    --accent: #f97316;
    --focus: rgba(15, 118, 110, 0.24);
    --shadow-sm: 0 10px 24px rgba(7, 16, 34, 0.06);
    --shadow-md: 0 18px 38px rgba(7, 16, 34, 0.1);
    --shadow-lg: 0 24px 56px rgba(7, 16, 34, 0.15);
}

* {
    box-sizing: border-box;
}

html,
body {
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-bg {
    position: relative;
    background:
        radial-gradient(circle at 14% -8%, rgba(14, 165, 164, 0.16), transparent 34%),
        radial-gradient(circle at 86% 108%, rgba(249, 115, 22, 0.15), transparent 36%),
        linear-gradient(164deg, #f8fbff 0%, #eef3fa 46%, #f7fbff 100%);
}

.app-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at 50% 40%, black, transparent 78%);
}

.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(72px);
    opacity: 0.5;
    animation: floatOrb 14s ease-in-out infinite alternate;
}

.orb-top {
    top: -190px;
    right: -130px;
    width: 430px;
    height: 430px;
    background: rgba(13, 148, 136, 0.36);
}

.orb-bottom {
    bottom: -210px;
    left: -130px;
    width: 380px;
    height: 380px;
    background: rgba(249, 115, 22, 0.22);
    animation-duration: 17s;
}

.app-topbar {
    border-color: rgba(123, 146, 181, 0.24) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82)) !important;
    box-shadow: 0 8px 24px rgba(7, 16, 34, 0.08);
}

.app-sidebar {
    border-color: rgba(123, 146, 181, 0.24) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.82)) !important;
}

.card {
    position: relative;
    border: 1px solid var(--surface-border);
    border-radius: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.82));
    backdrop-filter: blur(12px);
    padding: 1.35rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

.label {
    margin-bottom: 0.38rem;
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #23314d;
}

.input-field {
    width: 100%;
    border-radius: 0.95rem;
    border: 1px solid #c6d3e6;
    background: #ffffff;
    padding: 0.68rem 0.84rem;
    color: var(--ink);
    font-size: 0.92rem;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--brand-soft);
    box-shadow: 0 0 0 4px var(--focus), inset 0 1px 1px rgba(15, 23, 42, 0.04);
}

.input-field:hover {
    border-color: #a5b8d3;
}

textarea.input-field {
    min-height: 118px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0.95rem;
    border: 1px solid transparent;
    padding: 0.62rem 0.98rem;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.005em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(126deg, var(--brand) 0%, var(--brand-soft) 58%, #22c4b5 100%);
    color: #f8fffe;
    box-shadow: 0 14px 26px rgba(15, 118, 110, 0.28);
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: -140%;
    left: -32%;
    width: 34%;
    height: 320%;
    transform: rotate(18deg);
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.45s ease;
}

.btn-primary:hover::before {
    left: 116%;
}

.btn-secondary {
    background: linear-gradient(180deg, #f0fdff, #dcfaf6);
    border-color: #8fe9da;
    color: #0f6963;
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    background: var(--surface-solid);
    border-color: #c8d5e9;
    color: #2f3d57;
}

.btn-danger {
    background: linear-gradient(180deg, #fff2f4, #ffe8ec);
    border-color: #ffc7d1;
    color: #b11343;
}

.btn-whatsapp {
    background: linear-gradient(180deg, #28d968, #1fc15c);
    color: #03371a;
    border-color: #1fc15c;
    box-shadow: 0 12px 24px rgba(37, 211, 102, 0.22);
}

.nav-link {
    display: flex;
    align-items: center;
    border-radius: 0.95rem;
    padding: 0.72rem 0.78rem;
    font-size: 0.9rem;
    font-weight: 800;
    color: #33445f;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    position: relative;
}

.nav-link::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    margin-right: 0.58rem;
    background: #a8b8d2;
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.18);
}

.nav-link:hover {
    transform: translateX(2px);
    background: rgba(15, 118, 110, 0.08);
    color: #0f6363;
}

.nav-link-active {
    background: linear-gradient(130deg, rgba(18, 181, 165, 0.16), rgba(15, 118, 110, 0.2));
    color: #0d5a62;
}

.nav-link-active::before {
    background: #0f766e;
    box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.11);
}

.chip {
    border-radius: 999px;
    border: 1px solid #cad7ea;
    background: #ffffff;
    padding: 0.42rem 0.82rem;
    font-size: 0.74rem;
    font-weight: 800;
    color: #33445f;
    white-space: nowrap;
}

.chip-active {
    border-color: #11887d;
    background: linear-gradient(120deg, #d8fdf7, #c5f8ed);
    color: #0f6963;
}

.table-ui {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-ui thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #f8fbff, #f2f7fd);
    border-top: 1px solid #d8e2f2;
    border-bottom: 1px solid #d8e2f2;
    color: #4b5b77;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.67rem;
    text-align: left;
    padding: 0.82rem 0.86rem;
}

.table-ui thead th:first-child {
    border-left: 1px solid #d8e2f2;
    border-top-left-radius: 0.9rem;
}

.table-ui thead th:last-child {
    border-right: 1px solid #d8e2f2;
    border-top-right-radius: 0.9rem;
}

.table-ui tbody td {
    border-bottom: 1px solid #e2e8f4;
    padding: 0.9rem 0.86rem;
    font-size: 0.89rem;
    color: #22324c;
}

.table-ui tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.35);
}

.table-ui tbody tr:hover {
    background: rgba(15, 118, 110, 0.07);
}

.quick-link {
    border: 1px solid #d5e0f0;
    border-radius: 1.06rem;
    padding: 0.94rem 0.95rem;
    font-weight: 800;
    color: #0f243f;
    background: linear-gradient(180deg, #ffffff, #f9fbff);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.quick-link:hover {
    transform: translateY(-2px);
    border-color: #8ee4d6;
    color: #0f6761;
    box-shadow: var(--shadow-md);
}

.alert-success {
    border: 1px solid #a7f3d0;
    background: linear-gradient(180deg, #f0fdf6, #e5faef);
    color: #0c7c52;
}

.alert-error {
    border: 1px solid #fecdd3;
    background: linear-gradient(180deg, #fff4f6, #ffecef);
    color: #be123c;
}

.alert-info {
    border: 1px solid #bfdbfe;
    background: linear-gradient(180deg, #f2f7ff, #e9f2ff);
    color: #1d4ed8;
}

.auth-panel {
    border-color: rgba(120, 144, 181, 0.28) !important;
    box-shadow: var(--shadow-lg) !important;
}

.auth-hero {
    background:
        radial-gradient(circle at 14% 20%, rgba(45, 212, 191, 0.22), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(251, 146, 60, 0.2), transparent 36%),
        linear-gradient(160deg, #0b1327 0%, #0f1f3f 52%, #132a52 100%) !important;
}

.auth-form-wrap {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 252, 255, 0.84));
}

.fade-in {
    animation: riseIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.16);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7dd3c8, #0f766e);
    border-radius: 999px;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes floatOrb {
    0% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(-8px, 10px, 0) scale(1.03);
    }
    100% {
        transform: translate3d(10px, -4px, 0) scale(0.98);
    }
}

@media (max-width: 768px) {
    .card {
        border-radius: 1rem;
        padding: 1rem;
    }

    .btn {
        width: auto;
    }

    .table-ui thead th,
    .table-ui tbody td {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }
}
